From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Shutko Newsgroups: gmane.emacs.devel Subject: Re: appt.el fix: don't use prin1-to-string Date: Wed, 14 Aug 2002 14:44:59 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <87d6slb7pw.fsf@wesley.springies.com> References: <877kivsr8o.fsf@wesley.springies.com> <200208132246.g7DMkOC07166@wijiji.santafe.edu> <8765yewaik.fsf@wesley.springies.com> <200208141435.g7EEZqO18207@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: main.gmane.org 1029351137 18983 127.0.0.1 (14 Aug 2002 18:52:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 14 Aug 2002 18:52:17 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17f3Fe-0004w4-00 for ; Wed, 14 Aug 2002 20:52:14 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17f3em-000411-00 for ; Wed, 14 Aug 2002 21:18:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17f3Ga-000232-00; Wed, 14 Aug 2002 14:53:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17f3Fj-0001ts-00 for emacs-devel@gnu.org; Wed, 14 Aug 2002 14:52:19 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17f3Fh-0001tZ-00 for emacs-devel@gnu.org; Wed, 14 Aug 2002 14:52:18 -0400 Original-Received: from mta1.srv.hcvlny.cv.net ([167.206.5.4]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17f3Fh-0001tT-00; Wed, 14 Aug 2002 14:52:17 -0400 Original-Received: from wesley.springies.com (ool-182f7213.dyn.optonline.net [24.47.114.19]) by mta1.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 0.8 (built Jul 12 2002)) with ESMTP id <0H0U00M1YK577D@mta1.srv.hcvlny.cv.net>; Wed, 14 Aug 2002 14:46:19 -0400 (EDT) Original-Received: from ats by wesley.springies.com with local (Exim 3.35 #1 (Debian)) id 17f395-0004ot-00; Wed, 14 Aug 2002 14:45:27 -0400 In-Reply-To: <200208141435.g7EEZqO18207@rum.cs.yale.edu> Original-To: Stefan Monnier User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu) Original-Lines: 55 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6540 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6540 Stefan Monnier writes: > Please add a short comment to explain why prin1-to-string is used. 2002-08-13 Alan Shutko * 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 - In a variety of flavors! Corn Frakes: The choice of the next generation.