Преглед на файлове

Bugfix: Avoid raising buffer-modified flag during LaTeX export

This had, as usually, to do with changing text properties.

Report by Russel Adams.
Carsten Dominik преди 16 години
родител
ревизия
a93c5d2e2e
променени са 2 файла, в които са добавени 10 реда и са изтрити 4 реда
  1. 4 0
      lisp/ChangeLog
  2. 6 4
      lisp/org-export-latex.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-02-22  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-export-latex.el (org-export-as-latex)
+	(org-export-latex-first-lines): Avoid modification flag when
+	adding or removing text properties.
+
 	* org.el (orgstruct++-mode): New function.
 	(turn-on-orgstruct++): Call `orgstruct++-mode'.
 	(org-context-p): Allow detecting item context after the first line

+ 6 - 4
lisp/org-export-latex.el

@@ -388,8 +388,9 @@ when PUB-DIR is set, use this as the publishing directory."
       (error "Need a file name to be able to export")))
 
   (message "Exporting to LaTeX...")
-  (remove-text-properties (point-min) (point-max)
-			  '(:org-license-to-kill nil))
+  (org-unmodified
+   (remove-text-properties (point-min) (point-max)
+			   '(:org-license-to-kill nil)))
   (org-update-radio-target-regexp)
   (org-export-latex-set-initial-vars ext-plist arg)
   (let* ((wcf (current-window-configuration))
@@ -803,8 +804,9 @@ If BEG is non-nil, the is the beginning of he region."
 	    :LaTeX-fragments nil
 	    :timestamps (plist-get opt-plist :timestamps)
 	    :footnotes (plist-get opt-plist :footnotes)))
-	(add-text-properties pt (max pt (1- end))
-			     '(:org-license-to-kill t))))))
+	(org-unmodified
+	 (add-text-properties pt (max pt (1- end))
+			      '(:org-license-to-kill t)))))))
 
 (defun org-export-latex-collect-header-macros (&optional title)
   "Find the various definitions in #+... lines and define TeX macros for them."