GNU bug report logs - #49593
Emacs overrides normal-erase-is-backspace

Previous Next

Package: emacs;

Reported by: "Paul W. Rankin" <pwr <at> bydasein.com>

Date: Fri, 16 Jul 2021 07:26:01 UTC

Severity: normal

Tags: moreinfo, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Paul W. Rankin" <pwr <at> bydasein.com>
Cc: 49593 <at> debbugs.gnu.org
Subject: bug#49593: Emacs overrides normal-erase-is-backspace
Date: Fri, 16 Jul 2021 12:04:42 +0200
"Paul W. Rankin" <pwr <at> bydasein.com> writes:

> normal-erase-is-backspace is maybe; marked as "CHANGED outside of
> Customize"

The doc string does say:

Setting this variable with setq doesn't take effect.  Programmatically,
call `normal-erase-is-backspace-mode' (which see) instead.

But setting it with `custom-set-variables' should work, I'd have
thought?  Hm...

(custom-set-variables '(normal-erase-is-backspace t))

sets it to `maybe', so it's not a startup problem (there's been some
with Customize)...

Hm, looking at the code to `normal-erase-is-backspace-mode', I don't see
how that's supposed to work at all.  The value is only used in
`normal-erase-is-backspace-setup-frame', and calling
`normal-erase-is-backspace-mode' doesn't actually change the value of
the variable, which explains why `custom-set-variables' does nothing.

The following change seems to fix the issue:

diff --git a/lisp/simple.el b/lisp/simple.el
index 322693f631..01851e0a0a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9505,9 +9505,9 @@ normal-erase-is-backspace
   :set (lambda (symbol value)
 	 ;; The fboundp is because of a problem with :set when
 	 ;; dumping Emacs.  It doesn't really matter.
-	 (if (fboundp 'normal-erase-is-backspace-mode)
-	     (normal-erase-is-backspace-mode (or value 0))
-	   (set-default symbol value))))
+	 (when (fboundp 'normal-erase-is-backspace-mode)
+	   (normal-erase-is-backspace-mode (or value 0)))
+	 (set-default symbol value)))
 
 (defun normal-erase-is-backspace-setup-frame (&optional frame)
   "Set up `normal-erase-is-backspace-mode' on FRAME, if necessary."



But is that the correct fix?

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




This bug report was last modified 3 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.