emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103313: Convert some defvars to defc


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103313: Convert some defvars to defcustoms.
Date: Wed, 16 Feb 2011 21:13:17 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103313
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2011-02-16 21:13:17 -0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/speedbar.el
  lisp/term.el
  lisp/term/sup-mouse.el
  lisp/term/x-win.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-17 05:02:02 +0000
+++ b/lisp/ChangeLog    2011-02-17 05:13:17 +0000
@@ -1,5 +1,15 @@
 2011-02-17  Glenn Morris  <address@hidden>
 
+       * 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):

=== modified file 'lisp/speedbar.el'
--- a/lisp/speedbar.el  2011-01-26 08:36:39 +0000
+++ b/lisp/speedbar.el  2011-02-17 05:13:17 +0000
@@ -614,8 +614,11 @@
   :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 @@
   :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 @@
            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 @@
          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-key-map> `\\[speedbar-toggle-updates]'
-
-to toggle this value.")
+If you want to change this while speedbar is active, either use
+\\[customize] or call \\<speedbar-key-map> `\\[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 @@
 
 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.")
-
-(defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
-  "*List of arguments to use with `speedbar-fetch-etags-command'.
+(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)
+
+(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'.

=== modified file 'lisp/term.el'
--- a/lisp/term.el      2011-01-25 04:08:28 +0000
+++ b/lisp/term.el      2011-02-17 05:13:17 +0000
@@ -762,11 +762,13 @@
    "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 @@
 
 ;;; 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 @@
 ;; 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.

=== modified file 'lisp/term/sup-mouse.el'
--- a/lisp/term/sup-mouse.el    2011-01-25 04:08:28 +0000
+++ b/lisp/term/sup-mouse.el    2011-02-17 05:13:17 +0000
@@ -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)

=== modified file 'lisp/term/x-win.el'
--- a/lisp/term/x-win.el        2011-02-01 21:37:12 +0000
+++ b/lisp/term/x-win.el        2011-02-17 05:13:17 +0000
@@ -1167,20 +1167,28 @@
   :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'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]