org-export-with-buffer-copy: Avoid all the hooks, not just `org-mode-hook'

* lisp/ox.el (org-export--generate-copy-script): Use
`delay-mode-hooks' to disable all the hooks to be executed instead of
only `org-mode-hook'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
This commit is contained in:
Ihor Radchenko 2022-10-05 14:00:02 +08:00
parent 5a167f6ef2
commit aa90e5b59c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 4 additions and 3 deletions

View File

@ -2622,9 +2622,10 @@ The function assumes BUFFER's major mode is `org-mode'."
ov-set)))
(lambda ()
(let ((inhibit-modification-hooks t))
;; Set major mode. Ignore `org-mode-hook' as it has been run
;; already in BUFFER.
(let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode))
;; Set major mode. Ignore `org-mode-hook' and other hooks as
;; they have been run already in BUFFER.
(delay-mode-hooks
(let ((org-inhibit-startup t)) (org-mode)))
;; Copy specific buffer local variables and variables set
;; through BIND keywords.
(pcase-dolist (`(,var . ,val) varvals)