From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.help Subject: Re: goto-char with set-buffer operations take only effect when buffer is not visible! Date: Sat, 09 Dec 2006 22:51:50 +0100 Message-ID: <877ix0pwjt.fsf@gmx.at> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165704032 8149 80.91.229.10 (9 Dec 2006 22:40:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 22:40:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 09 23:40:32 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GtArv-0002wd-Oc for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Dec 2006 23:40:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtArv-0005c4-Bm for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Dec 2006 17:40:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newshunter!cosy.sbg.ac.at!newsfeed.utanet.at!newsfeed2.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:erpOK0tVhPFkSOIm+VnK5LUBKhU= Original-Lines: 28 Original-NNTP-Posting-Host: news-access-from.tuwien.ac.at Original-X-Trace: 1165701012 tunews.univie.ac.at 12384 192.35.241.118 Original-X-Complaints-To: abuse@tuwien.ac.at Original-Xref: shelby.stanford.edu gnu.emacs.help:143776 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39380 Archived-At: Dieter Wilhelm writes: > > (let ((cb (buffer-name))) > (set-buffer "*Ansys*") ;make buffer scroll with output > (goto-char (point-max)) > (set-buffer cb)) Using with-current-buffer, this becomes: (with-current-buffer "*Ansys*" (goto-char (point-max))) > To my astonishment this works only when the buffer *Ansys* is not > visible! When the buffer is visible and I call this snippet in > another one the cursor in *Ansys* won't budge a single character. Add: (walk-windows (lambda (w) (when (string= (buffer-name (window-buffer w)) "*Ansys*") (with-selected-window w (goto-char (point-max)))))) to move the point permanently also if the buffer's window is visible and not selected. All the best, Markus Triska