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: save-excursion and the mark Date: Mon, 23 Feb 2015 17:33:43 -0500 Message-ID: References: <87bnkklv44.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424730894 11177 80.91.229.3 (23 Feb 2015 22:34:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 22:34:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Oleh Krehel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 23 23:34:43 2015 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 1YQ1aL-0004pZ-PG for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 23:34:41 +0100 Original-Received: from localhost ([::1]:45734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1aL-0006Hu-9R for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 17:34:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1a5-0006Di-IV for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:34:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQ1a0-0004yn-G9 for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:34:25 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1a0-0004yg-CU for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:34:20 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCw4mEhQYDSSIOAjOIwEBAQEGAQEBAR6PeAeEKgWKJ59LgUUihAwggnMBAQE X-IPAS-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCw4mEhQYDSSIOAjOIwEBAQEGAQEBAR6PeAeEKgWKJ59LgUUihAwggnMBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="111274245" Original-Received: from 108-161-121-152.dsl.teksavvy.com (HELO pastel.home) ([108.161.121.152]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Feb 2015 17:34:19 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7AF061898; Mon, 23 Feb 2015 17:33:43 -0500 (EST) In-Reply-To: <87bnkklv44.fsf@gmail.com> (Oleh Krehel's message of "Mon, 23 Feb 2015 12:34:19 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.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:183431 Archived-At: > I have a package that might be using the feature. Where and how? > None of the tests were failing when I wrapped `save-excursion' like > this: > (defmacro lispy-save-excursion (&rest body) > "More intuitive (`save-excursion' BODY)." > (declare (indent 0)) > `(let ((activep (region-active-p)) > (mark (mark)) > (out (save-excursion > ,@body))) > (when activep > (set-mark mark)) > (when (bolp) > (back-to-indentation)) > out)) Hmm... this seems to redundantly save&restore the mark. What is this supposed to illustrate/test? Stefan