From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: conf-space-mode Date: Sat, 16 Sep 2006 15:45:33 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158414361 20850 80.91.229.2 (16 Sep 2006 13:46:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Sep 2006 13:46:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 16 15:45:59 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GOaUT-0008Ux-7M for ged-emacs-devel@m.gmane.org; Sat, 16 Sep 2006 15:45:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOaUS-0001TC-AJ for ged-emacs-devel@m.gmane.org; Sat, 16 Sep 2006 09:45:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GOaUG-0001PT-4z for emacs-devel@gnu.org; Sat, 16 Sep 2006 09:45:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GOaUE-0001Kl-Cp for emacs-devel@gnu.org; Sat, 16 Sep 2006 09:45:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOaUE-0001KL-6C for emacs-devel@gnu.org; Sat, 16 Sep 2006 09:45:38 -0400 Original-Received: from [62.99.145.6] (helo=mx.inode.at) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GOaWb-00028O-NF; Sat, 16 Sep 2006 09:48:06 -0400 Original-Received: from [81.223.36.131] (port=3713 helo=gaston.none) by smartmx-06.inode.at with esmtp (Exim 4.50) id 1GOaUA-00087G-HH; Sat, 16 Sep 2006 15:45:35 +0200 Original-To: rms@gnu.org Mail-Followup-To: rms@gnu.org, emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:59908 Archived-At: Richard Stallman writes: > Now that I think about it, this whole approach is wrong. It is wrong > to look at current-prefix-arg except inside of an interactive spec. > > Does this patch make it all work? [...] > ;; In case the local variables list specifies conf-space-keywords, > ;; recompute other things from that afterward. > ! (add-hook 'hack-local-variables-hook 'conf-space-mode-internal)) I think this should be (add-hook 'hack-local-variables-hook 'conf-space-mode-internal nil t) [...] > ! (defun conf-space-keywords (keywords) > ! "Enter Conf Space mode using regexp KEYWORDS to match the keywords. > ! See `conf-space-mode'." > ! (interactive "sConf Space keyword regexp: ") > ! > ! (conf-mode-initialize "#" 'conf-space-font-lock-keywords) > ! (make-local-variable 'conf-assignment-sign) > ! (setq conf-assignment-sign nil) > ! (make-local-variable 'conf-space-keywords) > ! (setq conf-space-keywords keywords) > ! (conf-space-mode-internal) I'd suggest something like (defun conf-space-keywords (keywords) "Enter Conf Space mode using regexp KEYWORDS to match the keywords. See `conf-space-mode'." (interactive "sConf Space keyword regexp: ") (delay-mode-hooks (conf-space-mode)) (setq conf-space-keywords (if (equal keywords "") ;`if' instead of `unless' for clarity. ;; An empty string is not useful here. ;; So reset to the default. nil keywords)) (conf-space-mode-internal) (run-mode-hooks)) But as I said, I don't use this feature at all, so this is just idle speculation about what could be useful. > ! ;; Don't let this hook run and override us. > ! (remove-hook 'hack-local-variables-hook 'conf-space-mode-internal)) I dont't think this is necessary since the function `conf-space-keywords' is not run as a result of calling `normal-mode'.