home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!cs.utexas.edu!torn!cunews!nrcnet0!bnrgate!bwdls61!bwdls138!jsparkes
- From: jsparkes@bwdls138.bnr.ca (Jeff Sparkes)
- Subject: get-screen-for-buffer + raise under tvtwm (was: 2 questions)
- Message-ID: <1992Aug12.142522.5435@bwdls61.bnr.ca>
- Sender: usenet@bwdls61.bnr.ca (Use Net)
- Nntp-Posting-Host: bwdls138
- Organization: Bell-Northern Research Ltd., Ottawa
- References: <9208112202.AA03604@maestro.mitre.org> <9208112232.AA14929@thalidomide.lucid> <TFB.92Aug12134552@eagle.aisb.ed.ac.uk>
- Date: Wed, 12 Aug 1992 14:25:22 GMT
- Lines: 53
-
- In article <TFB.92Aug12134552@eagle.aisb.ed.ac.uk> tfb@aisb.ed.ac.uk (Tim Bradshaw) writes:
- >>>>>> On 11 Aug 92 22:32:44 GMT, jwz@lucid.com (Jamie Zawinski) said:
- >
- >> In message <9208112202.AA03604@maestro.mitre.org> Michael Lamoureux wrote:
- >>>
- >>> I was trying to get get-screen-for-buffer to work as documented. I did a
- >>> grep through the source, and I determined that get-screen-for-buffer never
- >>> get's called.
- >
- >> It's called by virtue of begin the value of pre-display-buffer-hook, which
- >> is called from display-buffer. The problem is that there are several other
- >> ways that buffers can get displayed besides calling display-buffer. If you
- >> do find-file, it just calls switch-to-buffer, meaning reuse the current
- >> window. If you do find-file-other-window, it uses display-buffer, so it
- >> should pop up in another screen.
- >
- >>> I don't know why it works at all, and I don't know why, if it works at all,
- >>> that it doesn't work as documented.
- >
- >> I think it does work as documented, but it's not clear that what it does is
- >> all that useful.
- >
- >I think that get-screen-for-buffer works correctly. However I am
- >fairly sure that the code that drives it is broken in some way. I
- >have code that uses it to display manual pages in their own screens &
- >quite often but in some unpredictable way, the wrong buffer ends up in
- >the newly created screen. I looked at what get-screen-for-buffer was
- >doing and it creates & returns the correct screen, but somewhere after
- >then the buffer-screen correspondence is lost. I couldn't really work
- >out what was doing this but it seemed to be obscure, and I'm still not
- >100% sure it's not my misunderstanding of what is meant to happen.
-
- This whole thread sounded interesting, so I started playing with
- get-screen-for-buffer. A little poking around in files.el, and the
- using the advise package led me to this:
-
- (require 'advise)
- (advise 'after-find-file 'jds:find-screen 'after)
-
- (defun jds:find-screen(junk)
- (get-screen-for-buffer (current-buffer)))
-
-
- This seems to work well, but I still haven't exhaustively tested it.
-
- BTW, this also led me to discover that raise-window does not work, but
- lower-window does. I'm on a sun, running X11R5 and tvtwm. Anyone
- else have this problem?
- --
- --
- Jeff Sparkes jsparkes@bnr.ca Bell-Northern Research, Ottawa (613)765-2503
- "For better gas mileage, do not drive with the parking brake on."
- - paraphrased from the owners manual of my Integra.
-