commit 244499292e0c5e0f210435f3949963e54f4dc4db (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Wed Apr 28 10:05:53 2021 +0200 Improve add-log-current-defun-header-regexp * lisp/vc/add-log.el (add-log-current-defun-header-regexp): Allow digits. Require at least one letter. (Bug#48037) diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 6b38806651..2e20284951 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -1194,7 +1194,7 @@ file were isearch was started." (forward-paragraph n))) (defcustom add-log-current-defun-header-regexp - "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]" + "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alnum:]]*[[:alpha:]][-_[:alnum:]]*\\)[ \t]*[:=]" "Heuristic regexp used by `add-log-current-defun' for unknown major modes. The regexp's first submatch is placed in the ChangeLog entry, in parentheses." commit a9fc30e6c2ea67d7a2faa5c218af5bcae9f31246 Author: Peter Oliver Date: Wed Apr 28 05:18:40 2021 +0300 Add tests * test/lisp/progmodes/ruby-mode-tests.el (ruby-with-temp-file): New helper. (ruby--set-encoding-when-ascii, ruby--set-encoding-when-utf8) (ruby--set-encoding-when-latin-15): Tests for the previous commit (bug#48043). diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 42a011c8bc..e2ea0d9137 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -32,6 +32,13 @@ (ruby-mode) ,@body)) +(defmacro ruby-with-temp-file (contents &rest body) + `(ruby-with-temp-buffer ,contents + (set-visited-file-name "ruby-mode-tests") + ,@body + (set-buffer-modified-p nil) + (delete-file buffer-file-name))) + (defun ruby-should-indent (content column) "Assert indentation COLUMN on the last line of CONTENT." (ruby-with-temp-buffer content @@ -844,6 +851,30 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby--insert-coding-comment "utf-8") (should (string= "# encoding: utf-8\n\n" (buffer-string)))))) +(ert-deftest ruby--set-encoding-when-ascii () + (ruby-with-temp-file "ascii" + (let ((ruby-encoding-magic-comment-style 'ruby) + (ruby-insert-encoding-magic-comment t)) + (setq save-buffer-coding-system 'us-ascii) + (ruby-mode-set-encoding) + (should (string= "ascii" (buffer-string)))))) + +(ert-deftest ruby--set-encoding-when-utf8 () + (ruby-with-temp-file "💎" + (let ((ruby-encoding-magic-comment-style 'ruby) + (ruby-insert-encoding-magic-comment t)) + (setq save-buffer-coding-system 'utf-8) + (ruby-mode-set-encoding) + (should (string= "💎" (buffer-string)))))) + +(ert-deftest ruby--set-encoding-when-latin-15 () + (ruby-with-temp-file "Ⓡ" + (let ((ruby-encoding-magic-comment-style 'ruby) + (ruby-insert-encoding-magic-comment t)) + (setq save-buffer-coding-system 'iso-8859-15) + (ruby-mode-set-encoding) + (should (string= "# coding: iso-8859-15\nⓇ" (buffer-string)))))) + (ert-deftest ruby--indent/converted-from-manual-test () :tags '(:expensive-test) ;; Converted from manual test. commit 6a078097c98902b3d90ec614a8f96d027203c812 Author: Dmitry Gutov Date: Wed Apr 28 05:11:36 2021 +0300 Don't add magic comment to Ruby files for utf-8 encoding * lisp/progmodes/ruby-mode.el (ruby-encoding-map): Add entry for utf-8 (bug#48043). (ruby--detect-encoding): Don't convert to string too early, so that returning nil is meaningful. (ruby-mode-set-encoding): Convert to string here. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 84ac8fdb28..35772827ce 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -291,6 +291,7 @@ Only has effect when `ruby-use-smie' is nil." (defcustom ruby-encoding-map '((us-ascii . nil) ;; Do not put coding: us-ascii + (utf-8 . nil) ;; Default since Ruby 2.0 (shift-jis . cp932) ;; Emacs charset name of Shift_JIS (shift_jis . cp932) ;; MIME charset name of Shift_JIS (japanese-cp932 . cp932)) ;; Emacs charset name of CP932 @@ -760,7 +761,7 @@ The style of the comment is controlled by `ruby-encoding-magic-comment-style'." (defun ruby--detect-encoding () (if (eq ruby-insert-encoding-magic-comment 'always-utf8) - "utf-8" + 'utf-8 (let ((coding-system (or save-buffer-coding-system buffer-file-coding-system))) @@ -769,12 +770,11 @@ The style of the comment is controlled by `ruby-encoding-magic-comment-style'." (or (coding-system-get coding-system 'mime-charset) (coding-system-change-eol-conversion coding-system nil)))) (if coding-system - (symbol-name - (if ruby-use-encoding-map - (let ((elt (assq coding-system ruby-encoding-map))) - (if elt (cdr elt) coding-system)) - coding-system)) - "ascii-8bit")))) + (if ruby-use-encoding-map + (let ((elt (assq coding-system ruby-encoding-map))) + (if elt (cdr elt) coding-system)) + coding-system) + 'ascii-8bit)))) (defun ruby--encoding-comment-required-p () (or (eq ruby-insert-encoding-magic-comment 'always-utf8) @@ -796,7 +796,7 @@ The style of the comment is controlled by `ruby-encoding-magic-comment-style'." (unless (string= (match-string 2) coding-system) (goto-char (match-beginning 2)) (delete-region (point) (match-end 2)) - (insert coding-system))) + (insert (symbol-name coding-system)))) ((looking-at "\\s *#.*coding\\s *[:=]")) (t (when ruby-insert-encoding-magic-comment (ruby--insert-coding-comment coding-system)))) commit c62262736ca9fd5a012565fb5ab50e2dd4ff6a4b Author: Andrea Corallo Date: Tue Apr 27 23:10:05 2021 +0200 * Clean-up temporary eln test-suite directory when exiting (bug#48060) * lisp/startup.el (normal-top-level): Remove eln test-suite temp dir when exiting. diff --git a/lisp/startup.el b/lisp/startup.el index a21372a046..3513ab7c4e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -550,7 +550,9 @@ It is the default value of the variable `top-level'." ;; testsuite, add a temporary folder in front to produce there ;; new compilations. (when (equal (getenv "HOME") "/nonexistent") - (push (make-temp-file "emacs-testsuite-" t) comp-eln-load-path))) + (let ((tmp-dir (make-temp-file "emacs-testsuite-" t))) + (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) + (push tmp-dir comp-eln-load-path)))) ;; Look in each dir in load-path for a subdirs.el file. If we ;; find one, load it, which will add the appropriate subdirs of ;; that dir into load-path. This needs to be done before setting commit 4e1e0b9decfa2c8cb90b91d619ca078412513ba5 Author: Andrea Corallo Date: Tue Apr 27 22:43:12 2021 +0200 Have `comp-cstr-intersection-no-mem' intersect pos neg value sets * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem): intersect pos and neg value sets * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Add two tests and fix some test number. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 2a50ceb194..73b78a3672 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -790,7 +790,9 @@ Non memoized version of `comp-cstr-intersection-no-mem'." (setf (range pos) (comp-range-intersection (range pos) - (comp-range-negation (range neg)))) + (comp-range-negation (range neg))) + (valset pos) + (cl-set-difference (valset pos) (valset neg))) ;; Return a non negated form. (setf (typeset dst) (typeset pos) diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el index 2e4628522f..59e1b6982e 100644 --- a/test/lisp/emacs-lisp/comp-cstr-tests.el +++ b/test/lisp/emacs-lisp/comp-cstr-tests.el @@ -198,22 +198,26 @@ ((and (or symbol string) (or number marker)) . nil) ;; 78 ((and t t) . t) - ;; 80 + ;; 79 ((and (or marker number) (integer 0 0)) . (integer 0 0)) - ;; 81 + ;; 80 ((and t (not t)) . nil) - ;; 82 + ;; 81 ((or (integer 1 1) (not (integer 1 1))) . t) - ;; 83 + ;; 82 ((not t) . nil) - ;; 84 + ;; 83 ((not nil) . t) - ;; 85 + ;; 84 ((or (not string) t) . t) - ;; 86 + ;; 85 ((or (not vector) sequence) . sequence) + ;; 86 + ((or (not symbol) null) . t) ;; 87 - ((or (not symbol) null) . t)) + ((and (or null integer) (not (or null integer))) . nil) + ;; 88 + ((and (or (member a b c)) (not (or (member a b)))) . (member c))) "Alist type specifier -> expected type specifier.")) (defmacro comp-cstr-synthesize-tests () commit 2ab8d1ee3bd14a388ba3c3391257c337ad39c719 Author: Stefan Kangas Date: Tue Apr 27 22:53:04 2021 +0200 Avoid missing whitespace in help-for-help * lisp/help.el (help--for-help-make-commands): Avoid missing whitespace before description of command. Problem reported by Dmitry Gutov . diff --git a/lisp/help.el b/lisp/help.el index 63f9974ef6..85312a411a 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -210,6 +210,7 @@ Do not call this in the scope of `with-help-window'." ;; "RET" so we can't use it here. (propertize name 'face 'help-key-binding) (concat "\\[" name "]")) + " " ; ensure we have some whitespace before the description (propertize "\t" 'display '(space :align-to 8)) desc)) "")) commit 1ee62ac5bd943f7f2803e66d63ccf78113d31fa0 Author: Michael Albinus Date: Tue Apr 27 20:56:07 2021 +0200 Fix loading problem in Tramp * lisp/net/tramp.el (tramp-autoload-file-name-handler): Load also tramp-compat.el. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index dc34b8f024..88af9afd98 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2564,8 +2564,11 @@ Falls back to normal file name handler if no Tramp file name handler exists." (tramp-unload-file-name-handlers) (when tramp-mode ;; We cannot use `tramp-compat-temporary-file-directory' here due - ;; to autoload. + ;; to autoload. When installing Tramp's GNU ELPA package, there + ;; might be an older, incompatible version active. We try to + ;; overload this. (let ((default-directory temporary-file-directory)) + (load "tramp-compat" 'noerror 'nomessage) (load "tramp" 'noerror 'nomessage))) (apply operation args))) commit 7e25e0f96bb6facf21405e0b5c078d46cbef75f7 Author: Eli Zaretskii Date: Tue Apr 27 21:51:57 2021 +0300 ; * src/comp.c: Fix typos. diff --git a/src/comp.c b/src/comp.c index c2da5b2ebf..a4dba435b4 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4716,7 +4716,7 @@ maybe_defer_native_compilation (Lisp_Object function_name, return; } - /* This is to have deferred compilation able to compile comp + /* This is so deferred compilation is able to compile comp dependencies breaking circularity. */ if (!NILP (Ffeaturep (Qcomp, Qnil))) { @@ -4949,7 +4949,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump, /* In case another load of the same CU is active on the stack all ephemeral data is hold by that frame. Re-writing 'data_ephemeral_vec' would be not only a waste of cycles but - more importantly would lead to crashed if the contained data + more importantly would lead to crashes if the contained data is not cons hashed. */ if (!recursive_load) { commit 233c0af31e2c018043bd9abfa5acbeafbb535a94 Author: Stefan Kangas Date: Tue Apr 27 18:54:37 2021 +0200 ; Fix typos diff --git a/src/comp.c b/src/comp.c index 5309be46de..c2da5b2ebf 100644 --- a/src/comp.c +++ b/src/comp.c @@ -1,4 +1,4 @@ -/* Compile elisp into native code. +/* Compile Emacs Lisp into native code. Copyright (C) 2019-2021 Free Software Foundation, Inc. Author: Andrea Corallo @@ -4716,7 +4716,7 @@ maybe_defer_native_compilation (Lisp_Object function_name, return; } - /* This is to have deferred compilaiton able to compile comp + /* This is to have deferred compilation able to compile comp dependencies breaking circularity. */ if (!NILP (Ffeaturep (Qcomp, Qnil))) { @@ -4949,7 +4949,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump, /* In case another load of the same CU is active on the stack all ephemeral data is hold by that frame. Re-writing 'data_ephemeral_vec' would be not only a waste of cycles but - more importanly would lead to crashed if the contained data + more importantly would lead to crashed if the contained data is not cons hashed. */ if (!recursive_load) { diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index a1893fde5c..ba8b8b0093 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -293,7 +293,7 @@ Check that the resulting binaries do not differ." (comp-tests-throw-f 3))))) (comp-deftest gc () - "Try to do some longer computation to let the gc kick in." + "Try to do some longer computation to let the GC kick in." (dotimes (_ 100000) (comp-tests-cons-cdr-f 3)) (should (= (comp-tests-cons-cdr-f 3) 3))) @@ -317,7 +317,7 @@ Check that the resulting binaries do not differ." (should (string= (comp-tests-string-trim-f "dsaf ") "dsaf"))) (comp-deftest trampoline-removal () - ;; This tests that we can can call primitives with no dedicated bytecode. + ;; This tests that we can call primitives with no dedicated bytecode. ;; At speed >= 2 the trampoline will not be used. (should (hash-table-p (comp-tests-trampoline-removal-f)))) @@ -399,7 +399,7 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (string= " ➊" (comp-test-45342-f 1)))) (comp-deftest assume-double-neg () - "In fwprop assumtions (not (not (member x))) /= (member x)." + "In fwprop assumptions (not (not (member x))) /= (member x)." (should-not (comp-test-assume-double-neg-f "bar" "foo"))) (comp-deftest assume-in-loop-1 () @@ -416,7 +416,7 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (defvar comp-test-primitive-advice) (comp-deftest primitive-advice () - "Test effectiveness of primitive advicing." + "Test effectiveness of primitive advising." (let (comp-test-primitive-advice (f (lambda (&rest args) (setq comp-test-primitive-advice args)))) commit d8e037eeaa7eef26349bc0fb3fa00e10a5c4b894 Author: Daniel Mendler Date: Tue Apr 27 19:44:41 2021 +0300 (affixation-function): Allow only three-element list elements Restrict the definition of the `affixation-function`. The function must return a list of three element lists. Since the `affixation-function` is part of the widely used `completing-read` API a simplification is helpful for both authors of completion UIs and authors of completion tables. * doc/lispref/minibuf.texi: Update documentation. * lisp/minibuffer.el: Update documentation. * lisp/simple.el (read-extended-command--affixation): Return three-element lists. https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg01193.html diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 72f0e5878b..bc8868b58d 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1819,12 +1819,10 @@ default to that string. @item :affixation-function The value should be a function to add prefixes and suffixes to completions. This function must accept one argument, a list of -completions, and should return such a list of completions where -each element contains a list of three elements: a completion, -a prefix string, and a suffix string. When this function -returns a list of two elements, it is interpreted as a list -of a completion and a suffix string like in @code{:annotation-function}. -This function takes priority over @code{:annotation-function}. +completions, and should return a list of annotated completions. Each +element of the returned list must be a three-element list, the +completion, a prefix string, and a suffix string. This function takes +priority over @code{:annotation-function}. @item :exit-function The value should be a function to run after performing completion. @@ -1942,10 +1940,8 @@ completions. The function should take one argument, return such a list of @var{completions} where each element contains a list of three elements: a completion, a prefix which is displayed before the completion string in the @file{*Completions*} buffer, and -a suffix displayed after the completion string. When this function -returns a list of two elements, it is interpreted as a list of -a completion and a suffix string like in @code{annotation-function}. -This function takes priority over @code{annotation-function}. +a suffix displayed after the completion string. This function +takes priority over @code{annotation-function}. @item display-sort-function The value should be a function for sorting completions. The function diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 98691c2ede..2400624953 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -122,10 +122,10 @@ This metadata is an alist. Currently understood keys are: returns a string to append to STRING. - `affixation-function': function to prepend/append a prefix/suffix to entries. Takes one argument (COMPLETIONS) and should return a list - of completions with a list of either two elements: completion - and suffix, or three elements: completion, its prefix - and suffix. This function takes priority over `annotation-function' - when both are provided, so only this function is used. + of annotated completions. The elements of the list must be + three-element lists: completion, its prefix and suffix. This + function takes priority over `annotation-function' when both are + provided, so only this function is used. - `display-sort-function': function to sort entries in *Completions*. Takes one argument (COMPLETIONS) and should return a new list of completions. Can operate destructively. @@ -1972,11 +1972,11 @@ These include: `:affixation-function': Function to prepend/append a prefix/suffix to completions. The function must accept one argument, a list of - completions, and return a list where each element is a list of - either two elements: a completion, and a suffix, or - three elements: a completion, a prefix and a suffix. - This function takes priority over `:annotation-function' - when both are provided, so only this function is used. + completions, and return a list of annotated completions. The + elements of the list must be three-element lists: completion, its + prefix and suffix. This function takes priority over + `:annotation-function' when both are provided, so only this + function is used. `:exit-function': Function to run after completion is performed. diff --git a/lisp/simple.el b/lisp/simple.el index 999755a642..26eb8cad7f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2080,8 +2080,11 @@ or (if one of MODES is a minor mode), if it is switched on in BUFFER." (obsolete (format " (%s)" (car obsolete))) ((and binding (not (stringp binding))) - (format " (%s)" (key-description binding)))))) - (if suffix (list command-name suffix) command-name))) + (format " (%s)" (key-description binding))) + (t "")))) + (put-text-property 0 (length suffix) + 'face 'completions-annotations suffix) + (list command-name "" suffix))) command-names))) (defcustom suggest-key-bindings t commit 7133a67dcdb68fc16d71c3d45323baba8ac5afe9 Author: Mattias Engdegård Date: Tue Apr 27 17:36:15 2021 +0200 Calc: control digits after decimal point (bug#47302) Calc normally displays a trailing decimal point for floats with no fractional part, like '12.'. Some uses require at least one digit after the point; add the governing variable calc-digit-after-point. * lisp/calc/calc.el (calc-digit-after-point): New variable. (math-format-number): Use it. * test/lisp/calc/calc-tests.el (calc-display-digit-after-point): New test. diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ec09abb34c..1e7d5e7766 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -483,6 +483,11 @@ current precision are displayed in scientific notation in calc-mode.") "Floating-point numbers with this negative exponent or lower are displayed scientific notation in calc-mode.") +(defvar calc-digit-after-point nil + "If t, display at least one digit after the decimal point, as in `12.0'. +If nil, the decimal point may come last in a number, as in `12.'. +This setting only applies to floats in normal display mode.") + (defvar calc-other-modes nil "List of used-defined strings to append to Calculator mode line.") @@ -3184,7 +3189,8 @@ the United States." exp (- exp adj))))) (setq str (int-to-string mant)) (let* ((len (length str)) - (dpos (+ exp len))) + (dpos (+ exp len)) + (trailing-0 (and calc-digit-after-point "0"))) (if (and (eq fmt 'float) (<= dpos (+ calc-internal-prec calc-display-sci-high)) (>= dpos (+ calc-display-sci-low 2))) @@ -3194,9 +3200,11 @@ the United States." (setq str (concat "0" point str))) ((and (<= exp 0) (> dpos 0)) (setq str (concat (substring str 0 dpos) point - (substring str dpos)))) + (substring str dpos) + (and (>= dpos len) trailing-0)))) ((> exp 0) - (setq str (concat str (make-string exp ?0) point))) + (setq str (concat str (make-string exp ?0) + point trailing-0))) (t ; (< dpos 0) (setq str (concat "0" point (make-string (- dpos) ?0) str)))) diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index c5aa5a31eb..13dd228d3b 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -191,6 +191,33 @@ An existing calc stack is reused, otherwise a new one is created." (let ((calc-number-radix 36)) (should (equal (math-format-number 12345678901) "36#5,O6A,QT1"))))) +(ert-deftest calc-digit-after-point () + "Test display of trailing 0 after decimal point (bug#47302)." + (let ((calc-digit-after-point nil)) + ;; Integral floats have no digits after the decimal point (default). + (should (equal (math-format-number '(float 0 0)) "0.")) + (should (equal (math-format-number '(float 5 0)) "5.")) + (should (equal (math-format-number '(float 3 1)) "30.")) + (should (equal (math-format-number '(float 23 0)) "23.")) + (should (equal (math-format-number '(float 123 0)) "123.")) + (should (equal (math-format-number '(float 1 -1)) "0.1")) + (should (equal (math-format-number '(float 54 -1)) "5.4")) + (should (equal (math-format-number '(float 1 -4)) "1e-4")) + (should (equal (math-format-number '(float 1 14)) "1e14")) + (should (equal (math-format-number 12) "12"))) + (let ((calc-digit-after-point t)) + ;; Integral floats have at least one digit after the decimal point. + (should (equal (math-format-number '(float 0 0)) "0.0")) + (should (equal (math-format-number '(float 5 0)) "5.0")) + (should (equal (math-format-number '(float 3 1)) "30.0")) + (should (equal (math-format-number '(float 23 0)) "23.0")) + (should (equal (math-format-number '(float 123 0)) "123.0")) + (should (equal (math-format-number '(float 1 -1)) "0.1")) + (should (equal (math-format-number '(float 54 -1)) "5.4")) + (should (equal (math-format-number '(float 1 -4)) "1e-4")) + (should (equal (math-format-number '(float 1 14)) "1e14")) + (should (equal (math-format-number 12) "12")))) + (ert-deftest calc-calendar () "Test calendar conversions (bug#36822)." (should (equal (calcFunc-julian (math-parse-date "2019-07-27")) 2458692)) commit d55d5358b27dee15ebbd998131d22b221f5f4964 Author: Stefan Kangas Date: Tue Apr 27 14:17:44 2021 +0200 ; * lisp/emacs-lisp/comp.el: Fix typos. Add LocalWords. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 5b2dbe1ffe..0ebaccbe4a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -162,7 +162,7 @@ if `confirm-kill-processes' is non-nil." :version "28.1") (defcustom comp-native-driver-options nil - "Options passed verbatim to the native compiler's backend driver. + "Options passed verbatim to the native compiler's back-end driver. Note that not all options are meaningful; typically only the options affecting the assembler and linker are likely to be useful. @@ -189,7 +189,8 @@ compilation mechanism." "Non-nil to prevent native-compiling of Emacs Lisp code. Note that when `no-byte-compile' is set to non-nil it overrides the value of `no-native-compile'. -This is normally set in local file variables at the end of the elisp file: +This is normally set in local file variables at the end of the +Emacs Lisp file: \;; Local Variables:\n;; no-native-compile: t\n;; End:") ;;;###autoload(put 'no-native-compile 'safe-local-variable 'booleanp) @@ -236,7 +237,7 @@ Can be one of: 'd-default', 'd-impure' or 'd-ephemeral'. See `comp-ctxt'.") (defvar comp-disabled-passes '() "List of disabled passes. -For internal use only by the testsuite.") +For internal use by the test suite only.") (defvar comp-post-pass-hooks '() "Alist whose elements are of the form (PASS FUNCTIONS...). @@ -248,7 +249,7 @@ Useful to hook into pass checkers.") `( ;; Functions we can trust not to be or if redefined should expose ;; the same type. Vast majority of these is either pure or - ;; pritive, the original list is the union of pure + + ;; primitive, the original list is the union of pure + ;; side-effect-free-fns + side-effect-and-error-free-fns: (% (function ((or number marker) (or number marker)) number)) (* (function (&rest (or number marker)) number)) @@ -639,7 +640,7 @@ Useful to hook into pass checkers.") ,@comp-limple-assignments ,@comp-limple-branches return) - "All limple operators.") + "All Limple operators.") (defvar comp-func nil "Bound to the current function by most passes.") @@ -925,7 +926,7 @@ CFG is mutated by a pass.") (defun comp-mvar-type-hint-match-p (mvar type-hint) "Match MVAR against TYPE-HINT. -In use by the backend." +In use by the back-end." (cl-ecase type-hint (cons (comp-cstr-cons-p mvar)) (fixnum (comp-cstr-fixnum-p mvar)))) @@ -1225,7 +1226,7 @@ clashes." 'pure)))) (when (byte-code-function-p f) (signal 'native-compiler-error - "can't native compile an already bytecompiled function")) + "can't native compile an already byte-compiled function")) (setf (comp-func-byte-func func) (byte-compile (comp-func-name func))) (let ((lap (byte-to-native-lambda-lap @@ -1310,7 +1311,7 @@ clashes." (comp-func-speed func) (comp-spill-speed name) (comp-func-pure func) (comp-spill-decl-spec name 'pure)) - ;; Store the c-name to have it retrivable from + ;; Store the c-name to have it retrievable from ;; `comp-ctxt-top-level-forms'. (when top-l-form (setf (byte-to-native-func-def-c-name top-l-form) c-name)) @@ -1501,7 +1502,7 @@ If SSA is non-nil, populate it with m-var in ssa form." (push insn (comp-block-insns bb)))) (defun comp-emit-set-call (call) - "Emit CALL assigning the result the the current slot frame. + "Emit CALL assigning the result to the current slot frame. If the callee function is known to have a return type, propagate it." (cl-assert call) (comp-emit (list 'set (comp-slot) call))) @@ -1655,7 +1656,7 @@ Return value is the fall-through block name." finally return t)) (defun comp-emit-switch (var last-insn) - "Emit a limple for a lap jump table given VAR and LAST-INSN." + "Emit a Limple for a lap jump table given VAR and LAST-INSN." ;; FIXME this not efficient for big jump tables. We should have a second ;; strategy for this case. (pcase last-insn @@ -1706,7 +1707,7 @@ SP-DELTA is the stack adjustment." (minarg (car arity)) (maxarg (cdr arity))) (when (eq maxarg 'unevalled) - (signal 'native-ice (list "subr contains unevalled args" subr-name))) + (signal 'native-ice (list "subr contains unevalled args" subr-name))) (if (eq maxarg 'many) ;; callref case. (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) @@ -2026,7 +2027,7 @@ and the annotation emission." (make-comp-mvar :constant (comp-func-d-lambda-list function))))) (cl-defgeneric comp-emit-for-top-level (form for-late-load) - "Emit the limple code for top level FORM.") + "Emit the Limple code for top level FORM.") (cl-defmethod comp-emit-for-top-level ((form byte-to-native-func-def) for-late-load) @@ -2102,7 +2103,7 @@ These are stored in the reloc data array." (make-comp-mvar :slot 0))))) (defun comp-limplify-top-level (for-late-load) - "Create a limple function to modify the global environment at load. + "Create a Limple function to modify the global environment at load. When FOR-LATE-LOAD is non-nil, the emitted function modifies only function definition. @@ -2606,7 +2607,7 @@ blocks." (maphash (lambda (_ f) (when (and (>= (comp-func-speed f) 1) ;; No point to run this on dynamic scope as - ;; this pass is effecive only on local + ;; this pass is effective only on local ;; variables. (comp-func-l-p f) (not (comp-func-has-non-local f))) @@ -3013,8 +3014,8 @@ Return t when one or more block was removed, nil otherwise." ;; possible. (defconst comp-fwprop-max-insns-scan 4500 - ;; Choosen as ~ the greatest required value for full convergence - ;; native compiling all Emacs codebase. + ;; Chosen as ~ the greatest required value for full convergence + ;; native compiling all Emacs code-base. "Max number of scanned insn before giving-up.") (defun comp-copy-insn (insn) @@ -3053,7 +3054,7 @@ Return t when one or more block was removed, nil otherwise." (defun comp-fwprop-prologue () "Prologue for the propagate pass. Here goes everything that can be done not iteratively (read once). -Forward propagate immediate involed in assignments." +Forward propagate immediate involed in assignments." ; FIXME: Typo. Involved or invoked? (cl-loop for b being each hash-value of (comp-func-blocks comp-func) do (cl-loop @@ -3116,7 +3117,7 @@ Fold the call in case." (when-let ((cstr-f (gethash f comp-known-func-cstr-h))) (let ((cstr (comp-cstr-f-ret cstr-f))) (when (comp-cstr-empty-p cstr) - ;; Store it to be rewrittein as non local exit. + ;; Store it to be rewritten as non local exit. (setf (comp-block-lap-non-ret-insn comp-block) insn)) (setf (comp-mvar-range lval) (comp-cstr-range cstr) (comp-mvar-valset lval) (comp-cstr-valset cstr) @@ -3191,7 +3192,7 @@ Return t if something was changed." with comp-block = b for insn in (comp-block-insns b) for orig-insn = (unless modified - ;; Save consing after 1th change. + ;; Save consing after 1st change. (comp-copy-insn insn)) do (comp-fwprop-insn insn) @@ -3791,7 +3792,7 @@ sharing the original source filename (including FILE)." for f in (when (file-exists-p dir) (directory-files dir t regexp t)) ;; We may not be able to delete the file if we have no write - ;; permisison. + ;; permission. do (ignore-error file-error (comp-delete-or-replace-file f)))))) @@ -3828,7 +3829,7 @@ session." (rename-file newfile oldfile))))) (defvar comp-files-queue () - "List of Elisp files to be compiled.") + "List of Emacs Lisp files to be compiled.") (defvar comp-async-compilations (make-hash-table :test #'equal) "Hash table file-name -> async compilation process.") @@ -4204,4 +4205,6 @@ of (commands) to run simultaneously." (provide 'comp) +;; LocalWords: limplified limplified limplification limplify Limple LIMPLE libgccjit elc eln + ;;; comp.el ends here commit 6fb80c9ad80bfc0db18285d6e23c3ee08e2aa657 Author: Michael Albinus Date: Tue Apr 27 12:28:02 2021 +0200 ; * test/infra/gitlab-ci.yml: Add local variable. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 1da91a39bd..4023437e59 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -296,3 +296,7 @@ test-all-inotify: variables: target: emacs-inotify make_params: check-expensive + +# Local Variables: +# add-log-current-defun-header-regexp: "^\\([-_.[:alnum:]]+\\)[ \t]*:" +# End: