emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/raeburn-startup ddae7c3 3/7: Allow dumping of elis


From: Ken Raeburn
Subject: [Emacs-diffs] scratch/raeburn-startup ddae7c3 3/7: Allow dumping of elisp--xref-identifier-completion-table.
Date: Tue, 30 May 2017 04:53:33 -0400 (EDT)

branch: scratch/raeburn-startup
commit ddae7c3372f8a3ef5dc02010dea6471f68e4898f
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>

    Allow dumping of elisp--xref-identifier-completion-table.
    
    The symbol "obarray" can be output by the dumper, but an actual
    obarray cannot in any form that would read back properly.
    
    * lisp/progmodes/elisp-mode.el (elisp--xref-identifier-completion-table):
    Rewrite definition to not directly incorporate the value of obarray.
    * lisp/loadup.el: Don't exclude it from the dump.
---
 lisp/loadup.el               |  5 -----
 lisp/progmodes/elisp-mode.el | 22 ++++++++++++++--------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/lisp/loadup.el b/lisp/loadup.el
index 2b5bb3e..19ad5d3 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -542,11 +542,6 @@ lost after dumping")))
                          ;; unprintable objects.
                          ((eq s 'advertised-signature-table)
                           (make-hash-table :test 'eq :weakness 'key))
-                         ;; FIXME: Incorporates obarray by value,
-                         ;; which doesn't work (chained symbols are
-                         ;; ignored).  Reconstruct at startup?
-                         ((eq s 'elisp--xref-identifier-completion-table)
-                          nil)
                          ((subrp v)
                           `(symbol-function ',(intern (subr-name v))))
                          ((and (markerp v) (null (marker-buffer v)))
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index d6f2679..ed984c6 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -810,15 +810,21 @@ non-nil result supercedes the xrefs produced by
             (push (elisp--xref-find-definitions sym) lst))
            (nreverse lst))))
 
+;; This used to use apply-partially, but that turned "obarray" into a
+;; reference to the actual obarray, not the symbol, and that's
+;; incompatible with the dumper code.
 (defvar elisp--xref-identifier-completion-table
-  (apply-partially #'completion-table-with-predicate
-                   obarray
-                   (lambda (sym)
-                     (or (boundp sym)
-                         (fboundp sym)
-                         (featurep sym)
-                         (facep sym)))
-                   'strict))
+  (lambda (string pred2 action)
+    (completion-table-with-predicate obarray
+                                     (lambda (sym)
+                                       (or (boundp sym)
+                                           (fboundp sym)
+                                           (featurep sym)
+                                           (facep sym)))
+                                     'strict
+                                     string
+                                     pred2
+                                     action)))
 
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (eql elisp)))
   elisp--xref-identifier-completion-table)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]