فهرست منبع

Merge branch 'maint'

Nicolas Goaziou 8 سال پیش
والد
کامیت
d5690b6206
1فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 7 5
      lisp/ox-icalendar.el

+ 7 - 5
lisp/ox-icalendar.el

@@ -879,22 +879,24 @@ The file is stored under the name chosen in
   "Export current agenda view to an iCalendar FILE.
   "Export current agenda view to an iCalendar FILE.
 This function assumes major mode for current buffer is
 This function assumes major mode for current buffer is
 `org-agenda-mode'."
 `org-agenda-mode'."
-  (let* ((org-export-use-babel)	; Don't evaluate Babel block.
+  (let* ((org-export-use-babel)		;don't evaluate Babel blocks
 	 (contents
 	 (contents
 	  (org-export-string-as
 	  (org-export-string-as
 	   (with-output-to-string
 	   (with-output-to-string
 	     (save-excursion
 	     (save-excursion
-	       (let ((p (point-min)))
+	       (let ((p (point-min))
+		     (seen nil))	;prevent duplicates
 		 (while (setq p (next-single-property-change p 'org-hd-marker))
 		 (while (setq p (next-single-property-change p 'org-hd-marker))
 		   (let ((m (get-text-property p 'org-hd-marker)))
 		   (let ((m (get-text-property p 'org-hd-marker)))
-		     (when m
+		     (when (and m (not (memq m seen)))
+		       (push m seen)
 		       (with-current-buffer (marker-buffer m)
 		       (with-current-buffer (marker-buffer m)
 			 (org-with-wide-buffer
 			 (org-with-wide-buffer
 			  (goto-char (marker-position m))
 			  (goto-char (marker-position m))
 			  (princ
 			  (princ
 			   (org-element-normalize-string
 			   (org-element-normalize-string
-			    (buffer-substring
-			     (point) (progn (outline-next-heading) (point)))))))))
+			    (buffer-substring (point)
+					      (org-entry-end-position))))))))
 		   (forward-line)))))
 		   (forward-line)))))
 	   'icalendar t
 	   'icalendar t
 	   '(:ascii-charset utf-8 :ascii-links-to-notes nil
 	   '(:ascii-charset utf-8 :ascii-links-to-notes nil