From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: goto-char with set-buffer operations take only effect when buffer is not visible! Date: Sun, 10 Dec 2006 16:57:50 +0100 Organization: The Church of Emacs Message-ID: <87lklfd9q9.fsf@hans.local.net> References: <877ix0pwjt.fsf@gmx.at> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165784423 32050 80.91.229.10 (10 Dec 2006 21:00:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Dec 2006 21:00:23 +0000 (UTC) Cc: hans-dieter.wilhelm@siemens.com, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 10 22:00:20 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 1GtVmW-0001sf-54 for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Dec 2006 22:00:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtVmV-0002jT-Kw for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Dec 2006 16:00:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GtVmF-0002iI-Ki for help-gnu-emacs@gnu.org; Sun, 10 Dec 2006 16:00:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GtVmE-0002hV-5i for help-gnu-emacs@gnu.org; Sun, 10 Dec 2006 16:00:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtVmD-0002hJ-Vw for help-gnu-emacs@gnu.org; Sun, 10 Dec 2006 16:00:02 -0500 Original-Received: from [212.227.126.187] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GtVmD-00021d-MK for help-gnu-emacs@gnu.org; Sun, 10 Dec 2006 16:00:02 -0500 Original-Received: from [84.167.66.73] (helo=duenenhof-wilhelm.de) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1GtVm93e78-0004Xc; Sun, 10 Dec 2006 21:59:58 +0100 Original-Received: by duenenhof-wilhelm.de (Postfix, from userid 1000) id 25B837568F; Sun, 10 Dec 2006 16:57:50 +0100 (CET) Original-To: Markus Triska In-Reply-To: <877ix0pwjt.fsf@gmx.at> (Markus Triska's message of "Sat\, 09 Dec 2006 22\:51\:50 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d7ab225b98a136e1c2910381f940ecb9 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:39387 Archived-At: Markus Triska writes: > 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))) Ahhh, with-current-buffer it's far more elegant. > >> 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)))))) > Great! Thank you for the template, I'll implement it in this way. -- Best wishes H. Dieter Wilhelm Darmstadt, Germany