Recenter a named buffer that is not neccessarily the current buffer in emacs Lisp

Posted by Yu Shen on Stack Overflow See other posts from Stack Overflow or by Yu Shen
Published on 2010-03-21T05:20:07Z Indexed on 2010/03/21 5:31 UTC
Read the original article Hit count: 642

Filed under:
|

I'd like to recenter a buffer, called "Lense", where I've inserted some text. I wished to make it the current buffer by "(set-buffer "Lense")", then "(recenter 0))". By the following code segments:

(save-excursion (set-buffer "Lense") (recenter 0))

However, it seems that the above code would only recenter the buffer which is the current buffer, and "(set-buffer "Lense")" has no effect to make the current buffer to be "Lense".

Please help me to figure out the right way to recenter the named buffer "Lense".

Thanks,

Yu

© Stack Overflow or respective owner

Related posts about emacs

Related posts about elisp