From b5c35aafb8ea59b958b12fb7cc096c941995e6d4 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 3 Aug 1999 05:33:14 +0000 Subject: [PATCH] (mu-cite-get-prefix-register-verbose-method): Bind `minibuffer-allow-text-properties' to nil; use `mu-cite-remove-text-properties'; use `if' instead of `when'. (mu-cite-get-prefix-register-method): Ditto. (mu-cite-save-registration-file): Don't use `prin1-to-string' for avoiding text properties. --- mu-register.el | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/mu-register.el b/mu-register.el index 5488dd3..60e0b62 100644 --- a/mu-register.el +++ b/mu-register.el @@ -110,12 +110,14 @@ (symbol-name mu-registration-symbol) "\n '(") (insert (mapconcat - (function prin1-to-string) + (function + (lambda (elem) + (format "(\"%s\" . \"%s\")" (car elem) (cdr elem)))) (symbol-value mu-registration-symbol) "\n ")) (insert "\n ))\n\n") (insert ";;; " (file-name-nondirectory mu-registration-file) - " ends here.\n") + " ends here\n") (write-region-as-coding-system mu-registration-file-coding-system (point-min)(point-max) mu-registration-file nil 'nomsg) @@ -149,31 +151,36 @@ (defun mu-cite-get-prefix-register-method () (let ((addr (mu-cite-get-value 'address))) (or (mu-register-get-citation-name addr) - (let ((return - (read-string "Citation name? " - (or (mu-cite-get-value 'x-attribution) - (mu-cite-get-value 'full-name)) - 'mu-register-history))) - (when (and (or mu-cite-allow-null-string-registration - (not (string-equal return ""))) - (y-or-n-p (format "Register \"%s\"? " return))) - (mu-register-add-citation-name return addr)) + (let* ((minibuffer-allow-text-properties nil) + (return + (mu-cite-remove-text-properties + (read-string "Citation name? " + (or (mu-cite-get-value 'x-attribution) + (mu-cite-get-value 'full-name)) + 'mu-register-history)))) + + (if (and (or mu-cite-allow-null-string-registration + (not (string-equal return ""))) + (y-or-n-p (format "Register \"%s\"? " return))) + (mu-register-add-citation-name return addr)) return)))) ;;;###autoload (defun mu-cite-get-prefix-register-verbose-method () (let* ((addr (mu-cite-get-value 'address)) (return1 (mu-register-get-citation-name addr)) - (return (read-string "Citation name? " - (or return1 - (mu-cite-get-value 'x-attribution) - (mu-cite-get-value 'full-name)) - 'mu-register-history))) - (when (and (or mu-cite-allow-null-string-registration - (not (string-equal return ""))) - (not (string-equal return return1)) - (y-or-n-p (format "Register \"%s\"? " return))) - (mu-register-add-citation-name return addr)) + (minibuffer-allow-text-properties nil) + (return (mu-cite-remove-text-properties + (read-string "Citation name? " + (or return1 + (mu-cite-get-value 'x-attribution) + (mu-cite-get-value 'full-name)) + 'mu-register-history)))) + (if (and (or mu-cite-allow-null-string-registration + (not (string-equal return ""))) + (not (string-equal return return1)) + (y-or-n-p (format "Register \"%s\"? " return))) + (mu-register-add-citation-name return addr)) return)) -- 1.7.10.4