From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Global Font Lock by default Date: Thu, 3 Nov 2005 20:03:20 -0600 (CST) Message-ID: <200511040203.jA423Km08516@raven.dms.auburn.edu> References: <200510311648.j9VGmgKN020532@scanner2.ics.uci.edu> <200511010729.jA17TkKN014345@scanner2.ics.uci.edu> <85mzknjlqt.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1131069883 1588 80.91.229.2 (4 Nov 2005 02:04:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 Nov 2005 02:04:43 +0000 (UTC) Cc: dann@ics.uci.edu, storm@cua.dk, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 04 03:04:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EXqw6-0004kB-Hs for ged-emacs-devel@m.gmane.org; Fri, 04 Nov 2005 03:04:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXqw5-0002tR-UW for ged-emacs-devel@m.gmane.org; Thu, 03 Nov 2005 21:04:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EXqvX-0002l6-9A for emacs-devel@gnu.org; Thu, 03 Nov 2005 21:03:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EXqvU-0002j6-V7 for emacs-devel@gnu.org; Thu, 03 Nov 2005 21:03:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXqvU-0002is-NA for emacs-devel@gnu.org; Thu, 03 Nov 2005 21:03:32 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EXqvS-0005Yw-Nl; Thu, 03 Nov 2005 21:03:30 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.13.3+Sun/8.13.3) with ESMTP id jA423KAs005984; Thu, 3 Nov 2005 20:03:20 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id jA423Km08516; Thu, 3 Nov 2005 20:03:20 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.1 (manatee.dms.auburn.edu [131.204.53.104]); Thu, 03 Nov 2005 20:03:21 -0600 (CST) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45380 Archived-At: 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 ============================================================