all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
Subject: goto-char with set-buffer operations take only effect when buffer is not visible!
Date: Sat, 09 Dec 2006 20:32:52 +0100	[thread overview]
Message-ID: <8764ckeufv.fsf@hans.local.net> (raw)


Hi

I catch the output from a program which runs under `start-process' in
a buffer called *Ansys*.  I'd like to have that the buffer scrolls
always to the end of the latest output (like tail -f).  This works
automatically when the cursor in this buffer is below the current
output.  Then I can work in a certain buffer and see the output scroll
by in the neighbouring *Ansys* buffer. 

Unfortunately when the process is created the cursor is not at the end
of the output but remains at (point-min).  So I wrote this snippet:

  (let ((cb (buffer-name)))
    (set-buffer "*Ansys*")	       ;make buffer scroll with output
    (goto-char (point-max))
    (set-buffer cb))

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.

This seems like a bug to me, isn't it?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

             reply	other threads:[~2006-12-09 19:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-09 19:32 Dieter Wilhelm [this message]
     [not found] <mailman.1701.1165697627.2155.help-gnu-emacs@gnu.org>
2006-12-09 21:51 ` goto-char with set-buffer operations take only effect when buffer is not visible! Markus Triska
2006-12-10 15:57   ` Dieter Wilhelm
2006-12-10 14:01 ` Johan Bockgård
2006-12-10 15:52   ` Dieter Wilhelm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8764ckeufv.fsf@hans.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.