mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
ox-icalendar: Prevent duplicates when writing agenda view
* lisp/ox-icalendar.el (org-icalendar-export-current-agenda): Prevent duplicates when writing agenda view. Reported-by: Nicolae Cindea <ncindea@gmail.com> http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00116.html
This commit is contained in:
parent
f320f05192
commit
e67f0f29de
|
@ -879,22 +879,24 @@ The file is stored under the name chosen in
|
|||
"Export current agenda view to an iCalendar FILE.
|
||||
This function assumes major mode for current buffer is
|
||||
`org-agenda-mode'."
|
||||
(let* ((org-export-babel-evaluate) ; Don't evaluate Babel block.
|
||||
(let* ((org-export-babel-evaluate) ;don't evaluate Babel blocks
|
||||
(contents
|
||||
(org-export-string-as
|
||||
(with-output-to-string
|
||||
(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))
|
||||
(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)
|
||||
(org-with-wide-buffer
|
||||
(goto-char (marker-position m))
|
||||
(princ
|
||||
(org-element-normalize-string
|
||||
(buffer-substring
|
||||
(point) (progn (outline-next-heading) (point)))))))))
|
||||
(buffer-substring (point)
|
||||
(org-entry-end-position))))))))
|
||||
(forward-line)))))
|
||||
'icalendar t
|
||||
'(:ascii-charset utf-8 :ascii-links-to-notes nil
|
||||
|
|
Loading…
Reference in a new issue