unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Johan Bockgård" <bojohan@gnu.org>
To: Lele Gaifax <lele@metapensiero.it>
Cc: emacs-devel@gnu.org
Subject: Re: Strange problem with emacs-lisp/copyright.el
Date: Sun, 05 Nov 2017 12:36:09 +0100	[thread overview]
Message-ID: <87a801gdp2.fsf@gnu.org> (raw)
In-Reply-To: <87d153mbh1.fsf@metapensiero.it> (Lele Gaifax's message of "Tue,  31 Oct 2017 19:14:02 +0100")

Lele Gaifax <lele@metapensiero.it> writes:

> Hi all,
>
> this is just to properly end the thread [1], and ask whether I should open an
> issue, or add an annotation to the existing (but not exactly the same) issue
> #7179 [2], or what.
>
> Back in April I applied Johan Bockgård'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
    
    * 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 "? ")



      parent reply	other threads:[~2017-11-05 11:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  6:53 Strange problem with emacs-lisp/copyright.el Lele Gaifax
2017-04-11  9:28 ` Alan Third
2017-04-17 17:29 ` Lele Gaifax
2017-04-21 17:49   ` Lele Gaifax
2017-04-22 13:21     ` Johan Bockgård
2017-04-23 21:00       ` Lele Gaifax
2017-05-05  9:36         ` Lele Gaifax
2017-10-31 18:14           ` Lele Gaifax
2017-11-01  2:19             ` Noam Postavsky
2017-11-05 11:36             ` Johan Bockgård [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a801gdp2.fsf@gnu.org \
    --to=bojohan@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lele@metapensiero.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).