summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-08-14 13:34:18 +0300
committerEli Zaretskii <eliz@gnu.org>2015-08-14 13:34:18 +0300
commit9d053b34cb62afece1e14e7cdedeef0d160fb528 (patch)
tree8267fd537d5cbce1c0c49069318590f421590707
parentacac9f4d727072b31914c9224957ff8dfec97df1 (diff)
downloademacs-9d053b34cb62afece1e14e7cdedeef0d160fb528.tar.gz
Don't miss warnings about removing string text properties while dumping
* src/alloc.c (purecopy): Warn about removing a string's text properties even when the same string was already pure-copied earlier. * lisp/progmodes/elisp-mode.el (elisp--xref-format) (elisp--xref-format-extra): Fix the commentary.
-rw-r--r--lisp/progmodes/elisp-mode.el4
-rw-r--r--src/alloc.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 81314574672..8392df2a6b9 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -605,7 +605,7 @@ It can be quoted, or be inside a quoted form."
(elisp--xref-find-apropos id))))
;; WORKAROUND: This is nominally a constant, but the text properities
-;; are not preserved thru dump if use defconst. See bug#21237
+;; are not preserved thru dump if use defconst. See bug#21237.
(defvar elisp--xref-format
(let ((str "(%s %s)"))
(put-text-property 1 3 'face 'font-lock-keyword-face str)
@@ -613,7 +613,7 @@ It can be quoted, or be inside a quoted form."
str))
;; WORKAROUND: This is nominally a constant, but the text properities
-;; are not preserved thru dump if use defconst. See bug#21237
+;; are not preserved thru dump if use defconst. See bug#21237.
(defvar elisp--xref-format-extra
(let ((str "(%s %s %s)"))
(put-text-property 1 3 'face 'font-lock-keyword-face str)
diff --git a/src/alloc.c b/src/alloc.c
index 66e62daf136..91b4c6e1515 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5339,6 +5339,10 @@ purecopy (Lisp_Object obj)
if (PURE_POINTER_P (XPNTR (obj)) || INTEGERP (obj) || SUBRP (obj))
return obj; /* Already pure. */
+ if (STRINGP (obj) && XSTRING (obj)->intervals)
+ message_with_string ("Dropping text-properties while making string `%s' pure",
+ obj, true);
+
if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
{
Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil);
@@ -5351,14 +5355,9 @@ purecopy (Lisp_Object obj)
else if (FLOATP (obj))
obj = make_pure_float (XFLOAT_DATA (obj));
else if (STRINGP (obj))
- {
- if (XSTRING (obj)->intervals)
- message_with_string ("Dropping text-properties while making string `%s' pure",
- obj, true);
- obj = make_pure_string (SSDATA (obj), SCHARS (obj),
- SBYTES (obj),
- STRING_MULTIBYTE (obj));
- }
+ obj = make_pure_string (SSDATA (obj), SCHARS (obj),
+ SBYTES (obj),
+ STRING_MULTIBYTE (obj));
else if (COMPILEDP (obj) || VECTORP (obj) || HASH_TABLE_P (obj))
{
struct Lisp_Vector *objp = XVECTOR (obj);