X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/1288eda2f520c4cb2b06de9d279d2d65704091f6..e4f6fdcb38127754b8f0b31d202354db85553aff:/contrib/stgit.el diff --git a/contrib/stgit.el b/contrib/stgit.el index f3b573d..21ef28a 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -25,7 +25,7 @@ (cd dir) (unless (eq 0 (call-process "git" nil t nil "rev-parse" "--show-cdup")) - (error "cannot find top-level git tree for %s." dir)))))) + (error "Cannot find top-level git tree for %s" dir)))))) (expand-file-name (concat (file-name-as-directory dir) (car (split-string cdup "\n"))))))) @@ -230,11 +230,15 @@ flag, which reduces performance." "Alist of names of file types") (defun stgit-file-type-string (type) + "Return string describing file type TYPE (the high bits of file permission). +Cf. `stgit-file-type-strings' and `stgit-file-type-change-string'." (let ((type-str (assoc type stgit-file-type-strings))) (or (and type-str (cdr type-str)) (format "unknown type %o" type)))) (defun stgit-file-type-change-string (old-perm new-perm) + "Return string describing file type change from OLD-PERM to NEW-PERM. +Cf. `stgit-file-type-string'." (let ((old-type (lsh old-perm -9)) (new-type (lsh new-perm -9))) (cond ((= old-type new-type) "") @@ -248,6 +252,8 @@ flag, which reduces performance." (stgit-file-type-string new-type)))))) (defun stgit-file-mode-change-string (old-perm new-perm) + "Return string describing file mode change from OLD-PERM to NEW-PERM. +Cf. `stgit-file-type-change-string'." (setq old-perm (logand old-perm #o777) new-perm (logand new-perm #o777)) (if (or (= old-perm new-perm) @@ -271,6 +277,10 @@ flag, which reduces performance." 'face 'stgit-file-permission-face))))))) (defun stgit-expand-patch (patchsym) + "Expand (show modification of) the patch with name PATCHSYM (a +symbol) at point. +`stgit-expand-find-copies-harder' controls how hard to try to +find copied files." (save-excursion (forward-line) (let* ((start (point)) @@ -396,7 +406,7 @@ flag, which reduces performance." "Show status using `git-status'." (interactive) (unless (fboundp 'git-status) - (error "stgit-git-status requires git-status")) + (error "The stgit-git-status command requires git-status")) (let ((dir default-directory)) (save-selected-window (pop-to-buffer nil) @@ -501,14 +511,17 @@ Commands: (run-hooks 'stgit-mode-hook)) (defun stgit-add-mark (patch) + "Mark the patch named PATCH." (let ((patchsym (intern patch))) (setq stgit-marked-patches (cons patchsym stgit-marked-patches)))) (defun stgit-remove-mark (patch) + "Unmark the patch named PATCH." (let ((patchsym (intern patch))) (setq stgit-marked-patches (delq patchsym stgit-marked-patches)))) (defun stgit-clear-marks () + "Unmark all patches." (setq stgit-marked-patches '())) (defun stgit-marked-patches () @@ -568,7 +581,8 @@ the new file names instead of just one name." "Move point to the line containing PATCH." (let ((p (point))) (goto-char (point-min)) - (if (re-search-forward (concat "^[>+-][ *]" (regexp-quote patch) " ") nil t) + (if (re-search-forward (concat "^[>+-][ *]" (regexp-quote patch) " ") + nil t) (progn (move-to-column goal-column) t) (goto-char p) @@ -761,7 +775,8 @@ end of the patch." (let ((patch "")) (while (> (length description) 0) (cond ((string-match "\\`[a-zA-Z_-]+" description) - (setq patch (downcase (concat patch (match-string 0 description)))) + (setq patch (downcase (concat patch + (match-string 0 description)))) (setq description (substring description (match-end 0)))) ((string-match "\\` +" description) (setq patch (concat patch "-")) @@ -834,9 +849,9 @@ With prefix argument, refresh the marked patch or the patch under point." (let ((patchargs (if arg (let ((patches (stgit-patches-marked-or-at-point))) (cond ((null patches) - (error "no patch to update")) + (error "No patch to update")) ((> (length patches) 1) - (error "too many patches selected")) + (error "Too many patches selected")) (t (cons "-p" patches)))) nil)))