aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2025-05-12 17:49:02 -0400
committerStefan Monnier2025-05-12 17:49:02 -0400
commit40559bf71cd5efdf4c88ab43bc7e55abf3a66c20 (patch)
tree14bd25fae432fc9b9dd650d3e4569b238f11b0f9
parent872658764823bb805796002c46c0e6e4456e65b7 (diff)
downloademacs-40559bf71cd5efdf4c88ab43bc7e55abf3a66c20.tar.gz
emacs-40559bf71cd5efdf4c88ab43bc7e55abf3a66c20.zip
help.el: Don't abuse `inhibit-modification-hooks`
* lisp/help.el (substitute-command-keys): Set `inhibit-modification-hooks` locally so it doesn't affect downstream function. (help--window-setup): Don't let-bind `inhibit-modification-hooks`. It was introduced accidentally in commit cd87a5c7a18e.
-rw-r--r--lisp/help.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 15e7cecf156..49394fea2cd 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -305,6 +305,8 @@ specifies what to do when the user exits the help buffer.
305 305
306Do not call this in the scope of `with-help-window'." 306Do not call this in the scope of `with-help-window'."
307 (and (not (get-buffer-window standard-output)) 307 (and (not (get-buffer-window standard-output))
308 ;; FIXME: Call this code *after* we display the buffer, so we can
309 ;; detect reliably whether it's been put in its own frame or what.
308 (let ((first-message 310 (let ((first-message
309 (cond ((or 311 (cond ((or
310 pop-up-frames 312 pop-up-frames
@@ -331,7 +333,7 @@ Do not call this in the scope of `with-help-window'."
331 (list (selected-window) (window-buffer) 333 (list (selected-window) (window-buffer)
332 (window-start) (window-point))) 334 (window-start) (window-point)))
333 "Type \\[switch-to-buffer] RET to remove help window.")))) 335 "Type \\[switch-to-buffer] RET to remove help window."))))
334 (funcall (or function 'message) 336 (funcall (or function #'message)
335 (concat 337 (concat
336 (if first-message 338 (if first-message
337 (substitute-command-keys first-message)) 339 (substitute-command-keys first-message))
@@ -1396,10 +1398,10 @@ Otherwise, return a new string."
1396 ;; overriding-local-map, or from a \\<mapname> construct in STRING 1398 ;; overriding-local-map, or from a \\<mapname> construct in STRING
1397 ;; itself. 1399 ;; itself.
1398 (let ((keymap overriding-local-map) 1400 (let ((keymap overriding-local-map)
1399 (inhibit-modification-hooks t)
1400 (inhibit-read-only t) 1401 (inhibit-read-only t)
1401 (orig-buf (current-buffer))) 1402 (orig-buf (current-buffer)))
1402 (with-temp-buffer 1403 (with-temp-buffer
1404 (setq-local inhibit-modification-hooks t) ;; For speed.
1403 (insert string) 1405 (insert string)
1404 (goto-char (point-min)) 1406 (goto-char (point-min))
1405 (while (< (point) (point-max)) 1407 (while (< (point) (point-max))
@@ -2170,8 +2172,7 @@ The `temp-buffer-window-setup-hook' hook is called."
2170 buffer-file-name nil) 2172 buffer-file-name nil)
2171 (setq-local help-mode--current-data nil) 2173 (setq-local help-mode--current-data nil)
2172 (buffer-disable-undo) 2174 (buffer-disable-undo)
2173 (let ((inhibit-read-only t) 2175 (let ((inhibit-read-only t))
2174 (inhibit-modification-hooks t))
2175 (erase-buffer) 2176 (erase-buffer)
2176 (delete-all-overlays) 2177 (delete-all-overlays)
2177 (prog1 2178 (prog1