Sfoglia il codice sorgente

Export: Fix problem with exporting message mode src regions

Message-mode assigns auto-safe file names to temporary buffers, in the
draft directory.  This causes problems when running message-mode in a
temporary buffer with with-temp-buffer.  When the form tries to kill
the buffer, is asks for saving it....

This commit turns off the buffer-modified flag and so avoids the
query.

Patch by Nick Dokos.
Carsten Dominik 16 anni fa
parent
commit
6ccc6b4652
2 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 4 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-exp.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-03-04  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-format-source-code-or-example): Mark
+	temporary buffer unmodified, so that it will be killed even if
+	mode like message mode has decided to assign a file name.
+
 	* org.el (org-scan-tags): Improve tag inheritance.
 	(org-scan-tags, org-make-tags-matcher): Make tag comparison
 	case-sensitive.

+ 1 - 0
lisp/org-exp.el

@@ -2471,6 +2471,7 @@ Numbering lines works for all three major backends (html, latex, and ascii)."
 			  (funcall mode)
 			(fundamental-mode))
 		      (font-lock-fontify-buffer)
+		      (set-buffer-modified-p nil)
 		      (org-export-htmlize-region-for-paste
 		       (point-min) (point-max))))
 	      (if (string-match "<pre\\([^>]*\\)>\n?" rtn)