[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] enhancement to set-variable to set buffer-locally
From: |
John Paul Wallington |
Subject: |
Re: [patch] enhancement to set-variable to set buffer-locally |
Date: |
09 Aug 2002 01:28:32 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Benjamin Rutt <address@hidden> wrote:
> So, I decided to write a patch that would watch for a prefix arg given
> to the function `set-variable' such that the variable would be set in
> a buffer-local fashion (by calling `make-local-variable'). Then, the
> command becomes:
>
> C-u M-x set-variable RET ps-print-header RET nil RET
>
> Although it looks like just as many keystrokes, you can now complete
> on the variable name, etc. So I think it can save keystrokes that
> way. And, I think it's a natural extension to `set-variable'.
This looks neat. Perhaps `set-variable' should also change its
prompt when var satisfies `local-variable-if-set-p' ?
e.g.:
*** 3653,3659 ****
(read-variable "Set variable: ")))
(minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive))
! (prompt (format "Set %s to value: " var))
(val (if prop
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
--- 3655,3665 ----
(read-variable "Set variable: ")))
(minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive))
! (prompt (format "Set %s to%svalue: " var
! (if (or current-prefix-arg
! (local-variable-if-set-p var))
! " (buffer-local) "
! " ")))
(val (if prop
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
--
John Paul Wallington