From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Sawyer Newsgroups: gmane.emacs.bugs Subject: bug#16673: [saveplace] toggle-save-place doesn't toggle-save-place Date: Thu, 6 Feb 2014 18:57:57 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1391716623 20682 80.91.229.3 (6 Feb 2014 19:57:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Feb 2014 19:57:03 +0000 (UTC) To: 16673@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 06 20:57:10 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WBV4O-0007Ea-Q3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Feb 2014 20:57:09 +0100 Original-Received: from localhost ([::1]:38181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBV4O-0007PP-GF for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Feb 2014 14:57:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBV4K-0007Oa-2L for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 14:57:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBV4J-00075S-9R for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 14:57:04 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBV4J-00075I-5o for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 14:57:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WBV4I-00076h-6m for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 14:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Sawyer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Feb 2014 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139171657527248 (code B ref -1); Thu, 06 Feb 2014 19:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Feb 2014 19:56:15 +0000 Original-Received: from localhost ([127.0.0.1]:53719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBV3V-00075P-87 for submit@debbugs.gnu.org; Thu, 06 Feb 2014 14:56:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37314) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBU9G-0005Y7-Gs for submit@debbugs.gnu.org; Thu, 06 Feb 2014 13:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBU9A-0004DH-Ki for submit@debbugs.gnu.org; Thu, 06 Feb 2014 13:58:06 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBU9A-0004DD-HA for submit@debbugs.gnu.org; Thu, 06 Feb 2014 13:58:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBU99-00057g-Cv for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 13:58:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBU98-0004Cs-IR for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 13:57:59 -0500 Original-Received: from mail-ve0-x232.google.com ([2607:f8b0:400c:c01::232]:34035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBU98-0004CY-Eb for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2014 13:57:58 -0500 Original-Received: by mail-ve0-f178.google.com with SMTP id oy12so1870411veb.37 for ; Thu, 06 Feb 2014 10:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=75Kgxdbd1z2T8veHSdjSOKQb/yvwJdFZjIQnWrNJxao=; b=EhCa6Re+2/s/cDs3pSa8Cg6Q/d3dj00smZy+GvdGcudrt93ojOxWyvW4bZA/oUFExK wm++PWe0oHskgkWI4dyfFHXGkRZdtQ9GQMYgiJ30+JK+E/bDyYCGLzIDBSPUB8imValS pKWKMyvyuS6kgCWh8RegZD0U4MuugBLka91VKwP+of1KaOgKZEoekzSttXDxRHwTkGU7 e8zk70eoj2ax1P7h+WGdz2xgNZGrZqRairyX10nhniJ4ieFTdutXmCRcI1Cxe9rJYN84 uQTuGDl+KEDmSvu/2KCxWnTXj65q5KYpgv+AejNo4yujfTJKhjbu4IpeuqKtXnauDo6D YCSA== X-Received: by 10.58.181.71 with SMTP id du7mr2817969vec.25.1391713077409; Thu, 06 Feb 2014 10:57:57 -0800 (PST) Original-Received: by 10.58.46.134 with HTTP; Thu, 6 Feb 2014 10:57:57 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Thu, 06 Feb 2014 14:56:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84751 Archived-At: Hi all, I noticed a while back that toggle-save-place doesn't actually toggle save-place. Whilst I mostly run Aquamacs these days, the bug exists in the existing codebase. In particular, in a buffer where save-place is nil, it is unconditionally turned on. I submitted a path for this to the Aquamacs maintainer, and include it here for your attention. (I also took the opportunity to use prefix-numeric-value on the argument, so it plays nice with C-u). Regards, Andy $ git diff saveplace.el diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 91da103..0325475 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -156,12 +156,12 @@ file: (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode) dired-directory))) (message "Buffer `%s' not visiting a file or directory" (buffer-name)) - (if (and save-place (or (not parg) (<= parg 0))) - (progn - (message "No place will be saved in this file") - (setq save-place nil)) - (message "Place will be saved") - (setq save-place t)))) + (setq save-place (if parg + (> (prefix-numeric-value parg) 0) + (not save-place))) + (message (if save-place + "Place will be saved" + "No place will be saved in this file"))))