emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conf-space-mode


From: Wolfgang Jenkner
Subject: Re: conf-space-mode
Date: Sat, 16 Sep 2006 15:45:33 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Richard Stallman <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]