From: Paul Eggert <eggert@cs.ucla.edu>
To: John Wiegley <jwiegley@gmail.com>
Cc: 28280@debbugs.gnu.org
Subject: bug#28280: Maximally unhelpful diagnostic message.
Date: Sun, 17 Sep 2017 22:35:44 -0700 [thread overview]
Message-ID: <914cb27e-1120-398b-b4ea-bc35dc37fe40@cs.ucla.edu> (raw)
In-Reply-To: <20170829184140.GA4339@ACM>
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
> GM> A few seconds grep suggests this is due to the code in newline, added ~ 3
> GM> years ago in 62ee8b1 ("Add assertions to try and help catch bug#18913").
> GM> The complete lack of progress in that report since then suggests it may be
> GM> time to remove/downgrade those assertions.
>
> Agreed.
Make sense, so I installed the attached into emacs-26.
[-- Attachment #2: 0001-Remove-old-cl-assert-calls-in-newline.patch --]
[-- Type: text/x-patch, Size: 3075 bytes --]
From 81b3261b0324137b7c8c05353227673f18264849 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 17 Sep 2017 22:32:31 -0700
Subject: [PATCH] Remove old cl-assert calls in 'newline'
* lisp/simple.el (newline): Remove cl-assert calls
that didn't seem to be helping us debug Bug#18913,
and that caused problems as reported in Bug#28280.
Suggested by Glenn Morris (Bug#28280#8).
---
lisp/simple.el | 39 ++++++++++++++++-----------------------
1 file changed, 16 insertions(+), 23 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 1ffe181..4e42fd5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -434,10 +434,6 @@ newline
;; Do the rest in post-self-insert-hook, because we want to do it
;; *before* other functions on that hook.
(lambda ()
- ;; We are not going to insert any newlines if arg is
- ;; non-positive.
- (or (and (numberp arg) (<= arg 0))
- (cl-assert (eq ?\n (char-before))))
;; Mark the newline(s) `hard'.
(if use-hard-newlines
(set-hard-newline-properties
@@ -456,25 +452,22 @@ newline
;; starts a page.
(or was-page-start
(move-to-left-margin nil t)))))
- (unwind-protect
- (if (not interactive)
- ;; FIXME: For non-interactive uses, many calls actually
- ;; just want (insert "\n"), so maybe we should do just
- ;; that, so as to avoid the risk of filling or running
- ;; abbrevs unexpectedly.
- (let ((post-self-insert-hook (list postproc)))
- (self-insert-command arg))
- (unwind-protect
- (progn
- (add-hook 'post-self-insert-hook postproc nil t)
- (self-insert-command arg))
- ;; We first used let-binding to protect the hook, but that
- ;; was naive since add-hook affects the symbol-default
- ;; value of the variable, whereas the let-binding might
- ;; only protect the buffer-local value.
- (remove-hook 'post-self-insert-hook postproc t)))
- (cl-assert (not (member postproc post-self-insert-hook)))
- (cl-assert (not (member postproc (default-value 'post-self-insert-hook))))))
+ (if (not interactive)
+ ;; FIXME: For non-interactive uses, many calls actually
+ ;; just want (insert "\n"), so maybe we should do just
+ ;; that, so as to avoid the risk of filling or running
+ ;; abbrevs unexpectedly.
+ (let ((post-self-insert-hook (list postproc)))
+ (self-insert-command arg))
+ (unwind-protect
+ (progn
+ (add-hook 'post-self-insert-hook postproc nil t)
+ (self-insert-command arg))
+ ;; We first used let-binding to protect the hook, but that
+ ;; was naive since add-hook affects the symbol-default
+ ;; value of the variable, whereas the let-binding might
+ ;; only protect the buffer-local value.
+ (remove-hook 'post-self-insert-hook postproc t))))
nil)
(defun set-hard-newline-properties (from to)
--
2.7.4
prev parent reply other threads:[~2017-09-18 5:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 18:41 bug#28280: Maximally unhelpful diagnostic message Alan Mackenzie
2017-08-29 19:20 ` Glenn Morris
2017-08-29 19:32 ` John Wiegley
2017-08-29 20:15 ` Alan Mackenzie
2017-08-30 12:17 ` npostavs
2020-08-24 13:59 ` Lars Ingebrigtsen
2020-10-11 2:08 ` Lars Ingebrigtsen
2017-08-30 19:51 ` Glenn Morris
2017-08-31 21:11 ` Alan Mackenzie
2017-09-18 5:35 ` Paul Eggert [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=914cb27e-1120-398b-b4ea-bc35dc37fe40@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=28280@debbugs.gnu.org \
--cc=jwiegley@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.