Commit 422d776e authored by Jonas Bernoulli's avatar Jonas Bernoulli

Improve and fix how options are sorted into Custom groups

parent 33c5c1ca
......@@ -7,6 +7,10 @@ Changes since v2.9.0
* The function `magit-display-buffer' now sets the focus on the frame
used to display the selected window. #2865
* The Custom groups are better organized now. New groups were added,
but many options also moved between groups that already existed
before.
* Many doc-strings were improved, added, and fixed.
* The obsolete variable `magit-repository-directory-depth' is no
......
......@@ -56,7 +56,7 @@ from `magit-no-confirm'. Even if you have all of the Magit-Wip
modes enabled you shouldn't do that, because those modes to not
track any files that are not tracked in the proper branch."
:package-version '(magit . "2.1.0")
:group 'magit
:group 'magit-essentials
:type 'boolean)
(defcustom magit-unstage-committed t
......
......@@ -33,7 +33,8 @@
(defgroup magit-auto-revert nil
"Revert buffers when files in repository change."
:group 'auto-revert
:group 'magit-extensions)
:group 'magit-essentials
:group 'magit-modes)
(defcustom auto-revert-buffer-list-filter nil
"Filter that determines which buffers `auto-revert-buffers' reverts.
......@@ -56,6 +57,7 @@ is enabled."
:package-version '(magit . "2.4.2")
:group 'auto-revert
:group 'magit-auto-revert
:group 'magit-related
:type '(radio (const :tag "no filter" nil)
(function-item magit-auto-revert-buffer-p)
(function-item magit-auto-revert-repository-buffer-p)
......@@ -114,8 +116,8 @@ seconds of user inactivity. That is not desirable."
(define-globalized-minor-mode magit-auto-revert-mode auto-revert-mode
magit-turn-on-auto-revert-mode-if-desired
:package-version '(magit . "2.4.0")
:group 'magit
:group 'magit-auto-revert
:group 'magit-essentials
;; When `global-auto-revert-mode' is enabled, then this mode is
;; redundant. When `magit-revert-buffers' is nil, then the user has
;; opted out of the automatic reverts while the old implementation
......@@ -250,8 +252,6 @@ located. If there is no current repository, then return FALLBACK
(advice-add 'auto-revert-buffers :before
'auto-revert-buffers--buffer-list-filter)
(custom-add-to-group 'magit 'auto-revert-check-vc-info 'custom-variable)
;;; magit-autorevert.el ends soon
(provide 'magit-autorevert)
;; Local Variables:
......
......@@ -34,7 +34,7 @@
(defgroup magit-blame nil
"Blame support for Magit."
:group 'magit-extensions)
:group 'magit-modes)
(defcustom magit-blame-heading-format "%-20a %C %s"
"Format string used for blame headings.
......
......@@ -43,6 +43,21 @@
"Controlling Git from Emacs."
:group 'tools)
(defgroup magit-essentials nil
"Options that every Magit user should briefly think about.
Each of these options falls into one or more of these categories:
* Options that affect Magit's behavior in fundamental ways.
* Options that affect safety.
* Options that affect performance.
* Options that are of a personal nature."
:group 'magit)
(defgroup magit-miscellaneous nil
"Miscellanous Magit options."
:group 'magit)
(defgroup magit-commands nil
"Options controlling behavior of certain commands."
:group 'magit)
......@@ -62,15 +77,24 @@ are enabled by default by the popup `magit-NAME-popup'."
"Modes used or provided by Magit."
:group 'magit)
(defgroup magit-extensions nil
"Extensions to Magit."
(defgroup magit-buffers nil
"Options concerning Magit buffers."
:group 'magit)
(defgroup magit-refresh nil
"Options controlling how Magit buffers are refreshed."
:group 'magit
:group 'magit-buffers)
(defgroup magit-faces nil
"Faces used by Magit."
:group 'magit
:group 'faces)
(defgroup magit-extensions nil
"Extensions to Magit."
:group 'magit)
(custom-add-to-group 'magit-modes 'magit-popup 'custom-group)
(custom-add-to-group 'magit-faces 'magit-popup-faces 'custom-group)
(custom-add-to-group 'magit-modes 'git-commit 'custom-group)
......@@ -79,7 +103,17 @@ are enabled by default by the popup `magit-NAME-popup'."
(custom-add-to-group 'magit-faces 'git-rebase-faces 'custom-group)
(custom-add-to-group 'magit-process 'with-editor 'custom-group)
(custom-add-to-group 'magit 'vc-follow-symlinks 'custom-variable)
(defgroup magit-related nil
"Options that are relevant to Magit but that are defined elsewhere."
:group 'magit
:group 'magit-extensions
:group 'magit-essentials)
(custom-add-to-group 'magit-related 'auto-revert-check-vc-info 'custom-variable)
(custom-add-to-group 'magit-auto-revert 'auto-revert-check-vc-info 'custom-variable)
(custom-add-to-group 'magit-related 'smerge-refine-ignore-whitespace 'custom-variable)
(custom-add-to-group 'magit-related 'vc-follow-symlinks 'custom-variable)
;;; magit-core.el ends soon
(provide 'magit-core)
......
......@@ -57,20 +57,23 @@
"Inspect and manipulate Git diffs."
:group 'magit-modes)
(custom-add-to-group 'magit-diff 'smerge-refine-ignore-whitespace
'custom-variable)
(defcustom magit-diff-mode-hook nil
"Hook run after entering Magit-Diff mode."
:group 'magit-diff
:type 'hook)
(defcustom magit-diff-arguments '("--stat" "--no-ext-diff")
"The diff arguments used in buffers whose mode derives from `magit-diff-mode'."
:group 'magit-git-arguments
:group 'magit-diff
:type '(repeat (string :tag "Argument")))
(defcustom magit-diff-sections-hook
'(magit-insert-diff
magit-insert-xref-buttons)
"Hook run to insert sections into a `magit-diff-mode' buffer."
:package-version '(magit . "2.3.0")
:group 'magit-revision
:group 'magit-diff
:type 'hook)
(defcustom magit-diff-expansion-threshold 60
......@@ -313,6 +316,15 @@ and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=7847."
:group 'magit-revision
:type 'boolean)
;;;; Diff Sections
(defcustom magit-diff-section-arguments '("--no-ext-diff")
"The diff arguments used in buffers that show other things besides diffs."
:group 'magit-git-arguments
:group 'magit-diff
:group 'magit-status
:type '(repeat (string :tag "Argument")))
;;; Faces
(defface magit-diff-file-heading
......@@ -587,17 +599,6 @@ and `:slant'."
(magit-define-popup-keys-deferred 'magit-diff-mode-refresh-popup)
(magit-define-popup-keys-deferred 'magit-revision-mode-refresh-popup)
(defcustom magit-diff-arguments '("--stat" "--no-ext-diff")
"The diff arguments used in buffers whose mode derives from `magit-diff-mode'."
:group 'magit-git-arguments
:type '(repeat (string :tag "Argument")))
(defcustom magit-diff-section-arguments '("--no-ext-diff")
"The diff arguments used in buffers that show other things besides diffs."
:group 'magit-diff
:group 'magit-status
:type '(repeat (string :tag "Argument")))
(defvar magit-diff-section-file-args nil)
(put 'magit-diff-section-file-args 'permanent-local t)
(put 'magit-diff-section-arguments 'permanent-local t)
......
......@@ -118,7 +118,7 @@ purpose."
:group 'magit-process
:type '(repeat string))
(defcustom magit-git-debug nil
(defvar magit-git-debug nil
"Whether to enable additional reporting of git errors.
Magit basically calls git for one of these two reasons: for
......@@ -134,10 +134,7 @@ option is non-nil and git returns with a non-zero exit status,
then at least its standard error is inserted into this buffer.
This is only intended for debugging purposes. Do not enable this
permanently, that would negatively affect performance"
:group 'magit
:group 'magit-process
:type 'boolean)
permanently, that would negatively affect performance.")
(defcustom magit-ref-namespaces
'(("^@$" magit-head nil)
......@@ -164,7 +161,7 @@ font FONT. If FORMATTER is non-nil it should be a function that
takes two arguments, the full ref and the face. It is supposed
to return a propertized label that represents the ref."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:group 'magit-miscellanous
:type '(repeat
(list regexp
face
......
......@@ -73,6 +73,7 @@ to what you have set for `magit-log-margin'."
"The log arguments used in `magit-log-mode' buffers."
:package-version '(magit . "2.3.0")
:group 'magit-git-arguments
:group 'magit-log
:type '(repeat (string :tag "Argument")))
(defcustom magit-log-remove-graph-args '("--follow" "--grep" "-G" "-S" "-L")
......@@ -327,6 +328,7 @@ the upstream isn't ahead of the current branch) show."
(defcustom magit-log-section-arguments '("-n256" "--decorate")
"The log arguments used in buffers that show other things besides logs."
:package-version '(magit . "2.4.0")
:group 'magit-git-arguments
:group 'magit-log
:group 'magit-status
:type '(repeat (string :tag "Argument")))
......
......@@ -85,7 +85,7 @@ To run a function with a particular buffer current, use
`magit-refresh-buffer-hook' and use `derived-mode-p'
inside your function."
:package-version '(magit . "2.4.0")
:group 'magit-modes
:group 'magit-refresh
:type 'hook
:options '(magit-maybe-save-repository-buffers))
......@@ -99,7 +99,7 @@ To run a function with a particular buffer current, use
`magit-refresh-buffer-hook' and use `derived-mode-p'
inside your function."
:package-version '(magit . "2.4.0")
:group 'magit-modes
:group 'magit-refresh
:type 'hook)
(defcustom magit-display-buffer-function 'magit-display-buffer-traditional
......@@ -109,7 +109,7 @@ All Magit buffers (buffers whose major-modes derive from
`magit-mode') are displayed using `magit-display-buffer',
which in turn uses the function specified here."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type '(radio (function-item magit-display-buffer-traditional)
(function-item magit-display-buffer-same-window-except-diff-v1)
(function-item magit-display-buffer-fullframe-status-v1)
......@@ -121,7 +121,7 @@ which in turn uses the function specified here."
(defcustom magit-pre-display-buffer-hook '(magit-save-window-configuration)
"Hook run by `magit-display-buffer' before displaying the buffer."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type 'hook
:get 'magit-hook-custom-get
:options '(magit-save-window-configuration))
......@@ -129,7 +129,7 @@ which in turn uses the function specified here."
(defcustom magit-post-display-buffer-hook '(magit-maybe-set-dedicated)
"Hook run by `magit-display-buffer' after displaying the buffer."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type 'hook
:get 'magit-hook-custom-get
:options '(magit-maybe-set-dedicated))
......@@ -138,7 +138,7 @@ which in turn uses the function specified here."
'magit-generate-buffer-name-default-function
"The function used to generate the name for a Magit buffer."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type '(radio (function-item magit-generate-buffer-name-default-function)
(function :tag "Function")))
......@@ -171,19 +171,19 @@ If another `magit-generate-buffer-name-function' is used, then
it may not respect this option, or on the contrary it may
support additional %-sequences."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type 'string)
(defcustom magit-uniquify-buffer-names t
"Whether to uniquify the names of Magit buffers."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type 'boolean)
(defcustom magit-bury-buffer-function 'magit-restore-window-configuration
"The function used to bury or kill the current Magit buffer."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-buffers
:type '(radio (function-item quit-window)
(function-item magit-mode-quit-window)
(function-item magit-restore-window-configuration)
......@@ -197,20 +197,20 @@ Each function is run with the current section as only argument
until one of them returns non-nil. If all functions return nil,
then fall back to regular region highlighting."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:group 'magit-refresh
:type 'hook
:options '(magit-section-update-region magit-diff-update-hunk-region))
(defcustom magit-refresh-verbose nil
"Whether to revert Magit buffers verbosely."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:group 'magit-refresh
:type 'boolean)
(defcustom magit-refresh-buffer-hook nil
"Normal hook for `magit-refresh-buffer' to run after refreshing."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:group 'magit-refresh
:type 'hook)
(defcustom magit-refresh-status-buffer t
......@@ -223,6 +223,7 @@ current Magit buffer, which is always refreshed automatically.
Only set this to nil after exhausting all other options to
improve performance."
:package-version '(magit . "2.4.0")
:group 'magit-refresh
:group 'magit-status
:type 'boolean)
......@@ -237,6 +238,8 @@ any other non-nil value the user has to confirm each save.
The default is t to avoid surprises, but `dontask' is the
recommended value."
:group 'magit-essentials
:group 'magit-buffers
:type '(choice (const :tag "Never" nil)
(const :tag "Ask" t)
(const :tag "Save without asking" dontask)))
......@@ -285,7 +288,7 @@ because it doesn't cost much to offer this option we do so.
However that might change. If the existence of this option
starts complicating other things, then it will be removed."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-miscellaneous
:type 'boolean)
;;; Magit Mode
......
......@@ -31,6 +31,23 @@
;;; Options
(defgroup magit-stash nil
"List stashes and show stash diffs."
:group 'magit-modes)
;;;; Diff options
(defcustom magit-stash-sections-hook
'(magit-insert-stash-worktree
magit-insert-stash-index
magit-insert-stash-untracked)
"Hook run to insert sections into stash diff buffers."
:package-version '(magit . "2.1.0")
:group 'magit-stash
:type 'hook)
;;;; Log options
(defcustom magit-stashes-margin
(list (nth 0 magit-log-margin)
(nth 1 magit-log-margin)
......@@ -52,7 +69,7 @@ AUTHOR controls whether the name of the author is also shown by
AUTHOR-WIDTH has to be an integer. When the name of the author
is shown, then this specifies how much space is used to do so."
:package-version '(magit . "2.9.0")
:group 'magit-refs
:group 'magit-stash
:group 'magit-margin
:type magit-log-margin--custom-type
:initialize 'magit-custom-initialize-reset
......@@ -357,15 +374,6 @@ instead of \"Stashes:\"."
;;; Show Stash
(defcustom magit-stash-sections-hook
'(magit-insert-stash-worktree
magit-insert-stash-index
magit-insert-stash-untracked)
"Hook run to insert sections into stash buffers."
:package-version '(magit . "2.1.0")
:group 'magit-log
:type 'hook)
;;;###autoload
(defun magit-stash-show (stash &optional args files)
"Show all diffs of a stash in a buffer."
......
......@@ -30,7 +30,7 @@
(defcustom magit-submodule-list-mode-hook '(hl-line-mode)
"Hook run after entering Magit-Submodule-List mode."
:package-version '(magit . "2.9.0")
:group 'magit-modes
:group 'magit-repolist
:type 'hook
:get 'magit-hook-custom-get
:options '(hl-line-mode))
......@@ -54,7 +54,7 @@ and with `default-directory' bound to the toplevel of its working
tree. It has to return a string to be inserted or nil. PROPS is
an alist that supports the keys `:right-align' and `:pad-right'."
:package-version '(magit . "2.8.0")
:group 'magit-commands
:group 'magit-repolist-mode
:type `(repeat (list :tag "Column"
(string :tag "Header Label")
(integer :tag "Column Width")
......@@ -327,6 +327,7 @@ These sections can be expanded to show the respective commits."
(define-derived-mode magit-submodule-list-mode tabulated-list-mode "Modules"
"Major mode for browsing a list of Git submodules."
:group 'magit-repolist-mode
(setq x-stretch-cursor nil)
(setq tabulated-list-padding 0)
(setq tabulated-list-sort-key (cons "Path" nil))
......
......@@ -57,7 +57,7 @@ turn on `helm-mode' and leave this option set to the default
value. However, if you prefer to not use `helm-mode' but still
want Magit to use Helm for completion, you can set this option to
`helm--completing-read-default'."
:group 'magit
:group 'magit-essentials
:type '(radio (function-item magit-builtin-completing-read)
(function-item magit-ido-completing-read)
(function-item helm--completing-read-default)
......@@ -82,7 +82,7 @@ these commands do:
`magit-branch-rename'
`magit-tag'"
:package-version '(magit . "2.9.0")
:group 'magit-commands
:group 'magit-miscellaneous
:type '(list :convert-widget custom-hook-convert-widget)
:options '(magit-branch
magit-branch-and-checkout
......@@ -196,7 +196,7 @@ Global settings:
this mode is enabled then `safe-with-wip' has the same effect
as adding all of these symbols individually."
:package-version '(magit . "2.1.0")
:group 'magit
:group 'magit-essentials
:group 'magit-commands
:type `(choice (const :tag "Always require confirmation" nil)
(const :tag "Never require confirmation" t)
......@@ -213,7 +213,7 @@ identifying actions, then `yes-or-no-p' is used for those,
`y-or-no-p' for all others. The list of actions is the same as
for `magit-no-confirm' (which see)."
:package-version '(magit . "2.9.0")
:group 'magit-commands
:group 'magit-miscellaneous
:type `(choice (const :tag "Always ask \"yes or no\" questions" t)
(const :tag "Always ask \"y or n\" questions" nil)
(set :tag "Ask \"yes or no\" questions only for"
......@@ -239,7 +239,7 @@ some of these messages useless.
Messages which can currently be suppressed using this option are:
* \"Turning on magit-auto-revert-mode...\""
:package-version '(magit . "2.8.0")
:group 'magit
:group 'magit-miscellaneous
:type '(repeat string))
(defcustom magit-ellipsis ?
......@@ -248,7 +248,7 @@ Messages which can currently be suppressed using this option are:
Currently this is used to abbreviate author names in the margin
and in process buffers to elide `magit-git-global-arguments'."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:group 'magit-miscellaneous
:type 'character)
(defcustom magit-update-other-window-delay 0.2
......@@ -265,7 +265,7 @@ this option controls for how long. For optimal experience you
might have to adjust this delay and/or the keyboard repeat rate
and delay of your graphical environment or operating system."
:package-version '(magit . "2.3.0")
:group 'magit-modes
:group 'magit-miscellaneous
:type 'number)
(defcustom magit-view-git-manual-method 'info
......@@ -280,7 +280,7 @@ and delay of your graphical environment or operating system."
`woman' View the respective man-page using the `woman' package."
:package-version '(magit . "2.9.0")
:group 'magit-modes
:group 'magit-miscellaneous
:type '(choice (const :tag "view info manual" info)
(const :tag "view manpage using `man'" man)
(const :tag "view manpage using `woman'" woman)))
......
......@@ -37,7 +37,8 @@
(defgroup magit-wip nil
"Automatically commit to work-in-progress refs."
:group 'magit-extensions)
:group 'magit-modes
:group 'magit-essentials)
(defcustom magit-wip-after-save-local-mode-lighter " sWip"
"Lighter for Magit-Wip-After-Save-Local mode."
......
......@@ -456,7 +456,7 @@ For backward compatibility reasons an element may be a string,
instead of a cons-cell, in which case the value of the obsolete
option `magit-repository-directories-depth' specifies the depth."
:package-version '(magit . "2.8.0")
:group 'magit
:group 'magit-essentials
:type '(repeat (choice (cons directory (integer :tag "Depth")) directory)))
(defvar magit-repository-directories-depth 3
......@@ -465,10 +465,16 @@ This variable is obsolete and only used for elements of the
option `magit-repository-directories' (which see) that don't
specify the depth directly.")
;;;; Repolist Mode
(defgroup magit-repolist nil
"List repositories in a buffer."
:group 'magit-modes)
(defcustom magit-repolist-mode-hook '(hl-line-mode)
"Hook run after entering Magit-Repolist mode."
:package-version '(magit . "2.9.0")
:group 'magit-modes
:group 'magit-repolist
:type 'hook
:get 'magit-hook-custom-get
:options '(hl-line-mode))
......@@ -490,7 +496,7 @@ and with `default-directory' bound to the toplevel of its working
tree. It has to return a string to be inserted or nil. PROPS is
an alist that supports the keys `:right-align' and `:pad-right'."
:package-version '(magit . "2.8.0")
:group 'magit-commands
:group 'magit-repolist
:type `(repeat (list :tag "Column"
(string :tag "Header Label")
(integer :tag "Column Width")
......@@ -2863,6 +2869,7 @@ Currently this only adds the following key bindings.
(define-globalized-minor-mode global-magit-file-mode
magit-file-mode magit-file-mode-turn-on
:package-version '(magit . "2.2.0")
:group 'magit-essentials
:group 'magit-modes)
;;;; Blob Mode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment