Commit 890a0826 authored by Thomas Fitzsimmons's avatar Thomas Fitzsimmons

Make icalendar-import-buffer not show diary file buffer

* lisp/calendar/diary-lib.el (diary-make-entry): Add
omit-trailing-space parameter.  Add do-not-show parameter to
allow not showing diary file buffer.
* lisp/calendar/icalendar.el (icalendar--add-diary-entry): Remove
workaround to omit trailing space in diary entry.  Have
diary-make-entry not display the diary file buffer.  (Bug#35645)
parent 58cde923
Pipeline #1928 failed with stage
in 3 seconds
......@@ -2062,12 +2062,19 @@ calendar."
;;; Diary insertion functions.
(defun diary-make-entry (string &optional nonmarking file)
(defun diary-make-entry (string &optional nonmarking file omit-trailing-space
"Insert a diary entry STRING which may be NONMARKING in FILE.
If omitted, NONMARKING defaults to nil and FILE defaults to
`diary-file'. If OMIT-TRAILING-SPACE is non-nil, then do not add
a trailing space to the entry. If DO-NOT-SHOW is non-nil, do not
show the diary buffer."
(let ((diary-file-name (or file diary-file)))
(if do-not-show
(find-file-noselect diary-file-name)
(let ((pop-up-frames (or pop-up-frames (window-dedicated-p))))
(find-file-other-window (or file diary-file)))
(find-file-other-window diary-file-name))))
(when (eq major-mode (default-value 'major-mode)) (diary-mode))
......@@ -2082,7 +2089,7 @@ If omitted, NONMARKING defaults to nil and FILE defaults to
(if (bolp) "" "\n")
(if nonmarking diary-nonmarking-symbol "")
string " "))
string (if omit-trailing-space "" " "))))
(defun diary-insert-entry (arg &optional event)
......@@ -2502,20 +2502,10 @@ the entry."
(when summary
(setq non-marking
(y-or-n-p (format "Make appointment non-marking? "))))
(unless diary-filename
(setq diary-filename
(read-file-name "Add appointment to this diary file: ")))
;; Note: diary-make-entry will add a trailing blank char.... :(
(funcall (if (fboundp 'diary-make-entry)
string non-marking diary-filename)))
;; Würgaround to remove the trailing blank char
(with-current-buffer (find-file diary-filename)
(goto-char (point-max))
(if (= (char-before) ? )
(delete-char -1)))
(diary-make-entry string non-marking diary-filename t t))
;; return diary-filename in case it has been changed interactively
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment