commit 797ff44d53ef4c4b800de8467b403c876cac3c1f (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Tue Sep 22 02:33:42 2020 +0200 Fix shellcheck warning * build-aux/update-subdirs: Fix issue indicated by the shellcheck linter (warning SC2046). diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs index 336029fb71..96712f0b32 100755 --- a/build-aux/update-subdirs +++ b/build-aux/update-subdirs @@ -26,7 +26,7 @@ for file in *; do *.elc | *.el | term | RCS | CVS | Old | . | .. | =* | *~ | *.orig | *.rej) ;; *) - if [ -d $file ]; then + if [ -d "$file" ]; then if [ "$file" = "obsolete" ]; then subdirs="$subdirs \"$file\"" else commit 2788557000d91fb2a928286512c0871e64c6d79b Author: Stefan Kangas Date: Tue Sep 22 02:04:15 2020 +0200 Support shellcheck in compilation-mode * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Add shellcheck regexp. * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data): (compile-test-error-regexps): Add test for shellcheck. * etc/compilation.txt: Add shellcheck example. * etc/NEWS: Announce the change. foo diff --git a/etc/NEWS b/etc/NEWS index 6bfe45a683..a4c823072c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -689,6 +689,9 @@ case-insensitive matching of messages when the old behavior is required, but the recommended solution is to use a correctly matching regexp instead. +--- +*** Messages from ShellCheck are now recognized. + --- *** Messages from Visual Studio that mention column numbers are now recognized. diff --git a/etc/compilation.txt b/etc/compilation.txt index 11aefc6bc6..df0b82ebc9 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -536,6 +536,14 @@ cc-1070 cc: WARNING File = linkl.c, Line = 38 cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3 +* ShellCheck + +In autogen.sh line 38: +autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac` +^----------^ SC2034: autoconf_min appears unused. Verify use (or export if used externally). + ^-- SC2006: Use $(...) notation instead of legacy backticked `...`. + + * Sun Ada (VADS, Solaris) symbol: sun-ada diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 7ac5405ab1..06bdd1e98d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -449,6 +449,9 @@ during global destruction\\.$\\)" 1 2) \\([0-9]+\\) of file://\\(.+\\)" 4 2 3 (1)) + (shellcheck + "^In \\(.+\\) line \\([0-9]+\\):" 1 2) + (sparc-pascal-file "^\\w\\w\\w \\w\\w\\w +[0-3]?[0-9] +[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\ [12][09][0-9][0-9] +\\(.*\\):$" diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 819f2e78c2..45eebac036 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -324,6 +324,9 @@ 1 8 71 "/home/reto/test/group.xml") ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" 1 8 4 "/home/reto/test/group.xml") + ;; shellcheck + ("In autogen.sh line 48:" + 1 nil 48 "autogen.sh") ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example ("Thu May 14 10:46:12 1992 mom3.p:" 1 nil nil "mom3.p") @@ -436,7 +439,7 @@ The test data is in `compile-tests--test-regexps-data'." (compilation-num-warnings-found 0) (compilation-num-infos-found 0)) (mapc #'compile--test-error-line compile-tests--test-regexps-data) - (should (eq compilation-num-errors-found 95)) + (should (eq compilation-num-errors-found 96)) (should (eq compilation-num-warnings-found 35)) (should (eq compilation-num-infos-found 28))))) commit c0188959c1ed96481cfba6ad75ad251391049d87 Author: Stefan Kangas Date: Tue Sep 22 00:58:59 2020 +0200 Remove Emacs 23 compat code from cedet * lisp/cedet/ede/proj-elisp.el (project-compile-target): * lisp/cedet/semantic/bovine/grammar.el (bovine-grammar-expand-form): * lisp/cedet/semantic/ede-grammar.el (project-compile-target): Remove Emacs 23 compat code. diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el index a0af4a4ddc..bcd672133d 100644 --- a/lisp/cedet/ede/proj-elisp.el +++ b/lisp/cedet/ede/proj-elisp.el @@ -153,18 +153,9 @@ Bonus: Return a cons cell: (COMPILED . UPTODATE)." (let* ((fsrc (expand-file-name src dir)) (elc (concat (file-name-sans-extension fsrc) ".elc"))) (with-no-warnings - (if (< emacs-major-version 24) - ;; Does not have `byte-recompile-file' - (if (or (not (file-exists-p elc)) - (file-newer-than-file-p fsrc elc)) - (progn - (setq comp (1+ comp)) - (byte-compile-file fsrc)) - (setq utd (1+ utd))) - - (if (eq (byte-recompile-file fsrc nil 0) t) - (setq comp (1+ comp)) - (setq utd (1+ utd))))))) + (if (eq (byte-recompile-file fsrc nil 0) t) + (setq comp (1+ comp)) + (setq utd (1+ utd)))))) (oref obj source)) (message "All Emacs Lisp sources are up to date in %s" (eieio-object-name obj)) diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index 7b835b8509..10afb06532 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -143,8 +143,7 @@ expanded from elsewhere." form (cdr form)) ;; Hack for dealing with new reading of unquotes outside of ;; backquote (introduced in 2010-12-06T16:37:26Z!monnier@iro.umontreal.ca). - (when (and (>= emacs-major-version 24) - (listp first) + (when (and (listp first) (or (equal (car first) '\,) (equal (car first) '\,@))) (if (listp (cadr first)) diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el index 2464833859..d435ff6b6e 100644 --- a/lisp/cedet/semantic/ede-grammar.el +++ b/lisp/cedet/semantic/ede-grammar.el @@ -142,19 +142,10 @@ Lays claim to all -by.el, and -wy.el files." (match-string 1 package))) (src (ede-expand-filename obj fname)) (csrc (concat (file-name-sans-extension src) ".elc"))) - (if (< emacs-major-version 24) - ;; Does not have `byte-recompile-file' - (if (or (not (file-exists-p csrc)) - (file-newer-than-file-p src csrc)) - (progn - (setq comp (1+ comp)) - (byte-compile-file src)) - (setq utd (1+ utd))) - ;; Emacs 24 and newer - (with-no-warnings - (if (eq (byte-recompile-file src nil 0) t) - (setq comp (1+ comp)) - (setq utd (1+ utd)))))))) + (with-no-warnings + (if (eq (byte-recompile-file src nil 0) t) + (setq comp (1+ comp)) + (setq utd (1+ utd))))))) (oref obj source)) (message "All Semantic Grammar sources are up to date in %s" (eieio-object-name obj)) (cons comp utd))) commit e1290f471314c2d9cce9c74429a31303edf88b3f Author: Stefan Kangas Date: Tue Sep 22 00:57:22 2020 +0200 Remove some Emacs 20 compat code * lisp/apropos.el (apropos-local-value): * lisp/progmodes/antlr-mode.el (antlr-mode-menu): * lisp/progmodes/idlwave.el (idlwave-attach-classes): * lisp/textmodes/artist.el (artist-replace-chars): Remove Emacs 20 compat code. diff --git a/lisp/apropos.el b/lisp/apropos.el index 6d8c7847b0..e7e8955afe 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -863,14 +863,12 @@ Optional arg BUFFER (default: current buffer) is the buffer to check." (setq apropos-accumulator (cons (list symb (apropos-score-str var) nil var) apropos-accumulator)))))) (let ((apropos-multi-type nil)) - (if (> emacs-major-version 20) - (apropos-print - nil "\n----------------\n" - (format "Buffer `%s' has the following local variables\nmatching %s`%s':" - (buffer-name buffer) - (if (consp pattern) "keywords " "") - pattern)) - (apropos-print nil "\n----------------\n")))) + (apropos-print + nil "\n----------------\n" + (format "Buffer `%s' has the following local variables\nmatching %s`%s':" + (buffer-name buffer) + (if (consp pattern) "keywords " "") + pattern)))) ;;;###autoload (defun apropos-documentation (pattern &optional do-all) diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 24e1f8831a..29adf3b190 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -720,9 +720,8 @@ imenu." "Major mode menu." `("Antlr" ,@(if (cond-emacs-xemacs - :EMACS (and antlr-options-use-submenus - (>= emacs-major-version 21)) - :XEMACS antlr-options-use-submenus) + :EMACS antlr-options-use-submenus + :XEMACS antlr-options-use-submenus) `(("Insert File Option" :filter ,(lambda (x) (antlr-options-menu-filter 1 x))) ("Insert Grammar Option" diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 90e56943f2..121f5d6304 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -6727,8 +6727,7 @@ accumulate information on matching completions." (not super-classes))) ; no possibilities for inheritance ;; In these cases, we do not have to do anything list - (let* ((do-prop (and (>= show-classes 0) - (>= emacs-major-version 21))) + (let* ((do-prop (>= show-classes 0)) (do-buf (not (= show-classes 0))) (do-dots t) (inherit (if (and (not (eq type 'class-tag)) super-classes) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 9c94fff12c..75b13bd7d8 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1993,25 +1993,11 @@ The replacement is used to convert tabs and new-lines to spaces." (defun artist-replace-chars (new-char count) "Replace characters at point with NEW-CHAR. COUNT chars are replaced." - ;; Check that the variable exists first. The doc says it was added in 19.23. - (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20)) - (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3))) - ;; This is a bug workaround for Emacs 20, versions up to 20.3: - ;; The self-insert-command doesn't care about the overwrite-mode, - ;; so the insertion is done in the same way as in picture mode. - ;; This seems to be a little bit slower. - (let* ((replaced-c (artist-get-replacement-char new-char)) - (replaced-s (make-string count replaced-c))) - (artist-move-to-xy (+ (artist-current-column) count) - (artist-current-line)) - (delete-char (- count)) - (insert replaced-s)) - ;; In emacs-19, the self-insert-command works better - (let ((overwrite-mode 'overwrite-mode-textual) - (fill-column 32765) ; Large :-) - (blink-matching-paren nil)) - (setq last-command-event (artist-get-replacement-char new-char)) - (self-insert-command count)))) + (let ((overwrite-mode 'overwrite-mode-textual) + (fill-column 32765) ; Large :-) + (blink-matching-paren nil)) + (setq last-command-event (artist-get-replacement-char new-char)) + (self-insert-command count))) (defsubst artist-replace-string (string &optional see-thru) "Replace contents at point with STRING. commit 9a3a2a00dac62609ff32caa9c3dbe8c97f4918ef Author: Stefan Kangas Date: Tue Sep 22 00:54:54 2020 +0200 Remove some unnecessary compat code * test/lisp/emacs-lisp/ert-x-tests.el (ert-test-describe-test): * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01): Remove unnecessary compat code; these tests should never need to run on older versions of Emacs. diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el index b760f8c786..f342bff047 100644 --- a/test/lisp/emacs-lisp/ert-x-tests.el +++ b/test/lisp/emacs-lisp/ert-x-tests.el @@ -187,18 +187,15 @@ "Tests `ert-describe-test'." (save-window-excursion (ert-with-buffer-renamed ("*Help*") - (if (< emacs-major-version 24) - (should (equal (should-error (ert-describe-test 'ert-describe-test)) - '(error "Requires Emacs 24"))) - (ert-describe-test 'ert-test-describe-test) - (with-current-buffer "*Help*" - (let ((case-fold-search nil)) - (should (string-match (concat - "\\`ert-test-describe-test is a test" - " defined in" - " ['`‘]ert-x-tests.elc?['’]\\.\n\n" - "Tests ['`‘]ert-describe-test['’]\\.\n\\'") - (buffer-string))))))))) + (ert-describe-test 'ert-test-describe-test) + (with-current-buffer "*Help*" + (let ((case-fold-search nil)) + (should (string-match (concat + "\\`ert-test-describe-test is a test" + " defined in" + " ['`‘]ert-x-tests.elc?['’]\\.\n\n" + "Tests ['`‘]ert-describe-test['’]\\.\n\\'") + (buffer-string)))))))) (ert-deftest ert-test-message-log-truncation () :tags '(:causes-redisplay) diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index 96e88f62fe..b89e8c876e 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el @@ -106,7 +106,6 @@ only the name before the link arrow." "Test editing a file name without saving the change. Finding the new name should be possible while still in wdired-mode." - :expected-result (if (< emacs-major-version 27) :failed :passed) (let* ((test-dir (make-temp-file "test-dir-" t)) (test-file (concat (file-name-as-directory test-dir) "foo.c")) (replace "bar") commit 83b0fc4429e4743a14dc914a09217923d35591bf Author: Stefan Kangas Date: Tue Sep 22 00:35:05 2020 +0200 Fix thinko in dired-change-marks * lisp/dired.el (dired-change-marks): Fix my previous broken attempt to declare advertised-calling-convention. diff --git a/lisp/dired.el b/lisp/dired.el index 7839ace803..1ed949d5db 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4062,10 +4062,10 @@ only in the active region if `dired-mark-region' is non-nil." (if fn (backup-file-name-p fn)))) "backup file"))) -(defun dired-change-marks (old new) +(defun dired-change-marks (&optional old new) "Change all OLD marks to NEW marks. OLD and NEW are both characters used to mark files." - (declare (advertised-calling-convention '(old new) "28.1")) + (declare (advertised-calling-convention (old new) "28.1")) (interactive (let* ((cursor-in-echo-area t) (old (progn (message "Change (old mark): ") (read-char))) commit fb68645b5a258c98acc11efdc3caae80683cc6b0 Author: Stefan Kangas Date: Wed Sep 2 02:45:39 2020 +0200 Move several completions from eshell to pcomplete (Bug#10585) * lisp/eshell/em-unix.el (eshell-complete-hostname) (pcomplete/ftp, pcomplete/ncftp, pcomplete/ping) (pcomplete/rlogin, pcomplete/telnet, pcomplete/rsh): Move from here... * lisp/pcmpl-unix.el (pcmpl-unix-complete-hostname) (pcomplete/ftp, pcomplete/ncftp, pcomplete/ping) (pcomplete/rlogin, pcomplete/telnet, pcomplete/rsh): ...to here. Make old names into aliases. * lisp/eshell/esh-util.el (eshell-hosts-file) (eshell-host-names, eshell-host-timestamp) (eshell-read-hosts-file, eshell-read-hosts) (eshell-read-host-names): Move from here... * lisp/pcomplete.el (pcomplete-hosts-file) (pcomplete--host-name-cache) (pcomplete--host-name-cache-timestamp) (pcomplete-read-hosts-file, pcomplete-read-hosts) (pcomplete-read-host-names): ...to here. Make old names into aliases. * lisp/eshell/em-unix.el (eshell-complete-host-reference): Update caller. diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index fbd3cfbb6f..fd4cd6716d 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -787,9 +787,9 @@ external command." ;; completions rules for some common UNIX commands -(defsubst eshell-complete-hostname () - "Complete a command that wants a hostname for an argument." - (pcomplete-here (eshell-read-host-names))) +(autoload 'pcmpl-unix-complete-hostname "pcmpl-unix") +(define-obsolete-function-alias 'eshell-complete-hostname + #'pcmpl-unix-complete-hostname "28.1") (defun eshell-complete-host-reference () "If there is a host reference, complete it." @@ -798,26 +798,7 @@ external command." (when (setq index (string-match "@[a-z.]*\\'" arg)) (setq pcomplete-stub (substring arg (1+ index)) pcomplete-last-completion-raw t) - (throw 'pcomplete-completions (eshell-read-host-names))))) - -(defalias 'pcomplete/ftp 'eshell-complete-hostname) -(defalias 'pcomplete/ncftp 'eshell-complete-hostname) -(defalias 'pcomplete/ping 'eshell-complete-hostname) -(defalias 'pcomplete/rlogin 'eshell-complete-hostname) - -(defun pcomplete/telnet () - (require 'pcmpl-unix) - (pcomplete-opt "xl(pcmpl-unix-user-names)") - (eshell-complete-hostname)) - -(defun pcomplete/rsh () - "Complete `rsh', which, after the user and hostname, is like xargs." - (require 'pcmpl-unix) - (pcomplete-opt "l(pcmpl-unix-user-names)") - (eshell-complete-hostname) - (pcomplete-here (funcall pcomplete-command-completion-function)) - (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) - pcomplete-default-completion-function))) + (throw 'pcomplete-completions (pcomplete-read-host-names))))) (defvar block-size) (defvar by-bytes) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index ab030ede05..0122f9be48 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -51,9 +51,15 @@ similarly to external commands, as far as successful result output." :group 'eshell-util) (defcustom eshell-hosts-file "/etc/hosts" - "The name of the /etc/hosts file." + "The name of the /etc/hosts file. +Use `pcomplete-hosts-file' instead; this variable is obsolete and +has no effect." :type '(choice (const :tag "No hosts file" nil) file) :group 'eshell-util) +;; Don't make it into an alias, because it doesn't really work with +;; custom and risks creating duplicate entries. Just point users to +;; the other variable, which is less frustrating. +(make-obsolete-variable 'eshell-hosts-file nil "28.1") (defcustom eshell-handle-errors t "If non-nil, Eshell will handle errors itself. @@ -127,11 +133,14 @@ function `string-to-number'." (defvar eshell-user-timestamp nil "A timestamp of when the user file was read.") -(defvar eshell-host-names nil - "A cache the names of frequently accessed hosts.") +;;; Obsolete variables: -(defvar eshell-host-timestamp nil - "A timestamp of when the hosts file was read.") +(define-obsolete-variable-alias 'eshell-host-names + 'pcomplete--host-name-cache "28.1") +(define-obsolete-variable-alias 'eshell-host-timestamp + 'pcomplete--host-name-cache-timestamp "28.1") +(defvar pcomplete--host-name-cache) +(defvar pcomplete--host-name-cache-timestamp) ;;; Functions: @@ -479,37 +488,15 @@ list." (defalias 'eshell-user-name 'user-login-name) -(defun eshell-read-hosts-file (filename) - "Read in the hosts from FILENAME, default `eshell-hosts-file'." - (let (hosts) - (with-temp-buffer - (insert-file-contents (or filename eshell-hosts-file)) - (goto-char (point-min)) - (while (re-search-forward - ;; "^ \t\\([^# \t\n]+\\)[ \t]+\\([^ \t\n]+\\)\\([ \t]*\\([^ \t\n]+\\)\\)?" - "^[ \t]*\\([^# \t\n]+\\)[ \t]+\\([^ \t\n].+\\)" nil t) - (push (cons (match-string 1) - (split-string (match-string 2))) - hosts))) - (nreverse hosts))) - -(defun eshell-read-hosts (file result-var timestamp-var) - "Read the contents of /etc/hosts for host names." - (if (or (not (symbol-value result-var)) - (not (symbol-value timestamp-var)) - (time-less-p - (symbol-value timestamp-var) - (file-attribute-modification-time (file-attributes file)))) - (progn - (set result-var (apply #'nconc (eshell-read-hosts-file file))) - (set timestamp-var (current-time)))) - (symbol-value result-var)) - -(defun eshell-read-host-names () - "Read the contents of /etc/hosts for host names." - (if eshell-hosts-file - (eshell-read-hosts eshell-hosts-file 'eshell-host-names - 'eshell-host-timestamp))) +(autoload 'pcomplete-read-hosts-file "pcomplete") +(autoload 'pcomplete-read-hosts "pcomplete") +(autoload 'pcomplete-read-host-names "pcomplete") +(define-obsolete-function-alias 'eshell-read-hosts-file + #'pcomplete-read-hosts-file "28.1") +(define-obsolete-function-alias 'eshell-read-hosts + #'pcomplete-read-hosts "28.1") +(define-obsolete-function-alias 'eshell-read-host-names + #'pcomplete-read-host-names "28.1") (defsubst eshell-copy-environment () "Return an unrelated copy of `process-environment'." diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index 822f6f37e7..74f45b9523 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -217,6 +217,29 @@ Includes files as well as host names followed by a colon." (pcmpl-ssh-hosts))))))) (complete-with-action action table string pred)))))) +(defsubst pcmpl-unix-complete-hostname () + "Complete a command that wants a hostname for an argument." + (pcomplete-here (pcomplete-read-host-names))) + +(defalias 'pcomplete/ftp 'pcmpl-unix-complete-hostname) +(defalias 'pcomplete/ncftp 'pcmpl-unix-complete-hostname) +(defalias 'pcomplete/ping 'pcmpl-unix-complete-hostname) +(defalias 'pcomplete/rlogin 'pcmpl-unix-complete-hostname) + +;;;###autoload +(defun pcomplete/telnet () + (pcomplete-opt "xl(pcmpl-unix-user-names)") + (pcmpl-unix-complete-hostname)) + +;;;###autoload +(defun pcomplete/rsh () + "Complete `rsh', which, after the user and hostname, is like xargs." + (pcomplete-opt "l(pcmpl-unix-user-names)") + (pcmpl-unix-complete-hostname) + (pcomplete-here (funcall pcomplete-command-completion-function)) + (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) + pcomplete-default-completion-function))) + (provide 'pcmpl-unix) ;;; pcmpl-unix.el ends here diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 32e61e84e0..014f9628b9 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -325,6 +325,10 @@ already terminated by a character, this variable should be locally modified to be an empty string, or the desired separation string." :type 'string) +(defcustom pcomplete-hosts-file "/etc/hosts" + "The name of the /etc/hosts file." + :type '(choice (const :tag "No hosts file" nil) file)) + ;;; Internal Variables: ;; for cycling completion support @@ -1289,6 +1293,46 @@ If specific documentation can't be given, be generic." (skip-chars-backward "\n") (buffer-substring (point-min) (point)))) +;; hostname completion + +(defvar pcomplete--host-name-cache nil + "A cache the names of frequently accessed hosts.") + +(defvar pcomplete--host-name-cache-timestamp nil + "A timestamp of when the hosts file was read.") + +(defun pcomplete-read-hosts-file (filename) + "Read in the hosts from FILENAME, default `pcomplete-hosts-file'." + (let (hosts) + (with-temp-buffer + (insert-file-contents (or filename pcomplete-hosts-file)) + (goto-char (point-min)) + (while (re-search-forward + ;; "^ \t\\([^# \t\n]+\\)[ \t]+\\([^ \t\n]+\\)\\([ \t]*\\([^ \t\n]+\\)\\)?" + "^[ \t]*\\([^# \t\n]+\\)[ \t]+\\([^ \t\n].+\\)" nil t) + (push (cons (match-string 1) + (split-string (match-string 2))) + hosts))) + (nreverse hosts))) + +(defun pcomplete-read-hosts (file result-var timestamp-var) + "Read the contents of /etc/hosts for host names." + (if (or (not (symbol-value result-var)) + (not (symbol-value timestamp-var)) + (time-less-p + (symbol-value timestamp-var) + (file-attribute-modification-time (file-attributes file)))) + (progn + (set result-var (apply #'nconc (pcomplete-read-hosts-file file))) + (set timestamp-var (current-time)))) + (symbol-value result-var)) + +(defun pcomplete-read-host-names () + "Read the contents of /etc/hosts for host names." + (if pcomplete-hosts-file + (pcomplete-read-hosts pcomplete-hosts-file 'pcomplete--host-name-cache + 'pcomplete--host-name-cache-timestamp))) + ;; create a set of aliases which allow completion functions to be not ;; quite so verbose commit 600d3f0669742b398d91c421e335fc6680f6fdc0 Author: Stefan Kangas Date: Wed Sep 2 02:34:43 2020 +0200 Move pcomplete/bcc32 from eshell to pcmpl-x (Bug#10585) * lisp/eshell/em-xtra.el (pcomplete/bcc32, pcomplete/bcc): Move from here... * lisp/pcmpl-x.el (pcomplete/bcc32, pcomplete/bcc): ...to here. diff --git a/lisp/eshell/em-xtra.el b/lisp/eshell/em-xtra.el index d55986c49b..3c038edfd1 100644 --- a/lisp/eshell/em-xtra.el +++ b/lisp/eshell/em-xtra.el @@ -94,36 +94,6 @@ naturally accessible within Emacs." (defalias 'eshell/ff 'find-name-dired) (defalias 'eshell/gf 'find-grep-dired) -(defun pcomplete/bcc32 () - "Completion function for Borland's C++ compiler." - (let ((cur (pcomplete-arg 0))) - (cond - ((string-match "\\`-w\\([^;]+;\\)*\\([^;]*\\)\\'" cur) - (pcomplete-here - '("ali" "amb" "amp" "asc" "asm" "aus" "bbf" "bei" "big" "ccc" - "cln" "cod" "com" "cpt" "csu" "def" "dig" "dpu" "dsz" "dup" - "eas" "eff" "ext" "hch" "hid" "ias" "ibc" "ifr" "ill" "nil" - "lin" "lvc" "mcs" "mes" "mpc" "mpd" "msg" "nak" "ncf" "nci" - "ncl" "nfd" "ngu" "nin" "nma" "nmu" "nod" "nop" "npp" "nsf" - "nst" "ntd" "nto" "nvf" "obi" "obs" "ofp" "osh" "ovf" "par" - "pch" "pck" "pia" "pin" "pow" "prc" "pre" "pro" "rch" "ret" - "rng" "rpt" "rvl" "sig" "spa" "stl" "stu" "stv" "sus" "tai" - "tes" "thr" "ucp" "use" "voi" "zdi") (match-string 2 cur))) - ((string-match "\\`-[LIn]\\([^;]+;\\)*\\([^;]*\\)\\'" cur) - (pcomplete-here (pcomplete-dirs) (match-string 2 cur))) - ((string-match "\\`-[Ee]\\(.*\\)\\'" cur) - (pcomplete-here (pcomplete-dirs-or-entries "\\.[Ee][Xx][Ee]\\'") - (match-string 1 cur))) - ((string-match "\\`-o\\(.*\\)\\'" cur) - (pcomplete-here (pcomplete-dirs-or-entries "\\.[Oo][Bb][Jj]\\'") - (match-string 1 cur))) - (t - (pcomplete-opt "3456ABCDEHIKLMNOPRSTUVXabcdefgijklnoptuvwxyz")))) - (while (pcomplete-here - (pcomplete-dirs-or-entries "\\.[iCc]\\([Pp][Pp]\\)?\\'")))) - -(defalias 'pcomplete/bcc 'pcomplete/bcc32) - (provide 'em-xtra) ;; Local Variables: diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el index 5244ada523..6e96a67b7b 100644 --- a/lisp/pcmpl-x.el +++ b/lisp/pcmpl-x.el @@ -286,5 +286,37 @@ long options." (pcmpl-x-ag-options)))) (pcomplete-here* (pcomplete-dirs-or-entries))))) +;;;###autoload +(defun pcomplete/bcc32 () + "Completion function for Borland's C++ compiler." + (let ((cur (pcomplete-arg 0))) + (cond + ((string-match "\\`-w\\([^;]+;\\)*\\([^;]*\\)\\'" cur) + (pcomplete-here + '("ali" "amb" "amp" "asc" "asm" "aus" "bbf" "bei" "big" "ccc" + "cln" "cod" "com" "cpt" "csu" "def" "dig" "dpu" "dsz" "dup" + "eas" "eff" "ext" "hch" "hid" "ias" "ibc" "ifr" "ill" "nil" + "lin" "lvc" "mcs" "mes" "mpc" "mpd" "msg" "nak" "ncf" "nci" + "ncl" "nfd" "ngu" "nin" "nma" "nmu" "nod" "nop" "npp" "nsf" + "nst" "ntd" "nto" "nvf" "obi" "obs" "ofp" "osh" "ovf" "par" + "pch" "pck" "pia" "pin" "pow" "prc" "pre" "pro" "rch" "ret" + "rng" "rpt" "rvl" "sig" "spa" "stl" "stu" "stv" "sus" "tai" + "tes" "thr" "ucp" "use" "voi" "zdi") (match-string 2 cur))) + ((string-match "\\`-[LIn]\\([^;]+;\\)*\\([^;]*\\)\\'" cur) + (pcomplete-here (pcomplete-dirs) (match-string 2 cur))) + ((string-match "\\`-[Ee]\\(.*\\)\\'" cur) + (pcomplete-here (pcomplete-dirs-or-entries "\\.[Ee][Xx][Ee]\\'") + (match-string 1 cur))) + ((string-match "\\`-o\\(.*\\)\\'" cur) + (pcomplete-here (pcomplete-dirs-or-entries "\\.[Oo][Bb][Jj]\\'") + (match-string 1 cur))) + (t + (pcomplete-opt "3456ABCDEHIKLMNOPRSTUVXabcdefgijklnoptuvwxyz")))) + (while (pcomplete-here + (pcomplete-dirs-or-entries "\\.[iCc]\\([Pp][Pp]\\)?\\'")))) + +;;;###autoload +(defalias 'pcomplete/bcc 'pcomplete/bcc32) + (provide 'pcmpl-x) ;;; pcmpl-x.el ends here commit 9fff5491c30189c8446cd03fe7d80a13b20d69d3 Author: Stefan Kangas Date: Mon Sep 21 17:55:37 2020 +0200 Convert a manual test for nxml-mode to unit test * test/manual/indent/nxml.xml: Delete file. * test/lisp/nxml/nxml-mode-tests.el (nxml-mode-test-comment-bug-17264): New test based on deleted file. diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el index 624e5c8866..54d3bd8d13 100644 --- a/test/lisp/nxml/nxml-mode-tests.el +++ b/test/lisp/nxml/nxml-mode-tests.el @@ -132,5 +132,26 @@ ")))) +(ert-deftest nxml-mode-test-comment-bug-17264 () + "Test for Bug#17264." + (with-temp-buffer + (nxml-mode) + (let ((data " + + + +")) + (insert data) + (goto-char (point-min)) + (search-forward " - - - commit b63c3535b0cd45544b5af854f88984af5125dd0b Author: Stefan Kangas Date: Mon Sep 21 17:41:45 2020 +0200 Convert manual indent test for ruby-mode into unit test * test/manual/indent/ruby.rb: Move from here... * test/lisp/progmodes/ruby-mode-resources/ruby.rb: ...to here. * test/lisp/progmodes/ruby-mode-tests.el (ruby-mode-tests-data-dir): New variable. (ruby--indent/converted-from-manual-test): New test. diff --git a/test/manual/indent/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb similarity index 100% rename from test/manual/indent/ruby.rb rename to test/lisp/progmodes/ruby-mode-resources/ruby.rb diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 9d677a2c27..fb3b42b30d 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -24,6 +24,12 @@ (require 'ert) (require 'ruby-mode) +(defvar ruby-mode-tests-data-dir + (file-truename + (expand-file-name "ruby-mode-resources/" + (file-name-directory (or load-file-name + buffer-file-name))))) + (defmacro ruby-with-temp-buffer (contents &rest body) (declare (indent 1) (debug t)) `(with-temp-buffer @@ -842,6 +848,19 @@ 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)))))) +;; TODO: Convert these into unit proper tests instead of using an +;; external file. +(ert-deftest ruby--indent/converted-from-manual-test () + :tags '(:expensive-test) + ;; Converted from manual test. + (let ((buf (find-file-noselect (expand-file-name "ruby.rb" + ruby-mode-tests-data-dir)))) + (unwind-protect + (with-current-buffer buf + (let ((orig (buffer-string))) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig)))) + (kill-buffer buf)))) (provide 'ruby-mode-tests) commit 1d98bed6c33e35cac2f04d2fd13f1bf1483d2f42 Author: Stefan Kangas Date: Mon Sep 21 17:32:51 2020 +0200 Convert manual indent test for scheme-mode into unit test * test/manual/indent/scheme.scm: Delete file. * test/lisp/progmodes/scheme-tests.el: New file with unit test for scheme-mode based on deleted file. diff --git a/test/lisp/progmodes/scheme-tests.el b/test/lisp/progmodes/scheme-tests.el new file mode 100644 index 0000000000..e3736bd411 --- /dev/null +++ b/test/lisp/progmodes/scheme-tests.el @@ -0,0 +1,50 @@ +;;; scheme-tests.el --- Test suite for scheme.el -*- lexical-binding:t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'scheme) + +(ert-deftest scheme-test-indent () + ;; FIXME: Look into what is the expected indent here and fix it. + :expected-result :failed + ;; Converted from manual test. + (with-temp-buffer + (scheme-mode) + ;; TODO: Should some of these be fontification tests as well? + (let ((orig "#!/usr/bin/scheme is this a comment? + +;; This one is a comment +(a) +#| and this one as #|well|# as this! |# +(b) +(cons #;(this is a + comment) + head tail) +")) + (insert orig) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig))))) + +(provide 'scheme-tests) + +;;; scheme-tests.el ends here diff --git a/test/manual/indent/scheme.scm b/test/manual/indent/scheme.scm deleted file mode 100644 index 84d0f6d878..0000000000 --- a/test/manual/indent/scheme.scm +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/scheme is this a comment? - -;; This one is a comment -(a) -#| and this one as #|well|# as this! |# -(b) -(cons #;(this is a - comment) - head tail) commit 01f7fdb2a0790f6eb257791fc3ddf56a514c4693 Author: Stefan Kangas Date: Mon Sep 21 17:19:48 2020 +0200 Convert manual indent test for ps-mode into unit test * test/manual/indent/ps-mode.ps: Delete file. * test/lisp/progmodes/ps-mode-tests.el (ps-mode-test-indent): New unit test based on deleted file. diff --git a/test/lisp/progmodes/ps-mode-tests.el b/test/lisp/progmodes/ps-mode-tests.el index d565b321fd..eedf3f7009 100644 --- a/test/lisp/progmodes/ps-mode-tests.el +++ b/test/lisp/progmodes/ps-mode-tests.el @@ -43,6 +43,30 @@ (should (equal (buffer-string) "foo\\220\\221\\222bar")))) +(ert-deftest ps-mode-test-indent () + ;; Converted from manual test. + (with-temp-buffer + (ps-mode) + ;; TODO: Should some of these be fontification tests as well? + (let ((orig "%!PS-2.0 + +<< 23 45 >> %dictionary +< 23 > %hex string +<~a>a%a~> %base85 string +(%)s +(sf\(g>a)sdg) + +/foo { + << + hello 2 + 3 + >> +} def +")) + (insert orig) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig))))) + (provide 'ps-mode-tests) ;;; ps-mode-tests.el ends here diff --git a/test/manual/indent/ps-mode.ps b/test/manual/indent/ps-mode.ps deleted file mode 100644 index 4b4ee0f10c..0000000000 --- a/test/manual/indent/ps-mode.ps +++ /dev/null @@ -1,14 +0,0 @@ -%!PS-2.0 - -<< 23 45 >> %dictionary -< 23 > %hex string -<~a>a%a~> %base85 string -(%)s -(sf\(g>a)sdg) - -/foo { - << - hello 2 - 3 - >> -} def commit fb8c319825a15f0892b84c1985961fd865e54e13 Author: Sam Steingold Date: Mon Sep 21 11:50:29 2020 -0400 (json-encode-string): Strip properties to fix bug#43549 diff --git a/lisp/json.el b/lisp/json.el index 9002e86853..c2fc1574fa 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -432,14 +432,14 @@ Initialized lazily by `json-encode-string'.") ;; string length as our heuristic. See also bug#20154. (if (and (< (length string) json--long-string-threshold) (not (string-match-p (rx json--escape) string))) - (concat "\"" string "\"") + (concat "\"" (substring-no-properties string) "\"") (with-current-buffer (or json--string-buffer (with-current-buffer (generate-new-buffer " *json-string*") ;; This seems to afford decent performance gains. (setq-local inhibit-modification-hooks t) (setq json--string-buffer (current-buffer)))) - (insert ?\" string) + (insert ?\" (substring-no-properties string)) ; see bug#43549 (goto-char (1+ (point-min))) (while (re-search-forward (rx json--escape) nil 'move) (let ((char (preceding-char))) commit fa560bea191033e8af6bf3dc49cb6f6d94611535 Author: Lin Sun Date: Mon Sep 21 17:33:13 2020 +0200 Fix problem with ede-mode bugging out on non-existent files * lisp/cedet/ede/emacs.el: Check whether the directory exists in ede-emacs-find-in-directories before using it (bug#43547). diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el index bfcbd40fcc..a052c5c61e 100644 --- a/lisp/cedet/ede/emacs.el +++ b/lisp/cedet/ede/emacs.el @@ -234,20 +234,19 @@ All files need the macros from lisp.h!" (let* ((D (car dirs)) (ed (expand-file-name D base)) (ef (expand-file-name name ed))) - (if (file-exists-p ef) - (setq ans ef) - ;; Not in this dir? How about subdirs? - (let ((dirfile (directory-files ed t)) - (moredirs nil) - ) - ;; Get all the subdirs. - (dolist (DF dirfile) - (when (and (file-directory-p DF) - (not (string-match "\\.$" DF))) - (push DF moredirs))) - ;; Try again. - (setq ans (ede-emacs-find-in-directories name ed moredirs)) - )) + (when (file-exists-p ed) + (if (file-exists-p ef) + (setq ans ef) + ;; Not in this dir? How about subdirs? + (let ((dirfile (directory-files ed t)) + (moredirs nil)) + ;; Get all the subdirs. + (dolist (DF dirfile) + (when (and (file-directory-p DF) + (not (string-match "\\.$" DF))) + (push DF moredirs))) + ;; Try again. + (setq ans (ede-emacs-find-in-directories name ed moredirs))))) (setq dirs (cdr dirs)))) ans)) commit 018278a8d095f79c001ad3b128cdba18ac8e2d5f Author: Lars Ingebrigtsen Date: Mon Sep 21 17:24:02 2020 +0200 Fix recent change to window-max-chars-per-line * lisp/window.el (window-max-chars-per-line): line-number-display-width can return a floating point number, but we want an integer (bug#43548). diff --git a/lisp/window.el b/lisp/window.el index 72957d846a..9aca94d502 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2173,7 +2173,7 @@ the font." (let* ((window-width (window-body-width window t)) (font-width (window-font-width window face)) (ncols (- (/ window-width font-width) - (line-number-display-width 'columns)))) + (ceiling (line-number-display-width 'columns))))) (if (and (display-graphic-p) overflow-newline-into-fringe (not commit ca4a37e0930b2bbb322ae3d1e9dc95f80d3966cd Author: Lars Ingebrigtsen Date: Mon Sep 21 17:20:14 2020 +0200 Doc string fix for gnus-summary-hide-thread * lisp/gnus/gnus-sum.el (gnus-summary-hide-thread): Remove text from doc string apparently copy-pasted from the function above. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 87e48f6b04..b3ed5cb664 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -11806,8 +11806,6 @@ will not be hidden." (defun gnus-summary-hide-thread () "Hide thread subtrees. -If PREDICATE is supplied, threads that satisfy this predicate -will not be hidden. Returns nil if no threads were there to be hidden." (interactive) (beginning-of-line) commit c8f809dbb95de2458260b08a565123bb11b6c5eb Author: dickmao Date: Mon Sep 21 17:19:14 2020 +0200 Remove a misleading message in gnus-summary-hide-thread * lisp/gnus/gnus-sum.el (gnus-summary-hide-thread): Jump past invisible thread instead of begging off with an out-of-band diagnostic (bug#43538). diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 8e27a94e5b..87e48f6b04 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -11828,9 +11828,9 @@ Returns nil if no threads were there to be hidden." (overlay-put ol 'invisible 'gnus-sum) (overlay-put ol 'evaporate t))) (gnus-summary-goto-subject article) + ;; We moved backward past the start point (invisible thread?) (when (> start (point)) - (message "Hiding the thread moved us backwards, aborting!") - (goto-char (point-max)))) + (goto-char starteol))) (goto-char start) nil)))) commit d5d642eb71d8228d5a408a3d43ca1f4a5b500b9d Author: Stefan Kangas Date: Mon Sep 21 16:39:54 2020 +0200 Convert manual indent test for opascal-mode into unit test * test/manual/indent/opascal.pas: Delete file. * test/lisp/progmodes/opascal-tests.el: New file with unit test for oposcal-mode based on deleted file. diff --git a/test/lisp/progmodes/opascal-tests.el b/test/lisp/progmodes/opascal-tests.el new file mode 100644 index 0000000000..70a4ebfa70 --- /dev/null +++ b/test/lisp/progmodes/opascal-tests.el @@ -0,0 +1,45 @@ +;;; opascal-tests.el --- tests for opascal.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +(require 'ert) +(require 'opascal) + +(ert-deftest opascal-indent-bug-36348 () + (with-temp-buffer + (opascal-mode) + (let ((orig "{ -*- opascal -*- } + +procedure Toto (); +begin + for i := 0 to 1 do + Write (str.Chars[i]); + + // bug#36348 + for var i := 0 to 1 do + Write (str.Chars[i]); + +end; +")) + (insert orig) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig))))) + +(provide 'opascal-tests) + +;;; opascal-tests.el ends here diff --git a/test/manual/indent/opascal.pas b/test/manual/indent/opascal.pas deleted file mode 100644 index ac4beb3f84..0000000000 --- a/test/manual/indent/opascal.pas +++ /dev/null @@ -1,12 +0,0 @@ -{ -*- opascal -*- } - -procedure Toto (); -begin - for i := 0 to 1 do - Write (str.Chars[i]); - - // bug#36348 - for var i := 0 to 1 do - Write (str.Chars[i]); - -end; commit 31cb935cd72ec915f3461f4517a8675e96b66ac5 Author: Stefan Kangas Date: Mon Sep 21 16:23:24 2020 +0200 Convert manual indent test for lisp-mode into unit test * test/manual/indent/lisp.lisp: Delete file. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-defun): New unit test based on deleted file. diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index b1b7847961..d1183d83f6 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -294,6 +294,18 @@ Expected initialization file: `%s'\" (insert "\"\n") (lisp-indent-region (point-min) (point-max)))) +(ert-deftest lisp-indent-defun () + (with-temp-buffer + (lisp-mode) + (let ((orig "(defun x () + (print (quote ( thingy great + stuff))) + (print (quote (thingy great + stuff))))")) + (insert orig) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig))))) + ;;; Fontification diff --git a/test/manual/indent/lisp.lisp b/test/manual/indent/lisp.lisp deleted file mode 100644 index f3874b5c3e..0000000000 --- a/test/manual/indent/lisp.lisp +++ /dev/null @@ -1,5 +0,0 @@ -(defun x () - (print (quote ( thingy great - stuff))) - (print (quote (thingy great - stuff)))) commit f3e2d3418a482e7b3bf190a524caf0f2eb75b6bb Author: Stefan Kangas Date: Mon Sep 21 16:13:53 2020 +0200 Convert manual indent test for elisp-mode into unit test * test/manual/indent/elisp.el: Delete file. * test/lisp/progmodes/elisp-mode-tests.el (elisp-indent-basic): New unit test based on deleted file. diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 2de533e5eb..6c30e4f664 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -810,5 +810,17 @@ to (xref-elisp-test-descr-to-target xref)." (insert "?\\N{HEAVY CHECK MARK}") (should (equal (elisp--preceding-sexp) ?\N{HEAVY CHECK MARK})))) +(ert-deftest elisp-indent-basic () + (with-temp-buffer + (emacs-lisp-mode) + (let ((orig "(defun x () + (print (quote ( thingy great + stuff))) + (print (quote (thingy great + stuff))))")) + (insert orig) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig))))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here diff --git a/test/manual/indent/elisp.el b/test/manual/indent/elisp.el deleted file mode 100644 index 7d634ae84c..0000000000 --- a/test/manual/indent/elisp.el +++ /dev/null @@ -1,6 +0,0 @@ -;; -*- lexical-binding:t -*- -(defun x () - (print (quote ( thingy great - stuff))) - (print (quote (thingy great - stuff)))) commit 12ca4638338f671e7cba8693b7230409a0fcb9ea Author: Stefan Kangas Date: Mon Sep 21 16:02:55 2020 +0200 ; * test/lisp/textmodes/css-mode-tests.el: Add TODO. diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index f627d1c02c..02bd2aca30 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -417,6 +417,8 @@ (point)) "black"))))) +;; TODO: Convert these into unit proper tests instead of using an +;; external file. (ert-deftest css-mode-test-indent () (with-current-buffer (find-file-noselect (expand-file-name "test-indent.css" commit 7a2ac61b5d3adbfa7c54434056b9b772f83078af Author: Stephen Berman Date: Mon Sep 21 16:35:31 2020 +0200 Fix check in `newline' for blank lines * lisp/simple.el (newline): Clarify doc string and fix check for blank lines (bug#13810). diff --git a/lisp/simple.el b/lisp/simple.el index 7dc695848b..d7486e51dd 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -516,7 +516,7 @@ This hook is run by `delete-selection-uses-region-p', which see.") "Propertized string representing a hard newline character.") (defun newline (&optional arg interactive) - "Insert a newline, and move to left margin of the new line if it's blank. + "Insert a newline, and move to left margin of the new line. With prefix argument ARG, insert that many newlines. If `electric-indent-mode' is enabled, this indents the final new line @@ -553,7 +553,7 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (save-excursion (goto-char beforepos) (beginning-of-line) - (and (looking-at "[ \t]$") + (and (looking-at "[ \t]+$") (> (current-left-margin) 0) (delete-region (point) (line-end-position)))) commit e8d80f1e14c8efe42d59cf856cf403ec48dfe70b Author: Lars Ingebrigtsen Date: Mon Sep 21 16:10:13 2020 +0200 Fix line width in M-x term on -nw with line numbers * lisp/window.el (window-max-chars-per-line): Make the line width more correct in the presence of display-line-numbers-mode (bug#34513). diff --git a/lisp/window.el b/lisp/window.el index f1ee87aad2..72957d846a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2172,7 +2172,8 @@ the font." (with-selected-window (window-normalize-window window t) (let* ((window-width (window-body-width window t)) (font-width (window-font-width window face)) - (ncols (/ window-width font-width))) + (ncols (- (/ window-width font-width) + (line-number-display-width 'columns)))) (if (and (display-graphic-p) overflow-newline-into-fringe (not commit d2b754ec1a947a4d98fa6521ad9263bdc45900e5 Author: Lars Ingebrigtsen Date: Mon Sep 21 15:56:55 2020 +0200 Add more isearch submatch faces * doc/emacs/search.texi (Search Customizations): Adjust documentation. * lisp/isearch.el (search-highlight-submatches): Be a boolean. (isearch-group-{6-9}): New faces. (isearch-highlight): Use the variable as a boolean. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 508debd13c..d44d7bee2a 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1981,15 +1981,13 @@ setting the variable @code{search-highlight} to @code{nil}. When searching for regular expressions (with @kbd{C-M-s}, for instance), subexpressions receive special highlighting depending on the @code{search-highlight-submatches} variable. If this variable's -value is zero, no special highlighting is done, but if the value is a -positive integer @var{n}, the strings matching the first @var{n} -@samp{\( @dots{} \)} constructs (a.k.a.@: ``subexpressions'') in the -regular expression will be highlighted with distinct faces, named -@code{isearch-group-@var{n}}. For instance, when searching for -@samp{foo-\([0-9]+\)}, the part matched by @samp{[0-9]+} will be -highlighted with the @code{isearch-group-1} face if -@code{search-highlight-submatches} is greater or equal to 1. The -default value of @code{search-highlight-submatches} is 5. +value is @code{nil}, no special highlighting is done, but if the value +is non-@code{nil}, text that matches @samp{\( @dots{} \)} constructs +(a.k.a.@: ``subexpressions'') in the regular expression will be +highlighted with distinct faces, named @code{isearch-group-@var{n}}. +For instance, when searching for @samp{foo-\([0-9]+\)}, the part +matched by @samp{[0-9]+} will be highlighted with the +@code{isearch-group-1} face. @cindex lazy highlighting customizations @vindex isearch-lazy-highlight diff --git a/etc/NEWS b/etc/NEWS index 0d0d9daeee..6bfe45a683 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1046,8 +1046,7 @@ window after starting). This variable defaults to nil. *** Interactive regular expression search now uses faces for sub-groups. E.g., 'C-M-s foo-\([0-9]+\)' will now use the 'isearch-group-1' face on the part of the regexp that matches the sub-expression "[0-9]+". -This is controlled by the 'search-highlight-submatches' variable, -whose default value is 5. +This is controlled by the 'search-highlight-submatches' variable. --- *** New user option 'reveal-auto-hide'. diff --git a/lisp/isearch.el b/lisp/isearch.el index 0c2cc7686a..0053c4dd8a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -269,17 +269,12 @@ are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp' "Non-nil means incremental search highlights the current match." :type 'boolean) -(defcustom search-highlight-submatches 5 +(defcustom search-highlight-submatches t "Whether to highlight regexp subexpressions of the current regexp match. -A positive integer N means highlight regexp subexpressions 1 to N. - -When 0, do not highlight regexp subexpressions. A negative value is -treated as zero. The faces used to do the highlights are named `isearch-group-1', -`isearch-group-2', and so on, and if you increase this variable from -the default, you have to add more of these faces." - :type 'integer +`isearch-group-2', and so on." + :type 'boolean :version "28.1") (defface isearch @@ -3719,6 +3714,47 @@ since they have special meaning in a regexp." :group 'isearch :version "28.1") +(defface isearch-group-6 + '((((class color) (background light)) + (:background "#500050" :foreground "lightskyblue1")) + (((class color) (background dark)) + (:background "#703050" :foreground "white")) + (t (:inverse-video t))) + "Face for highlighting Isearch sub-group matches (sixth sub-group)." + :group 'isearch + :version "28.1") + +(defface isearch-group-7 + '((((class color) (background light)) + (:background "#400040" :foreground "lightskyblue1")) + (((class color) (background dark)) + (:background "#602050" :foreground "white")) + (t (:inverse-video t))) + "Face for highlighting Isearch sub-group matches (seventh sub-group)." + :group 'isearch + :version "28.1") + +(defface isearch-group-8 + '((((class color) (background light)) + (:background "#300030" :foreground "lightskyblue1")) + (((class color) (background dark)) + (:background "#501050" :foreground "white")) + (t (:inverse-video t))) + "Face for highlighting Isearch sub-group matches (eighth sub-group)." + :group 'isearch + :version "28.1") + +(defface isearch-group-9 + '((((class color) (background light)) + (:background "#200020" :foreground "lightskyblue1")) + (((class color) (background dark)) + (:background "#400040" :foreground "white")) + (t (:inverse-video t))) + "Face for highlighting Isearch sub-group matches (ninth sub-group)." + :group 'isearch + :version "28.1") + + (defun isearch-highlight (beg end) (if search-highlight (if isearch-overlay @@ -3729,13 +3765,12 @@ since they have special meaning in a regexp." ;; 1001 is higher than lazy's 1000 and ediff's 100+ (overlay-put isearch-overlay 'priority 1001) (overlay-put isearch-overlay 'face isearch-face))) - (when (and (integerp search-highlight-submatches) - (> search-highlight-submatches 0) + (when (and search-highlight-submatches isearch-regexp) (mapc 'delete-overlay isearch-submatches-overlays) (setq isearch-submatches-overlays nil) (let ((i 0) ov) - (while (<= i search-highlight-submatches) + (while (<= i 9) (when (match-beginning i) (setq ov (make-overlay (match-beginning i) (match-end i))) (overlay-put ov 'face (intern-soft (format "isearch-group-%d" i))) commit ebad35e4d99340af1bad3702063f029a21e188bc Author: Stefan Kangas Date: Mon Sep 21 15:41:43 2020 +0200 ; Fix more trivial typos diff --git a/test/ChangeLog.1 b/test/ChangeLog.1 index c364219c36..2bf014d0a9 100644 --- a/test/ChangeLog.1 +++ b/test/ChangeLog.1 @@ -1754,7 +1754,7 @@ * indent/prolog.prolog: Test alignment of ->; with operator at bol. - * indent/css-mode.css (.x2): Test alignement inside braces. + * indent/css-mode.css (.x2): Test alignment inside braces. 2013-10-26 Dmitry Gutov diff --git a/test/lisp/emacs-lisp/faceup-resources/files/test1.txt.faceup b/test/lisp/emacs-lisp/faceup-resources/files/test1.txt.faceup index 7d4938adf1..ec9e82148f 100644 --- a/test/lisp/emacs-lisp/faceup-resources/files/test1.txt.faceup +++ b/test/lisp/emacs-lisp/faceup-resources/files/test1.txt.faceup @@ -1,7 +1,7 @@ This is a test of `faceup', a regression test system for font-lock keywords. It should use major mode `faceup-test-mode'. -«(help-echo):"Baloon tip: Fly smoothly!":«w:WARNING»»: The first word on this line should use +«(help-echo):"Balloon tip: Fly smoothly!":«w:WARNING»»: The first word on this line should use `font-lock-warning-face', and a tooltip should be displayed if the mouse pointer is moved over it. diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 34777013c3..54801adda6 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1406,7 +1406,7 @@ The door of all subtleties! ") (ert-deftest files-tests-revert-buffer () - "Test that revert-buffer is succesful." + "Test that revert-buffer is successful." (files-tests--with-temp-file temp-file-name (with-temp-buffer (insert files-tests-lao) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 58ad0516c5..62ed3f2bfb 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -322,7 +322,7 @@ (dbus-check-arguments :session dbus--test-service '(:array (:dict-entry :string "string" :boolean t)))) - ;; The second element is `nil' (implicitely). FIXME: Is this right? + ;; The second element is `nil' (implicitly). FIXME: Is this right? (should (dbus-check-arguments :session dbus--test-service '(:array (:dict-entry :string "string")))) diff --git a/test/manual/etags/y-src/parse.y b/test/manual/etags/y-src/parse.y index 075add2c82..eeef44cc6e 100644 --- a/test/manual/etags/y-src/parse.y +++ b/test/manual/etags/y-src/parse.y @@ -556,7 +556,7 @@ yylex FUN0() } #ifdef TEST if(nn==n_usr_funs) { - io_error_msg("Couln't turn fp into a ##"); + io_error_msg("Couldn't turn fp into a ##"); parse_error=BAD_FUNC; return ERROR; } diff --git a/test/manual/indent/ruby.rb b/test/manual/indent/ruby.rb index b038512b11..6b7d10dea3 100644 --- a/test/manual/indent/ruby.rb +++ b/test/manual/indent/ruby.rb @@ -34,7 +34,7 @@ def foo # Regexp after whitelisted method. "abc".sub /b/, 'd' -# Don't mis-match "sub" at the end of words. +# Don't mismatch "sub" at the end of words. a = asub / aslb + bsub / bslb; # Highlight the regexp after "if". commit 611b85b66366961dfcf53885438771b30569ffe0 Author: Juri Linkov Date: Mon Sep 21 15:05:55 2020 +0200 Tweak how Man selects the previous window on failure * lisp/man.el (Man-bgproc-sentinel): Ensure that we select the correct previous window (bug#38164). diff --git a/lisp/man.el b/lisp/man.el index 1a82b12062..5ee60cae9f 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1508,8 +1508,11 @@ manpage command." (when delete-buff (if (window-live-p (get-buffer-window Man-buffer t)) - (quit-restore-window - (get-buffer-window Man-buffer t) 'kill) + (progn + (quit-restore-window + (get-buffer-window Man-buffer t) 'kill) + ;; Ensure that we end up in the correct window. + (select-window (old-selected-window))) (kill-buffer Man-buffer))) (when message commit 462dbc1cb2c59eaca9c9344636b8af29462370a0 Author: Stefan Kangas Date: Mon Sep 21 13:29:10 2020 +0200 ; Fix typos diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index 73453cb9e4..510bb7959f 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el @@ -77,7 +77,7 @@ ;; 2nd: function to call to get a property value, ;; or an index number of C function to decode the value, ;; or nil if the value can be directly got from the table. -;; 3nd: function to call to put a property value, +;; 3rd: function to call to put a property value, ;; or an index number of C function to encode the value, ;; or nil if the value can be directly stored in the table. ;; 4th: function to call to get a description of a property value, or nil @@ -1177,7 +1177,7 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)." (defun unidata-describe-general-category (val) (cdr (assq val - '((nil . "Uknown") + '((nil . "Unknown") (Lu . "Letter, Uppercase") (Ll . "Letter, Lowercase") (Lt . "Letter, Titlecase") diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 70eb22b994..7d0650a405 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -1875,7 +1875,7 @@ yylex (void) /* Actually local to matching_regexp. These variables must be in - global scope for the case that `static' get's defined away. */ + global scope for the case that `static' gets defined away. */ static char *matching_regexp_buffer, *matching_regexp_end_buf; diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index 822ec176a3..bbed1d94f2 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -649,7 +649,7 @@ define-mode-overload\\)\ )) (when fun ;; Do not return FUN IFF the cursor is on FUN. - ;; Huh? Thats because if cursor is on fun, it is + ;; Huh? That's because if cursor is on fun, it is ;; the current symbol, and not the current function. (if (save-excursion (condition-case nil diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index 510f931fa9..86ccf28ad0 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el @@ -1245,7 +1245,7 @@ See `semanticdb-find-translate-path' for details on PATH. The argument BRUTISH will be set so that searching includes all tables in the current project. FIND-FILE-MATCH indicates that any time a match is found, the file -associated wit that tag should be loaded into a buffer." +associated with that tag should be loaded into a buffer." (semanticdb-find-tags-collector (lambda (table tags) (semanticdb-deep-find-tags-by-name-method table name tags)) @@ -1257,7 +1257,7 @@ See `semanticdb-find-translate-path' for details on PATH. The argument BRUTISH will be set so that searching includes all tables in the current project. FIND-FILE-MATCH indicates that any time a match is found, the file -associated wit that tag should be loaded into a buffer." +associated with that tag should be loaded into a buffer." (semanticdb-find-tags-collector (lambda (table tags) (semanticdb-deep-find-tags-for-completion-method table prefix tags)) diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index aaf43a1729..60a65b195b 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el @@ -89,7 +89,7 @@ same major mode as the current buffer.") :documentation "The tags belonging to this table.") (db-refs :initform nil :documentation - "List of `semanticdb-table' objects refering to this one. + "List of `semanticdb-table' objects referring to this one. These aren't saved, but are instead recalculated after load. See the file semanticdb-ref.el for how this slot is used.") (index :type semanticdb-abstract-search-index @@ -764,7 +764,7 @@ If a particular major mode wants to search any mode, put the Do not set the value of this variable permanently.") (defmacro semanticdb-with-match-any-mode (&rest body) - "A Semanticdb search occurring withing BODY will search tags in all modes. + "A Semanticdb search occurring within BODY will search tags in all modes. This temporarily sets `semanticdb-match-any-mode' while executing BODY." (declare (indent 0) (debug t)) `(let ((semanticdb-match-any-mode t)) diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index 3e090c004e..799aa45a82 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -1069,7 +1069,7 @@ Only in effect if `debug-on-error' is also non-nil." "For SYNTAX, execute FORMS with protection for unterminated syntax. If FORMS throws an error, treat this as a syntax problem, and execute the unterminated syntax code. FORMS should return a position. -Irregardless of an error, the cursor should be moved to the end of +Regardless of an error, the cursor should be moved to the end of the desired syntax, and a position returned. If `debug-on-error' is set, errors are not caught, so that you can debug them. diff --git a/lisp/composite.el b/lisp/composite.el index 77c5cd87b8..47d91c5d21 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -660,7 +660,7 @@ All non-spacing characters have this function in ;; align it at the center of the glyph of the ;; enclosing mark hoping that the enclosing mark ;; is big enough. We also have to adjust the - ;; x-offset and width of the mark ifself properly + ;; x-offset and width of the mark itself properly ;; depending on how the glyph is designed. ;; (non-spacing or not). For instance, when we diff --git a/lisp/descr-text.el b/lisp/descr-text.el index d6da428063..9305664e31 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -953,7 +953,7 @@ This function can be used as a value of ;; exclusively, we could call the (now unused) argument ;; _CALLBACK with hints on how to shorten the string if needed, ;; or with multiple usable strings which ElDoc picks according - ;; to its space contraints. + ;; to its space constraints. (describe-char-eldoc--format ch (unless (eq eldoc-echo-area-use-multiline-p t) diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index b75410ee22..810affa722 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -875,7 +875,7 @@ this object." ;; Now output readable lisp to recreate this object ;; It should look like this: ;; ( ... ) - ;; Each slot's slot is writen using its :writer. + ;; Each slot's slot is written using its :writer. (when eieio-print-indentation (princ (make-string (* eieio-print-depth 2) ? ))) (princ "(") diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index f8768051d1..8fc8db6222 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -421,7 +421,7 @@ pairs of the form (:KEY VALUE :KEY2 VALUE2...). KEY can be: * `:thing', VALUE is a short string or symbol designating what is being reported on. The documentation display engine can elect - to remove this information depending on space contraints; + to remove this information depending on space constraints; * `:face', VALUE is a symbol designating a face to use when displaying `:thing''s value. @@ -719,7 +719,7 @@ Other third-party strategy functions do not use produce callbacks to feed to `eldoc-documentation-function' and should endeavour to display the docstrings eventually produced." (let* (;; How many callbacks have been created by the strategy - ;; fucntion and passed to elements of + ;; function and passed to elements of ;; `eldoc-documentation-functions'. (howmany 0) ;; How many calls to callbacks we're still waiting on. Used diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index a8ce23284c..09c48d095c 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -594,7 +594,7 @@ MATCH is the pattern that needs to be matched, of the form: ((null (cdr else-alts)) (car else-alts)) (t (cons (car match) (nreverse else-alts))))))) ((memq match '(:pcase--succeed :pcase--fail)) (cons match match)) - (t (error "Uknown MATCH %s" match)))) + (t (error "Unknown MATCH %s" match)))) (defun pcase--split-rest (sym splitter rest) (let ((then-rest '()) @@ -725,7 +725,7 @@ MATCH is the pattern that needs to be matched, of the form: (pcase--app-subst-match match sym fun nsym)) (cdr match)))) ((memq match '(:pcase--succeed :pcase--fail)) match) - (t (error "Uknown MATCH %s" match)))) + (t (error "Unknown MATCH %s" match)))) (defun pcase--app-subst-rest (rest sym fun nsym) (mapcar (lambda (branch) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 0672f60752..fbcd7b8fb8 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -96,7 +96,7 @@ ;; out. ;; Q: But how can I then make out the sub-expressions? -;; A: Thats where the `sub-expression mode' comes in. In it only the +;; A: That's where the `sub-expression mode' comes in. In it only the ;; digit keys are assigned to perform an update that will flash the ;; corresponding subexp only. diff --git a/lisp/epa.el b/lisp/epa.el index b065887cef..609ac5d191 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -400,7 +400,7 @@ DOC is documentation text to insert at the start." e expired key. n never trust. m trust marginally. u trust ultimately. f trust fully (keys you have signed, usually). q trust status questionable. - trust status unspecified. - See GPG documentaion for more explanation. + See GPG documentation for more explanation. \n")) ;;;###autoload diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 8551cdd1de..309a78865d 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -152,7 +152,7 @@ ("EFnet: EU, PL, Warszawa" EFnet "irc.efnet.pl" 6667) ("EFnet: EU, RU, Moscow" EFnet "irc.rt.ru" ((6661 6669))) ("EFnet: EU, SE, Dalarna" EFnet "irc.du.se" ((6666 6669))) - ("EFnet: EU, SE, Gothenberg" EFnet "irc.hemmet.chalmers.se" ((6666 7000))) + ("EFnet: EU, SE, Gothenburg" EFnet "irc.hemmet.chalmers.se" ((6666 7000))) ("EFnet: EU, SE, Sweden" EFnet "irc.light.se" 6667) ("EFnet: EU, UK, London (carrier)" EFnet "irc.carrier1.net.uk" ((6666 6669))) ("EFnet: EU, UK, London (demon)" EFnet "efnet.demon.co.uk" ((6665 6669))) diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index d7388d480c..f748996acc 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1304,7 +1304,7 @@ downloaded into the agent." ;; gnus doesn't waste resources trying to fetch them. ;; NOTE: I don't do this for smaller gaps (< 100) as I don't - ;; want to modify the local file everytime someone restarts + ;; want to modify the local file every time someone restarts ;; gnus. The small gap will cause a tiny performance hit ;; when gnus tries, and fails, to retrieve the articles. ;; Still that should be smaller than opening a buffer, diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index cb39ffe946..ca61001091 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -546,7 +546,7 @@ If MODE is not set, try to find mode automatically." (mm-display-inline-fontify handle 'shell-script-mode)) (defun mm-display-javascript-inline (handle) - "Show JavsScript code from HANDLE inline." + "Show JavaScript code from HANDLE inline." (mm-display-inline-fontify handle 'javascript-mode)) ;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 7894285bdf..a43eee42ad 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -1425,7 +1425,7 @@ all. This may very well take some time.") (pop years))) (if years ;; Because we might not be limited in years, we must guard against - ;; infinite loops. Appart from cases like Feb 31, there are probably + ;; infinite loops. Apart from cases like Feb 31, there are probably ;; other ones, (no monday XXX 2nd etc). I don't know any algorithm to ;; decide this, so I assume that if we reach 10 years later, the ;; schedule is undecidable. diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 168c994bae..20f82e5cbd 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -211,7 +211,7 @@ By default this is the name of an email header field.") "Search groups in Gnus with assorted search engines." :group 'gnus) -(make-obsolete-variable 'nnir-summary-line-format "The formating +(make-obsolete-variable 'nnir-summary-line-format "The formatting specs previously unique to this variable may now be set in 'gnus-summary-line-format." "28.1") diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 4d653972c9..ed2cd26f0d 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1034,7 +1034,7 @@ then the specification is returned unchanged." ((facep fn) (hfy-face-attr-for-class fn hfy-display-class)) ;; FIXME: is this necessary? Faces can be symbols, but - ;; not symbols refering to other symbols? + ;; not symbols referring to other symbols? ((and (symbolp fn) (facep (symbol-value fn))) (hfy-face-attr-for-class diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el index b703d3dd2f..6b7419fa4c 100644 --- a/lisp/international/ucs-normalize.el +++ b/lisp/international/ucs-normalize.el @@ -98,7 +98,7 @@ ;; ;; D. Sorting and Composition of Smaller Blocks (`ucs-normalize-block-compose-chars') ;; -;; The block will be split to multiple samller blocks by starter +;; The block will be split to multiple smaller blocks by starter ;; characters. Each block is sorted, and composed if necessary. ;; ;; E. Composition of Entire Block (`ucs-normalize-compose-chars') diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 2d50df70fd..b319bf6e92 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -274,7 +274,7 @@ error of type `jsonrpc-error'. DEFERRED is passed to `jsonrpc-async-request', which see. If CANCEL-ON-INPUT is non-nil and the user inputs something while -the functino is waiting, then it exits immediately, returning +the function is waiting, then it exits immediately, returning CANCEL-ON-INPUT-RETVAL. Any future replies (normal or error) are ignored." (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer @@ -336,7 +336,7 @@ ignored." "Time in seconds before timing out a JSONRPC request.") -;;; Specfic to `jsonrpc-process-connection' +;;; Specific to `jsonrpc-process-connection' ;;; (defclass jsonrpc-process-connection (jsonrpc-connection) diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 3a59708d83..3437dba5e6 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -924,7 +924,7 @@ The ARG parameter is unused." nil (if kmacro-view-last-item (concat (cond ((= kmacro-view-item-no 2) "2nd") - ((= kmacro-view-item-no 3) "3nd") + ((= kmacro-view-item-no 3) "3rd") (t (format "%dth" kmacro-view-item-no))) " previous macro") "Last macro"))) diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el index 296dbd7897..3821785da7 100644 --- a/lisp/language/korea-util.el +++ b/lisp/language/korea-util.el @@ -46,7 +46,7 @@ (concat "korean-hangul" default-korean-keyboard)))) (defun quail-hangul-switch-symbol-ksc (&rest ignore) - "Swith to/from Korean symbol package." + "Switch to/from Korean symbol package." (interactive "i") (and current-input-method (if (string-equal current-input-method "korean-symbol") @@ -55,7 +55,7 @@ (activate-input-method "korean-symbol")))) (defun quail-hangul-switch-hanja (&rest ignore) - "Swith to/from Korean hanja package." + "Switch to/from Korean hanja package." (interactive "i") (and current-input-method (if (string-match "korean-hanja" current-input-method) diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el index a3fbb89bb8..d4577807c9 100644 --- a/lisp/mh-e/mh-limit.el +++ b/lisp/mh-e/mh-limit.el @@ -148,7 +148,7 @@ Use \\\\[mh-widen] to undo this command." "Put all following messages with same subject in sequence 'subject. If arg ALL is t, move to beginning of folder buffer to collect all messages. -If arg ALL is nil, collect only messages fron current one on forward. +If arg ALL is nil, collect only messages from current one on forward. Return number of messages put in the sequence: @@ -198,7 +198,7 @@ It would be desirable to avoid hard-coding this.") This function only works with an unthreaded folder. If arg ALL is t, move to beginning of folder buffer to collect all messages. If -arg ALL is nil, collect only messages fron current one on +arg ALL is nil, collect only messages from current one on forward. Return number of messages put in the sequence: diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el index 7e0981bed3..0732a16dc7 100644 --- a/lisp/mh-e/mh-speed.el +++ b/lisp/mh-e/mh-speed.el @@ -307,7 +307,7 @@ The function will expand out parent folders of FOLDER if needed." (mh-speed-toggle)) (goto-char (gethash prefix mh-speed-folder-map)))) (while suffix-list - ;; We always need atleast one toggle. We need two if the directory list + ;; We always need at least one toggle. We need two if the directory list ;; is stale since a folder was added. (when (equal prefix (get-text-property (mh-line-beginning-position) 'mh-folder)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7fd48b29a9..6d44ad23ad 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1297,7 +1297,7 @@ If nil, return `tramp-default-port'." (or (tramp-file-name-port vec) (tramp-get-method-parameter vec 'tramp-default-port))) -;; Comparision of file names is performed by `tramp-equal-remote'. +;; Comparison of file names is performed by `tramp-equal-remote'. (defun tramp-file-name-equal-p (vec1 vec2) "Check, whether VEC1 and VEC2 denote the same `tramp-file-name'." (and (tramp-file-name-p vec1) (tramp-file-name-p vec2) @@ -4639,7 +4639,7 @@ If it doesn't exist, generate a new one." (with-tramp-connection-property (tramp-get-connection-process vec) "device" (cons -1 (setq tramp-devices (1+ tramp-devices))))) -;; Comparision of vectors is performed by `tramp-file-name-equal-p'. +;; Comparison of vectors is performed by `tramp-file-name-equal-p'. (defun tramp-equal-remote (file1 file2) "Check, whether the remote parts of FILE1 and FILE2 are identical. The check depends on method, user and host name of the files. If diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index 7c4941e725..3d4843a39c 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el @@ -582,7 +582,7 @@ Solutions are sorted from least to greatest Hamming weight." (math-sub dest org)))) ;; transferm is the transfer matrix, ie it is the 25x25 - ;; matrix applied everytime a flip is carried out where a + ;; matrix applied every time a flip is carried out where a ;; flip is defined by a 25x1 Dirac vector --- ie all zeros ;; but 1 in the position that is flipped. (transferm diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 7d10027c76..4e336c0a06 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2697,7 +2697,7 @@ comment at the start of cc-engine.el for more info." ;; or the car of the list is the "position element" of ELT, the position ;; where ELT is valid. ;; - ;; POINT is left at the postition for which the returned state is valid. It + ;; POINT is left at the position for which the returned state is valid. It ;; will be either the position element of ELT, or one character before ;; that. (The latter happens in Emacs <= 25 and XEmacs, when ELT indicates ;; its position element directly follows a potential first character of a @@ -2767,7 +2767,7 @@ comment at the start of cc-engine.el for more info." ((nth 3 state) ; A string (list (point) (nth 3 state) (nth 8 state))) ((and (nth 4 state) ; A comment - (not (eq (nth 7 state) 'syntax-table))) ; but not a psuedo comment. + (not (eq (nth 7 state) 'syntax-table))) ; but not a pseudo comment. (list (point) (if (eq (nth 7 state) 1) 'c++ 'c) (nth 8 state))) @@ -2894,7 +2894,7 @@ comment at the start of cc-engine.el for more info." (setq nc-list (cdr nc-list)))))) (defun c-semi-get-near-cache-entry (here) - ;; Return the near cache entry at the highest postion before HERE, if any, + ;; Return the near cache entry at the highest position before HERE, if any, ;; or nil. The near cache entry is of the form (POSITION . STATE), where ;; STATE has the form of a result of `parse-partial-sexp'. (let ((nc-pos-state @@ -7170,7 +7170,7 @@ comment at the start of cc-engine.el for more info." ;; characters.) If the raw string is not terminated, E\) and E\" are set to ;; nil. ;; - ;; Note: this function is dependant upon the correct syntax-table text + ;; Note: this function is dependent upon the correct syntax-table text ;; properties being set. (let ((state (c-semi-pp-to-literal (point))) open-quote-pos open-paren-pos close-paren-pos close-quote-pos id) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d35eab15a2..468ffc949a 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -814,7 +814,7 @@ capable syntax engines). (defvar cperl-speed 'please-ignore-this-line "This is an incomplete compendium of what is available in other parts -of CPerl documentation. (Please inform me if I skept anything.) +of CPerl documentation. (Please inform me if I skipped anything.) There is a perception that CPerl is slower than alternatives. This part of documentation is designed to overcome this misconception. @@ -4486,7 +4486,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', 'syntax-table cperl-st-cfence)))) (setq was-subgr nil)) (t ; (?#)-comment - ;; Inside "(" and "\" arn't special in any way + ;; Inside "(" and "\" aren't special in any way ;; Works also if the outside delimiters are (). (or;;(if (eq (char-after b) ?\) ) ;;(re-search-forward diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 72b94a57b4..b4803687b5 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -683,7 +683,7 @@ otherwise build the summary from TYPE and SYMBOL." "List of functions to be run from `elisp--xref-find-definitions' to add additional xrefs. Called with one arg; the symbol whose definition is desired. Each function should return a list of xrefs, or nil; the first -non-nil result supercedes the xrefs produced by +non-nil result supersedes the xrefs produced by `elisp--xref-find-definitions'.") (cl-defmethod xref-backend-definitions ((_backend (eql elisp)) identifier) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 2c5c36504a..f6af1f2ea8 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1845,7 +1845,7 @@ Also see the documentation of the `tags-file-name' variable." Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit (\\[keyboard-quit], RET or q), you can resume the query replace with the command \\[tags-loop-continue]. -For non-interactive use, superceded by `fileloop-initialize-replace'." +For non-interactive use, superseded by `fileloop-initialize-replace'." (declare (advertised-calling-convention (from to &optional delimited) "27.1")) (interactive (query-replace-read-args "Tags query replace (regexp)" t t)) (fileloop-initialize-replace diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index bdb775795a..b286208fff 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -226,10 +226,10 @@ Specifically, start it when the saved buffer is actually displayed." (defcustom flymake-suppress-zero-counters :warning "Control appearance of zero-valued diagnostic counters in mode line. -If set to t, supress all zero counters. If set to a severity +If set to t, suppress all zero counters. If set to a severity symbol like `:warning' (the default) suppress zero counters less severe than that severity, according to `warning-numeric-level'. -If set to nil, don't supress any zero counters." +If set to nil, don't suppress any zero counters." :type 'symbol) (when (fboundp 'define-fringe-bitmap) @@ -632,7 +632,7 @@ associated `flymake-category' return DEFAULT." for (ov-prop . value) in (append (reverse (flymake--diag-overlay-properties diagnostic)) - (reverse ; ensure ealier props override later ones + (reverse ; ensure earlier props override later ones (flymake--lookup-type-property type 'flymake-overlay-control)) (alist-get type flymake-diagnostic-types-alist)) do (overlay-put ov ov-prop value)) @@ -1004,7 +1004,7 @@ special *Flymake log* buffer." :group 'flymake :lighter (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t) (add-hook 'eldoc-documentation-functions 'flymake-eldoc-function t t) - ;; If Flymake happened to be alrady already ON, we must cleanup + ;; If Flymake happened to be already already ON, we must cleanup ;; existing diagnostic overlays, lest we forget them by blindly ;; reinitializing `flymake--backend-state' in the next line. ;; See https://github.com/joaotavora/eglot/issues/223. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index e5c62f9148..8d6f8af232 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2547,7 +2547,7 @@ file names include non-ASCII characters." (defun gdb-gdb (_output-field) ;; This is needed because the "explore" command is not ended by the - ;; likes of "end" or "quit", but instead by a RET at the approriate + ;; likes of "end" or "quit", but instead by a RET at the appropriate ;; place, and we know we have exited "explore" when we get the ;; "(gdb)" prompt. (and (> gdb-control-level 0) diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 0b1ba80edc..9177b13418 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -301,7 +301,7 @@ Several variables affect how the hiding is done: ;; `hide-ifdef-env' is now a global variable. ;; We can still simulate the behavior of older hideif versions (i.e. ;; `hide-ifdef-env' being buffer local) by clearing this variable - ;; (C-c @ C) everytime before hiding current buffer. + ;; (C-c @ C) every time before hiding current buffer. ;; (set (make-local-variable 'hide-ifdef-env) ;; (default-value 'hide-ifdef-env)) (set 'hide-ifdef-env (default-value 'hide-ifdef-env)) @@ -1490,7 +1490,7 @@ Refer to `hide-ifdef-expand-reinclusion-protection' for more details." (test (hif-canonicalize hif-ifx-regexp)) (range (hif-find-range)) (elifs (hif-range-elif range)) - (if-part t) ; Everytime we start from if-part + (if-part t) ; Every time we start from if-part (complete nil)) ;; (message "test = %s" test) (sit-for 1) @@ -1650,7 +1650,7 @@ first arg will be `hif-etc'." ;; postponed the evaluation process one stage and store the "parsed tree" ;; into symbol database. The evaluation process was then "strings -> tokens ;; -> [parsed tree] -> value". Hideif therefore run slower since it need to -;; evaluate the parsed tree everytime when trying to expand the symbol. These +;; evaluate the parsed tree every time when trying to expand the symbol. These ;; temporarily code changes are obsolete and not in Emacs source repository. ;; ;; Furthermore, CPP did allow partial expression to be defined in several @@ -1659,7 +1659,7 @@ first arg will be `hif-etc'." ;; further, otherwise those partial expression will be fail on parsing and ;; we'll miss all macros that reference it. The evaluation process thus ;; became "strings -> [tokens] -> parsed tree -> value." This degraded the -;; performance since we need to parse tokens and evaluate them everytime +;; performance since we need to parse tokens and evaluate them every time ;; when that symbol is referenced. ;; ;; In real cases I found a lot portion of macros are "simple macros" that diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 235279e226..01cc330dc2 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -1413,7 +1413,7 @@ Fill comments, backslashed lines, and variable definitions specially." "Leave the browser and return to the makefile buffer." (interactive) (let ((my-client makefile-browser-client)) - (setq makefile-browser-client nil) ; we quitted, so NO client! + (setq makefile-browser-client nil) ; we quit, so NO client! (set-buffer-modified-p nil) (quit-window t) (pop-to-buffer my-client))) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 39120457b6..8c550b5768 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1030,7 +1030,7 @@ Each condition is either: * `or': the cdr is a list of recursive conditions, of which at least one has to be met. -If any of these conditions are satified for a buffer in the +If any of these conditions are satisfied for a buffer in the current project, it will be killed." :type '(repeat (choice regexp function symbol (cons :tag "Major mode" @@ -1225,7 +1225,7 @@ command to run when KEY is pressed. LABEL is used to distinguish the menu entries in the dispatch menu.") (defun project--keymap-prompt () - "Return a prompt for the project swithing dispatch menu." + "Return a prompt for the project switching dispatch menu." (mapconcat (pcase-lambda (`(,key ,label)) (format "[%s] %s" diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d2eb5f268b..7c3b611cd9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2059,7 +2059,7 @@ that they are prioritized when looking for executables." When this variable is non-nil, values are exported into remote hosts PATH before starting processes. Values defined in `python-shell-exec-path' will take precedence to paths defined -here. Normally you wont use this variable directly unless you +here. Normally you won't use this variable directly unless you plan to ensure a particular set of paths to all Python shell executed through tramp connections." :version "25.1" @@ -4130,7 +4130,7 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'." (goto-char (point-max))) (point-marker))) (multi-line-p - ;; Docstring styles may vary for oneliners and multi-liners. + ;; Docstring styles may vary for one-liners and multi-liners. (> (count-matches "\n" str-start-pos str-end-pos) 0)) (delimiters-style (pcase python-fill-docstring-style @@ -5336,7 +5336,7 @@ To use `flake8' you would set this to (\"flake8\" \"-\")." :group 'python-flymake :type '(repeat string)) -;; The default regexp accomodates for older pyflakes, which did not +;; The default regexp accommodates for older pyflakes, which did not ;; report the column number, and at the same time it's compatible with ;; flake8 output, although it may be redefined to explicitly match the ;; TYPE @@ -5536,7 +5536,7 @@ REPORT-FN is Flymake's callback function." (^ '(- (1+ (current-indentation)))))) (with-no-warnings - ;; supress warnings about eldoc-documentation-function being obsolete + ;; suppress warnings about eldoc-documentation-function being obsolete (if (null eldoc-documentation-function) ;; Emacs<25 (set (make-local-variable 'eldoc-documentation-function) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 5a469bb967..b1abefe534 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -1284,7 +1284,7 @@ won't merge conflict." (defcustom verilog-auto-inst-template-required nil "If non-nil, when creating a port with AUTOINST, require a template. -Any port which does not have a template will be ommitted from the +Any port which does not have a template will be omitted from the instantiation. If nil, if a port is not templated it will be inserted to connect diff --git a/lisp/replace.el b/lisp/replace.el index dc6e67ff40..035031ac93 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1674,7 +1674,7 @@ See also `multi-occur'." (with-current-buffer occur-buf ;; Make the default-directory of the *Occur* buffer match that of - ;; the buffer where the occurences come from + ;; the buffer where the occurrences come from (setq default-directory source-buffer-default-directory) (if (stringp nlines) (fundamental-mode) ;; This is for collect operation. diff --git a/lisp/ses.el b/lisp/ses.el index a2e603307e..64d03a7fe5 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -3672,7 +3672,7 @@ highlighted range in the spreadsheet." ;; 'rowcol' corresponding to 'ses-cell' property of symbol ;; 'sym'. Both must be the same. (unless (eq sym old-name) - (error "Spreadsheet is broken, both symbols %S and %S refering to cell (%d,%d)" sym old-name row col)) + (error "Spreadsheet is broken, both symbols %S and %S referring to cell (%d,%d)" sym old-name row col)) (if new-rowcol ;; the new name is of A1 type, so we test that the coordinate ;; inferred from new name @@ -3685,7 +3685,7 @@ highlighted range in the spreadsheet." (puthash new-name rowcol ses--named-cell-hashmap)) (push `(ses-rename-cell ,old-name ,cell) buffer-undo-list) (cl-pushnew rowcol ses--deferred-write :test #'equal) - ;; Replace name by new name in formula of cells refering to renamed cell. + ;; Replace name by new name in formula of cells referring to renamed cell. (dolist (ref (ses-cell-references cell)) (let* ((x (ses-sym-rowcol ref)) (xcell (ses-get-cell (car x) (cdr x)))) diff --git a/lisp/so-long.el b/lisp/so-long.el index f8a5cc920d..6ae8d0aec8 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -833,7 +833,7 @@ available in Emacs versions < 27). For more information refer to info node `(emacs) Bidirectional Editing' and info node `(elisp) Bidirectional Display'. Buffers are made read-only by default to prevent potentially-slow editing from -occurring inadvertantly, as buffers with excessively long lines are likely not +occurring inadvertently, as buffers with excessively long lines are likely not intended to be edited manually." :type '(alist :key-type (variable :tag "Variable") :value-type (sexp :tag "Value")) diff --git a/lisp/subr.el b/lisp/subr.el index f00e4ef867..377d914718 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4452,7 +4452,7 @@ This function returns a freshly created string." ;; We didn't have a match after all. (setq i (1+ i)) ;; We had one, so gather the previous part and the - ;; substition. + ;; substitution. (when (not (= start i)) (push (substring instring start i) result)) (push tostring result) diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index 097e769de8..53f918cff9 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -187,7 +187,7 @@ if that value is non-nil." (define-widget 'widget-browse 'push-button "Button for creating a widget browser. -The :value of the widget shuld be the widget to be browsed." +The :value of the widget should be the widget to be browsed." :format "%[[%v]%]" :value-create 'widget-browse-value-create :action 'widget-browse-action) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index e5c1b47f3b..caf57ae43f 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -217,7 +217,7 @@ If N is omitted or nil, scroll down by one line." (defun xwidget-webkit-scroll-forward (&optional n) "Scroll webkit horizontally by N chars. The width of char is calculated with `window-font-width'. -If N is ommited or nil, scroll forwards by one char." +If N is omitted or nil, scroll forwards by one char." (interactive "p") (xwidget-webkit-execute-script (xwidget-webkit-current-session) @@ -227,7 +227,7 @@ If N is ommited or nil, scroll forwards by one char." (defun xwidget-webkit-scroll-backward (&optional n) "Scroll webkit back by N chars. The width of char is calculated with `window-font-width'. -If N is ommited or nil, scroll backwards by one char." +If N is omitted or nil, scroll backwards by one char." (interactive "p") (xwidget-webkit-execute-script (xwidget-webkit-current-session) diff --git a/src/dispextern.h b/src/dispextern.h index e20f7bb7b6..0d982f7917 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -102,7 +102,7 @@ typedef XImage *Emacs_Pix_Context; #endif #ifdef USE_CAIRO -/* Mininal version of XImage. */ +/* Minimal version of XImage. */ typedef struct { int width, height; /* size of image */ diff --git a/src/keyboard.c b/src/keyboard.c index 8525d3b8de..af075a42c7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5696,7 +5696,7 @@ make_lispy_event (struct input_event *event) ignore_mouse_drag_p = false; } - /* Now we're releasing a button - check the co-ordinates to + /* Now we're releasing a button - check the coordinates to see if this was a click or a drag. */ else if (event->modifiers & up_modifier) { @@ -6644,7 +6644,7 @@ has the same base event type and all the specified modifiers. */) DEFUN ("internal-handle-focus-in", Finternal_handle_focus_in, Sinternal_handle_focus_in, 1, 1, 0, doc: /* Internally handle focus-in events. -This function potentially generates an artifical switch-frame event. */) +This function potentially generates an artificial switch-frame event. */) (Lisp_Object event) { Lisp_Object frame; diff --git a/src/nsxwidget.m b/src/nsxwidget.m index 2910d97225..3c6402c03f 100644 --- a/src/nsxwidget.m +++ b/src/nsxwidget.m @@ -36,7 +36,7 @@ rendering techniques, which is used by GTK xwidget implementation; Specifically NSView level view sharing / copying is not working. - *** So only one view can be associcated with a model. *** + *** So only one view can be associated with a model. *** With this decision, implementation is plain and can expect best out of webkit2's rationale. But process and session structures will diff --git a/src/pdumper.c b/src/pdumper.c index 217ffa6783..909900417d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -1817,7 +1817,7 @@ dump_field_lv_or_rawptr (struct dump_context *ctx, /* Now value is the Lisp_Object to which we want to point whether or not the field is a raw pointer (in which case we just synthesized - the Lisp_Object outselves) or a Lisp_Object (in which case we + the Lisp_Object ourselves) or a Lisp_Object (in which case we just copied the thing). Add a fixup or relocation. */ intptr_t out_value; @@ -1908,7 +1908,7 @@ dump_field_fixup_later (struct dump_context *ctx, (void) field_relpos (in_start, in_field); } -/* Mark an output object field, which is as wide as a poiner, as being +/* Mark an output object field, which is as wide as a pointer, as being fixed up to point to a specific offset in the dump. */ static void dump_field_ptr_to_dump_offset (struct dump_context *ctx, diff --git a/src/term.c b/src/term.c index 3f528585ba..3677644845 100644 --- a/src/term.c +++ b/src/term.c @@ -2416,7 +2416,7 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, pos_y = row->y + WINDOW_TOP_EDGE_Y (w); pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); - /* Save current cursor co-ordinates. */ + /* Save current cursor coordinates. */ save_y = curY (tty); save_x = curX (tty); cursor_to (f, pos_y, pos_x); diff --git a/src/w32fns.c b/src/w32fns.c index ab864332e7..3134f678f3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3640,7 +3640,7 @@ get_wm_chars (HWND aWnd, int *buf, int buflen, int ignore_ctrl, int ctrl, non-Emacs window with the same language environment, and using (dead)keys there would change the value stored in the kernel, but not this value. */ /* A layout may emit deadkey=0. It looks like this would reset the state - of the kernel's finite automaton (equivalent to emiting 0-length string, + of the kernel's finite automaton (equivalent to emitting 0-length string, which is otherwise impossible in the dead-key map of a layout). Be ready to treat the case when this delivers WM_(SYS)DEADCHAR. */ static int after_deadkey = -1; @@ -3701,7 +3701,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, of w32_get_key_modifiers (). */ wmsg.dwModifiers = w32_kbd_mods_to_emacs (console_modifiers, wParam); - /* What follows is just heuristics; the correct treatement requires + /* What follows is just heuristics; the correct treatment requires non-destructive ToUnicode(): http://search.cpan.org/~ilyaz/UI-KeyboardLayout/lib/UI/KeyboardLayout.pm#Can_an_application_on_Windows_accept_keyboard_events?_Part_IV:_application-specific_modifiers @@ -7001,7 +7001,7 @@ w32_create_tip_frame (struct w32_display_info *dpyinfo, Lisp_Object parms) Frame parameters may be changed if .Xdefaults contains specifications for the default font. For example, if there is an `Emacs.default.attributeBackground: pink', the `background-color' - attribute of the frame get's set, which let's the internal border + attribute of the frame gets set, which let's the internal border of the tooltip frame appear in pink. Prevent this. */ { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); @@ -7085,7 +7085,7 @@ compute_tip_xy (struct frame *f, /* If multiple monitor support is available, constrain the tip onto the current monitor. This improves the above by allowing negative - co-ordinates if monitor positions are such that they are valid, and + coordinates if monitor positions are such that they are valid, and snaps a tooltip onto a single monitor if we are close to the edge where it would otherwise flow onto the other monitor (or into nothingness if there is a gap in the overlap). */ @@ -8079,7 +8079,7 @@ handler application, but typically it is one of the following common \"pastelink\" - create a shortcut in DOCUMENT (which must be a directory) the file or directory whose name is in the clipboard. - \"runas\" - run DOCUMENT, which must be an excutable file, with + \"runas\" - run DOCUMENT, which must be an executable file, with elevated privileges (a.k.a. \"as Administrator\"). \"properties\" - open the property sheet dialog for DOCUMENT. diff --git a/src/w32heap.c b/src/w32heap.c index ececc73c02..ba3550b6e9 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -884,7 +884,7 @@ setrlimit (rlimit_resource_t rltype, const struct rlimit *rlp) { case RLIMIT_STACK: case RLIMIT_NOFILE: - /* We cannot modfy these limits, so we always fail. */ + /* We cannot modify these limits, so we always fail. */ errno = EPERM; break; default: diff --git a/src/w32menu.c b/src/w32menu.c index e076043f7b..da2db78a94 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1485,7 +1485,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) crash Emacs when we try to display those "strings". It is unclear why we get these dwItemData, or what they are: sometimes they point to a wchar_t string that is the menu - title, sometimes to someting that doesn't look like text + title, sometimes to something that doesn't look like text at all. (The problematic data also comes with the 0x0800 bit set, but this bit is not documented, so we don't want to depend on it.) */ diff --git a/src/w32term.c b/src/w32term.c index 2669f29b56..e0618e4f52 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -6877,7 +6877,7 @@ w32_make_frame_visible (struct frame *f) /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL causes unexpected behavior when unminimizing frames that were previously maximized. But only SW_SHOWNORMAL works properly for - frames that were truely hidden (using make-frame-invisible), so + frames that were truly hidden (using make-frame-invisible), so we need it to avoid Bug#5482. It seems that iconified is only set for minimized windows that are still visible, so use that to determine the appropriate flag to pass ShowWindow. */ diff --git a/src/w32term.h b/src/w32term.h index 8ba248013c..694493c6c8 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -476,7 +476,7 @@ struct scroll_bar { editing large files, we establish a minimum height by always drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below where they would be normally; the bottom and top are in a - different co-ordinate system. */ + different coordinate system. */ int start, end; /* If the scroll bar handle is currently being dragged by the user, diff --git a/src/xdisp.c b/src/xdisp.c index 49225c56fe..ac5307f4ac 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -510,7 +510,7 @@ static Lisp_Object list_of_error; || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t')))) /* These are the category sets we use. They are defined by - kinsoku.el and chracters.el. */ + kinsoku.el and characters.el. */ #define NOT_AT_EOL '<' #define NOT_AT_BOL '>' #define LINE_BREAKABLE '|' @@ -2230,7 +2230,7 @@ estimate_mode_line_height (struct frame *f, enum face_id face_id) } /* Given a pixel position (PIX_X, PIX_Y) on frame F, return glyph - co-ordinates in (*X, *Y). Set *BOUNDS to the rectangle that the + coordinates in (*X, *Y). Set *BOUNDS to the rectangle that the glyph at X, Y occupies, if BOUNDS != 0. If NOCLIP, do not force the value into range. */ @@ -3744,7 +3744,7 @@ init_to_row_end (struct it *it, struct window *w, struct glyph_row *row) it->continuation_lines_width = row->continuation_lines_width + row->pixel_width; CHECK_IT (it); - /* Initializing IT in the presense of compositions in reordered + /* Initializing IT in the presence of compositions in reordered rows is tricky: row->end above will generally cause us to start at position that is not the first one in the logical order, and we might therefore miss the composition earlier in diff --git a/src/xfns.c b/src/xfns.c index 78f977bf0a..46e4bd73a6 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6535,7 +6535,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms) Frame parameters may be changed if .Xdefaults contains specifications for the default font. For example, if there is an `Emacs.default.attributeBackground: pink', the `background-color' - attribute of the frame get's set, which let's the internal border + attribute of the frame gets set, which let's the internal border of the tooltip frame appear in pink. Prevent this. */ { Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); diff --git a/src/xterm.h b/src/xterm.h index db8d584781..0f8ba5e82b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -890,7 +890,7 @@ struct scroll_bar editing large files, we establish a minimum height by always drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below where they would be normally; the bottom and top are in a - different co-ordinate system. */ + different coordinate system. */ int start, end; /* If the scroll bar handle is currently being dragged by the user, diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index 54ec5d673c..6bb8ced1f3 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -40,7 +40,7 @@ (should-not (dired-do-shell-command "ls ? ./`?`" nil files))) (delete-file foo)))) -;; Auxiliar macro for `dired-test-bug28834': it binds +;; Auxiliary macro for `dired-test-bug28834': it binds ;; `dired-create-destination-dirs' to CREATE-DIRS and execute BODY. ;; If YES-OR-NO is non-nil, it binds `yes-or-no-p' to ;; to avoid the prompt. diff --git a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el index 4bad36080a..c77f2dc499 100644 --- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el +++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el @@ -44,7 +44,7 @@ (0 (progn (add-text-properties (match-beginning 0) (match-end 0) - '(help-echo "Baloon tip: Fly smoothly!")) + '(help-echo "Balloon tip: Fly smoothly!")) font-lock-warning-face)))) "Highlight rules for `faceup-test-mode'.") diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index febac8f478..b1b7847961 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -153,7 +153,7 @@ noindent\" 3 (should (equal (buffer-string) str))))) (ert-deftest indent-sexp-stop-before-eol-non-lisp () - "`indent-sexp' shouldn't be too agressive in non-Lisp modes." + "`indent-sexp' shouldn't be too aggressive in non-Lisp modes." ;; See https://debbugs.gnu.org/35286#13. (with-temp-buffer (prolog-mode) diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index ba0783ba8c..4c745ea6d7 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -828,7 +828,7 @@ In the first decryption this passphrase is hardcoded, in the second one it method "uid1@example.org" "sub@example.org" nil ;; Beware! For passphrases copy-sequence is necessary, as they may ;; be erased, which actually changes the function's code and causes - ;; multiple invokations to fail. I was surprised... + ;; multiple invocations to fail. I was surprised... (copy-sequence "Passphrase") t) (mml-secure-test-en-decrypt-with-passphrase method "uid1@example.org" "sub@example.org" nil diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el index 168a2c950c..1ef83daed2 100644 --- a/test/lisp/jsonrpc-tests.el +++ b/test/lisp/jsonrpc-tests.el @@ -167,7 +167,7 @@ (ert-deftest deferred-action-toolate () :tags '(:expensive-test) - "Deferred request fails because noone clears the flag." + "Deferred request fails because no one clears the flag." (jsonrpc--with-emacsrpc-fixture (conn) (should-error (jsonrpc-request conn '+ [1 2] diff --git a/test/manual/etags/c-src/emacs/src/keyboard.c b/test/manual/etags/c-src/emacs/src/keyboard.c index d4e3848afc..e869363152 100644 --- a/test/manual/etags/c-src/emacs/src/keyboard.c +++ b/test/manual/etags/c-src/emacs/src/keyboard.c @@ -5754,7 +5754,7 @@ make_lispy_event (struct input_event *event) ignore_mouse_drag_p = 0; } - /* Now we're releasing a button - check the co-ordinates to + /* Now we're releasing a button - check the coordinates to see if this was a click or a drag. */ else if (event->modifiers & up_modifier) { diff --git a/test/manual/etags/y-src/parse.c b/test/manual/etags/y-src/parse.c index e35d862ca5..0415c4a118 100644 --- a/test/manual/etags/y-src/parse.c +++ b/test/manual/etags/y-src/parse.c @@ -1917,7 +1917,7 @@ yylex FUN0() } #ifdef TEST if(nn==n_usr_funs) { - io_error_msg("Couln't turn fp into a ##"); + io_error_msg("Couldn't turn fp into a ##"); parse_error=BAD_FUNC; return ERROR; } commit e72d3793bcec67f9312e9d011e4357f8986bf837 Author: Lars Ingebrigtsen Date: Mon Sep 21 14:15:34 2020 +0200 Allow disabling the verbose eldoc truncation message * doc/emacs/programs.texi (Lisp Doc): Document it. * lisp/emacs-lisp/eldoc.el (eldoc-display-truncation-message): New variable (bug#43543). (eldoc--handle-docs): Use it. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 1c33d7dccc..f0dd62dad4 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1291,6 +1291,12 @@ ways. This abnormal hook holds documentation functions. It acts as a collection of backends for ElDoc. This is what modes should use to register their documentation functions with ElDoc. + +@vindex eldoc-display-truncation-message +@item eldoc-display-truncation-message +If non-@code{nil} (the default), display a verbose message about how +to view a complete documentation (if it has been truncated in the echo +area). If @code{nil}, just mark truncated messages with @samp{...}. @end table @node Hideshow diff --git a/etc/NEWS b/etc/NEWS index 1f52341ae4..0d0d9daeee 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -545,9 +545,16 @@ supplied error message. which appends a unique suffix to the Edebug name of the current definition. -+++ ** ElDoc ++++ +*** New user option 'eldoc-display-truncation-message'. +If non-nil (the default), eldoc will display a message saying +something like "(Documentation truncated. Use `M-x eldoc-doc-buffer' +to see rest" when a message has been truncated. If nil, truncated +messages will be marked with just "..." at the end. + ++++ *** New hook 'eldoc-documentation-functions'. This hook is intended to be used for registering doc string functions. These functions don't need to produce the doc string right away, they @@ -555,6 +562,7 @@ may arrange for it to be produced asynchronously. The results of all doc string functions are accessible to the user through the user option 'eldoc-documentation-strategy'. ++++ *** New user option 'eldoc-documentation-strategy'. The built-in choices available for this user option let users compose the results of 'eldoc-documentation-functions' in various ways, even diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 772c907c28..f8768051d1 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -67,6 +67,12 @@ If this variable is set to 0, no idle time is required." Changing the value requires toggling `eldoc-mode'." :type 'boolean) +(defcustom eldoc-display-truncation-message t + "If non-nil, provide verbose help when a message has been truncated. +If nil, truncated messages will just have \"...\" appended." + :type 'boolean + :version "28.1") + ;;;###autoload (defcustom eldoc-minor-mode-string (purecopy " ElDoc") "String to display in mode line when ElDoc Mode is enabled; nil for none." @@ -524,10 +530,13 @@ Honor most of `eldoc-echo-area-use-multiline-p'." (cl-return (concat (buffer-substring (point-min) (point)) - (and truncated + (and + truncated + (if eldoc-display-truncation-message (format "\n(Documentation truncated. Use `%s' to see rest)" - (substitute-command-keys "\\[eldoc-doc-buffer]"))))))))) + (substitute-command-keys "\\[eldoc-doc-buffer]")) + "...")))))))) ((= available 1) ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? (with-current-buffer (eldoc-doc-buffer) commit 4cb1e30988cc5c30bfc27a393c9b616870a3fc9e Author: Nicolas Graner Date: Mon Sep 21 13:57:31 2020 +0200 Fix default value in checkboxes in eww * lisp/net/eww.el (eww-submit): Checked checkboxes need a default value (bug#43542). Copyright-paperwork-exempt: yes diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8918be0d2e..1ed87c6625 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1634,7 +1634,7 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (cond ((member (plist-get input :type) '("checkbox" "radio")) (when (plist-get input :checked) - (push (cons name (plist-get input :value)) + (push (cons name (or (plist-get input :value) "on")) values))) ((equal (plist-get input :type) "file") (when-let ((file (plist-get input :filename))) commit 63f9d9af81a2758bfb3699ce223d9cbf891257d6 Author: Michael Albinus Date: Mon Sep 21 13:41:30 2020 +0200 Add D-Bus tests * doc/misc/dbus.texi (Type Conversion): Precise basic type values. * lisp/net/dbus.el (dbus-register-property): Send signal directly. * src/dbusbind.c (xd_signature): Accept non-nil objects for DBUS_TYPE_BOOLEAN. * test/lisp/net/dbus-tests.el (dbus-test01-basic-types) (dbus-test01-compound-types): New tests. diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index c317e5dd23..95d6523d36 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1025,15 +1025,16 @@ but different to (dbus-call-method @dots{} :int32 @var{nat-number} :signature @var{string}) @end lisp -The value for a byte D-Bus type can be any integer in the range 0 -through 255. If a character is used as argument, modifiers -represented outside this range are stripped off. For example, -@code{:byte ?x} is equal to @code{:byte ?\M-x}, but it is not equal to -@code{:byte ?\C-x} or @code{:byte ?\M-\C-x}. Signed and unsigned -integer D-Bus types expect a corresponding integer value. - -All basic D-Bus types based on a number are truncated to their type -range. For example, @code{:byte 1025} is equal to @code{:byte 1}. +The value for a D-Bus byte type can be any natural number. If the +number is larger than 255, it is truncated to the least significant +byte. For example, @code{:byte 1025} is equal to @code{:byte 1}. If +a character is used as argument, modifiers represented outside this +range are stripped off. For example, @code{:byte ?x} is equal to +@code{:byte ?\M-x}, but it is not equal to @code{:byte ?\C-x} or +@code{:byte ?\M-\C-x}. + +Signed and unsigned D-Bus integer types expect a corresponding integer +value. A unix file descriptor is restricted to the values 0@dots{}9. If typed explicitly, a non-@code{nil} boolean value like @code{:boolean 'symbol} is handled like @code{t} or @code{:boolean t}. diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 458ee81d70..86db7cbf18 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1660,6 +1660,19 @@ clients from discovering the still incomplete interface. (unless (or dont-register-service (member service (dbus-list-names bus))) (dbus-register-service bus service)) + ;; Send the PropertiesChanged signal. + (when emits-signal + (dbus-send-signal + bus service path dbus-interface-properties "PropertiesChanged" + ;; changed_properties. + (if (eq access :write) + '(:array: :signature "{sv}") + `(:array (:dict-entry ,property ,value))) + ;; invalidated_properties. + (if (eq access :write) + `(:array ,property) + '(:array)))) + ;; Create a hash table entry. We use nil for the unique name, ;; because the property might be accessed from anybody. (let ((key (list :property bus interface property)) @@ -1670,14 +1683,6 @@ clients from discovering the still incomplete interface. bus service path interface property)))) (puthash key val dbus-registered-objects-table) - ;; Set or Get the property, in order to validate the property's - ;; value and to send the PropertiesChanged signal. - (when (member service (dbus-list-names bus)) - (if (eq access :read) - (dbus-get-property bus service path interface property) - (apply - #'dbus-set-property bus service path interface property (cdr value)))) - ;; Return the object. (list key (list service path))))) diff --git a/src/dbusbind.c b/src/dbusbind.c index eb883e5dc8..4c5ab48580 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -374,8 +374,8 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) break; case DBUS_TYPE_BOOLEAN: - if (!EQ (object, Qt) && !NILP (object)) - wrong_type_argument (intern ("booleanp"), object); + /* Any non-nil object will be regarded as `t', so we don't apply + further type check. */ sprintf (signature, "%c", dtype); break; diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index b12b02771a..58ad0516c5 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -91,6 +91,275 @@ (string-equal (dbus-unescape-from-identifier (dbus-escape-as-identifier mstr)) mstr)))) +(ert-deftest dbus-test01-basic-types () + "Check basic D-Bus type arguments." + ;; Unknown keyword. + (should-error + (dbus-check-arguments :session dbus--test-service :keyword) + :type 'wrong-type-argument) + + ;; `:string'. + (should (dbus-check-arguments :session dbus--test-service "string")) + (should (dbus-check-arguments :session dbus--test-service :string "string")) + (should-error + (dbus-check-arguments :session dbus--test-service :string 0.5) + :type 'wrong-type-argument) + + ;; `:object-path'. + (should + (dbus-check-arguments + :session dbus--test-service :object-path "/object/path")) + (should-error + (dbus-check-arguments :session dbus--test-service :object-path "string") + :type 'dbus-error) + (should-error + (dbus-check-arguments :session dbus--test-service :object-path 0.5) + :type 'wrong-type-argument) + + ;; `:signature'. + (should (dbus-check-arguments :session dbus--test-service :signature "as")) + (should-error + (dbus-check-arguments :session dbus--test-service :signature "string") + :type 'dbus-error) + (should-error + (dbus-check-arguments :session dbus--test-service :signature 0.5) + :type 'wrong-type-argument) + + ;; `:boolean'. + (should (dbus-check-arguments :session dbus--test-service nil)) + (should (dbus-check-arguments :session dbus--test-service t)) + (should (dbus-check-arguments :session dbus--test-service :boolean nil)) + (should (dbus-check-arguments :session dbus--test-service :boolean t)) + ;; Will be handled as `nil'. + (should (dbus-check-arguments :session dbus--test-service :boolean)) + ;; Will be handled as `t'. + (should (dbus-check-arguments :session dbus--test-service :boolean 'whatever)) + + ;; `:byte'. + (should (dbus-check-arguments :session dbus--test-service :byte 0)) + ;; Only the least significant byte is taken into account. + (should + (dbus-check-arguments :session dbus--test-service :byte most-positive-fixnum)) + (should-error + (dbus-check-arguments :session dbus--test-service :byte -1) + :type 'wrong-type-argument) + (should-error + (dbus-check-arguments :session dbus--test-service :byte 0.5) + :type 'wrong-type-argument) + (should-error + (dbus-check-arguments :session dbus--test-service :byte "string") + :type 'wrong-type-argument) + + ;; `:int16'. + (should (dbus-check-arguments :session dbus--test-service :int16 0)) + (should (dbus-check-arguments :session dbus--test-service :int16 #x7fff)) + (should (dbus-check-arguments :session dbus--test-service :int16 #x-8000)) + (should-error + (dbus-check-arguments :session dbus--test-service :int16 #x8000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int16 #x-8001) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int16 0.5) + :type 'wrong-type-argument) + (should-error + (dbus-check-arguments :session dbus--test-service :int16 "string") + :type 'wrong-type-argument) + + ;; `:uint16'. + (should (dbus-check-arguments :session dbus--test-service :uint16 0)) + (should (dbus-check-arguments :session dbus--test-service :uint16 #xffff)) + (should-error + (dbus-check-arguments :session dbus--test-service :uint16 #x10000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint16 -1) + :type 'wrong-type-argument) + (should-error + (dbus-check-arguments :session dbus--test-service :uint16 0.5) + :type 'wrong-type-argument) + (should-error + (dbus-check-arguments :session dbus--test-service :uint16 "string") + :type 'wrong-type-argument) + + ;; `:int32'. + (should (dbus-check-arguments :session dbus--test-service :int32 0)) + (should (dbus-check-arguments :session dbus--test-service :int32 #x7fffffff)) + (should (dbus-check-arguments :session dbus--test-service :int32 #x-80000000)) + (should-error + (dbus-check-arguments :session dbus--test-service :int32 #x80000000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int32 #x-80000001) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int32 0.5) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int32 "string") + :type 'wrong-type-argument) + + ;; `:uint32'. + (should (dbus-check-arguments :session dbus--test-service 0)) + (should (dbus-check-arguments :session dbus--test-service :uint32 0)) + (should (dbus-check-arguments :session dbus--test-service :uint32 #xffffffff)) + (should-error + (dbus-check-arguments :session dbus--test-service :uint32 #x100000000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint32 -1) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint32 0.5) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint32 "string") + :type 'wrong-type-argument) + + ;; `:int64'. + (should (dbus-check-arguments :session dbus--test-service :int64 0)) + (should + (dbus-check-arguments :session dbus--test-service :int64 #x7fffffffffffffff)) + (should + (dbus-check-arguments :session dbus--test-service :int64 #x-8000000000000000)) + (should-error + (dbus-check-arguments :session dbus--test-service :int64 #x8000000000000000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int64 #x-8000000000000001) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int64 0.5) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :int64 "string") + :type 'wrong-type-argument) + + ;; `:uint64'. + (should (dbus-check-arguments :session dbus--test-service :uint64 0)) + (should + (dbus-check-arguments :session dbus--test-service :uint64 #xffffffffffffffff)) + (should-error + (dbus-check-arguments :session dbus--test-service :uint64 #x10000000000000000) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint64 -1) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint64 0.5) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :uint64 "string") + :type 'wrong-type-argument) + + ;; `:double'. + (should (dbus-check-arguments :session dbus--test-service :double 0)) + (should (dbus-check-arguments :session dbus--test-service :double 0.5)) + (should (dbus-check-arguments :session dbus--test-service :double -0.5)) + (should (dbus-check-arguments :session dbus--test-service :double -1)) + ;; Shall both be supported? + (should (dbus-check-arguments :session dbus--test-service :double 1.0e+INF)) + (should (dbus-check-arguments :session dbus--test-service :double 0.0e+NaN)) + (should-error + (dbus-check-arguments :session dbus--test-service :double "string") + :type 'wrong-type-argument) + + ;; `:unix-fd'. Value range 0 .. 9. + (should (dbus-check-arguments :session dbus--test-service :unix-fd 0)) + (should (dbus-check-arguments :session dbus--test-service :unix-fd 9)) + (should-error + (dbus-check-arguments :session dbus--test-service :unix-fd 10) + :type 'dbus-error) + (should-error + (dbus-check-arguments :session dbus--test-service :unix-fd -1) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :unix-fd 0.5) + :type 'args-out-of-range) + (should-error + (dbus-check-arguments :session dbus--test-service :unix-fd "string") + :type 'wrong-type-argument)) + +(ert-deftest dbus-test01-compound-types () + "Check basic D-Bus type arguments." + ;; `:array'. It contains several elements of the same type. + (should (dbus-check-arguments :session dbus--test-service '("string"))) + (should (dbus-check-arguments :session dbus--test-service '(:array "string"))) + (should + (dbus-check-arguments :session dbus--test-service '(:array :string "string"))) + (should + (dbus-check-arguments + :session dbus--test-service '(:array :string "string1" "string2"))) + ;; Empty array. + (should (dbus-check-arguments :session dbus--test-service '(:array))) + (should + (dbus-check-arguments :session dbus--test-service '(:array :signature "o"))) + ;; Different element types. + (should-error + (dbus-check-arguments + :session dbus--test-service + '(:array :string "string" :object-path "/object/path")) + :type 'wrong-type-argument) + + ;; `:variant'. It contains exactly one element. + (should + (dbus-check-arguments + :session dbus--test-service '(:variant :string "string"))) + (should + (dbus-check-arguments + :session dbus--test-service '(:variant (:array "string")))) + ;; More than one element. + (should-error + (dbus-check-arguments + :session dbus--test-service + '(:variant :string "string" :object-path "/object/path")) + :type 'wrong-type-argument) + + ;; `:dict-entry'. It must contain two elements; the first one must + ;; be of a basic type. It must be an element of an array. + (should + (dbus-check-arguments + :session dbus--test-service + '(:array (:dict-entry :string "string" :boolean t)))) + ;; The second element is `nil' (implicitely). FIXME: Is this right? + (should + (dbus-check-arguments + :session dbus--test-service '(:array (:dict-entry :string "string")))) + ;; Not two elements. + (should-error + (dbus-check-arguments + :session dbus--test-service + '(:array (:dict-entry :string "string" :boolean t :boolean t))) + :type 'wrong-type-argument) + ;; The first element ist not of a basic type. + (should-error + (dbus-check-arguments + :session dbus--test-service + '(:array (:dict-entry (:array :string "string") :boolean t))) + :type 'wrong-type-argument) + ;; It is not an element of an array. + (should-error + (dbus-check-arguments + :session dbus--test-service '(:dict-entry :string "string" :boolean t)) + :type 'wrong-type-argument) + ;; Different dict entry types can be part of an array. + (should + (dbus-check-arguments + :session dbus--test-service + '(:array + (:dict-entry :string "string1" :boolean t) + (:dict-entry :string "string2" :object-path "/object/path")))) + + ;; `:struct'. There is no restriction what could be an element of a struct. + (should + (dbus-check-arguments + :session dbus--test-service + '(:struct + :string "string" + :object-path "/object/path" + (:variant (:array :unix-fd 1 :unix-fd 2 :unix-fd 3 :unix-fd 4)))))) + (defun dbus--test-register-service (bus) "Check service registration at BUS." ;; Cleanup.