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: Using `save-window-excursion' instead of `save-excursion' for `comment-region'? Date: Thu, 05 Dec 2013 13:29:49 -0500 Message-ID: References: <87y53zk3dx.fsf@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386268212 31488 80.91.229.3 (5 Dec 2013 18:30:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 18:30:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 05 19:30:17 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vodgl-0007QT-LT for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2013 19:30:15 +0100 Original-Received: from localhost ([::1]:55162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vodgl-0002cv-3t for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2013 13:30:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vodgb-0002Pm-8M for emacs-devel@gnu.org; Thu, 05 Dec 2013 13:30:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VodgT-0007Kp-WB for emacs-devel@gnu.org; Thu, 05 Dec 2013 13:30:05 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:42237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VodgM-0007K0-70; Thu, 05 Dec 2013 13:29:50 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxL6g/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFFFxL6g/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="41230273" Original-Received: from 69-196-190-160.dsl.teksavvy.com (HELO pastel.home) ([69.196.190.160]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Dec 2013 13:29:49 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 40BFA609FE; Thu, 5 Dec 2013 13:29:49 -0500 (EST) In-Reply-To: <87y53zk3dx.fsf@bzg.ath.cx> (Bastien's message of "Thu, 05 Dec 2013 11:18:02 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166129 Archived-At: > In Org buffer, you can comment code within source blocks. This opens > a new buffer, insert the code there, comment it, and insert the buffer > contents back into Org's buffer. > With the current `comment-region' function, point is lost when Org > goes back to the org buffer. Using `save-window-excursion' instead > of `save-excursion' fixes the problem. I'm not sure exactly what means "point is lost" in this case, but if using save-window-excursion solves the problem, it's only by accident. Stefan