aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-10-28 20:29:29 -0700
committerGlenn Morris2010-10-28 20:29:29 -0700
commit9d7940260552d9ad5f331443aae200094ae2847c (patch)
treef7c3cf42cbf6a057ba2918f03b91e15da25c8b19
parentdcc029e017acab959291f9d938234240ac3cea32 (diff)
downloademacs-9d7940260552d9ad5f331443aae200094ae2847c.tar.gz
emacs-9d7940260552d9ad5f331443aae200094ae2847c.zip
Remove duplicate Lisp definitions of define-minor-mode variables defined in C.
* lisp/abbrev.el (abbrev-mode): * lisp/composite.el (auto-composition-mode): * lisp/menu-bar.el (menu-bar-mode): * lisp/simple.el (transient-mark-mode): * lisp/tool-bar.el (tool-bar-mode): Adjust the define-minor-mode calls so that they do not define the associated variables twice. * lisp/simple.el (transient-mark-mode): Remove defvar. * lisp/composite.el (auto-composition-mode): Make variable auto-buffer-local. * lisp/cus-start.el: Add transient-mark-mode, menu-bar-mode, tool-bar-mode. Handle multiple groups, and also custom-delayed-init-variables. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. * src/buffer.c (syms_of_buffer) <abbrev-mode, transient-mark-mode>: * src/frame.c (syms_of_frame) <tool-bar-mode>: Move docs here from Lisp.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/abbrev.el4
-rw-r--r--lisp/composite.el7
-rw-r--r--lisp/cus-start.el15
-rw-r--r--lisp/emacs-lisp/easy-mmode.el5
-rw-r--r--lisp/menu-bar.el3
-rw-r--r--lisp/simple.el31
-rw-r--r--lisp/tool-bar.el16
-rw-r--r--src/ChangeLog5
-rw-r--r--src/buffer.c23
-rw-r--r--src/frame.c6
11 files changed, 81 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fbbddf04b2e..d40db8cf573 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12010-10-29 Glenn Morris <rgm@gnu.org>
2
3 * abbrev.el (abbrev-mode):
4 * composite.el (auto-composition-mode):
5 * menu-bar.el (menu-bar-mode):
6 * simple.el (transient-mark-mode):
7 * tool-bar.el (tool-bar-mode): Adjust the define-minor-mode calls so
8 that they do not define the associated variables twice.
9 * simple.el (transient-mark-mode): Remove defvar.
10 * composite.el (auto-composition-mode): Make variable auto-buffer-local.
11 * cus-start.el: Add transient-mark-mode, menu-bar-mode, tool-bar-mode.
12 Handle multiple groups, and also custom-delayed-init-variables.
13 * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
14
12010-10-29 Stefan Monnier <monnier@iro.umontreal.ca> 152010-10-29 Stefan Monnier <monnier@iro.umontreal.ca>
2 16
3 * emacs-lisp/pcase.el (pcase): New `string' and `guard' patterns. 17 * emacs-lisp/pcase.el (pcase): New `string' and `guard' patterns.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 1c21aee5662..9d0e86fbce8 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -57,7 +57,9 @@ define global abbrevs instead."
57 "Toggle Abbrev mode in the current buffer. 57 "Toggle Abbrev mode in the current buffer.
58With optional argument ARG, turn abbrev mode on if ARG is 58With optional argument ARG, turn abbrev mode on if ARG is
59positive, otherwise turn it off. In Abbrev mode, inserting an 59positive, otherwise turn it off. In Abbrev mode, inserting an
60abbreviation causes it to expand and be replaced by its expansion.") 60abbreviation causes it to expand and be replaced by its expansion."
61 ;; It's defined in C, this stops the d-m-m macro defining it again.
62 :variable abbrev-mode)
61 63
62(put 'abbrev-mode 'safe-local-variable 'booleanp) 64(put 'abbrev-mode 'safe-local-variable 'booleanp)
63 65
diff --git a/lisp/composite.el b/lisp/composite.el
index 02c78580fff..da7705cf9eb 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -743,7 +743,11 @@ When Auto Composition is enabled, text characters are automatically composed
743by functions registered in `composition-function-table' (which see). 743by functions registered in `composition-function-table' (which see).
744 744
745You can use `global-auto-composition-mode' to turn on 745You can use `global-auto-composition-mode' to turn on
746Auto Composition mode in all buffers (this is the default).") 746Auto Composition mode in all buffers (this is the default)."
747 ;; It's defined in C, this stops the d-m-m macro defining it again.
748 :variable auto-composition-mode)
749;; It's not defined with DEFVAR_PER_BUFFER though.
750(make-variable-buffer-local 'auto-composition-mode)
747 751
748;;;###autoload 752;;;###autoload
749(define-minor-mode global-auto-composition-mode 753(define-minor-mode global-auto-composition-mode
@@ -757,5 +761,4 @@ See `auto-composition-mode' for more information on Auto-Composition mode."
757 761
758 762
759 763
760;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33
761;;; composite.el ends here 764;;; composite.el ends here
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index ceb7bcdfd1a..8fa20d624dd 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -101,6 +101,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
101 :set #'(lambda (symbol value) 101 :set #'(lambda (symbol value)
102 (set-default symbol value) 102 (set-default symbol value)
103 (force-mode-line-update t))) 103 (force-mode-line-update t)))
104 (transient-mark-mode editing-basics boolean nil
105 (not noninteractive)
106 :initialize custom-initialize-delay)
104 ;; callint.c 107 ;; callint.c
105 (mark-even-if-inactive editing-basics boolean) 108 (mark-even-if-inactive editing-basics boolean)
106 ;; callproc.c 109 ;; callproc.c
@@ -185,6 +188,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
185 (other :tag "hidden by keypress" 1)) 188 (other :tag "hidden by keypress" 1))
186 "22.1") 189 "22.1")
187 (make-pointer-invisible mouse boolean "23.2") 190 (make-pointer-invisible mouse boolean "23.2")
191 (menu-bar-mode frames boolean)
192 (tool-bar-mode (frames mouse) boolean)
188 ;; fringe.c 193 ;; fringe.c
189 (overflow-newline-into-fringe fringe boolean) 194 (overflow-newline-into-fringe fringe boolean)
190 ;; indent.c 195 ;; indent.c
@@ -452,11 +457,17 @@ since it could result in memory overflow and make Emacs crash."
452 (put symbol 'safe-local-variable (cadr prop))) 457 (put symbol 'safe-local-variable (cadr prop)))
453 (if (setq prop (memq :risky rest)) 458 (if (setq prop (memq :risky rest))
454 (put symbol 'risky-local-variable (cadr prop))) 459 (put symbol 'risky-local-variable (cadr prop)))
460 ;; Note this is the _only_ initialize property we handle.
461 (if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay)
462 (push symbol custom-delayed-init-variables))
455 ;; If this is NOT while dumping Emacs, 463 ;; If this is NOT while dumping Emacs,
456 ;; set up the rest of the customization info. 464 ;; set up the rest of the customization info.
457 (unless purify-flag 465 (unless purify-flag
458 ;; Add it to the right group. 466 ;; Add it to the right group(s).
459 (custom-add-to-group group symbol 'custom-variable) 467 (if (listp group)
468 (dolist (g group)
469 (custom-add-to-group g symbol 'custom-variable))
470 (custom-add-to-group group symbol 'custom-variable))
460 ;; Set the type. 471 ;; Set the type.
461 (put symbol 'custom-type type) 472 (put symbol 'custom-type type)
462 (put symbol 'custom-version version) 473 (put symbol 'custom-version version)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index e11572dfc62..9a703c96378 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -119,7 +119,8 @@ BODY contains code to execute each time the mode is enabled or disabled.
119 of the variable MODE to store the state of the mode. PLACE 119 of the variable MODE to store the state of the mode. PLACE
120 can also be of the form (GET . SET) where GET is an expression 120 can also be of the form (GET . SET) where GET is an expression
121 that returns the current state and SET is a function that takes 121 that returns the current state and SET is a function that takes
122 a new state and sets it. 122 a new state and sets it. If you specify a :variable, this
123 function assumes it is defined elsewhere.
123 124
124For example, you could write 125For example, you could write
125 (define-minor-mode foo-mode \"If enabled, foo on you!\" 126 (define-minor-mode foo-mode \"If enabled, foo on you!\"
@@ -196,6 +197,7 @@ For example, you could write
196 `(:group ',(intern (replace-regexp-in-string 197 `(:group ',(intern (replace-regexp-in-string
197 "-mode\\'" "" mode-name))))) 198 "-mode\\'" "" mode-name)))))
198 199
200 ;; TODO? Mark booleans as safe if booleanp? Eg abbrev-mode.
199 (unless type (setq type '(:type 'boolean))) 201 (unless type (setq type '(:type 'boolean)))
200 202
201 `(progn 203 `(progn
@@ -583,5 +585,4 @@ BODY is executed after moving to the destination location."
583 585
584(provide 'easy-mmode) 586(provide 'easy-mmode)
585 587
586;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a
587;;; easy-mmode.el ends here 588;;; easy-mmode.el ends here
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index f75bbc5eb76..ac33940011a 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2073,7 +2073,8 @@ With a numeric argument, if the argument is positive,
2073turn on menu bars; otherwise, turn off menu bars." 2073turn on menu bars; otherwise, turn off menu bars."
2074 :init-value t 2074 :init-value t
2075 :global t 2075 :global t
2076 :group 'frames 2076 ;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
2077 :variable menu-bar-mode
2077 2078
2078 ;; Turn the menu-bars on all frames on or off. 2079 ;; Turn the menu-bars on all frames on or off.
2079 (let ((val (if menu-bar-mode 1 0))) 2080 (let ((val (if menu-bar-mode 1 0)))
diff --git a/lisp/simple.el b/lisp/simple.el
index 0d5638158fe..4d6d42f55a2 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1,8 +1,8 @@
1;;; simple.el --- basic editing commands for Emacs 1;;; simple.el --- basic editing commands for Emacs
2 2
3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998,
4;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 4;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
5;; Free Software Foundation, Inc. 5;; 2010 Free Software Foundation, Inc.
6 6
7;; Maintainer: FSF 7;; Maintainer: FSF
8;; Keywords: internal 8;; Keywords: internal
@@ -4051,29 +4051,8 @@ Invoke \\[apropos-documentation] and type \"transient\" or
4051\"mark.*active\" at the prompt, to see the documentation of 4051\"mark.*active\" at the prompt, to see the documentation of
4052commands which are sensitive to the Transient Mark mode." 4052commands which are sensitive to the Transient Mark mode."
4053 :global t 4053 :global t
4054 :init-value (not noninteractive) 4054 ;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
4055 :initialize 'custom-initialize-delay 4055 :variable transient-mark-mode)
4056 :group 'editing-basics)
4057
4058;; The variable transient-mark-mode is ugly: it can take on special
4059;; values. Document these here.
4060(defvar transient-mark-mode t
4061 "*Non-nil if Transient Mark mode is enabled.
4062See the command `transient-mark-mode' for a description of this minor mode.
4063
4064Non-nil also enables highlighting of the region whenever the mark is active.
4065The variable `highlight-nonselected-windows' controls whether to highlight
4066all windows or just the selected window.
4067
4068If the value is `lambda', that enables Transient Mark mode temporarily.
4069After any subsequent action that would normally deactivate the mark
4070\(such as buffer modification), Transient Mark mode is turned off.
4071
4072If the value is (only . OLDVAL), that enables Transient Mark mode
4073temporarily. After any subsequent point motion command that is not
4074shift-translated, or any other action that would normally deactivate
4075the mark (such as buffer modification), the value of
4076`transient-mark-mode' is set to OLDVAL.")
4077 4056
4078(defvar widen-automatically t 4057(defvar widen-automatically t
4079 "Non-nil means it is ok for commands to call `widen' when they want to. 4058 "Non-nil means it is ok for commands to call `widen' when they want to.
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 4dedf3dfca5..6630d85cd3e 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -1,8 +1,8 @@
1;;; tool-bar.el --- setting up the tool bar 1;;; tool-bar.el --- setting up the tool bar
2;; 2
3;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 4;; 2009, 2010 Free Software Foundation, Inc.
5;; 5
6;; Author: Dave Love <fx@gnu.org> 6;; Author: Dave Love <fx@gnu.org>
7;; Keywords: mouse frames 7;; Keywords: mouse frames
8;; Package: emacs 8;; Package: emacs
@@ -51,8 +51,8 @@ See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
51conveniently adding tool bar items." 51conveniently adding tool bar items."
52 :init-value t 52 :init-value t
53 :global t 53 :global t
54 :group 'mouse 54 ;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
55 :group 'frames 55 :variable tool-bar-mode
56 (let ((val (if tool-bar-mode 1 0))) 56 (let ((val (if tool-bar-mode 1 0)))
57 (dolist (frame (frame-list)) 57 (dolist (frame (frame-list))
58 (set-frame-parameter frame 'tool-bar-lines val)) 58 (set-frame-parameter frame 'tool-bar-lines val))
@@ -325,10 +325,10 @@ Customize `tool-bar-mode' if you want to show or hide the tool bar."
325 :initialize 'custom-initialize-default 325 :initialize 'custom-initialize-default
326 :set (lambda (sym val) 326 :set (lambda (sym val)
327 (set-default sym val) 327 (set-default sym val)
328 (modify-all-frames-parameters 328 (modify-all-frames-parameters
329 (list (cons 'tool-bar-position val)))))) 329 (list (cons 'tool-bar-position val))))))
330 330
331 331
332(provide 'tool-bar) 332(provide 'tool-bar)
333;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f 333
334;;; tool-bar.el ends here 334;;; tool-bar.el ends here
diff --git a/src/ChangeLog b/src/ChangeLog
index f3e2ea7854e..d61e20aa600 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-10-29 Glenn Morris <rgm@gnu.org>
2
3 * buffer.c (syms_of_buffer) <abbrev-mode, transient-mark-mode>:
4 * frame.c (syms_of_frame) <tool-bar-mode>: Move doc here from Lisp.
5
12010-10-26 Juanma Barranquero <lekktu@gmail.com> 62010-10-26 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * eval.c (init_eval_once): Set max_lisp_eval_depth to 600; 8 * eval.c (init_eval_once): Set max_lisp_eval_depth to 600;
diff --git a/src/buffer.c b/src/buffer.c
index 5a6bfcba060..67192b4843b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5600,7 +5600,8 @@ Format with `format-mode-line' to produce a string value. */);
5600 doc: /* Local (mode-specific) abbrev table of current buffer. */); 5600 doc: /* Local (mode-specific) abbrev table of current buffer. */);
5601 5601
5602 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil, 5602 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
5603 doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */); 5603 doc: /* Non-nil if Abbrev mode is enabled.
5604Use the command `abbrev-mode' to change this variable. */);
5604 5605
5605 DEFVAR_PER_BUFFER ("case-fold-search", &current_buffer->case_fold_search, 5606 DEFVAR_PER_BUFFER ("case-fold-search", &current_buffer->case_fold_search,
5606 Qnil, 5607 Qnil,
@@ -6098,11 +6099,23 @@ to the value obtained by calling `current-time'.
6098If the buffer has never been shown in a window, the value is nil. */); 6099If the buffer has never been shown in a window, the value is nil. */);
6099 6100
6100 DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode, 6101 DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode,
6101 doc: /* */); 6102 doc: /* Non-nil if Transient Mark mode is enabled.
6103See the command `transient-mark-mode' for a description of this minor mode.
6104
6105Non-nil also enables highlighting of the region whenever the mark is active.
6106The variable `highlight-nonselected-windows' controls whether to highlight
6107all windows or just the selected window.
6108
6109If the value is `lambda', that enables Transient Mark mode temporarily.
6110After any subsequent action that would normally deactivate the mark
6111\(such as buffer modification), Transient Mark mode is turned off.
6112
6113If the value is (only . OLDVAL), that enables Transient Mark mode
6114temporarily. After any subsequent point motion command that is not
6115shift-translated, or any other action that would normally deactivate
6116the mark (such as buffer modification), the value of
6117`transient-mark-mode' is set to OLDVAL. */);
6102 Vtransient_mark_mode = Qnil; 6118 Vtransient_mark_mode = Qnil;
6103 /* The docstring is in simple.el. If we put it here, it would be
6104 overwritten when transient-mark-mode is defined using
6105 define-minor-mode. */
6106 6119
6107 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, 6120 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
6108 doc: /* *Non-nil means disregard read-only status of buffers or characters. 6121 doc: /* *Non-nil means disregard read-only status of buffers or characters.
diff --git a/src/frame.c b/src/frame.c
index 1c9d471cfa9..1f8ff8d562b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4571,7 +4571,11 @@ or call the function `menu-bar-mode'. */);
4571 Vmenu_bar_mode = Qt; 4571 Vmenu_bar_mode = Qt;
4572 4572
4573 DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode, 4573 DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
4574 doc: /* Non-nil if Tool-Bar mode is enabled. */); 4574 doc: /* Non-nil if Tool-Bar mode is enabled.
4575See the command `tool-bar-mode' for a description of this minor mode.
4576Setting this variable directly does not take effect;
4577either customize it (see the info node `Easy Customization')
4578or call the function `tool-bar-mode'. */);
4575 Vtool_bar_mode = Qt; 4579 Vtool_bar_mode = Qt;
4576 4580
4577 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, 4581 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,