diff options
| author | Richard M. Stallman | 1997-05-25 18:08:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-25 18:08:23 +0000 |
| commit | 286c247d12b5a470bc03e45730936eb09cc63d28 (patch) | |
| tree | cedba2595348c523c2bc94dc1074de80efca0a27 | |
| parent | 9a5114ac7e384d28a13c99725380b6024abde5cf (diff) | |
| download | emacs-286c247d12b5a470bc03e45730936eb09cc63d28.tar.gz emacs-286c247d12b5a470bc03e45730936eb09cc63d28.zip | |
Use defgroup and defcustom.
| -rw-r--r-- | lisp/dired-x.el | 115 | ||||
| -rw-r--r-- | lisp/dired.el | 70 |
2 files changed, 129 insertions, 56 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index f3d89690555..aed4373105a 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | ;; Date: 1994/08/18 19:27:42 | 7 | ;; Date: 1994/08/18 19:27:42 |
| 8 | ;; Keywords: dired extensions | 8 | ;; Keywords: dired extensions |
| 9 | 9 | ||
| 10 | ;; Copyright (C) 1993, 1994 Free Software Foundation | 10 | ;; Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc. |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| 13 | 13 | ||
| @@ -134,46 +134,67 @@ | |||
| 134 | 134 | ||
| 135 | ;;; User-defined variables. | 135 | ;;; User-defined variables. |
| 136 | 136 | ||
| 137 | (defvar dired-bind-vm nil | 137 | (defgroup dired-x nil |
| 138 | "*t says \"V\" in dired-mode will `dired-vm', otherwise \"V\" is `dired-rmail'. | 138 | "Extended directory editing (dired-x)." |
| 139 | Also, RMAIL files contain -*- rmail -*- at the top so \"f\", | 139 | :group 'dired) |
| 140 | `dired-advertised-find-file', will run rmail.") | ||
| 141 | |||
| 142 | (defvar dired-bind-jump t | ||
| 143 | "*t says bind `dired-jump' to C-x C-j, otherwise do not.") | ||
| 144 | 140 | ||
| 145 | (defvar dired-bind-man t | 141 | (defgroup dired-keys nil |
| 146 | "*t says bind `dired-man' to \"N\" in dired-mode, otherwise do not.") | 142 | "Dired keys customizations." |
| 143 | :prefix "dired-" | ||
| 144 | :group 'dired-x) | ||
| 147 | 145 | ||
| 148 | (defvar dired-bind-info t | 146 | (defcustom dired-bind-vm nil |
| 149 | "*t says bind `dired-info' to \"I\" in dired-mode, otherwise do not.") | 147 | "*t says \"V\" in dired-mode will `dired-vm', otherwise \"V\" is `dired-rmail'. |
| 150 | 148 | Also, RMAIL files contain -*- rmail -*- at the top so \"f\", | |
| 151 | (defvar dired-vm-read-only-folders nil | 149 | `dired-advertised-find-file', will run rmail." |
| 150 | :type 'boolean | ||
| 151 | :group 'dired-keys) | ||
| 152 | |||
| 153 | (defcustom dired-bind-jump t | ||
| 154 | "*t says bind `dired-jump' to C-x C-j, otherwise do not." | ||
| 155 | :type 'boolean | ||
| 156 | :group 'dired-keys) | ||
| 157 | |||
| 158 | (defcustom dired-bind-man t | ||
| 159 | "*t says bind `dired-man' to \"N\" in dired-mode, otherwise do not." | ||
| 160 | :type 'boolean | ||
| 161 | :group 'dired-keys) | ||
| 162 | |||
| 163 | (defcustom dired-bind-info t | ||
| 164 | "*t says bind `dired-info' to \"I\" in dired-mode, otherwise do not." | ||
| 165 | :type 'boolean | ||
| 166 | :group 'dired-keys) | ||
| 167 | |||
| 168 | (defcustom dired-vm-read-only-folders nil | ||
| 152 | "*If t, \\[dired-vm] will visit all folders read-only. | 169 | "*If t, \\[dired-vm] will visit all folders read-only. |
| 153 | If neither nil nor t, e.g. the symbol `if-file-read-only', only | 170 | If neither nil nor t, e.g. the symbol `if-file-read-only', only |
| 154 | files not writable by you are visited read-only. | 171 | files not writable by you are visited read-only. |
| 155 | 172 | ||
| 156 | Read-only folders only work in VM 5, not in VM 4.") | 173 | Read-only folders only work in VM 5, not in VM 4." |
| 174 | :type '(choice (const :tag "off" nil) | ||
| 175 | (const :tag "on" t) | ||
| 176 | (sexp :tag "non-writable only" if-file-read-only)) | ||
| 177 | :group 'dired-x) | ||
| 157 | 178 | ||
| 158 | (defvar dired-omit-files-p nil | 179 | (defcustom dired-omit-files-p nil |
| 159 | "*If non-nil, \"uninteresting\" files are not listed (buffer-local). | 180 | "*If non-nil, \"uninteresting\" files are not listed (buffer-local). |
| 160 | Use \\[dired-omit-toggle] to toggle its value. | 181 | Use \\[dired-omit-toggle] to toggle its value. |
| 161 | Uninteresting files are those whose filenames match regexp `dired-omit-files', | 182 | Uninteresting files are those whose filenames match regexp `dired-omit-files', |
| 162 | plus those ending with extensions in `dired-omit-extensions'.") | 183 | plus those ending with extensions in `dired-omit-extensions'." |
| 184 | :type 'boolean | ||
| 185 | :group 'dired-x) | ||
| 163 | (make-variable-buffer-local 'dired-omit-files-p) | 186 | (make-variable-buffer-local 'dired-omit-files-p) |
| 164 | 187 | ||
| 165 | (defvar dired-omit-files "^#\\|^\\.$\\|^\\.\\.$" | 188 | (defcustom dired-omit-files "^#\\|^\\.$\\|^\\.\\.$" |
| 166 | "*Filenames matching this regexp will not be displayed. | 189 | "*Filenames matching this regexp will not be displayed. |
| 167 | This only has effect when `dired-omit-files-p' is t. See interactive function | 190 | This only has effect when `dired-omit-files-p' is t. See interactive function |
| 168 | `dired-omit-toggle' \(\\[dired-omit-toggle]\) and variable | 191 | `dired-omit-toggle' \(\\[dired-omit-toggle]\) and variable |
| 169 | `dired-omit-extensions'. The default is to omit `.', `..', and auto-save | 192 | `dired-omit-extensions'. The default is to omit `.', `..', and auto-save |
| 170 | files.") | 193 | files." |
| 194 | :type 'regexp | ||
| 195 | :group 'dired-x) | ||
| 171 | 196 | ||
| 172 | (defvar dired-omit-size-limit 20000 | 197 | (defcustom dired-find-subdir nil ; t is pretty near to DWIM... |
| 173 | "*If a dired buffer listing contains more than this many characters, | ||
| 174 | do not do omitting. If nil, always do omitting.") | ||
| 175 | |||
| 176 | (defvar dired-find-subdir nil ; t is pretty near to DWIM... | ||
| 177 | "*If non-nil, Dired always finds a directory in a buffer of its own. | 198 | "*If non-nil, Dired always finds a directory in a buffer of its own. |
| 178 | If nil, Dired finds the directory as a subdirectory in some other buffer | 199 | If nil, Dired finds the directory as a subdirectory in some other buffer |
| 179 | if it is present as one. | 200 | if it is present as one. |
| @@ -183,30 +204,48 @@ used is chosen. | |||
| 183 | 204 | ||
| 184 | Dired avoids switching to the current buffer, so that if you have | 205 | Dired avoids switching to the current buffer, so that if you have |
| 185 | a normal and a wildcard buffer for the same directory, C-x d RET will | 206 | a normal and a wildcard buffer for the same directory, C-x d RET will |
| 186 | toggle between those two.") | 207 | toggle between those two." |
| 208 | :type 'boolean | ||
| 209 | :group 'dired-x) | ||
| 210 | |||
| 211 | (defcustom dired-omit-size-limit 20000 | ||
| 212 | "*Maximum size for the \"omitting\" feature. | ||
| 213 | If nil, there is no maximum size." | ||
| 214 | :type '(choice (const :tag "no maximum" nil) integer) | ||
| 215 | :group 'dired-x) | ||
| 187 | 216 | ||
| 188 | (defvar dired-enable-local-variables t | 217 | (defcustom dired-enable-local-variables t |
| 189 | "*Control use of local-variables lists in dired. | 218 | "*Control use of local-variables lists in dired. |
| 190 | The value can be t, nil or something else. | 219 | The value can be t, nil or something else. |
| 191 | A value of t means local-variables lists are obeyed; | 220 | A value of t means local-variables lists are obeyed; |
| 192 | nil means they are ignored; anything else means query. | 221 | nil means they are ignored; anything else means query. |
| 193 | 222 | ||
| 194 | This temporarily overrides the value of `enable-local-variables' when listing | 223 | This temporarily overrides the value of `enable-local-variables' when listing |
| 195 | a directory. See also `dired-local-variables-file'.") | 224 | a directory. See also `dired-local-variables-file'." |
| 225 | :type 'boolean | ||
| 226 | :group 'dired-x) | ||
| 196 | 227 | ||
| 197 | (defvar dired-guess-shell-gnutar nil | 228 | (defcustom dired-guess-shell-gnutar nil |
| 198 | "*If non-nil, name of GNU tar executable (e.g., \"tar\" or \"gtar\") and `z' | 229 | "*If non-nil, name of GNU tar executable (e.g., \"tar\" or \"gtar\") and `z' |
| 199 | switch will be used for compressed or gzip'ed tar files. If no GNU tar, set | 230 | switch will be used for compressed or gzip'ed tar files. If no GNU tar, set |
| 200 | to nil: a pipe using `zcat' or `gunzip -c' will be used.") | 231 | to nil: a pipe using `zcat' or `gunzip -c' will be used." |
| 201 | 232 | :type 'boolean | |
| 202 | (defvar dired-guess-shell-gzip-quiet t | 233 | :group 'dired-x) |
| 203 | "*non-nil says pass -q to gzip overriding verbose GZIP environment.") | 234 | |
| 204 | 235 | (defcustom dired-guess-shell-gzip-quiet t | |
| 205 | (defvar dired-guess-shell-znew-switches nil | 236 | "*non-nil says pass -q to gzip overriding verbose GZIP environment." |
| 206 | "*If non-nil, then string of switches passed to `znew', example: \"-K\"") | 237 | :type 'boolean |
| 207 | 238 | :group 'dired-x) | |
| 208 | (defvar dired-clean-up-buffers-too t | 239 | |
| 209 | "*t says offer to kill buffers visiting files and dirs deleted in dired.") | 240 | (defcustom dired-guess-shell-znew-switches nil |
| 241 | "*If non-nil, then string of switches passed to `znew', example: \"-K\"" | ||
| 242 | :type 'boolean | ||
| 243 | :group 'dired-x) | ||
| 244 | |||
| 245 | (defcustom dired-clean-up-buffers-too t | ||
| 246 | "*t says offer to kill buffers visiting files and dirs deleted in dired." | ||
| 247 | :type 'boolean | ||
| 248 | :group 'dired-x) | ||
| 210 | 249 | ||
| 211 | ;;; KEY BINDINGS. | 250 | ;;; KEY BINDINGS. |
| 212 | 251 | ||
diff --git a/lisp/dired.el b/lisp/dired.el index c2d61948c80..9b0891ad262 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -35,12 +35,24 @@ | |||
| 35 | 35 | ||
| 36 | ;;; Customizable variables | 36 | ;;; Customizable variables |
| 37 | 37 | ||
| 38 | (defgroup dired nil | ||
| 39 | "Directory editing." | ||
| 40 | :group 'environment) | ||
| 41 | |||
| 42 | (defgroup dired-mark nil | ||
| 43 | "Handling marks in dired." | ||
| 44 | :prefix "dired-" | ||
| 45 | :group 'dired) | ||
| 46 | |||
| 47 | |||
| 38 | ;;;###autoload | 48 | ;;;###autoload |
| 39 | (defvar dired-listing-switches "-al" | 49 | (defcustom dired-listing-switches "-al" |
| 40 | "*Switches passed to `ls' for dired. MUST contain the `l' option. | 50 | "*Switches passed to `ls' for dired. MUST contain the `l' option. |
| 41 | May contain all other options that don't contradict `-l'; | 51 | May contain all other options that don't contradict `-l'; |
| 42 | may contain even `F', `b', `i' and `s'. See also the variable | 52 | may contain even `F', `b', `i' and `s'. See also the variable |
| 43 | `dired-ls-F-marks-symlinks' concerning the `F' switch.") | 53 | `dired-ls-F-marks-symlinks' concerning the `F' switch." |
| 54 | :type 'string | ||
| 55 | :group 'dired) | ||
| 44 | 56 | ||
| 45 | ; Don't use absolute paths as /bin should be in any PATH and people | 57 | ; Don't use absolute paths as /bin should be in any PATH and people |
| 46 | ; may prefer /usr/local/gnu/bin or whatever. However, chown is | 58 | ; may prefer /usr/local/gnu/bin or whatever. However, chown is |
| @@ -61,7 +73,7 @@ may contain even `F', `b', `i' and `s'. See also the variable | |||
| 61 | "Name of chmod command (usually `chmod' or `chmode').") | 73 | "Name of chmod command (usually `chmod' or `chmode').") |
| 62 | 74 | ||
| 63 | ;;;###autoload | 75 | ;;;###autoload |
| 64 | (defvar dired-ls-F-marks-symlinks nil | 76 | (defcustom dired-ls-F-marks-symlinks nil |
| 65 | "*Informs dired about how `ls -lF' marks symbolic links. | 77 | "*Informs dired about how `ls -lF' marks symbolic links. |
| 66 | Set this to t if `ls' (or whatever program is specified by | 78 | Set this to t if `ls' (or whatever program is specified by |
| 67 | `insert-directory-program') with `-lF' marks the symbolic link | 79 | `insert-directory-program') with `-lF' marks the symbolic link |
| @@ -73,52 +85,74 @@ nil (the default), if it gives `bar@ -> foo', set it to t. | |||
| 73 | Dired checks if there is really a @ appended. Thus, if you have a | 85 | Dired checks if there is really a @ appended. Thus, if you have a |
| 74 | marking `ls' program on one host and a non-marking on another host, and | 86 | marking `ls' program on one host and a non-marking on another host, and |
| 75 | don't care about symbolic links which really end in a @, you can | 87 | don't care about symbolic links which really end in a @, you can |
| 76 | always set this variable to t.") | 88 | always set this variable to t." |
| 89 | :type 'boolean | ||
| 90 | :group 'dired-mark) | ||
| 77 | 91 | ||
| 78 | ;;;###autoload | 92 | ;;;###autoload |
| 79 | (defvar dired-trivial-filenames "^\\.\\.?$\\|^#" | 93 | (defcustom dired-trivial-filenames "^\\.\\.?$\\|^#" |
| 80 | "*Regexp of files to skip when finding first file of a directory. | 94 | "*Regexp of files to skip when finding first file of a directory. |
| 81 | A value of nil means move to the subdir line. | 95 | A value of nil means move to the subdir line. |
| 82 | A value of t means move to first file.") | 96 | A value of t means move to first file." |
| 97 | :type '(choice (const :tag "Move to subdir" nil) | ||
| 98 | (const :tag "Move to first" t) | ||
| 99 | regexp) | ||
| 100 | :group 'dired) | ||
| 83 | 101 | ||
| 84 | ;;;###autoload | 102 | ;;;###autoload |
| 85 | (defvar dired-keep-marker-rename t | 103 | (defcustom dired-keep-marker-rename t |
| 86 | ;; Use t as default so that moved files "take their markers with them". | 104 | ;; Use t as default so that moved files "take their markers with them". |
| 87 | "*Controls marking of renamed files. | 105 | "*Controls marking of renamed files. |
| 88 | If t, files keep their previous marks when they are renamed. | 106 | If t, files keep their previous marks when they are renamed. |
| 89 | If a character, renamed files (whether previously marked or not) | 107 | If a character, renamed files (whether previously marked or not) |
| 90 | are afterward marked with that character.") | 108 | are afterward marked with that character." |
| 109 | :type '(choice (const :tag "Keep" t) | ||
| 110 | (character :tag "Mark")) | ||
| 111 | :group 'dired-mark) | ||
| 91 | 112 | ||
| 92 | ;;;###autoload | 113 | ;;;###autoload |
| 93 | (defvar dired-keep-marker-copy ?C | 114 | (defcustom dired-keep-marker-copy ?C |
| 94 | "*Controls marking of copied files. | 115 | "*Controls marking of copied files. |
| 95 | If t, copied files are marked if and as the corresponding original files were. | 116 | If t, copied files are marked if and as the corresponding original files were. |
| 96 | If a character, copied files are unconditionally marked with that character.") | 117 | If a character, copied files are unconditionally marked with that character." |
| 118 | :type '(choice (const :tag "Keep" t) | ||
| 119 | (character :tag "Mark")) | ||
| 120 | :group 'dired-mark) | ||
| 97 | 121 | ||
| 98 | ;;;###autoload | 122 | ;;;###autoload |
| 99 | (defvar dired-keep-marker-hardlink ?H | 123 | (defcustom dired-keep-marker-hardlink ?H |
| 100 | "*Controls marking of newly made hard links. | 124 | "*Controls marking of newly made hard links. |
| 101 | If t, they are marked if and as the files linked to were marked. | 125 | If t, they are marked if and as the files linked to were marked. |
| 102 | If a character, new links are unconditionally marked with that character.") | 126 | If a character, new links are unconditionally marked with that character." |
| 127 | :type '(choice (const :tag "Keep" t) | ||
| 128 | (character :tag "Mark")) | ||
| 129 | :group 'dired-mark) | ||
| 103 | 130 | ||
| 104 | ;;;###autoload | 131 | ;;;###autoload |
| 105 | (defvar dired-keep-marker-symlink ?Y | 132 | (defcustom dired-keep-marker-symlink ?Y |
| 106 | "*Controls marking of newly made symbolic links. | 133 | "*Controls marking of newly made symbolic links. |
| 107 | If t, they are marked if and as the files linked to were marked. | 134 | If t, they are marked if and as the files linked to were marked. |
| 108 | If a character, new links are unconditionally marked with that character.") | 135 | If a character, new links are unconditionally marked with that character." |
| 136 | :type '(choice (const :tag "Keep" t) | ||
| 137 | (character :tag "Mark")) | ||
| 138 | :group 'dired-mark) | ||
| 109 | 139 | ||
| 110 | ;;;###autoload | 140 | ;;;###autoload |
| 111 | (defvar dired-dwim-target nil | 141 | (defcustom dired-dwim-target nil |
| 112 | "*If non-nil, dired tries to guess a default target directory. | 142 | "*If non-nil, dired tries to guess a default target directory. |
| 113 | This means: if there is a dired buffer displayed in the next window, | 143 | This means: if there is a dired buffer displayed in the next window, |
| 114 | use its current subdir, instead of the current subdir of this dired buffer. | 144 | use its current subdir, instead of the current subdir of this dired buffer. |
| 115 | 145 | ||
| 116 | The target is used in the prompt for file copy, rename etc.") | 146 | The target is used in the prompt for file copy, rename etc." |
| 147 | :type 'boolean | ||
| 148 | :group 'dired) | ||
| 117 | 149 | ||
| 118 | ;;;###autoload | 150 | ;;;###autoload |
| 119 | (defvar dired-copy-preserve-time t | 151 | (defcustom dired-copy-preserve-time t |
| 120 | "*If non-nil, Dired preserves the last-modified time in a file copy. | 152 | "*If non-nil, Dired preserves the last-modified time in a file copy. |
| 121 | \(This works on only some systems.)") | 153 | \(This works on only some systems.)" |
| 154 | :type 'boolean | ||
| 155 | :group 'dired) | ||
| 122 | 156 | ||
| 123 | ;;; Hook variables | 157 | ;;; Hook variables |
| 124 | 158 | ||