Sfoglia il codice sorgente

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
Ihor Radchenko 2 anni fa
parent
commit
aa90e5b59c
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 4 3
      lisp/ox.el

+ 4 - 3
lisp/ox.el

@@ -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)