In Elisp this seemingly easy peace of code does not actually move the point.
(with-current-buffer "foo"
(goto-char (point-max)))
AFAIK with-current-buffer
should not restore the point in the target buffer.
If not, then how do I manipulate point in a buffer?
I think you're confusing the buffer's point with the window's point. If you want to move the cursor in some window showing "foo", you need to select that window while you do the goto-char
, or else you need to use set-window-point
.
In general a buffer has N+1 points (one is its own, and the N are for the N windows that display the buffer).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With