Selaa lähdekoodia

Fix org-src saving mechanism for XEmacs

write-contents-hooks is not buffer-local by default in XEmacs 21.4.
Michael Sperber 15 vuotta sitten
vanhempi
commit
67b5a92c78
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      lisp/org-src.el

+ 5 - 2
lisp/org-src.el

@@ -644,8 +644,11 @@ the language, a switch telling if the content should be in a single line."
 	  (setq buffer-file-name
 		(concat (buffer-file-name (marker-buffer org-edit-src-beg-marker))
 			"[" (buffer-name) "]"))
-	  (set (if (featurep 'xemacs) 'write-contents-hooks 'write-contents-functions)
-	       '(org-edit-src-save)))
+	  (if (featurep 'xemacs)
+	      (progn
+		(make-variable-buffer-local 'write-contents-hooks) ; needed only for 21.4
+		(setq write-contents-hooks '(org-edit-src-save)))
+	    (setq write-contents-functions '(org-edit-src-save))))
       (setq buffer-read-only t))))
 
 (org-add-hook 'org-src-mode-hook 'org-src-mode-configure-edit-buffer)