[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: appt.el fix: don't use prin1-to-string
From: |
Alan Shutko |
Subject: |
Re: appt.el fix: don't use prin1-to-string |
Date: |
Wed, 14 Aug 2002 14:44:59 -0400 |
User-agent: |
Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu) |
Stefan Monnier <monnier+gnu/address@hidden> writes:
> Please add a short comment to explain why prin1-to-string is used.
2002-08-13 Alan Shutko <address@hidden>
* calendar/appt.el (appt-delete): Remove properties before calling
prin1-to-string.
(appt-make-list): Remove prin1-to-string calls (and substrings
around them) since strings may have properties.
Index: lisp/calendar/appt.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/appt.el,v
retrieving revision 1.44
diff -u -r1.44 appt.el
--- lisp/calendar/appt.el 12 Aug 2002 17:21:06 -0000 1.44
+++ lisp/calendar/appt.el 14 Aug 2002 18:44:36 -0000
@@ -454,8 +454,17 @@
(let* ((tmp-msg-list appt-time-msg-list))
(while tmp-msg-list
(let* ((element (car tmp-msg-list))
- (prompt-string (concat "Delete "
- (prin1-to-string (car (cdr element)))
+ (entry (car (cdr element)))
+ (prompt-string (concat "Delete "
+ ;; Use prin1-to-string here to
+ ;; put quotes around the entry,
+ ;; and escape any quotes within
+ ;; the entry.
+ (prin1-to-string
+ (progn
+ (set-text-properties 0 (length entry)
+ nil entry)
+ entry))
" from list? "))
(test-input (y-or-n-p prompt-string)))
(setq tmp-msg-list (cdr tmp-msg-list))
@@ -512,9 +521,7 @@
(while (and entry-list
(calendar-date-equal
(calendar-current-date) (car (car entry-list))))
- (let ((time-string (substring (prin1-to-string
- (cadr (car entry-list))) 1 -1)))
-
+ (let ((time-string (cadr (car entry-list))))
(while (string-match
"\\([0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\).*"
time-string)
--
Alan Shutko <address@hidden> - In a variety of flavors!
Corn Frakes: The choice of the next generation.