[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/raeburn-startup 5d4b7f9 26/43: Dump and restore em
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] scratch/raeburn-startup 5d4b7f9 26/43: Dump and restore empty abbrev tables. |
Date: |
Mon, 31 Jul 2017 02:11:03 -0400 (EDT) |
branch: scratch/raeburn-startup
commit 5d4b7f9bc2d2f065141d044305c407677ee4ebbb
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>
Dump and restore empty abbrev tables.
Abbrev tables are obarrays and thus don't print out in a useful form.
They need to be assembled at load time. Fortunately, loadup.el only
gives us empty abbrev tables, so we don't have to actually restore any
abbrevs, only the tables.
* lisp/loadup.el: When variable values are abbrev tables, emit a
"make-abbrev-table" initialization with the appropriate property
lists. Check abbrev tables and their parents for instances of
sharing. Reject any abbrev tables that are not empty.
---
lisp/loadup.el | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/lisp/loadup.el b/lisp/loadup.el
index fb276d2..4e68505c 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -497,6 +497,10 @@ lost after dumping")))
(coding-systems '()) (coding-system-aliases '())
(charsets '()) (charset-aliases '())
(unified-charsets '())
+ (abbrev-tables (make-hash-table :test 'eq))
+ (abbrev-assign-cmds '())
+ (abbrev-make-cmds '())
+ (abbrev-counter 0)
(cmds '()))
(setcdr global-buffers-menu-map nil) ;; Get rid of buffer objects!
(push `(internal--set-standard-syntax-table
@@ -547,6 +551,45 @@ lost after dumping")))
'(let ((ol (make-overlay (point-min) (point-min))))
(delete-overlay ol)
ol))
+ ;; abbrev-table-p isn't very robust
+ ((condition-case nil
+ (abbrev-table-p v)
+ (error nil))
+ (cl-labels ((replace-abbrevs-for-dump
+ (table)
+ (or (abbrev-table-empty-p table)
+ (error "Non-empty abbrev tables not
handled"))
+ (let ((newval (gethash table
abbrev-tables)))
+ (if newval
+ `(aref scratch-abbrev-tables
,newval)
+ (let* ((props (symbol-plist
(obarray-get table ""))))
+ (cond ((plist-get props :parents)
+ (setq props (copy-sequence
props))
+ (plist-put props
+ :parents
+ (mapcar (lambda
(value)
+ (list
'\, (replace-abbrevs-for-dump value)))
+
(plist-get props :parents)))
+ (setq props (list '\`
props)))
+ ((eq (length props) 2)
+ ;; Only
:abbrev-table-modiff, which gets added at creation anyway.
+ (setq props nil)))
+ (push `(aset scratch-abbrev-tables
+ ,abbrev-counter
+ ,(if props
+
`(make-abbrev-table ,props)
+
'(make-abbrev-table)))
+ abbrev-make-cmds)
+ (puthash table abbrev-counter
abbrev-tables)
+ (prog1
+ `(aref scratch-abbrev-tables
,abbrev-counter)
+ (setq abbrev-counter (1+
abbrev-counter))))))))
+ (push `(set-default ',s
+ ,(replace-abbrevs-for-dump v))
+ abbrev-assign-cmds))
+ ;; Placeholder to be used before we know
+ ;; we've defined make-abbrev-table.
+ 0)
(v (macroexp-quote v))))
cmds)
;; Local variables: make-variable-buffer-local,
@@ -599,6 +642,10 @@ lost after dumping")))
(print '(get-buffer-create "*Messages*"))
(print `(progn . ,cmds))
(terpri)
+ ;; Now that make-abbrev-table is defined, use it.
+ (print `(let ((scratch-abbrev-tables (make-vector ,abbrev-counter
0)))
+ ,@(nreverse abbrev-make-cmds)
+ ,@abbrev-assign-cmds))
(print `(let ((css ',charsets))
(dotimes (i 3)
(dolist (cs (prog1 css (setq css nil)))
- [Emacs-diffs] scratch/raeburn-startup cc22b26 19/43: Don't save internal--text-quoting-flag., (continued)
- [Emacs-diffs] scratch/raeburn-startup cc22b26 19/43: Don't save internal--text-quoting-flag., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 3da90ae 32/43: Make watchers dumpable., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 363abae 30/43: Support dumping variable aliases., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 291e585 24/43: Update load-path and purify-flag even if not bootstrapping., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 2c96099 27/43: Don't dump artifacts of the dump process., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup bd8bcb3 29/43: Load uniquify after dump/reload., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup d987a68 39/43: Don't show the build directory in load-history., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup de45051 37/43: Fix use of "-l" on command line after installation., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 272c874 23/43: Fix startup on MS-Windows, Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup d95042a 35/43: ; Add comment regarding silent loading of dumped.elc., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 5d4b7f9 26/43: Dump and restore empty abbrev tables.,
Ken Raeburn <=
- [Emacs-diffs] scratch/raeburn-startup a0ac557 28/43: Clear out doc strings matching DOC file before dumping., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 7764bd73 36/43: * lisp/loadup.el: Load uniquify quietly. Put fewer newlines in dump file., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 6faa843 20/43: Load documentation at startup., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 43dcdd3 25/43: Load cl-macs, needed for cl-labels., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 761346d 34/43: Use CANNOT_DUMP mode., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup dbdfea8 33/43: Don't check for dump-emacs being bound., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 6794f2e 40/43: Make more preloaded files visible to make-docfile., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup cd0966b 42/43: ; admin/notes/big-elc: Notes on this experimental branch., Ken Raeburn, 2017/07/31
- [Emacs-diffs] scratch/raeburn-startup 13f3370 43/43: ; Merge from branch 'master', Ken Raeburn, 2017/07/31