Browse Source

org: check for derived-mode-p instead of "org-mode" exactly

* lisp/org.el (org-mode-restart): Check for derived-mode-p instead of
  "org-mode" exactly.  This covers a situation normal-mode already
  instantiates a derived mode (e.g. via file local variables).
Achim Gratz 11 years ago
parent
commit
e655e664bf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org.el

+ 2 - 2
lisp/org.el

@@ -20468,8 +20468,8 @@ Also updates the keyword regular expressions."
   (interactive)
   (interactive)
   ;; this will set the mode *and* set file local variables.
   ;; this will set the mode *and* set file local variables.
   (normal-mode)
   (normal-mode)
-  ;; but it may leave us in some other mode
-  (unless (string= "org-mode" mode-name)
+  ;; but it may leave us in some unrelated mode
+  (unless (derived-mode-p "org-mode")
     (org-mode))
     (org-mode))
   (message "Org-mode restarted"))
   (message "Org-mode restarted"))