help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Cool and Useful LISP for the .emacs file


From: lawrence mitchell
Subject: Re: Cool and Useful LISP for the .emacs file
Date: Fri, 07 Nov 2003 18:37:28 +0000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50

Reiner Steib wrote:

[...]

> |   (setq require-final-newline 'query)

> Hm, it works, but maybe it should be "ask", see `files.el'.

Whilst the defcustom form for REQUIRE-FINAL-NEWLINE has 'ask in
it, note the docstring:

| Non-nil but not t says ask user whether to add a newline when
| there isn't one.  nil means don't add newlines.

Note also this code from BASIC-SAVE-BUFFER:

| (or (eq require-final-newline t)
|     (and require-final-newline
|          (y-or-n-p
|           (format "Buffer %s does not end in newline.  Add one? "
|                   (buffer-name)))))

i.e. any non-nil but not-t value will have the same effect as
any other.  Setting it to 'ask, or 'query makes sense for
someone looking at the variable binding later.

Though (setq require-final-newline 'fnord) should work equally well.

[...]

-- 
lawrence mitchell <address@hidden>


reply via email to

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