Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!tikal!sigma!uw-nsr!uw-warp!tom From: tom@uw-warp.UUCP Newsgroups: comp.emacs Subject: Re: Updating point in a buffer NOT on the screen. Message-ID: <268@uw-warp.UUCP> Date: Sun, 30-Aug-87 02:25:33 EDT Article-I.D.: uw-warp.268 Posted: Sun Aug 30 02:25:33 1987 Date-Received: Tue, 1-Sep-87 01:38:37 EDT References: <421@cos.COM> Organization: The Warp, Seattle, WA Lines: 33 In-reply-to: patrick@COS.COM's message of 28 Aug 87 12:19:03 GMT Posting-Front-End: GNU Emacs 18.47.1 of Sat Jun 27 1987 on uw-warp (usg-unix-v) In article <421@cos.COM> patrick@COS.COM (Patrick Steranka) writes: >I have a question I hope someone can help me with. >How can I update a buffer's point IF/WHEN the buffer is NOT >in a window? > >The only solution I currently know of to modify a buffers point is >by using the command "set-window-point", and of course that requires >the buffer to be in a window. There are two flavors of point, one for buffers and one for windows. To set the point in "some-buffer" to 50, say, you can use (save-excursion (set-buffer "some-buffer") (goto-char 50)) This sets the buffer point regardless of whether the buffer is in a window or not. However, any windows displaying "some-buffer" will not have their window points changed. So if you now switch to a window which is already displaying "some-buffer", the buffer point (which was just set to 50) is set again to match the window point. If instead you select "some-buffer" in a window which is not already displaying it, the window point will be set to match the buffer point and you will find the cursor at character 50. Put simply, goto-char sets a buffer point. set-window-point sets a window point. When a buffer is newly selected in a window, the window point is set to the buffer point. When the cursor is moved to a window, the buffer point is set to the window point. When the cursor is moved within a window, both points change. -- Tom May uw-nsr!uw-warp!tom@beaver.cs.washington.edu uw-beaver!uw-nsr!uw-warp!tom