unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: 17757@debbugs.gnu.org, Stefan Monnier <monnier@IRO.UMontreal.CA>,
	James Cloos <cloos@jhcloos.com>
Subject: bug#17757: 24.4.50; Whitespace changes break signature mark
Date: Wed, 14 Jul 2021 16:21:35 +0200	[thread overview]
Message-ID: <87zgupht74.fsf@gnus.org> (raw)
In-Reply-To: <87mvr77fb2.fsf@mbork.pl> (Marcin Borkowski's message of "Thu, 11 Feb 2016 10:43:29 +0100")

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





  parent reply	other threads:[~2021-07-14 14:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 17:10 bug#17757: 24.4.50; Whitespace changes break signature mark James Cloos
2016-02-11  9:43 ` Marcin Borkowski
2019-09-29 14:06   ` Lars Ingebrigtsen
2021-07-14 14:21   ` Lars Ingebrigtsen [this message]
2021-07-14 14:43     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-14 14:50       ` Lars Ingebrigtsen
2021-07-14 14:57         ` Lars Ingebrigtsen
2021-07-14 15:27           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-14 15:25         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-14 15:41           ` Lars Ingebrigtsen
2021-07-14 16:09             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgupht74.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=17757@debbugs.gnu.org \
    --cc=cloos@jhcloos.com \
    --cc=mbork@mbork.pl \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).