From: Noam Postavsky <npostavs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Filipp Gunbin <fgunbin@fastmail.fm>, 31557@debbugs.gnu.org
Subject: bug#31557: 27.0.50; SES hangs on save when 'delete-trailing-whitespace' is in 'before-save-hook'
Date: Sun, 03 Jun 2018 12:05:34 -0400 [thread overview]
Message-ID: <87po1797ox.fsf@gmail.com> (raw)
In-Reply-To: <83muwbdge6.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 03 Jun 2018 18:44:01 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> If my reading of the code is correct, it should infloop for every use
> case where region-modifiable-p returns nil.
Yes, agreed.
> Does the patch below look right?
>
> --- lisp/simple.el~0 2018-03-14 06:40:04.000000000 +0200
> +++ lisp/simple.el 2018-06-03 17:51:37.213490900 +0300
> @@ -667,8 +667,9 @@
> (while (re-search-forward "\\s-$" end-marker t)
> (skip-syntax-backward "-" (line-beginning-position))
> (let ((b (point)) (e (match-end 0)))
> - (when (region-modifiable-p b e)
> - (delete-region b e)))))
> + (if (region-modifiable-p b e)
> + (delete-region b e)
> + (goto-char e)))))
Looks good to me.
next prev parent reply other threads:[~2018-06-03 16:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 17:53 bug#31557: 27.0.50; SES hangs on save when 'delete-trailing-whitespace' is in 'before-save-hook' Filipp Gunbin
2018-06-03 15:44 ` Eli Zaretskii
2018-06-03 16:05 ` Noam Postavsky [this message]
2018-06-04 14:26 ` Filipp Gunbin
2018-06-04 16:34 ` Eli Zaretskii
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=87po1797ox.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=31557@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=fgunbin@fastmail.fm \
/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).