]> code.delx.au - gnu-emacs/blobdiff - lisp/loadup.el
Dired recognize dirs when file size in human units
[gnu-emacs] / lisp / loadup.el
index 53fc2215a903528365a52456684d4fde483a5799..5c16464282b6b5dc188bc1ad4e6997d89783b8ea 100644 (file)
                            (expand-file-name "textmodes" dir)
                            (expand-file-name "vc" dir)))))
 
-;; Prevent build-time PATH getting stored in the binary.
-;; Mainly cosmetic, but helpful for Guix.  (Bug#20330)
-(setq exec-path nil)
-
 (if (eq t purify-flag)
     ;; Hash consing saved around 11% of pure space in my tests.
     (setq purify-flag (make-hash-table :test 'equal :size 80000)))
   ;; In case loaddefs hasn't been generated yet.
   (file-error (load "ldefs-boot.el")))
 
+(let ((new (make-hash-table :test 'equal)))
+  ;; Now that loaddefs has populated definition-prefixes, purify its contents.
+  (maphash (lambda (k v) (puthash (purecopy k) (purecopy v) new))
+           definition-prefixes)
+  (setq definition-prefixes new))
+
 (load "emacs-lisp/nadvice")
 (load "emacs-lisp/cl-preloaded")
 (load "minibuffer")            ;After loaddefs, for define-minor-mode.
@@ -425,6 +427,12 @@ lost after dumping")))
     (message "Pure-hashed: %d strings, %d vectors, %d conses, %d bytecodes, %d others"
              strings vectors conses bytecodes others)))
 
+;; Prevent build-time PATH getting stored in the binary.
+;; Mainly cosmetic, but helpful for Guix.  (Bug#20330)
+;; Do this here, rather than earlier, so that the above code
+;; can invoke Git commands and the like.
+(setq exec-path nil)
+
 ;; Avoid error if user loads some more libraries now and make sure the
 ;; hash-consing hash table is GC'd.
 (setq purify-flag nil)