-----Original Message----- From: David Kastrup <[email protected]> To: David Sumbler <[email protected]> CC: [email protected] Subject: Re: Automatic narrowing in Emacs? Date: Wed, 02 Jan 2019 15:14:29 +0100
David Sumbler <[email protected]> writes: > I now realise that in these cases the buffer has been "narrowed". > This is a useful feature of Emacs that I wasn't even aware of > previously, and no doubt I shall start to use it intentionally in > future. > > But I find that a large buffer gets narrowed automatically when I am > editing, even though I have not given a command for this. Even if I > then issue a 'widen' command (Ctrl-x n w) the buffer gets narrowed > again after short while. The key sequences for narrowing are _disabled_ by default as narrowing is confusing. If you haven't enabled them, this should not be an issue. Looking at LilyPond-mode, I see a few occurences of narrowing: $ git grep narrow lilypond-indent.el: (narrow-to-region lilypond-mode.el: (narrow-to-region start end) lilypond-song.el: (narrow-to-region (or (mark) (point)) (point))) Those are likely for purely programmatic reasons. If you are plagued here, you may want to review the respective Elisp passages to see if the narrow-to-region sequences are reliably reversed (by being encapsulated in constructs that are guaranteed to restore the state of narrowing even when exited in error cases). -----Original Message----- From: Andrew Bernard <[email protected]> To: lilypond-user Mailinglist <[email protected]> Subject: Re: Automatic narrowing in Emacs? Date: Wed, 2 Jan 2019 23:33:47 +1100 Hi David, Never heard of this being automatic. Have you got a lot of customisations in your emacs? What version are you running (not that I think that makes any difference) and on what platform? Weird. hard to imagine how you would have both set a mark and typed C-x n n inadvertently. I always found lilypond mode a bit strange. I don't use it. Can't think of any examples at the moment, but I understand it's a bit half baked, isn't that so? ---------------------------------- To answer Andrew first, I am running Emacs 25.2.2 in Ubuntu 18.04. My own customisations of Emacs are fairly normal and trivial (screen and font colour etc.). And David is quite right: if I type C-x n n I get told that narrowing is disabled, and would have to choose to enable it. I am pretty sure that I am cannot be typing C-x n n SPC or C-x n n ! by accident. In other words, my buffer is being narrowed even when the narrowing commands themselves are disabled. Pretty mysterious, eh? I had already looked at those 3 mentions of narrowing in the Lilypond- mode files. From what I could see they wouldn't cause narrowing by accident, although I am not capable of analysing the code to the extent that David suggests in his final sentence. As for Lilypond-mode being half-baked, I don't find that, although there are a few anomalies, e.g. indenting after manual beams and sometimes after slurs is a bit buggy. (I don't think the characters '()[]' should affect the indenting at all in pure Lilypond code, but occasionally they do.) And I add 'q' to the list of allowable note- names in lilypond-words.el so that repeated chords don't stand out like lighthouses in the text! David _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
