Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!jrferro From: jrferro@athena.mit.edu (Jon R Ferro) Newsgroups: comp.emacs Subject: Re: Sections in Gnu Emacs Buffers? Message-ID: <9134@bloom-beacon.MIT.EDU> Date: 7 Feb 89 00:07:09 GMT References: <2846@hplabsz.HPL.HP.COM> <4300032@m.cs.uiuc.edu> <49769@yale-celray.yale.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jrferro@athena.mit.edu (Jon R Ferro) Organization: Massachusetts Institute of Technology Lines: 65 >>What kinds of things would you use intervals for? Is this the right idea?: The first thing that pops into mind would be to have intervals automagically set off by comment delimiters, so that I wouldn't have to think about how to fool C-mode into letting me edit my block comments the way I like: ... [C-mode: TAB means indent-current-line] ... } /* ** [Pseudo-Text-Fill-mode with interval variable fill-prefix = "** "] ** [TAB means tab-to-tab-stop] ** ... */ [Back in C-mode] ... This usage implies some sort of automatic interval-creation mechanism similar to abbrevs (NOT like the explicit ruler insertion of MacWrite). I don't know enough about the theoretical operation of major modes to know if changing to a "pseudo" mode in an interval would be best handled by actually calling the mode function or just changing all the mode and keymap variables in the interval. Another good example is the editing of yacc input files for which emacs (correctly) use c-mode in the sections which are actually C code, but where c-mode rather gets in your way during the editing of the grammar rules. (This would be better handled by something much more text-mode-ish) As was mentioned before, interval-local variables would also give a mechanism for marking off blocks to be displayed bold, underlined, or \narrower like the MacWrite or TeX commands they would emulate, but I don't think pushing emacs towards WYSIWYGness should be the reason for this work, or a good thing at all. P.S. How would interval boundaries be displayed in the file? Would one (a) have to find the boundaries via mark-current-interval or narrow-to-interval and then go back to editing, or (b) would there be a command like display-current-interval which would invert the current interval's text until either the next keypress or until the next call to undisplay-current-interval, or (c) permanent visible markers in the text? (My opinion: Both (a) and (b) should be available. (c) loses big.) Would it even be necessary to display the boundaries of the interval if the mode-line had some indication of what interval or set of interval variables is active at the point? If the interval mechanism works as transparently as the buffer/window mechanism, I can picture never worrying about it. Sounds like a very intriguing puzzle and a likely addition to emacs. Hope these comments help. --Jon Jon Ferro MIT Mathematics jrferro@athena.mit.edu