From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: `save-excursion' defeated by `set-buffer' Date: Mon, 11 Jan 2010 09:24:29 +0100 Organization: Organization?!? Message-ID: <87skadjbgi.fsf@lola.goethe.zz> References: <87aaxdqwqv.fsf@regnitz.physics.niu.edu> <876380nvnt.fsf@lola.goethe.zz> <87hbrijbyg.fsf@lola.goethe.zz> <87skb0iw04.fsf@lola.goethe.zz> <1DA372296B5F41A1A3317F557D27355D@us.oracle.com> <87ocl8gvcn.fsf@lola.goethe.zz> <558DC61A9B3E4FF89CC53FF9DF7F7709@us.oracle.com> <87eim3hd14.fsf@lola.goethe.zz> <87eilyl6o9.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263198619 984 80.91.229.12 (11 Jan 2010 08:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jan 2010 08:30:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 11 09:30:12 2010 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 1NUFf9-0000I4-Pf for ged-emacs-devel@m.gmane.org; Mon, 11 Jan 2010 09:30:12 +0100 Original-Received: from localhost ([127.0.0.1]:34463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUFfA-0006Sm-3H for ged-emacs-devel@m.gmane.org; Mon, 11 Jan 2010 03:30:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUFbK-0005qZ-Ue for emacs-devel@gnu.org; Mon, 11 Jan 2010 03:26:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUFbF-0005pV-Md for emacs-devel@gnu.org; Mon, 11 Jan 2010 03:26:14 -0500 Original-Received: from [199.232.76.173] (port=33192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUFbF-0005pL-DF for emacs-devel@gnu.org; Mon, 11 Jan 2010 03:26:09 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:38702) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NUFbE-0003bW-W8 for emacs-devel@gnu.org; Mon, 11 Jan 2010 03:26:09 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NUFae-0006oa-K3 for emacs-devel@gnu.org; Mon, 11 Jan 2010 09:25:32 +0100 Original-Received: from p5b2c257e.dip.t-dialin.net ([91.44.37.126]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jan 2010 09:25:32 +0100 Original-Received: from dak by p5b2c257e.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jan 2010 09:25:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c257e.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) Cancel-Lock: sha1:SRjh6Jd1MHmf5AAQCWAVotvPHig= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:119814 Archived-At: Stefan Monnier writes: >> As an example, when debugging some operation in buffer FOO, I can use >> save-excursion in FOO and then set-buffer to the DEBUG buffer. If the > > You can still do it just as well. And get a warning when doing so. Where is the point in warnings that are both inaccurate ("save-excursion defeated by set-buffer" is nonsensical, since save-excursion still perfectly well does its documented job of restoring _original_ buffer, point, mark) as well as inapplicable? If you say that you find most (save-excursion (set-buffer combinations in the Emacs code base a bad idea, the solution is using grep and fixing all those occurences where you think they are an error. Emitting a warning changes no existing code, annoys people, and flags code as problematic that isn't. Possibly code that is written to be compatible with versions of Emacs without save-current-buffer. -- David Kastrup