From 53ef76c7d3cd9932d8d3be981aef3a136cc8849d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 16 Feb 2011 21:13:17 -0800 Subject: [PATCH] Convert some defvars to defcustoms. * lisp/speedbar.el (speedbar-ignored-modes, speedbar-file-unshown-regexp) (speedbar-update-flag, speedbar-fetch-etags-command) (speedbar-fetch-etags-arguments): * lisp/term.el (term-buffer-maximum-size, term-input-chunk-size) (term-completion-autolist, term-completion-addsuffix) (term-completion-recexact, term-completion-fignore): * lisp/term/sup-mouse.el (sup-mouse-fast-select-window): * lisp/term/x-win.el (x-select-request-type): Convert some defvars with "*" to defcustoms. --- lisp/ChangeLog | 10 +++++++++ lisp/speedbar.el | 51 +++++++++++++++++++++++++----------------- lisp/term.el | 51 +++++++++++++++++++++++++++--------------- lisp/term/sup-mouse.el | 7 ++++-- lisp/term/x-win.el | 22 ++++++++++++------ 5 files changed, 94 insertions(+), 47 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ca4fa798d15..399b1fff4e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2011-02-17 Glenn Morris + * speedbar.el (speedbar-ignored-modes, speedbar-file-unshown-regexp) + (speedbar-update-flag, speedbar-fetch-etags-command) + (speedbar-fetch-etags-arguments): + * term.el (term-buffer-maximum-size, term-input-chunk-size) + (term-completion-autolist, term-completion-addsuffix) + (term-completion-recexact, term-completion-fignore): + * term/sup-mouse.el (sup-mouse-fast-select-window): + * term/x-win.el (x-select-request-type): + Convert some defvars with "*" to defcustoms. + * shell.el (shell-delimiter-argument-list): Set it to nil. (Bug#8027) * vc/vc.el (vc-default-previous-version): diff --git a/lisp/speedbar.el b/lisp/speedbar.el index b84afd797d1..dad2a4c82ac 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -614,8 +614,11 @@ state data." :group 'speedbar :type 'hook) -(defvar speedbar-ignored-modes '(fundamental-mode) - "*List of major modes which speedbar will not switch directories for.") +(defcustom speedbar-ignored-modes '(fundamental-mode) + "List of major modes which speedbar will not switch directories for." + :group 'speedbar + :type '(choice (const nil) + (repeat :tag "List of modes" (symbol :tag "Major mode")))) (defun speedbar-extension-list-to-regex (extlist) "Takes EXTLIST, a list of extensions and transforms it into regexp. @@ -669,7 +672,7 @@ directories here; see `vc-directory-exclusion-list'." :group 'speedbar :type 'string) -(defvar speedbar-file-unshown-regexp +(defcustom speedbar-file-unshown-regexp (let ((nstr "") (noext completion-ignored-extensions)) (while noext (setq nstr (concat nstr (regexp-quote (car noext)) "\\'" @@ -677,8 +680,10 @@ directories here; see `vc-directory-exclusion-list'." noext (cdr noext))) ;; backup refdir lockfile (concat nstr "\\|#[^#]+#$\\|\\.\\.?\\'\\|\\.#")) - "*Regexp matching files we don't want displayed in a speedbar buffer. -It is generated from the variable `completion-ignored-extensions'.") + "Regexp matching files we don't want displayed in a speedbar buffer. +It is generated from the variable `completion-ignored-extensions'." + :group 'speedbar + :type 'string) (defvar speedbar-file-regexp nil "Regular expression matching files we know how to expand. @@ -755,14 +760,17 @@ DIRECTORY-EXPRESSION to `speedbar-ignored-directory-expressions'." speedbar-ignored-directory-regexp (speedbar-extension-list-to-regex speedbar-ignored-directory-expressions))) -(defvar speedbar-update-flag dframe-have-timer-flag - "*Non-nil means to automatically update the display. +(defcustom speedbar-update-flag dframe-have-timer-flag + "Non-nil means to automatically update the display. When this is nil then speedbar will not follow the attached frame's directory. -When speedbar is active, use: - -\\ `\\[speedbar-toggle-updates]' - -to toggle this value.") +If you want to change this while speedbar is active, either use +\\[customize] or call \\ `\\[speedbar-toggle-updates]'." + :group 'speedbar + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set sym val) + (speedbar-toggle-updates)) + :type 'boolean) (defvar speedbar-update-flag-disable nil "Permanently disable changing of the update flag.") @@ -3643,17 +3651,20 @@ to be at the beginning of a line in the etags buffer. This variable is ignored if `speedbar-use-imenu-flag' is non-nil.") -(defvar speedbar-fetch-etags-command "etags" - "*Command used to create an etags file. - -This variable is ignored if `speedbar-use-imenu-flag' is t.") +(defcustom speedbar-fetch-etags-command "etags" + "Command used to create an etags file. +This variable is ignored if `speedbar-use-imenu-flag' is t." + :group 'speedbar + :type 'string) -(defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-") - "*List of arguments to use with `speedbar-fetch-etags-command'. +(defcustom speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-") + "List of arguments to use with `speedbar-fetch-etags-command'. This creates an etags output buffer. Use `speedbar-toggle-etags' to modify this list conveniently. - -This variable is ignored if `speedbar-use-imenu-flag' is t.") +This variable is ignored if `speedbar-use-imenu-flag' is t." + :group 'speedbar + :type '(choice (const nil) + (repeat :tag "List of arguments" string))) (defun speedbar-toggle-etags (flag) "Toggle FLAG in `speedbar-fetch-etags-arguments'. diff --git a/lisp/term.el b/lisp/term.el index ea419234e0f..df95ca830ab 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -762,11 +762,13 @@ Buffer local variable.") "magenta3" "cyan3" "white"]) ;; Inspiration came from comint.el -mm -(defvar term-buffer-maximum-size 2048 - "*The maximum size in lines for term buffers. +(defcustom term-buffer-maximum-size 2048 + "The maximum size in lines for term buffers. Term buffers are truncated from the top to be no greater than this number. Notice that a setting of 0 means \"don't truncate anything\". This variable -is buffer-local.") +is buffer-local." + :group 'term + :type 'integer) (when (featurep 'xemacs) (defvar term-terminal-menu @@ -2209,9 +2211,11 @@ Security bug: your string can still be temporarily recovered with ;;; Low-level process communication -(defvar term-input-chunk-size 512 - "*Long inputs send to term processes are broken up into chunks of this size. -If your process is choking on big inputs, try lowering the value.") +(defcustom term-input-chunk-size 512 + "Long inputs send to term processes are broken up into chunks of this size. +If your process is choking on big inputs, try lowering the value." + :group 'term + :type 'integer) (defun term-send-string (proc str) "Send to PROC the contents of STR as input. @@ -3909,27 +3913,38 @@ This is a good place to put keybindings.") ;; Commands like this are fine things to put in load hooks if you ;; want them present in specific modes. -(defvar term-completion-autolist nil - "*If non-nil, automatically list possibilities on partial completion. -This mirrors the optional behavior of tcsh.") +(defcustom term-completion-autolist nil + "If non-nil, automatically list possibilities on partial completion. +This mirrors the optional behavior of tcsh." + :group 'term + :type 'boolean) -(defvar term-completion-addsuffix t - "*If non-nil, add a `/' to completed directories, ` ' to file names. +(defcustom term-completion-addsuffix t + "If non-nil, add a `/' to completed directories, ` ' to file names. If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact -completion. This mirrors the optional behavior of tcsh.") +completion. This mirrors the optional behavior of tcsh." + :group 'term + :type '(choice (const :tag "No suffix" nil) + (cons (string :tag "dirsuffix") (string :tag "filesuffix")) + (other :tag "Suffix" t))) -(defvar term-completion-recexact nil - "*If non-nil, use shortest completion if characters cannot be added. +(defcustom term-completion-recexact nil + "If non-nil, use shortest completion if characters cannot be added. This mirrors the optional behavior of tcsh. -A non-nil value is useful if `term-completion-autolist' is non-nil too.") +A non-nil value is useful if `term-completion-autolist' is non-nil too." + :group 'term + :type 'boolean) -(defvar term-completion-fignore nil - "*List of suffixes to be disregarded during file completion. +(defcustom term-completion-fignore nil + "List of suffixes to be disregarded during file completion. This mirrors the optional behavior of bash and tcsh. -Note that this applies to `term-dynamic-complete-filename' only.") +Note that this applies to `term-dynamic-complete-filename' only." + :group 'term + :type '(choice (const nil) + (repeat :tag "List of suffixes" string))) (defvar term-file-name-prefix "" "Prefix prepended to absolute file names taken from process input. diff --git a/lisp/term/sup-mouse.el b/lisp/term/sup-mouse.el index a8b78bb3e38..6d77241008c 100644 --- a/lisp/term/sup-mouse.el +++ b/lisp/term/sup-mouse.el @@ -30,8 +30,11 @@ ;;; User customization option: -(defvar sup-mouse-fast-select-window nil - "*Non-nil for mouse hits to select new window, then execute; else just select.") +(defcustom sup-mouse-fast-select-window nil + "Non-nil means mouse hits select new window, then execute. +Otherwise just select." + :type 'boolean + :group 'mouse) (defconst mouse-left 0) (defconst mouse-center 1) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 1ec80d5c277..e3c42626a3f 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -1167,20 +1167,28 @@ pasted text.") :group 'killing :version "24.1") -(defvar x-select-request-type nil - "*Data type request for X selection. +(defcustom x-select-request-type nil + "Data type request for X selection. The value is one of the following data types, a list of them, or nil: `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT' -If the value is one of the above symbols, try only the specified -type. +If the value is one of the above symbols, try only the specified type. If the value is a list of them, try each of them in the specified order until succeed. -The value nil is the same as this list: - \(UTF8_STRING COMPOUND_TEXT STRING) -") +The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING)." + :type '(choice (const :tag "Default" nil) + (const COMPOUND_TEXT) + (const UTF8_STRING) + (const STRING) + (const TEXT) + (set :tag "List of values" + (const COMPOUND_TEXT) + (const UTF8_STRING) + (const STRING) + (const TEXT))) + :group 'killing) ;; Get a selection value of type TYPE by calling x-get-selection with ;; an appropriate DATA-TYPE argument decided by `x-select-request-type'. -- 2.39.5