From: Stefan Monnier <monnier@iro.umontreal.ca>
To: <emacs-devel@gnu.org>
Subject: Re: default-truncate-lines
Date: Thu, 22 Nov 2007 21:38:14 -0500 [thread overview]
Message-ID: <jwvwss9r8nb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <v9ve7ugfga.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Thu, 22 Nov 2007 22:04:05 +0100")
>> -(defcustom gnus-article-truncate-lines default-truncate-lines
>> +(defcustom gnus-article-truncate-lines (default-value 'truncate-lines)
> I don't care about this change, but out of curiosity: (why) does it
> make a difference?
Every time I see one of those default-FOO variable used I get flashes of
the following code:
/* If this variable is a default for something stored
in the buffer itself, such as default-fill-column,
find the buffers that don't have local values for it
and update them. */
if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults
&& XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1))
{
int offset = ((char *) XOBJFWD (valcontents)->objvar
- (char *) &buffer_defaults);
int idx = PER_BUFFER_IDX (offset);
Lisp_Object tail;
if (idx <= 0)
break;
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object buf;
struct buffer *b;
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
b = XBUFFER (buf);
if (! PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = newval;
}
}
and every time I get to replace it with a use of `default-value', I feel
like maybe this madness will disappear some day.
Stefan
next prev parent reply other threads:[~2007-11-23 2:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1IvIQa-0006Te-72@localhost.localdomain>
2007-11-22 21:04 ` default-truncate-lines (was: Changes to emacs/lisp/gnus/gnus-art.el, v) Reiner Steib
2007-11-23 2:38 ` Stefan Monnier [this message]
2007-11-24 3:12 ` default-truncate-lines Richard Stallman
2007-11-24 4:39 ` default-truncate-lines Stefan Monnier
2008-03-01 21:15 ` default-truncate-lines Reiner Steib
2008-03-02 21:56 ` default-truncate-lines Stefan Monnier
2008-03-03 18:26 ` default-truncate-lines 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwss9r8nb.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).