From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Strange problem with emacs-lisp/copyright.el Date: Sun, 05 Nov 2017 12:36:09 +0100 Message-ID: <87a801gdp2.fsf@gnu.org> References: <87o9w3ph9a.fsf@nautilus> <87mvbfvt63.fsf@metapensiero.it> <8760hxk5wc.fsf@metapensiero.it> <87fugz5bmo.fsf@gnu.org> <874lxezvnv.fsf@metapensiero.it> <8737cj63wt.fsf@metapensiero.it> <87d153mbh1.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1509881781 25297 195.159.176.226 (5 Nov 2017 11:36:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Nov 2017 11:36:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lele Gaifax Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 05 12:36:17 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBJDr-0006EA-7s for ged-emacs-devel@m.gmane.org; Sun, 05 Nov 2017 12:36:15 +0100 Original-Received: from localhost ([::1]:43858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBJDy-0003PC-K4 for ged-emacs-devel@m.gmane.org; Sun, 05 Nov 2017 06:36:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBJDs-0003Np-6N for emacs-devel@gnu.org; Sun, 05 Nov 2017 06:36:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBJDp-0001zR-3u for emacs-devel@gnu.org; Sun, 05 Nov 2017 06:36:16 -0500 Original-Received: from manu26.manufrog.com ([98.142.98.2]:51878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBJDo-0001yu-VK for emacs-devel@gnu.org; Sun, 05 Nov 2017 06:36:13 -0500 Original-Received: from c-8506e555.04-211-6c6b701.cust.bredbandsbolaget.se ([85.229.6.133]:47042 helo=muon.localdomain) by manu26.manufrog.com with esmtpa (Exim 4.89) (envelope-from ) id 1eBJDm-00036B-Oi; Sun, 05 Nov 2017 12:36:10 +0100 Original-Received: by muon.localdomain (Postfix, from userid 1000) id 454EE484277; Sun, 5 Nov 2017 12:36:09 +0100 (CET) In-Reply-To: <87d153mbh1.fsf@metapensiero.it> (Lele Gaifax's message of "Tue, 31 Oct 2017 19:14:02 +0100") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - manu26.manufrog.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gnu.org X-Get-Message-Sender-Via: manu26.manufrog.com: authenticated_id: noreply@tryserumgardar.se X-Authenticated-Sender: manu26.manufrog.com: noreply@tryserumgardar.se X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 98.142.98.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:223442 Lele Gaifax writes: > Hi all, > > this is just to properly end the thread [1], and ask whether I should ope= n an > issue, or add an annotation to the existing (but not exactly the same) is= sue > #7179 [2], or what. > > Back in April I applied Johan Bockg=C3=A5rd's suggestion and since then I= haven't > seen the reported problem again: I've been intending to check in the fix below. Sorry for not getting around to it sooner. I don't think we need a new bug report. copyright.el: Avoid inadvertent point motion =20=20=20=20 * lisp/emacs-lisp/copyright.el (copyright-update-year): Enlarge the scope of save-excursion. Reported in: https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00271.html diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 11569e4..25dc77c 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -186,9 +186,10 @@ (defun copyright-update-year (replace noquery) (substring copyright-current-year -2)) (if (or noquery (save-window-excursion - (switch-to-buffer (current-buffer)) - ;; Fixes some point-moving oddness (bug#2209). + ;; switch-to-buffer might move point when + ;; switch-to-buffer-preserve-window-point is non-nil. (save-excursion + (switch-to-buffer (current-buffer)) (y-or-n-p (if replace (concat "Replace copyright year(s) by " copyright-current-year "? ")