Parcourir la source

Fix bug with region export.

Carsten Dominik il y a 16 ans
Parent
commit
66a41c6298
2 fichiers modifiés avec 16 ajouts et 7 suppressions
  1. 6 0
      lisp/ChangeLog
  2. 10 7
      lisp/org-exp.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2008-07-23  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-exp.el (org-export-region-as-html, org-export-as-html): Make
+	sure that calls from `org-export-region-as-html' do not do the
+	special check for a subtree.
+
 2008-07-22  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-agenda.el (org-batch-store-agenda-views): Fix parsing bug.

+ 10 - 7
lisp/org-exp.el

@@ -2610,12 +2610,13 @@ in a window.  A non-interactive call will only return the buffer."
   (when (interactive-p)
     (setq buffer "*Org HTML Export*"))
   (let ((transient-mark-mode t) (zmacs-regions t)
-	rtn)
+	ext-plist rtn)
+    (setq ext-plist (plist-put ext-plist :ignore-subree-p t))
     (goto-char end)
     (set-mark (point)) ;; to activate the region
     (goto-char beg)
     (setq rtn (org-export-as-html
-	       nil nil nil
+	       nil nil ext-plist
 	       buffer body-only))
     (if (fboundp 'deactivate-mark) (deactivate-mark))
     (if (and (interactive-p) (bufferp rtn))
@@ -2673,11 +2674,13 @@ PUB-DIR is set, use this as the publishing directory."
 	 (rbeg (and region-p (region-beginning)))
 	 (rend (and region-p (region-end)))
 	 (subtree-p
-	  (when region-p
-	    (save-excursion
-	      (goto-char rbeg)
-	      (and (org-at-heading-p)
-		   (>= (org-end-of-subtree t t) rend)))))
+	  (if (plist-get opt-plist :ignore-subree-p)
+	      nil
+	    (when region-p
+	      (save-excursion
+		(goto-char rbeg)
+		(and (org-at-heading-p)
+		     (>= (org-end-of-subtree t t) rend))))))
 	 (opt-plist (if subtree-p 
 			(org-export-add-subtree-options opt-plist rbeg)
 		      opt-plist))