From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: dann@ics.uci.edu, storm@cua.dk, emacs-devel@gnu.org
Subject: Re: Global Font Lock by default
Date: Thu, 3 Nov 2005 20:03:20 -0600 (CST) [thread overview]
Message-ID: <200511040203.jA423Km08516@raven.dms.auburn.edu> (raw)
In-Reply-To: <E1EXfTp-0007ZZ-3Y@fencepost.gnu.org> (rms@gnu.org)
Below is a slightly revised version of my patch to easy-mmode. The
only differences with my prior patch are that the new treatment of
keywords is now reflected in the docstring and that a :global keyword
is now ignored, since the very use of `define-global-minor-mode'
implies that it must be t. If my patches seem OK, I would also update
the Elisp doc for `define-global-minor-mode'.
===File ~/easy-mmode-diff===================================
*** easy-mmode.el 24 Aug 2005 08:06:37 -0500 1.71
--- easy-mmode.el 03 Nov 2005 19:04:26 -0600
***************
*** 272,279 ****
"Make GLOBAL-MODE out of the buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.
! KEYS is a list of CL-style keyword arguments:
! :group to specify the custom group.
If MODE's set-up depends on the major mode in effect when it was
enabled, then disabling and reenabling MODE should make MODE work
--- 272,285 ----
"Make GLOBAL-MODE out of the buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.
! KEYS is a list of CL-style keyword arguments. As the minor mode
! defined by this function is always global, any :global keyword is
! ignored. Other keywords have the same meaning as in `define-minor-mode',
! which see. In particular, :group specifies the custom group.
! The most useful keywords are those that are passed on to the
! `defcustom'. It normally makes no sense to pass the :lighter
! or :keymap keywords to `define-global-minor-mode', since these
! are usually passed to the buffer-local version of the minor mode.
If MODE's set-up depends on the major mode in effect when it was
enabled, then disabling and reenabling MODE should make MODE work
***************
*** 285,305 ****
(pretty-name (easy-mmode-pretty-mode-name mode))
(pretty-global-name (easy-mmode-pretty-mode-name global-mode))
(group nil)
! (extra-args nil)
(MODE-buffers (intern (concat global-mode-name "-buffers")))
(MODE-enable-in-buffers
(intern (concat global-mode-name "-enable-in-buffers")))
(MODE-check-buffers
(intern (concat global-mode-name "-check-buffers")))
(MODE-cmhh (intern (concat global-mode-name "-cmhh")))
! (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))))
;; Check keys.
! (while (keywordp (car keys))
! (case (pop keys)
! (:extra-args (setq extra-args (pop keys)))
(:group (setq group (nconc group (list :group (pop keys)))))
! (t (setq keys (cdr keys)))))
(unless group
;; We might as well provide a best-guess default group.
--- 291,313 ----
(pretty-name (easy-mmode-pretty-mode-name mode))
(pretty-global-name (easy-mmode-pretty-mode-name global-mode))
(group nil)
! (extra-keywords nil)
(MODE-buffers (intern (concat global-mode-name "-buffers")))
(MODE-enable-in-buffers
(intern (concat global-mode-name "-enable-in-buffers")))
(MODE-check-buffers
(intern (concat global-mode-name "-check-buffers")))
(MODE-cmhh (intern (concat global-mode-name "-cmhh")))
! (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))
! keyw)
;; Check keys.
! (while (keywordp (setq keyw (car keys)))
! (setq keys (cdr keys))
! (case keyw
(:group (setq group (nconc group (list :group (pop keys)))))
! (:global (setq keys (cdr keys)))
! (t (push keyw extra-keywords) (push (pop keys) extra-keywords))))
(unless group
;; We might as well provide a best-guess default group.
***************
*** 317,323 ****
%s is actually not turned on in every buffer but only in those
in which `%s' turns it on."
pretty-name pretty-global-name pretty-name turn-on)
! :global t :extra-args ,extra-args ,@group
;; Setup hook to handle future mode changes and new buffers.
(if ,global-mode
--- 325,331 ----
%s is actually not turned on in every buffer but only in those
in which `%s' turns it on."
pretty-name pretty-global-name pretty-name turn-on)
! :global t ,@group ,@(nreverse extra-keywords)
;; Setup hook to handle future mode changes and new buffers.
(if ,global-mode
============================================================
prev parent reply other threads:[~2005-11-04 2:03 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-29 20:34 Global Font Lock by default Richard M. Stallman
2005-10-29 21:51 ` Kim F. Storm
2005-10-29 23:44 ` David Kastrup
2007-02-27 19:59 ` Stuart D. Herring
2005-10-30 14:52 ` Richard M. Stallman
2005-10-31 16:48 ` Dan Nicolaescu
2005-10-31 17:31 ` Romain Francoise
2005-10-31 17:47 ` Dan Nicolaescu
2005-10-31 18:35 ` Romain Francoise
2005-10-31 20:48 ` Dan Nicolaescu
2005-10-31 21:11 ` Romain Francoise
2005-10-31 21:24 ` Dan Nicolaescu
2005-10-31 21:50 ` Romain Francoise
2005-10-31 22:07 ` Dan Nicolaescu
2005-10-31 22:21 ` Stefan Monnier
2005-10-31 22:41 ` Dan Nicolaescu
2005-10-31 22:52 ` Stefan Monnier
2005-10-31 23:20 ` Miles Bader
2005-11-01 15:05 ` Dan Nicolaescu
2005-11-01 11:56 ` Romain Francoise
2005-11-01 21:52 ` Richard M. Stallman
2005-11-02 22:51 ` Dan Nicolaescu
2005-11-01 4:53 ` Eli Zaretskii
2005-11-01 6:25 ` Dan Nicolaescu
2005-11-01 6:35 ` Dan Nicolaescu
2005-11-01 19:50 ` Eli Zaretskii
2005-11-01 20:43 ` Dan Nicolaescu
2005-11-02 4:23 ` Eli Zaretskii
2005-11-02 5:46 ` Dan Nicolaescu
2005-11-02 18:55 ` Eli Zaretskii
2005-11-02 20:00 ` Dan Nicolaescu
2005-11-03 4:39 ` Eli Zaretskii
2005-11-03 5:53 ` Dan Nicolaescu
2005-11-04 11:01 ` Eli Zaretskii
2005-11-04 14:20 ` Eli Zaretskii
2005-11-06 19:47 ` Dan Nicolaescu
2005-11-01 7:29 ` Dan Nicolaescu
2005-11-01 10:03 ` Kim F. Storm
2005-11-01 12:04 ` Kim F. Storm
2005-11-01 12:56 ` Chong Yidong
2005-11-01 13:36 ` Kim F. Storm
2005-11-01 15:10 ` Dan Nicolaescu
2005-11-01 17:19 ` Luc Teirlinck
2005-11-01 17:23 ` Luc Teirlinck
2005-11-01 17:28 ` Luc Teirlinck
2005-11-01 19:57 ` Eli Zaretskii
2005-11-01 19:54 ` Eli Zaretskii
2005-11-01 20:03 ` Kim F. Storm
2005-11-02 1:33 ` Luc Teirlinck
2005-11-02 10:27 ` Richard M. Stallman
2005-11-02 12:08 ` David Kastrup
2005-11-02 14:10 ` Luc Teirlinck
2005-11-03 13:50 ` Richard M. Stallman
2005-11-03 14:57 ` Stefan Monnier
2005-11-03 16:24 ` David Kastrup
2005-11-04 2:03 ` Luc Teirlinck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200511040203.jA423Km08516@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=dann@ics.uci.edu \
--cc=emacs-devel@gnu.org \
--cc=storm@cua.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.