From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: default-truncate-lines Date: Fri, 23 Nov 2007 23:39:56 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195879215 10485 80.91.229.12 (24 Nov 2007 04:40:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2007 04:40:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 24 05:40:22 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvmoX-0001O6-3f for ged-emacs-devel@m.gmane.org; Sat, 24 Nov 2007 05:40:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvmoI-0001yS-JT for ged-emacs-devel@m.gmane.org; Fri, 23 Nov 2007 23:40:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IvmoF-0001xn-Kl for emacs-devel@gnu.org; Fri, 23 Nov 2007 23:40:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IvmoE-0001ww-8o for emacs-devel@gnu.org; Fri, 23 Nov 2007 23:40:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvmoE-0001wt-1Z for emacs-devel@gnu.org; Fri, 23 Nov 2007 23:40:02 -0500 Original-Received: from tomts20.bellnexxia.net ([209.226.175.74] helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ivmo9-000738-Mq; Fri, 23 Nov 2007 23:39:57 -0500 Original-Received: from pastel.home ([74.12.207.44]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20071124043956.ZPMY8273.tomts20-srv.bellnexxia.net@pastel.home>; Fri, 23 Nov 2007 23:39:56 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5AE1B8197; Fri, 23 Nov 2007 23:39:56 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Fri, 23 Nov 2007 22:12:03 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84030 Archived-At: > /* 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