Subject: Re: bug#48294: Use 'with-current-buffer' byte-compiler warning seems wrong

From: Eli Zaretskii <[email-masked]>
Date: Sun, 09 May 2021 19:11:13 +0300

> From: Robert Weiner <[email-masked]>
> Date: Sun, 9 May 2021 11:57:25 -0400
> Cc: [email-masked]
> 
> Thanks for the feedback.  Everything you wrote is very clear.  The issue, however, is that I want to save
> point in the current buffer prior to switching context to the 'with-current-buffer' buffer, just as my
> (save-excursion (set-buffer ...)) code does.  If I move the save-excursion into the with-current-buffer body,
> then it applies to the new buffer not the original one and if in that same body we change buffers again to the
> original and move point, then that movement will stay in place.  So the question is, what is the appropriate
> code that the byte-compiler will accept when you want to save your original place before switching buffers. 

I don't understand: with-current-buffer doesn't change point of the
original buffer, so why do you need to save it?