all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: default-truncate-lines
Date: Fri, 23 Nov 2007 23:39:56 -0500	[thread overview]
Message-ID: <jwvtznc45wc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1IvlR5-0006z5-H3@fencepost.gnu.org> (Richard Stallman's message of "Fri, 23 Nov 2007 22:12:03 -0500")

> 	      /* 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.  */

> The reason for this is so that variables like `fill-column'
> which are stored in slots in the buffer
> can have buffer-local values in some buffers and not in others.
> Setting the default value needs to store it into the proper
> slot in buffers that don't have buffer-local bindings of the variable.

> The code seems straightforward.  I don't see how use of
> `default-value' could replace it.

Yes, I've spent enough time recently looking at the var manipulation
code to know that it's correct, but this whole code is only there for
the default-FOO variables.  The loop over all buffers is also present in
set-default where it's indeed necessary.  We could/should of course
use a separate function to avoid this redundancy, but the main ugliness
is in the first 5 lines (which are not needed in set-default):

	  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);

comparing pointers like that is terribly hackish.


        Stefan

  reply	other threads:[~2007-11-24  4:39 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   ` default-truncate-lines Stefan Monnier
2007-11-24  3:12     ` default-truncate-lines Richard Stallman
2007-11-24  4:39       ` Stefan Monnier [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtznc45wc.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.