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.
This commit is contained in:
parent
dcc029e017
commit
9d79402605
11 changed files with 81 additions and 48 deletions
|
@ -1,3 +1,17 @@
|
||||||
|
2010-10-29 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
|
* abbrev.el (abbrev-mode):
|
||||||
|
* composite.el (auto-composition-mode):
|
||||||
|
* menu-bar.el (menu-bar-mode):
|
||||||
|
* simple.el (transient-mark-mode):
|
||||||
|
* tool-bar.el (tool-bar-mode): Adjust the define-minor-mode calls so
|
||||||
|
that they do not define the associated variables twice.
|
||||||
|
* simple.el (transient-mark-mode): Remove defvar.
|
||||||
|
* composite.el (auto-composition-mode): Make variable auto-buffer-local.
|
||||||
|
* cus-start.el: Add transient-mark-mode, menu-bar-mode, tool-bar-mode.
|
||||||
|
Handle multiple groups, and also custom-delayed-init-variables.
|
||||||
|
* emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
|
||||||
|
|
||||||
2010-10-29 Stefan Monnier <monnier@iro.umontreal.ca>
|
2010-10-29 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
||||||
* emacs-lisp/pcase.el (pcase): New `string' and `guard' patterns.
|
* emacs-lisp/pcase.el (pcase): New `string' and `guard' patterns.
|
||||||
|
|
|
@ -57,7 +57,9 @@ define global abbrevs instead."
|
||||||
"Toggle Abbrev mode in the current buffer.
|
"Toggle Abbrev mode in the current buffer.
|
||||||
With optional argument ARG, turn abbrev mode on if ARG is
|
With optional argument ARG, turn abbrev mode on if ARG is
|
||||||
positive, otherwise turn it off. In Abbrev mode, inserting an
|
positive, otherwise turn it off. In Abbrev mode, inserting an
|
||||||
abbreviation causes it to expand and be replaced by its expansion.")
|
abbreviation causes it to expand and be replaced by its expansion."
|
||||||
|
;; It's defined in C, this stops the d-m-m macro defining it again.
|
||||||
|
:variable abbrev-mode)
|
||||||
|
|
||||||
(put 'abbrev-mode 'safe-local-variable 'booleanp)
|
(put 'abbrev-mode 'safe-local-variable 'booleanp)
|
||||||
|
|
||||||
|
|
|
@ -743,7 +743,11 @@ When Auto Composition is enabled, text characters are automatically composed
|
||||||
by functions registered in `composition-function-table' (which see).
|
by functions registered in `composition-function-table' (which see).
|
||||||
|
|
||||||
You can use `global-auto-composition-mode' to turn on
|
You can use `global-auto-composition-mode' to turn on
|
||||||
Auto Composition mode in all buffers (this is the default).")
|
Auto Composition mode in all buffers (this is the default)."
|
||||||
|
;; It's defined in C, this stops the d-m-m macro defining it again.
|
||||||
|
:variable auto-composition-mode)
|
||||||
|
;; It's not defined with DEFVAR_PER_BUFFER though.
|
||||||
|
(make-variable-buffer-local 'auto-composition-mode)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-minor-mode global-auto-composition-mode
|
(define-minor-mode global-auto-composition-mode
|
||||||
|
@ -757,5 +761,4 @@ See `auto-composition-mode' for more information on Auto-Composition mode."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33
|
|
||||||
;;; composite.el ends here
|
;;; composite.el ends here
|
||||||
|
|
|
@ -101,6 +101,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
|
||||||
:set #'(lambda (symbol value)
|
:set #'(lambda (symbol value)
|
||||||
(set-default symbol value)
|
(set-default symbol value)
|
||||||
(force-mode-line-update t)))
|
(force-mode-line-update t)))
|
||||||
|
(transient-mark-mode editing-basics boolean nil
|
||||||
|
(not noninteractive)
|
||||||
|
:initialize custom-initialize-delay)
|
||||||
;; callint.c
|
;; callint.c
|
||||||
(mark-even-if-inactive editing-basics boolean)
|
(mark-even-if-inactive editing-basics boolean)
|
||||||
;; callproc.c
|
;; callproc.c
|
||||||
|
@ -185,6 +188,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
|
||||||
(other :tag "hidden by keypress" 1))
|
(other :tag "hidden by keypress" 1))
|
||||||
"22.1")
|
"22.1")
|
||||||
(make-pointer-invisible mouse boolean "23.2")
|
(make-pointer-invisible mouse boolean "23.2")
|
||||||
|
(menu-bar-mode frames boolean)
|
||||||
|
(tool-bar-mode (frames mouse) boolean)
|
||||||
;; fringe.c
|
;; fringe.c
|
||||||
(overflow-newline-into-fringe fringe boolean)
|
(overflow-newline-into-fringe fringe boolean)
|
||||||
;; indent.c
|
;; indent.c
|
||||||
|
@ -452,11 +457,17 @@ since it could result in memory overflow and make Emacs crash."
|
||||||
(put symbol 'safe-local-variable (cadr prop)))
|
(put symbol 'safe-local-variable (cadr prop)))
|
||||||
(if (setq prop (memq :risky rest))
|
(if (setq prop (memq :risky rest))
|
||||||
(put symbol 'risky-local-variable (cadr prop)))
|
(put symbol 'risky-local-variable (cadr prop)))
|
||||||
|
;; Note this is the _only_ initialize property we handle.
|
||||||
|
(if (eq (cadr (memq :initialize rest)) 'custom-initialize-delay)
|
||||||
|
(push symbol custom-delayed-init-variables))
|
||||||
;; If this is NOT while dumping Emacs,
|
;; If this is NOT while dumping Emacs,
|
||||||
;; set up the rest of the customization info.
|
;; set up the rest of the customization info.
|
||||||
(unless purify-flag
|
(unless purify-flag
|
||||||
;; Add it to the right group.
|
;; Add it to the right group(s).
|
||||||
(custom-add-to-group group symbol 'custom-variable)
|
(if (listp group)
|
||||||
|
(dolist (g group)
|
||||||
|
(custom-add-to-group g symbol 'custom-variable))
|
||||||
|
(custom-add-to-group group symbol 'custom-variable))
|
||||||
;; Set the type.
|
;; Set the type.
|
||||||
(put symbol 'custom-type type)
|
(put symbol 'custom-type type)
|
||||||
(put symbol 'custom-version version)
|
(put symbol 'custom-version version)
|
||||||
|
|
|
@ -119,7 +119,8 @@ BODY contains code to execute each time the mode is enabled or disabled.
|
||||||
of the variable MODE to store the state of the mode. PLACE
|
of the variable MODE to store the state of the mode. PLACE
|
||||||
can also be of the form (GET . SET) where GET is an expression
|
can also be of the form (GET . SET) where GET is an expression
|
||||||
that returns the current state and SET is a function that takes
|
that returns the current state and SET is a function that takes
|
||||||
a new state and sets it.
|
a new state and sets it. If you specify a :variable, this
|
||||||
|
function assumes it is defined elsewhere.
|
||||||
|
|
||||||
For example, you could write
|
For example, you could write
|
||||||
(define-minor-mode foo-mode \"If enabled, foo on you!\"
|
(define-minor-mode foo-mode \"If enabled, foo on you!\"
|
||||||
|
@ -196,6 +197,7 @@ For example, you could write
|
||||||
`(:group ',(intern (replace-regexp-in-string
|
`(:group ',(intern (replace-regexp-in-string
|
||||||
"-mode\\'" "" mode-name)))))
|
"-mode\\'" "" mode-name)))))
|
||||||
|
|
||||||
|
;; TODO? Mark booleans as safe if booleanp? Eg abbrev-mode.
|
||||||
(unless type (setq type '(:type 'boolean)))
|
(unless type (setq type '(:type 'boolean)))
|
||||||
|
|
||||||
`(progn
|
`(progn
|
||||||
|
@ -583,5 +585,4 @@ BODY is executed after moving to the destination location."
|
||||||
|
|
||||||
(provide 'easy-mmode)
|
(provide 'easy-mmode)
|
||||||
|
|
||||||
;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a
|
|
||||||
;;; easy-mmode.el ends here
|
;;; easy-mmode.el ends here
|
||||||
|
|
|
@ -2073,7 +2073,8 @@ With a numeric argument, if the argument is positive,
|
||||||
turn on menu bars; otherwise, turn off menu bars."
|
turn on menu bars; otherwise, turn off menu bars."
|
||||||
:init-value t
|
:init-value t
|
||||||
:global t
|
:global t
|
||||||
:group 'frames
|
;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
|
||||||
|
:variable menu-bar-mode
|
||||||
|
|
||||||
;; Turn the menu-bars on all frames on or off.
|
;; Turn the menu-bars on all frames on or off.
|
||||||
(let ((val (if menu-bar-mode 1 0)))
|
(let ((val (if menu-bar-mode 1 0)))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;;; simple.el --- basic editing commands for Emacs
|
;;; simple.el --- basic editing commands for Emacs
|
||||||
|
|
||||||
;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||||
;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||||
;; Free Software Foundation, Inc.
|
;; 2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;; Maintainer: FSF
|
;; Maintainer: FSF
|
||||||
;; Keywords: internal
|
;; Keywords: internal
|
||||||
|
@ -4051,29 +4051,8 @@ Invoke \\[apropos-documentation] and type \"transient\" or
|
||||||
\"mark.*active\" at the prompt, to see the documentation of
|
\"mark.*active\" at the prompt, to see the documentation of
|
||||||
commands which are sensitive to the Transient Mark mode."
|
commands which are sensitive to the Transient Mark mode."
|
||||||
:global t
|
:global t
|
||||||
:init-value (not noninteractive)
|
;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
|
||||||
:initialize 'custom-initialize-delay
|
:variable transient-mark-mode)
|
||||||
:group 'editing-basics)
|
|
||||||
|
|
||||||
;; The variable transient-mark-mode is ugly: it can take on special
|
|
||||||
;; values. Document these here.
|
|
||||||
(defvar transient-mark-mode t
|
|
||||||
"*Non-nil if Transient Mark mode is enabled.
|
|
||||||
See the command `transient-mark-mode' for a description of this minor mode.
|
|
||||||
|
|
||||||
Non-nil also enables highlighting of the region whenever the mark is active.
|
|
||||||
The variable `highlight-nonselected-windows' controls whether to highlight
|
|
||||||
all windows or just the selected window.
|
|
||||||
|
|
||||||
If the value is `lambda', that enables Transient Mark mode temporarily.
|
|
||||||
After any subsequent action that would normally deactivate the mark
|
|
||||||
\(such as buffer modification), Transient Mark mode is turned off.
|
|
||||||
|
|
||||||
If the value is (only . OLDVAL), that enables Transient Mark mode
|
|
||||||
temporarily. After any subsequent point motion command that is not
|
|
||||||
shift-translated, or any other action that would normally deactivate
|
|
||||||
the mark (such as buffer modification), the value of
|
|
||||||
`transient-mark-mode' is set to OLDVAL.")
|
|
||||||
|
|
||||||
(defvar widen-automatically t
|
(defvar widen-automatically t
|
||||||
"Non-nil means it is ok for commands to call `widen' when they want to.
|
"Non-nil means it is ok for commands to call `widen' when they want to.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;;; tool-bar.el --- setting up the tool bar
|
;;; tool-bar.el --- setting up the tool bar
|
||||||
;;
|
|
||||||
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
|
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
|
||||||
;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
;; 2009, 2010 Free Software Foundation, Inc.
|
||||||
;;
|
|
||||||
;; Author: Dave Love <fx@gnu.org>
|
;; Author: Dave Love <fx@gnu.org>
|
||||||
;; Keywords: mouse frames
|
;; Keywords: mouse frames
|
||||||
;; Package: emacs
|
;; Package: emacs
|
||||||
|
@ -51,8 +51,8 @@ See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
|
||||||
conveniently adding tool bar items."
|
conveniently adding tool bar items."
|
||||||
:init-value t
|
:init-value t
|
||||||
:global t
|
:global t
|
||||||
:group 'mouse
|
;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
|
||||||
:group 'frames
|
:variable tool-bar-mode
|
||||||
(let ((val (if tool-bar-mode 1 0)))
|
(let ((val (if tool-bar-mode 1 0)))
|
||||||
(dolist (frame (frame-list))
|
(dolist (frame (frame-list))
|
||||||
(set-frame-parameter frame 'tool-bar-lines val))
|
(set-frame-parameter frame 'tool-bar-lines val))
|
||||||
|
@ -330,5 +330,5 @@ Customize `tool-bar-mode' if you want to show or hide the tool bar."
|
||||||
|
|
||||||
|
|
||||||
(provide 'tool-bar)
|
(provide 'tool-bar)
|
||||||
;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f
|
|
||||||
;;; tool-bar.el ends here
|
;;; tool-bar.el ends here
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-10-29 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
|
* buffer.c (syms_of_buffer) <abbrev-mode, transient-mark-mode>:
|
||||||
|
* frame.c (syms_of_frame) <tool-bar-mode>: Move doc here from Lisp.
|
||||||
|
|
||||||
2010-10-26 Juanma Barranquero <lekktu@gmail.com>
|
2010-10-26 Juanma Barranquero <lekktu@gmail.com>
|
||||||
|
|
||||||
* eval.c (init_eval_once): Set max_lisp_eval_depth to 600;
|
* eval.c (init_eval_once): Set max_lisp_eval_depth to 600;
|
||||||
|
|
23
src/buffer.c
23
src/buffer.c
|
@ -5600,7 +5600,8 @@ Format with `format-mode-line' to produce a string value. */);
|
||||||
doc: /* Local (mode-specific) abbrev table of current buffer. */);
|
doc: /* Local (mode-specific) abbrev table of current buffer. */);
|
||||||
|
|
||||||
DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil,
|
DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil,
|
||||||
doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */);
|
doc: /* Non-nil if Abbrev mode is enabled.
|
||||||
|
Use the command `abbrev-mode' to change this variable. */);
|
||||||
|
|
||||||
DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search,
|
DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search,
|
||||||
Qnil,
|
Qnil,
|
||||||
|
@ -6098,11 +6099,23 @@ to the value obtained by calling `current-time'.
|
||||||
If the buffer has never been shown in a window, the value is nil. */);
|
If the buffer has never been shown in a window, the value is nil. */);
|
||||||
|
|
||||||
DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode,
|
DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode,
|
||||||
doc: /* */);
|
doc: /* Non-nil if Transient Mark mode is enabled.
|
||||||
|
See the command `transient-mark-mode' for a description of this minor mode.
|
||||||
|
|
||||||
|
Non-nil also enables highlighting of the region whenever the mark is active.
|
||||||
|
The variable `highlight-nonselected-windows' controls whether to highlight
|
||||||
|
all windows or just the selected window.
|
||||||
|
|
||||||
|
If the value is `lambda', that enables Transient Mark mode temporarily.
|
||||||
|
After any subsequent action that would normally deactivate the mark
|
||||||
|
\(such as buffer modification), Transient Mark mode is turned off.
|
||||||
|
|
||||||
|
If the value is (only . OLDVAL), that enables Transient Mark mode
|
||||||
|
temporarily. After any subsequent point motion command that is not
|
||||||
|
shift-translated, or any other action that would normally deactivate
|
||||||
|
the mark (such as buffer modification), the value of
|
||||||
|
`transient-mark-mode' is set to OLDVAL. */);
|
||||||
Vtransient_mark_mode = Qnil;
|
Vtransient_mark_mode = Qnil;
|
||||||
/* The docstring is in simple.el. If we put it here, it would be
|
|
||||||
overwritten when transient-mark-mode is defined using
|
|
||||||
define-minor-mode. */
|
|
||||||
|
|
||||||
DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
|
DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
|
||||||
doc: /* *Non-nil means disregard read-only status of buffers or characters.
|
doc: /* *Non-nil means disregard read-only status of buffers or characters.
|
||||||
|
|
|
@ -4571,7 +4571,11 @@ or call the function `menu-bar-mode'. */);
|
||||||
Vmenu_bar_mode = Qt;
|
Vmenu_bar_mode = Qt;
|
||||||
|
|
||||||
DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
|
DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
|
||||||
doc: /* Non-nil if Tool-Bar mode is enabled. */);
|
doc: /* Non-nil if Tool-Bar mode is enabled.
|
||||||
|
See the command `tool-bar-mode' for a description of this minor mode.
|
||||||
|
Setting this variable directly does not take effect;
|
||||||
|
either customize it (see the info node `Easy Customization')
|
||||||
|
or call the function `tool-bar-mode'. */);
|
||||||
Vtool_bar_mode = Qt;
|
Vtool_bar_mode = Qt;
|
||||||
|
|
||||||
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
|
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue