summaryrefslogtreecommitdiff
path: root/lisp/desktop.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2018-04-19 23:30:46 +0300
committerJuri Linkov <juri@linkov.net>2018-04-19 23:30:46 +0300
commit99de04e6a84dbc93aab479666af126c8fb109b95 (patch)
tree20ceee48fe073cdc4713017b64025975df5bf879 /lisp/desktop.el
parent54f60fcad198be5f39fead6f4d453cea0942322a (diff)
downloademacs-99de04e6a84dbc93aab479666af126c8fb109b95.tar.gz
Use text properties to save search parameters. (Bug#22479)
* lisp/isearch.el (isearch-update-ring): Call isearch-string-propertize. Delete duplicates with possibly different text properties. (isearch-string-propertize) (isearch-update-from-string-properties): New functions. (with-isearch-suspended, isearch-ring-adjust1): Call isearch-update-from-string-properties. (isearch-edit-string): Let-bind minibuffer-allow-text-properties to t. (isearch-query-replace): Use propertized isearch-string. (isearch--lax-regexp-function-p): Simplify. * lisp/replace.el (query-replace-descr): Rewrite to keep text properties non-destructively in the replacement string. (query-replace--split-string): Don't remove text properties by substring-no-properties. (query-replace-read-args): Try to get isearch-regexp-function from text-properties. (perform-replace): Display parameters in the replacement message. * lisp/desktop.el (desktop--v2s): Check if text properties are unreadable. (Bug#30786)
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r--lisp/desktop.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 55ec71c1b94..3e1ba200b50 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -841,10 +841,12 @@ QUOTE may be `may' (value may be quoted),
((or (numberp value) (null value) (eq t value) (keywordp value))
(cons 'may value))
((stringp value)
- (let ((copy (copy-sequence value)))
- (set-text-properties 0 (length copy) nil copy)
- ;; Get rid of text properties because we cannot read them.
- (cons 'may copy)))
+ ;; Get rid of unreadable text properties.
+ (if (condition-case nil (read (format "%S" value)) (error nil))
+ (cons 'may value)
+ (let ((copy (copy-sequence value)))
+ (set-text-properties 0 (length copy) nil copy)
+ (cons 'may copy))))
((symbolp value)
(cons 'must value))
((vectorp value)