[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] externals/hyperbole c501027 2/2: Fix set-buffer byte-compiler
From: |
Stefan Monnier |
Subject: |
Re: [elpa] externals/hyperbole c501027 2/2: Fix set-buffer byte-compiler warnings; remove outdated references |
Date: |
Mon, 10 May 2021 21:25:11 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Eli and I exchanged messages about this on the emacs-devel list and settled
> on the outer save-excursion as you first wrote below since it is indeed the
> original buffer whose point we want to save which may be manipulated by
> some subroutine deep within the with-current-buffer that changes the buffer
> back to the original. Thanks as always for the pointers though. -- Bob
That seems to point at a very unusual arrangement which you might want
(in the longer term) to reconsider, e.g. by moving the `save-excursion`
to the "deep within" place that actually moves the point in the "outer
buffer".
In the mean time, adding a comment explaining what's going on
(e.g. giving an example scenario where point would be moved unexpectedly
in the outer buffer)would go a long way.
Similarly for the
(save-excursion
(with-current-buffer (find-file-noselect (expand-file-name hbmap:filename
hbmap:dir-user))
(save-excursion
in `gbut:ebut-program` because without an explanatory comment, this looks
like the kind of code you get when the author just "added
`save-excursion`s a bit at random until point stopped moving" ;-)
Stefan