[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 755045e 2/2: Work around "Attempt to modify read-on
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master 755045e 2/2: Work around "Attempt to modify read-only object" |
Date: |
Tue, 05 May 2015 12:30:37 +0000 |
branch: master
commit 755045e1eb27703a117e74bd5047928795f4a4e9
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Work around "Attempt to modify read-only object"
* lisp/progmodes/elisp-mode.el (elisp--xref-format): Extract from
elisp--xref-find-definitions, to work around "Attempt to modify
read-only object" error.
---
lisp/progmodes/elisp-mode.el | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index f085dcf..dac807e 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -628,12 +628,15 @@ It can be quoted, or be inside a quoted form."
(setq file (substring file 0 -1)))
(xref-make-elisp-location sym type file))))
+(defvar elisp--xref-format
+ (let ((str "(%s %s)"))
+ (put-text-property 1 3 'face 'font-lock-keyword-face str)
+ (put-text-property 4 6 'face 'font-lock-function-name-face str)
+ str))
+
(defun elisp--xref-find-definitions (symbol)
(save-excursion
- (let ((fmt "(%s %s)")
- lst)
- (put-text-property 1 3 'face 'font-lock-keyword-face fmt)
- (put-text-property 4 6 'face 'font-lock-function-name-face fmt)
+ (let (lst)
(dolist (type '(feature defface defvar defun))
(let ((loc
(condition-case err
@@ -642,7 +645,7 @@ It can be quoted, or be inside a quoted form."
(xref-make-bogus-location (error-message-string err))))))
(when loc
(push
- (xref-make (format fmt type symbol)
+ (xref-make (format elisp--xref-format type symbol)
loc)
lst))))
lst)))