aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Hållberg <gustav@gmail.com>2012-04-06 21:32:21 +0200
committerGustav Hållberg <gustav@gmail.com>2012-04-09 09:23:19 +0200
commit970a74e83041a162ec84a316d6aedd1e3bb8527b (patch)
tree9d2505cadeeada02abfc5e86b548562093fb77f2
parentc6a5c1067d48118d67ccb2223fd0356916653fa4 (diff)
downloadstgit-970a74e83041a162ec84a316d6aedd1e3bb8527b.tar.gz
stgit.el: Refactor: rewrite stgit-define-toggle-view
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r--contrib/stgit.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/contrib/stgit.el b/contrib/stgit.el
index aa67f5f..27b7ee4 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -2738,20 +2738,21 @@ See also `stgit-show-worktree-mode'.")
"The number of recent commits to show.")
(defmacro stgit-define-toggle-view (sym desc help)
- (declare (indent 1))
+ (declare (indent 1) (debug (symbolp stringp stringp)))
(let* ((name (symbol-name sym))
(fun (intern (concat "stgit-toggle-" name)))
(flag (intern (concat "stgit-show-" name))))
- ;; make help-follow find the correct function
- `(put (quote ,fun) 'definition-name 'stgit-define-toggle-view)
- `(defun ,fun (&optional arg)
- ,help
- (interactive "P")
- (stgit-assert-mode)
- (setq ,flag (if arg
- (> (prefix-numeric-value arg) 0)
- (not ,flag)))
- (stgit-reload (format "%s %s" (if ,flag "Showing" "Hiding") ,desc)))))
+ `(progn
+ ;; make help-follow find the correct function
+ (put (quote ,fun) 'definition-name 'stgit-define-toggle-view)
+ (defun ,fun (&optional arg)
+ ,help
+ (interactive "P")
+ (stgit-assert-mode)
+ (setq ,flag (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not ,flag)))
+ (stgit-reload (concat (if ,flag "Showing" "Hiding") " " ,desc))))))
(stgit-define-toggle-view worktree
"work tree and index"