• Re: ed

    From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Fri Jul 3 00:47:09 2026
    On Fri, 03 Jul 2026 00:55:34 +0100, Daniel Cerqueira wrote:

    M-q is the 'fill-paragraph' function.

    And a very versatile one it is, too. It copes with indented text,
    preserves quoting or comment prefixes, and also helpfully removes
    redundant spaces. ;)
  • From John McCue@jmclnx@gmail.com.invalid to comp.unix.shell on Fri Jul 3 01:32:46 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> wrote:
    On Fri, 03 Jul 2026 00:55:34 +0100, Daniel Cerqueira wrote:

    M-q is the 'fill-paragraph' function.

    I use this a lot :)

    And a very versatile one it is, too. It copes with indented text,
    preserves quoting or comment prefixes, and also helpfully removes
    redundant spaces. ;)

    A little warning about M-q. In GNU Emacs 30+, the scratch
    buffer's M-q is redefined to something else. If you want
    to use 'fill-paragraph' in the scratch buffer you may
    need to add these to ~/.emacs:

    ;; Map M-q in *scratch* buffer
    (add-hook 'lisp-interaction-mode-hook
    (lambda ()
    (local-set-key (kbd "M-q") 'fill-paragraph)))

    FWIW, I tend to use 'fill-paragraph' a lot in scratch.
    --
    [t]csh(1) - "An elegant shell, for a more... civilized age."
    - Paraphrasing Star Wars
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Fri Jul 3 04:11:53 2026
    On Fri, 3 Jul 2026 01:32:46 -0000 (UTC), John McCue wrote:

    A little warning about M-q. In GNU Emacs 30+, the scratch buffer's
    M-q is redefined to something else.

    I didn’t notice this (running Emacs 30.2, since that’s what was in
    Debian Unstable on my last upgrade), because I run with Emacs’ entire
    mode system disabled.

    FWIW, I tend to use 'fill-paragraph' a lot in scratch.

    So do I.

    Oh, and I also added a buffer-protection mechanism, because I have a
    shortcut (super-W) for closing the current buffer, and I was losing
    the scratch buffer too often from this. ;)
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.unix.shell,comp.emacs on Fri Jul 3 07:57:05 2026
    On 2026-07-03, Lawrence D’Oliveiro wrote:

    On Fri, 3 Jul 2026 01:32:46 -0000 (UTC), John McCue wrote:

    A little warning about M-q. In GNU Emacs 30+, the scratch buffer's
    M-q is redefined to something else.

    I didn’t notice this (running Emacs 30.2, since that’s what was in
    Debian Unstable on my last upgrade), because I run with Emacs’ entire
    mode system disabled.

    FWIW, I tend to use 'fill-paragraph' a lot in scratch.

    So do I.

    Oh, and I also added a buffer-protection mechanism, because I have a
    shortcut (super-W) for closing the current buffer, and I was losing
    the scratch buffer too often from this. ;)

    After spending way too long dealing with the consequences of *scratch*
    not being backed up, I went with this:

    (setq initial-buffer-choice "/home/[...]/scratch.org")

    The point being that I use the initial buffer more for quick
    note-keeping that ought to be transitory until saved in a more
    appropriate fashion, but I kept getting bitten by bugs of the following
    species - not saying it happened often enough, but still it happening
    once an year or so would pose an issue:

    * Drosophila Segmentationum Faltum

    * Aedes Blackoutitis


    Now more seriously, the point here is that, if that buffer is backed by
    a file, it does get auto-saved and can be restored to at least a
    somewhat recent copy in case of an improper Emacs shutdown.

    If you rely on it for Elisp interaction, I suppose you could as well as
    make it an Elisp file. I have the following, but I'm not sure the mode
    still needs to be set after the buffer is set to open a file matching
    .*\.org:

    (setq initial-major-mode 'org-mode [...] )

    Now I'm not sure this matters at all with a shortcut to close the buffer
    - but I suppose that, if it's a buffer with a file, it may prompt you
    before killing it? (It'd otherwise not protect as much as your
    protection, I guess, because there'd still be a gap between the last
    auto-save and it being killed?)

    (Meanwhile, I set Emacs on Android the same way, so I can start typing
    notes in the buffer it opens when it starts, and just do C-x C-s,
    without having to open a file first.)
    --
    Nuno Silva
  • From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.unix.shell,comp.emacs on Fri Jul 3 09:32:05 2026
    On 2026-07-03 08:57, Nuno Silva wrote:
    [...]

    The point being that I use the initial buffer more for quick
    note-keeping that ought to be transitory until saved in a more
    appropriate fashion, but I kept getting bitten by bugs of the following species - not saying it happened often enough, but still it happening
    once an year or so would pose an issue:

    * Drosophila Segmentationum Faltum

    * Aedes Blackoutitis


    A vimcination with linucillin is known to help against all that.


    Now more seriously, [...]

    Nah!

    Janis :-)