diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 11 | ||||
-rw-r--r-- | lisp/emacs-lisp/loaddefs-gen.el | 15 | ||||
-rw-r--r-- | lisp/emacs-lisp/memory-report.el | 7 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 10 | ||||
-rw-r--r-- | lisp/emacs-lisp/shortdoc.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/vtable.el | 14 |
6 files changed, 46 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 6656b7e57c1..889bffa3f5c 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4204,6 +4204,17 @@ bytecode definition was not changed in the meantime)." ;;; Compiler entry points. +(defun comp-compile-all-trampolines () + "Pre-compile AOT all trampolines." + (let ((comp-running-batch-compilation t) + ;; We want to target only the 'native-lisp' directory. + (native-compile-target-directory + (car (last native-comp-eln-load-path)))) + (mapatoms (lambda (f) + (when (subr-primitive-p (symbol-function f)) + (message "Compiling trampoline for: %s" f) + (comp-trampoline-compile f)))))) + ;;;###autoload (defun comp-lookup-eln (filename) "Given a Lisp source FILENAME return the corresponding .eln file if found. diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 964d23c770e..a1c4f91579e 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -283,6 +283,12 @@ expression, in which case we want to handle forms differently." ,@(when-let ((safe (plist-get props :safe))) `((put ',varname 'safe-local-variable ,safe)))))) + ;; Extract theme properties. + ((eq car 'deftheme) + (let* ((name (car-safe (cdr-safe form))) + (props (nthcdr 3 form))) + `(put ',name 'theme-properties (list ,@props)))) + ((eq car 'defgroup) ;; In Emacs this is normally handled separately by cus-dep.el, but for ;; third party packages, it can be convenient to explicitly autoload @@ -730,7 +736,14 @@ rules for built-in packages and excluded files." ;; updated. (file-newer-than-file-p (expand-file-name "emacs-lisp/loaddefs-gen.el" lisp-directory) - output-file)))) + output-file))) + (let ((lisp-mode-autoload-regexp + "^;;;###\\(\\(noexist\\)-\\)?\\(theme-autoload\\)")) + (loaddefs-generate + (expand-file-name "../etc/themes/" lisp-directory) + (expand-file-name "theme-loaddefs.el" lisp-directory)))) + +;;;###autoload (load "theme-loaddefs.el") (provide 'loaddefs-gen) diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el index 56b1ea6ed48..968a80b59e7 100644 --- a/lisp/emacs-lisp/memory-report.el +++ b/lisp/emacs-lisp/memory-report.el @@ -262,12 +262,7 @@ by counted more than once." (cl-struct-slot-info struct-type))))) (defun memory-report--format (bytes) - (setq bytes (/ bytes 1024.0)) - (let ((units '("KiB" "MiB" "GiB" "TiB"))) - (while (>= bytes 1024) - (setq bytes (/ bytes 1024.0)) - (setq units (cdr units))) - (format "%6.1f %s" bytes (car units)))) + (format "%10s" (file-size-human-readable bytes 'iec " "))) (defun memory-report--gc-elem (elems type) (* (nth 1 (assq type elems)) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 106b7d5a8de..92f15337671 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -975,7 +975,7 @@ untar into a directory named DIR; otherwise, signal an error." (or (string-match regexp name) ;; Tarballs created by some utilities don't list ;; directories with a trailing slash (Bug#13136). - (and (string-equal dir name) + (and (string-equal (expand-file-name dir) name) (eq (tar-header-link-type tar-data) 5)) (error "Package does not untar cleanly into directory %s/" dir))))) (tar-untar-buffer)) @@ -1240,8 +1240,12 @@ Return the pkg-desc, with desc-kind set to KIND." "Find package information for a tar file. The return result is a `package-desc'." (cl-assert (derived-mode-p 'tar-mode)) - (let* ((dir-name (file-name-directory - (tar-header-name (car tar-parse-info)))) + (let* ((dir-name (named-let loop + ((filename (tar-header-name (car tar-parse-info)))) + (let ((dirname (file-name-directory filename))) + ;; The first file can be in a subdir: look for the top. + (if dirname (loop (directory-file-name dirname)) + (file-name-as-directory filename))))) (desc-file (package--description-file dir-name)) (tar-desc (tar-get-file-descriptor (concat dir-name desc-file)))) (unless tar-desc diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 4cfd658e10d..dbac03432c1 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -897,6 +897,8 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), :eval (seq-drop-while #'numberp '(1 2 c d 5))) (seq-filter :eval (seq-filter #'numberp '(a b 3 4 f 6))) + (seq-keep + :eval (seq-keep #'cl-digit-char-p '(?6 ?a ?7))) (seq-remove :eval (seq-remove #'numberp '(1 2 c d 5))) (seq-remove-at-position diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el index 9bdf90bf1d6..de8503a1cb1 100644 --- a/lisp/emacs-lisp/vtable.el +++ b/lisp/emacs-lisp/vtable.el @@ -353,6 +353,11 @@ This also updates the displayed table." (let* ((cache (vtable--cache table)) (inhibit-read-only t) (keymap (get-text-property (point) 'keymap)) + (ellipsis (if (vtable-ellipsis table) + (propertize (truncate-string-ellipsis) + 'face (vtable-face table)) + "")) + (ellipsis-width (string-pixel-width ellipsis)) (elem (and after-object (assq after-object (car cache)))) (line (cons object (vtable--compute-cached-line table object)))) @@ -370,7 +375,8 @@ This also updates the displayed table." ;; FIXME: We have to adjust colors in lines below this if we ;; have :row-colors. (vtable--insert-line table line 0 - (nth 1 cache) (vtable--spacer table)) + (nth 1 cache) (vtable--spacer table) + ellipsis ellipsis-width) (add-text-properties start (point) (list 'keymap keymap 'vtable table))) ;; We may have inserted a non-numerical value into a previously @@ -516,7 +522,8 @@ This also updates the displayed table." (if (> (nth 1 elem) (elt widths index)) (concat (vtable--limit-string - pre-computed (- (elt widths index) ellipsis-width)) + pre-computed (- (elt widths index) + (or ellipsis-width 0))) ellipsis) pre-computed)) ;; Recompute widths. @@ -524,7 +531,8 @@ This also updates the displayed table." (if (> (string-pixel-width value) (elt widths index)) (concat (vtable--limit-string - value (- (elt widths index) ellipsis-width)) + value (- (elt widths index) + (or ellipsis-width 0))) ellipsis) value)))) (start (point)) |