all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
Cc: emacs-devel@gnu.org
Subject: Re: conf-space-mode
Date: Sat, 16 Sep 2006 15:45:33 +0200	[thread overview]
Message-ID: <m2lkokx6v6.fsf@gaston.none> (raw)
In-Reply-To: E1GOEhI-000733-9T@fencepost.gnu.org

Richard Stallman <rms@gnu.org> 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'.

  reply	other threads:[~2006-09-16 13:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 13:04 conf-space-mode Richard Stallman
2006-09-11  1:06 ` conf-space-mode Wolfgang Jenkner
2006-09-11 19:58   ` conf-space-mode Richard Stallman
2006-09-12  5:32     ` conf-space-mode Wolfgang Jenkner
2006-09-15 14:29       ` conf-space-mode Richard Stallman
2006-09-16 13:45         ` Wolfgang Jenkner [this message]
2006-09-16 19:05           ` conf-space-mode Richard Stallman
2006-09-18 11:00             ` conf-space-mode Wolfgang Jenkner
2006-09-18 18:52               ` conf-space-mode Richard Stallman

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=m2lkokx6v6.fsf@gaston.none \
    --to=wjenkner@inode.at \
    --cc=emacs-devel@gnu.org \
    /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.