bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17757: 24.4.50; Whitespace changes break signature mark


From: Lars Ingebrigtsen
Subject: bug#17757: 24.4.50; Whitespace changes break signature mark
Date: Wed, 14 Jul 2021 16:21:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Marcin Borkowski <mbork@mbork.pl> writes:

> I confirm that this is still a problem in GNU Emacs 25.1.50.2 (Git
> commit 4ccd2688).
>
> Steps to reproduce in emacs -Q:
>
> C-x m (compose-mail)
> M-> (end-of-buffer)
> "-- " (i.e., dash - dash - space)
> RET
>
> Now the space after the sigdashes disappears.

Tracing this a bit more, it seems that this is what's deleting the space
after the two dashes:

(defun electric-indent-post-self-insert-function ()
...
                (unless (eq electric-indent-inhibit 'electric-layout-mode)
                  ;; Unless we're operating under
                  ;; `electric-layout-mode' (Bug#35254), the goal here
                  ;; will be to remove the trailing whitespace after
                  ;; reindentation of the previous line because that
                  ;; may have (re)introduced it.
                  (goto-char before)
                  ;; We were at EOL in marker `before' before the call
                  ;; to `indent-according-to-mode' but after we may
                  ;; not be (Bug#15767).
                  (when (and (eolp))
                    (delete-horizontal-space t))))))

In Message mode, we want this to happen everywhere else, but not on that
particular line.  Does anybody have any idea how?  I briefly wondered
whether we could do something with fields (since
`delete-horizontal-space' respects fields), but...

Message mode fontises the signature delimiter, so we could use that to
put some other text property on the trailing space character, but I'm
not sure that's very appealing either.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]