Re: Manipulating keymaps
[email protected] Fri, 19 Jun 2026 13:53:26 -0400
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <[email protected]> |
Dr Rainer Woitok <[email protected]> writes: > Greetings, > > On Thursday, 2026-06-18 14:15:02 -0400, [email protected] wrote: > >> ... >> > #! /usr/bin/bash >> > # >> > # lorem ipsum, dolor sit amet consectetur adipisci velit, ONE, TWO, THREE, sed eius modi >> > # tempora incidunt, ut labore et dolore magnam aliquam. >> > >> > ; Again place the cursor on the "#" character preceding "lorem", en- >> > ; ter "C-<blank> <down> <down> C-u M-q" to again re-format these two >> > ; lines, BUT NOTHING HAPPENS, the two lines don't change. >> >> Using Emacs 30.2 (started from ‘emacs -Q’), with M-q bound >> to the command ‘prog-fill-reindent-defun’, the text was >> "filled", as expected. Here is a copy of the resulting >> text: >> >> > #! /usr/bin/bash >> > # >> > # lorem ipsum, dolor sit amet consectetur adipisci velit, ONE, TWO, >> > # THREE, sed eius modi tempora incidunt, ut labore et dolore magnam >> > # aliquam. > > The same happens here when I just place the cursor somewhere into this > text and hit "C-u M-q". But I MARKED the region to be processed by ex- > ecuting "C-SPC <down> <down>" before running "C-u M-q". > Yes, I replicated those steps, also, without any problems. That is, I positioned point on As I wrote previously, > > > > ; Again place the cursor on the "#" character preceding "lorem", en- > > ; ter "C-<blank> <down> <down> C-u M-q" to again re-format these two > > ; lines, BUT NOTHING HAPPENS, the two lines don't change. > > Using Emacs 30.2 (started from ‘emacs -Q’), with M-q bound > to the command ‘prog-fill-reindent-defun’, the text was > "filled", as expected. Here is a copy of the resulting > text: I retraced these steps again to confirm that C-u M-q after C-SPC <down> <down> "filled" the comment by breaking the lines. ‘prog-fill-reindent-defun’, conditionally, calls ‘fill-paragraph’. If the condition is met and ‘fill-paragraph’ is called, then this function handles four cases. The first case is: (and region transient-mark-mode mark-active (not (eq (region-beginning) (region-end))) (or (fill-region (region-beginning) (region-end) justify) t)) Here, ‘fill-region’ is called when the requisite conditions are met and the text is reformatted/"filled". Either your ‘emacs -Q’ is calling ‘fill-paragraph’ or it is not. Then, if it is called, then either ‘fill-region’ is called or it is not. As Stefan Monnier has recommended, you should consider reporting this as an error that your use-case has identified (but which other people cannot immediately reproduce). The command ‘report-emacs-bug’ can be used to send an email with your earlier description of the steps you took to produce the error. From there, an Emacs developer(s) may ask you questions to get more information to track down the source of the error. -- The lyf so short, the craft so long to lerne. - Geoffrey Chaucer, The Parliament of Birds.