(defcustom stgit-default-show-worktree t
"Set to non-nil to by default show the working tree in a new stgit buffer.
-Use \\<stgit-mode-map>\\[stgit-toggle-worktree] to toggle the
-this setting in an already-started StGit buffer."
+Use \\<stgit-mode-map>\\[stgit-toggle-worktree] to toggle this \
+setting in an already-started StGit buffer."
:type 'boolean
:group 'stgit
:link '(variable-link stgit-show-worktree))
+(defcustom stgit-default-show-unknown nil
+ "Set to non-nil to by default show unknown files a new stgit buffer.
+
+Use \\<stgit-mode-map>\\[stgit-toggle-unknown] to toggle this \
+setting in an already-started StGit buffer."
+ :type 'boolean
+ :group 'stgit
+ :link '(variable-link stgit-show-unknown))
+
+(defcustom stgit-default-show-ignored nil
+ "Set to non-nil to by default show ignored files a new stgit buffer.
+
+Use \\<stgit-mode-map>\\[stgit-toggle-ignored] to toggle this \
+setting in an already-started StGit buffer."
+ :type 'boolean
+ :group 'stgit
+ :link '(variable-link stgit-show-ignored))
+
(defcustom stgit-find-copies-harder nil
"Try harder to find copied files when listing patches.
Customization variables:
`stgit-abbreviate-copies-and-renames'
+`stgit-default-show-ignored'
`stgit-default-show-patch-names'
+`stgit-default-show-unknown'
`stgit-default-show-worktree'
`stgit-find-copies-harder'
`stgit-show-worktree-mode'
major-mode 'stgit-mode
goal-column 2)
(use-local-map stgit-mode-map)
- (set (make-local-variable 'list-buffers-directory) default-directory)
- (set (make-local-variable 'stgit-marked-patches) nil)
- (set (make-local-variable 'stgit-expanded-patches) (list :work :index))
- (set (make-local-variable 'stgit-show-patch-names)
- stgit-default-show-patch-names)
- (set (make-local-variable 'stgit-show-worktree) stgit-default-show-worktree)
- (set (make-local-variable 'stgit-show-ignored) nil)
- (set (make-local-variable 'stgit-show-unknown) nil)
- (set (make-local-variable 'stgit-index-node) nil)
- (set (make-local-variable 'stgit-worktree-node) nil)
- (set (make-local-variable 'parse-sexp-lookup-properties) t)
+ (mapc (lambda (x) (set (make-local-variable (car x)) (cdr x)))
+ `((list-buffers-directory . ,default-directory)
+ (parse-sexp-lookup-properties . t)
+ (stgit-expanded-patches . (:work :index))
+ (stgit-index-node . nil)
+ (stgit-worktree-node . nil)
+ (stgit-marked-patches . nil)
+ (stgit-show-ignored . ,stgit-default-show-ignored)
+ (stgit-show-patch-names . ,stgit-default-show-patch-names)
+ (stgit-show-unknown . ,stgit-default-show-unknown)
+ (stgit-show-worktree . ,stgit-default-show-worktree)))
(set-variable 'truncate-lines 't)
(add-hook 'after-save-hook 'stgit-update-stgit-for-buffer)
(unless stgit-did-advise
"Toggle the visibility of files ignored by git in the work
tree. With ARG, show these files if ARG is positive.
+Its initial setting is controlled by `stgit-default-show-ignored'.
+
Use \\[stgit-toggle-worktree] to show the work tree."
(interactive)
(stgit-assert-mode)
"Toggle the visibility of files not registered with git in the
work tree. With ARG, show these files if ARG is positive.
+Its initial setting is controlled by `stgit-default-show-unknown'.
+
Use \\[stgit-toggle-worktree] to show the work tree."
(interactive)
(stgit-assert-mode)