aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2018-02-16 19:11:59 -0800
committerGlenn Morris2018-02-16 19:11:59 -0800
commit0cb1c59aa891c6a04d3b9701485b20bfd6d8f2aa (patch)
treec6f4d5d186d7147feff03a110decf9e50826167f
parentb04fa19119c6db126bf0f80a1d610e21a7a27c23 (diff)
downloademacs-0cb1c59aa891c6a04d3b9701485b20bfd6d8f2aa.tar.gz
emacs-0cb1c59aa891c6a04d3b9701485b20bfd6d8f2aa.zip
Quieten compilation of icalendar.el
* lisp/calendar/icalendar.el (icalendar-import-buffer) (icalendar--convert-ical-to-diary, icalendar--add-diary-entry): Eliminate "Lexical argument shadows the dynamic variable" warning.
-rw-r--r--lisp/calendar/icalendar.el38
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index a725a4e916b..7af1520da47 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -1975,13 +1975,13 @@ P")
1975 (icalendar-import-buffer diary-filename t non-marking))) 1975 (icalendar-import-buffer diary-filename t non-marking)))
1976 1976
1977;;;###autoload 1977;;;###autoload
1978(defun icalendar-import-buffer (&optional diary-file do-not-ask 1978(defun icalendar-import-buffer (&optional diary-filename do-not-ask
1979 non-marking) 1979 non-marking)
1980 "Extract iCalendar events from current buffer. 1980 "Extract iCalendar events from current buffer.
1981 1981
1982This function searches the current buffer for the first iCalendar 1982This function searches the current buffer for the first iCalendar
1983object, reads it and adds all VEVENT elements to the diary 1983object, reads it and adds all VEVENT elements to the diary
1984DIARY-FILE. 1984DIARY-FILENAME.
1985 1985
1986It will ask for each appointment whether to add it to the diary 1986It will ask for each appointment whether to add it to the diary
1987unless DO-NOT-ASK is non-nil. When called interactively, 1987unless DO-NOT-ASK is non-nil. When called interactively,
@@ -2011,10 +2011,10 @@ buffer `*icalendar-errors*'."
2011 (message "Converting iCalendar...") 2011 (message "Converting iCalendar...")
2012 (setq ical-errors (icalendar--convert-ical-to-diary 2012 (setq ical-errors (icalendar--convert-ical-to-diary
2013 ical-contents 2013 ical-contents
2014 diary-file do-not-ask non-marking)) 2014 diary-filename do-not-ask non-marking))
2015 (when diary-file 2015 (when diary-filename
2016 ;; save the diary file if it is visited already 2016 ;; save the diary file if it is visited already
2017 (let ((b (find-buffer-visiting diary-file))) 2017 (let ((b (find-buffer-visiting diary-filename)))
2018 (when b 2018 (when b
2019 (save-current-buffer 2019 (save-current-buffer
2020 (set-buffer b) 2020 (set-buffer b)
@@ -2066,12 +2066,12 @@ buffer `*icalendar-errors*'."
2066 conversion-list) 2066 conversion-list)
2067 string))) 2067 string)))
2068 2068
2069(defun icalendar--convert-ical-to-diary (ical-list diary-file 2069(defun icalendar--convert-ical-to-diary (ical-list diary-filename
2070 &optional do-not-ask 2070 &optional do-not-ask
2071 non-marking) 2071 non-marking)
2072 "Convert iCalendar data to an Emacs diary file. 2072 "Convert iCalendar data to an Emacs diary file.
2073Import VEVENTS from the iCalendar object ICAL-LIST and saves them to a 2073Import VEVENTS from the iCalendar object ICAL-LIST and saves them to a
2074DIARY-FILE. If DO-NOT-ASK is nil the user is asked for each event 2074DIARY-FILENAME. If DO-NOT-ASK is nil the user is asked for each event
2075whether to actually import it. NON-MARKING determines whether diary 2075whether to actually import it. NON-MARKING determines whether diary
2076events are created as non-marking. 2076events are created as non-marking.
2077This function attempts to return t if something goes wrong. In this 2077This function attempts to return t if something goes wrong. In this
@@ -2199,8 +2199,8 @@ written into the buffer `*icalendar-errors*'."
2199 (if do-not-ask (setq summary nil)) 2199 (if do-not-ask (setq summary nil))
2200 ;; add entry to diary and store actual name of diary 2200 ;; add entry to diary and store actual name of diary
2201 ;; file (in case it was nil) 2201 ;; file (in case it was nil)
2202 (setq diary-file 2202 (setq diary-filename
2203 (icalendar--add-diary-entry diary-string diary-file 2203 (icalendar--add-diary-entry diary-string diary-filename
2204 non-marking summary))) 2204 non-marking summary)))
2205 ;; event was not ok 2205 ;; event was not ok
2206 (setq found-error t) 2206 (setq found-error t)
@@ -2217,8 +2217,8 @@ written into the buffer `*icalendar-errors*'."
2217 (message "%s" error-string)))) 2217 (message "%s" error-string))))
2218 2218
2219 ;; insert final newline 2219 ;; insert final newline
2220 (if diary-file 2220 (if diary-filename
2221 (let ((b (find-buffer-visiting diary-file))) 2221 (let ((b (find-buffer-visiting diary-filename)))
2222 (when b 2222 (when b
2223 (save-current-buffer 2223 (save-current-buffer
2224 (set-buffer b) 2224 (set-buffer b)
@@ -2498,9 +2498,9 @@ END-T is the event's end time in diary format."
2498 dtstart-dec "/") 2498 dtstart-dec "/")
2499 start-t)))) 2499 start-t))))
2500 2500
2501(defun icalendar--add-diary-entry (string diary-file non-marking 2501(defun icalendar--add-diary-entry (string diary-filename non-marking
2502 &optional summary) 2502 &optional summary)
2503 "Add STRING to the diary file DIARY-FILE. 2503 "Add STRING to the diary file DIARY-FILENAME.
2504STRING must be a properly formatted valid diary entry. NON-MARKING 2504STRING must be a properly formatted valid diary entry. NON-MARKING
2505determines whether diary events are created as non-marking. If 2505determines whether diary events are created as non-marking. If
2506SUMMARY is not nil it must be a string that gives the summary of the 2506SUMMARY is not nil it must be a string that gives the summary of the
@@ -2513,21 +2513,21 @@ the entry."
2513 (setq non-marking 2513 (setq non-marking
2514 (y-or-n-p (format "Make appointment non-marking? ")))) 2514 (y-or-n-p (format "Make appointment non-marking? "))))
2515 (save-window-excursion 2515 (save-window-excursion
2516 (unless diary-file 2516 (unless diary-filename
2517 (setq diary-file 2517 (setq diary-filename
2518 (read-file-name "Add appointment to this diary file: "))) 2518 (read-file-name "Add appointment to this diary file: ")))
2519 ;; Note: diary-make-entry will add a trailing blank char.... :( 2519 ;; Note: diary-make-entry will add a trailing blank char.... :(
2520 (funcall (if (fboundp 'diary-make-entry) 2520 (funcall (if (fboundp 'diary-make-entry)
2521 'diary-make-entry 2521 'diary-make-entry
2522 'make-diary-entry) 2522 'make-diary-entry)
2523 string non-marking diary-file))) 2523 string non-marking diary-filename)))
2524 ;; Würgaround to remove the trailing blank char 2524 ;; Würgaround to remove the trailing blank char
2525 (with-current-buffer (find-file diary-file) 2525 (with-current-buffer (find-file diary-filename)
2526 (goto-char (point-max)) 2526 (goto-char (point-max))
2527 (if (= (char-before) ? ) 2527 (if (= (char-before) ? )
2528 (delete-char -1))) 2528 (delete-char -1)))
2529 ;; return diary-file in case it has been changed interactively 2529 ;; return diary-filename in case it has been changed interactively
2530 diary-file) 2530 diary-filename)
2531 2531
2532;; ====================================================================== 2532;; ======================================================================
2533;; Examples 2533;; Examples