unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Shutko <ats@acm.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: appt.el fix: don't use prin1-to-string
Date: Wed, 14 Aug 2002 14:44:59 -0400	[thread overview]
Message-ID: <87d6slb7pw.fsf@wesley.springies.com> (raw)
In-Reply-To: <200208141435.g7EEZqO18207@rum.cs.yale.edu>

Stefan Monnier <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> Please add a short comment to explain why prin1-to-string is used.

2002-08-13  Alan Shutko  <ats@acm.org>

	* 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 <ats@acm.org> - In a variety of flavors!
Corn Frakes: The choice of the next generation.

  reply	other threads:[~2002-08-14 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-12 21:26 appt.el fix: don't use prin1-to-string Alan Shutko
2002-08-13 22:46 ` Richard Stallman
2002-08-14  0:26   ` Alan Shutko
2002-08-14 14:35     ` Stefan Monnier
2002-08-14 18:44       ` Alan Shutko [this message]
2002-08-14 23:13     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d6slb7pw.fsf@wesley.springies.com \
    --to=ats@acm.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).