Przeglądaj źródła

org-mode: Make local variables effective during Org startup

* lisp/org.el (org-mode): Call `hack-local-variables' early during Org
mode startup.  This way, Org startup options will regard local
variable settings.

* testing/.dir-locals.el: Create a stub dir-locals file to prevent
tests from being affected by directory-local settings of the root Org
repo folder.

Fixes
https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com/T/#u
Ihor Radchenko 3 lat temu
rodzic
commit
e22b4eb7aa
2 zmienionych plików z 9 dodań i 0 usunięć
  1. 4 0
      lisp/org.el
  2. 5 0
      testing/.dir-locals.el

+ 4 - 0
lisp/org.el

@@ -4708,6 +4708,10 @@ The following commands are available:
 
 \\{org-mode-map}"
   (setq-local org-mode-loading t)
+  ;; Apply file-local and directory-local variables, so that Org
+  ;; startup respects them.  See
+  ;; https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com/T/#u
+  (hack-local-variables 'ignore-mode-settings)
   (org-load-modules-maybe)
   (org-install-agenda-files-menu)
   (when (and org-link-descriptive

+ 5 - 0
testing/.dir-locals.el

@@ -0,0 +1,5 @@
+;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+;; Stub directory-local file to avoid tests being affected by upper-level settings.
+