Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!yale!Ram-Ashwin From: Ram-Ashwin@cs.yale.edu (Ashwin Ram) Newsgroups: comp.emacs Subject: Re: Sections in Gnu Emacs Buffers? Message-ID: <50744@yale-celray.yale.UUCP> Date: 15 Feb 89 15:19:22 GMT References: <2846@hplabsz.HPL.HP.COM> <4300032@m.cs.uiuc.edu> <49769@yale-celray.yale.UUCP> <779@ethz.UUCP> Sender: root@yale.UUCP Reply-To: Ram-Ashwin@cs.yale.edu (Ashwin Ram) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 60 In-reply-to: ceb@ethz.UUCP (Charles Buckley) In article <779@ethz.UUCP>, ceb@ethz.UUCP (Charles Buckley) writes: > In article <49769@yale-celray.yale.UUCP> spolsky-joel@CS.YALE.EDU (Joel Spolsky) writes: > In article <4300032@m.cs.uiuc.edu> liberte@m.cs.uiuc.edu writes: > >Stallman and I have just now been discussing interval-local > >variables. If we can figure out how to do it, he wants to add it > >to Emacs. > > If the overhead was low enough, this might be a way to implement > proper formatting, such as bold mode, underline mode, etc, > > While you're at it, how about simply having a hook to display the text > between the point and the mark in inverse-video, or standout mode, as > the jargoneurs would say? This comes up time and again. I agree that something like this is needed. However, I would not like the text between mark and point to be in inverse-video all the time because the mark is used for different purposes in Emacs. For example, when you M-> to the end of the file, Emacs leaves a mark at your previous position. In fact, in most buffers, there is always a mark somewhere, and you don't want half your screen to always be in inverse-video. On the other hand, inverse-video is very useful when you're selecting regions to cut and paste, or to pass to a process, or whatever. The problem here is that the same mark is used for this purpose too. I can think of a few solutions to this (some of these are used in different editors): - commands that automatically drop a mark (e.g., M->) don't turn on inverse-video; explicitly set marks (using set-mark-command) do - a separate command for selecting regions (i.e., separation of the "mark this spot" function and "select this region" function) - two mark commands (or a prefix argument to set-mark-command which turns on inverse video until the next "region" operation) - always turn inverse video on when a mark is set, but turn it off when the next "region" command is executed (i.e., excluding cursor movement commands). This way inverse video will normally be off, but it will temporarily be on while you're selecting a region - a command to toggle inverse video for the region. This way you can hit a key when you want the region to be highlighted What I'm trying to say is that this is more than a matter of adding a "standout mode" -- there is also the issue of what the best design is. My personal preference is as follows (a combination of the above): - automatic marks (e.g., M->) do not turn on inverse video - set-mark-command turns on inverse video - any region operation (C-w, case change, etc.) turns off inverse video - a command to toggle inverse video in case you explicitly want to turn it off or on for a given situation Of course, one could provide more than one method and have a user-settable variable to allow him to select which one he wants to use. -- Ashwin.