From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nathaniel Flath Newsgroups: gmane.emacs.devel Subject: Behaviour for save-excursion Date: Tue, 6 Oct 2009 09:44:38 -0400 Message-ID: <5e3a506e0910060644y4ba6c73fv18d63ef8a1393117@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd2900e7c42ed0475446e14 X-Trace: ger.gmane.org 1254838845 7143 80.91.229.12 (6 Oct 2009 14:20:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2009 14:20:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 06 16:20:36 2009 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 1MvAtZ-0004g9-PW for ged-emacs-devel@m.gmane.org; Tue, 06 Oct 2009 16:20:06 +0200 Original-Received: from localhost ([127.0.0.1]:57355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvAtZ-0006gn-6U for ged-emacs-devel@m.gmane.org; Tue, 06 Oct 2009 10:20:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvALO-0007ms-4p for emacs-devel@gnu.org; Tue, 06 Oct 2009 09:44:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvALJ-0007im-FY for emacs-devel@gnu.org; Tue, 06 Oct 2009 09:44:45 -0400 Original-Received: from [199.232.76.173] (port=47119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvALJ-0007iS-6w for emacs-devel@gnu.org; Tue, 06 Oct 2009 09:44:41 -0400 Original-Received: from mail-px0-f185.google.com ([209.85.216.185]:42816) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvALI-0007AE-FZ for emacs-devel@gnu.org; Tue, 06 Oct 2009 09:44:40 -0400 Original-Received: by pxi15 with SMTP id 15so3788533pxi.26 for ; Tue, 06 Oct 2009 06:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=VTt0e6Av852DjgGbKTkokTyd2Pj9ObA90sHWYwpwIj4=; b=kIbjoMnOd2i1BxZw/Fs1r7YJIrtwzvUR+LJLKp61saN2l0XABxjoLZT+/bpggeljnJ z+CpS6sBVs4eUaIDNI6QcjjZ8sGtn3FdI/geLAjcOAmR0PY26XmTetlFbR0jzTwlBvgM szo3pD8tBFT49X0o7N6GhGpq5CPN7As5ISYgw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nKwP20Vdxpcxt2t9ZGgdkS0VtnDOO1TaLV1u24JAUmKbbJBRShISDMffy0nJ7iQ1TP 2B7cxDl6G9iV23UHiSZTSR0fCAIG2p6aSiMrnuX84f0q2vhag1grB38gg5Yo5RYDo2cD lWSHQcyKeT15RaT+DnnNwftBAffKgZbG49E4c= Original-Received: by 10.140.136.5 with SMTP id j5mr325154rvd.0.1254836678705; Tue, 06 Oct 2009 06:44:38 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:115924 Archived-At: --000e0cd2900e7c42ed0475446e14 Content-Type: text/plain; charset=ISO-8859-1 What is the proper behaviour for save-excursion? The emacs-lisp intro and the docstring seem to have slightly differing explanations - namely, the docstring mentions that it saves current-buffer as well as point and mark, and the emacs-lisp intro does not. Based on just what it does, I'm not entirely sure which is correct - the following code snippet, executed in *scratch*, returns the "*scratch*" buffer but the buffer displayed is the "bar" buffer, and evaluating current-bufer afterwards returns the "bar" buffer. (progn (save-excursion (switch-to-buffer "bar")) (current-buffer)) Either the manual or the docstring should be changed to reflect what it does, but I'm not entirely sure which based on this. Thanks, Nathaniel Flath --000e0cd2900e7c42ed0475446e14 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What is the proper behaviour for save-excursion?=A0 The emacs-lisp intro an= d the docstring seem to have slightly differing explanations - namely, the = docstring mentions that it saves current-buffer as well as point and mark, = and the emacs-lisp intro does not.=A0 Based on just what it does, I'm n= ot entirely sure which is correct - the following code snippet, executed in= *scratch*, returns the "*scratch*" buffer but the buffer display= ed is the "bar" buffer, and evaluating current-bufer afterwards r= eturns the "bar" buffer.=A0

(progn
=A0 (save-excursion
=A0=A0=A0 (switch-to-buffer "bar&= quot;))
=A0 (current-buffer))

Either the manual or the docstring = should be changed to reflect what it does, but I'm not entirely sure wh= ich based on this.

Thanks,
Nathaniel Flath
--000e0cd2900e7c42ed0475446e14--