emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/icalendar.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/icalendar.el,v
Date: Wed, 21 Mar 2007 07:12:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       07/03/21 07:12:48

Index: icalendar.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/icalendar.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- icalendar.el        21 Jan 2007 02:38:24 -0000      1.20
+++ icalendar.el        21 Mar 2007 07:12:48 -0000      1.21
@@ -101,7 +101,7 @@
 
 ;;; Code:
 
-(defconst icalendar-version "0.14"
+(defconst icalendar-version "0.15"
   "Version number of icalendar.el.")
 
 ;; ======================================================================
@@ -226,16 +226,17 @@
         (replace-match "" nil nil)))
     unfolded-buffer))
 
-(defsubst icalendar--rris (&rest args)
+(defsubst icalendar--rris (regexp rep string &optional fixedcase literal)
   "Replace regular expression in string.
-Pass ARGS to `replace-regexp-in-string' (Emacs) or to
-`replace-in-string' (XEmacs)."
-  (if (fboundp 'replace-regexp-in-string)
+Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to
+`replace-regexp-in-string' (Emacs) or to `replace-in-string' (XEmacs)."
+  (cond ((fboundp 'replace-regexp-in-string)
       ;; Emacs:
-      (apply 'replace-regexp-in-string args)
+         (replace-regexp-in-string regexp rep string fixedcase literal))
+        ((fboundp 'replace-in-string)
   ;; XEmacs:
     (save-match-data ;; apparently XEmacs needs save-match-data
-      (apply 'replace-in-string args))))
+           (replace-in-string string regexp rep literal)))))
 
 (defun icalendar--read-element (invalue inparams)
   "Recursively read the next iCalendar element in the current buffer.
@@ -1472,8 +1473,8 @@
 DIARY-FILE.
 
 It will ask for each appointment whether to add it to the diary
-when DO-NOT-ASK is non-nil.  When called interactively,
-DO-NOT-ASK is set to t, so that you are asked fore each event.
+unless DO-NOT-ASK is non-nil.  When called interactively,
+DO-NOT-ASK is nil, so that you are asked for each event.
 
 NON-MARKING determines whether diary events are created as
 non-marking.
@@ -1669,8 +1670,11 @@
                         (concat diary-string " "
                                 (icalendar--format-ical-event e)))
                   (if do-not-ask (setq summary nil))
+                  ;; add entry to diary and store actual name of diary
+                  ;; file (in case it was nil)
+                  (setq diary-file
                   (icalendar--add-diary-entry diary-string diary-file
-                                              non-marking summary))
+                                                    non-marking summary)))
               ;; event was not ok
               (setq found-error t)
               (setq error-string
@@ -1684,13 +1688,15 @@
          (setq error-string (format "%s\n%s\nCannot handle this event: %s"
                                     error-val error-string e))
          (message "%s" error-string))))
+
     ;; insert final newline
+    (if diary-file
     (let ((b (find-buffer-visiting diary-file)))
       (when b
         (save-current-buffer
           (set-buffer b)
           (goto-char (point-max))
-          (insert "\n"))))
+              (insert "\n")))))
     (if found-error
         (save-current-buffer
           (set-buffer (get-buffer-create "*icalendar-errors*"))
@@ -1943,7 +1949,9 @@
         (setq diary-file
               (read-file-name "Add appointment to this diary file: ")))
       ;; Note: make-diary-entry will add a trailing blank char.... :(
-      (make-diary-entry string non-marking diary-file))))
+      (make-diary-entry string non-marking diary-file)))
+  ;; return diary-file in case it has been changed interactively
+  diary-file)
 
 (provide 'icalendar)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]