emacs-devel
[Top][All Lists]
Advanced

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

Re: show-buffer-local-variables


From: Ken Manheimer
Subject: Re: show-buffer-local-variables
Date: Sun, 2 Oct 2005 17:15:04 -0400

On 10/1/05, Richard M. Stallman <address@hidden> wrote:
>     I noticed this entry in emacs/etc/TODO:
>
>     ** Add a command to make a local variables list in the current buffer
>     and/or add a variable to the list.
>
>     I recently wrote a function that does the former, if I understand the
>     entry correctly.
>
> No, it is a misunderstanding.  A local variables list is text
> at the end of the file.

if i'm understanding correctly, then i include the functionality being
sought in the new version of allout.  (allout uses emacs local file
variables to stash a symmetric-key hint and a symmetric-key verifier
string in the file, when those features are enabled.)

here are excerpts from relevant functions that describe the interface:

(defun allout-adjust-file-variable (varname value)
  "Adjust the setting of an emacs file variable named VARNAME to VALUE.

This activity is inhibited if either `enable-local-variables'
`allout-enable-file-variable-adjustment' are nil.

When enabled, an entry for the variable is created if not already present,
or changed if established with a different value.  The section for the file
variables, itself, is created if not already present.  When created, the
section lines \(including the section line) exist as second-level topics in
a top-level topic at the end of the file.

enable-local-variables must be true for any of this to happen."
[...])

(defun allout-file-vars-section-data ()
  "Return data identifying the file-vars section, or nil if none.

Returns list `(beginning-point prefix-string suffix-string)'."
[...])

it would probably be trivial to revise alout-adjust-file-variable to
do wrap a file variables section it creates in an outline topic only
if the buffer is in outline mode.  it would also be nice to offload
this functionality from allout, and get scrutiny from others to see
whether the functionality is sufficiently general.

i suppose these functions would be best situated in files.el, to
reside with hack-local-variables &c.  ?

ken
address@hidden




reply via email to

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