commit ba31c62f815537c0412eb84e8188cc5c3c4948b1 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Thu Jul 25 10:06:26 2024 +0300 ; * doc/emacs/misc.texi (Document View): Improve wording (bug#72241). diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 5972b5db491..eb157c146e7 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -490,14 +490,14 @@ underlying file contents. @findex doc-view-open-text When you visit a file which would normally be handled by DocView mode but some requirement is not met (e.g., you operate in a terminal frame -or Emacs has no PNG support), you are queried if you want to view the -document's contents as plain text. If you confirm, the buffer is put in -text mode and DocView minor mode is activated. Thus, by typing @kbd{C-c -C-c} you switch to the fallback mode. With another @kbd{C-c C-c} you -return to DocView mode. The plain text contents can also be displayed -in a separate buffer named like the original document buffer with suffix -@code{/text} by typing @kbd{C-c C-t} (@code{doc-view-open-text}) from -within DocView mode. +or Emacs has no PNG support), Emacs asks if you want to view the +document's contents as plain text. If you answer yes, Emacs turns on +Text mode in the buffer and activates DocView minor mode. Thus, by +typing @kbd{C-c C-c}, you switch to this fallback mode. With another +@kbd{C-c C-c} you return to DocView mode. The plain text contents can +also be displayed in a separate buffer named like the original document +buffer with suffix @code{/text} by typing @kbd{C-c C-t} +(@code{doc-view-open-text}) from within DocView mode. You can explicitly enable DocView mode with the command @kbd{M-x doc-view-mode}. You can toggle DocView minor mode with @kbd{M-x commit c6937ef88b19d46342cefc1493a70f21a8993e08 Author: Tassilo Horn Date: Thu Jul 25 08:49:10 2024 +0200 Fix jumping to page in DocView's text contents (bug#72275) * lisp/doc-view.el (doc-view-open-text): Set page-delimiter to the form feed character in the text contents buffer (bug#72275). diff --git a/lisp/doc-view.el b/lisp/doc-view.el index da9ae991f57..63e0de9afe3 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1779,6 +1779,8 @@ For now these keys are useful: (insert-file-contents txt) (doc-view--text-view-mode) (setq-local doc-view--buffer-file-name dv-bfn) + ;; Pages are separated by form feed characters. + (setq-local page-delimiter " ") (set-buffer-modified-p nil) (doc-view-minor-mode) (goto-char (point-min)) commit 42cdfe7f60ef7ae3bccb5b1e43349c3a6b54ac4a Author: Paul Eggert Date: Wed Jul 24 23:32:24 2024 -0700 Fix process-attributes rss and pmem on GNU/Linux Problem reported by Rahguzar . * src/sysdep.c (system_process_attributes): [GNU_LINUX || CYGWIN || __ANDROID__]: When computing rss and pmem, don’t assume pagesize is 4096; it could be greater. diff --git a/src/sysdep.c b/src/sysdep.c index d916a695155..3955d796ca5 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -3548,6 +3548,7 @@ procfs_ttyname (int rdev) } # endif /* GNU_LINUX || __ANDROID__ */ +/* Total usable RAM in KiB. */ static uintmax_t procfs_get_total_memory (void) { @@ -3737,8 +3738,13 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qnice, make_fixnum (niceness)), attrs); attrs = Fcons (Fcons (Qthcount, INT_TO_INTEGER (thcount)), attrs); attrs = Fcons (Fcons (Qvsize, INT_TO_INTEGER (vsize / 1024)), attrs); - attrs = Fcons (Fcons (Qrss, INT_TO_INTEGER (4 * rss)), attrs); - pmem = 4.0 * 100 * rss / procfs_get_total_memory (); + + /* RSS in KiB. */ + uintmax_t rssk = rss; + rssk *= getpagesize () >> 10; + + attrs = Fcons (Fcons (Qrss, INT_TO_INTEGER (rssk)), attrs); + pmem = 100.0 * rssk / procfs_get_total_memory (); if (pmem > 100) pmem = 100; attrs = Fcons (Fcons (Qpmem, make_float (pmem)), attrs); commit 6eb3827f7bf757ef63c3e8e4a9971e18cf36423f Author: Tassilo Horn Date: Thu Jul 25 08:21:52 2024 +0200 Describe that DocView text contents display is in a separate buffer * doc/emacs/misc.texi (Document View): Adjust the docs to describe the new behavior (separate buffer for the text contents) from bug#72241. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index d1e8217f579..5972b5db491 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -488,15 +488,16 @@ mode or DocView minor mode, repeating @kbd{C-c C-c} underlying file contents. @findex doc-view-open-text - When you visit a file which would normally be handled by DocView -mode but some requirement is not met (e.g., you operate in a terminal -frame or Emacs has no PNG support), you are queried if you want to -view the document's contents as plain text. If you confirm, the -buffer is put in text mode and DocView minor mode is activated. Thus, -by typing @kbd{C-c C-c} you switch to the fallback mode. With another -@kbd{C-c C-c} you return to DocView mode. The plain text contents can -also be displayed from within DocView mode by typing @kbd{C-c C-t} -(@code{doc-view-open-text}). + When you visit a file which would normally be handled by DocView mode +but some requirement is not met (e.g., you operate in a terminal frame +or Emacs has no PNG support), you are queried if you want to view the +document's contents as plain text. If you confirm, the buffer is put in +text mode and DocView minor mode is activated. Thus, by typing @kbd{C-c +C-c} you switch to the fallback mode. With another @kbd{C-c C-c} you +return to DocView mode. The plain text contents can also be displayed +in a separate buffer named like the original document buffer with suffix +@code{/text} by typing @kbd{C-c C-t} (@code{doc-view-open-text}) from +within DocView mode. You can explicitly enable DocView mode with the command @kbd{M-x doc-view-mode}. You can toggle DocView minor mode with @kbd{M-x commit 210b98bc9937a86920716ebdf0b0e00a0c79c8fe Author: Manuel Giraud Date: Tue Jul 23 16:32:30 2024 +0200 bug#72241: 31.0.50; [PATCH] Use a dedicated buffer for `doc-view-open-text' Here is an updated version of this patch. WDYT? From 6e32534012cafeda1d7e67aab23a8206bc887c9f Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sun, 21 Jul 2024 18:52:52 +0200 Subject: [PATCH] Use a dedicated buffer for `doc-view-open-text' * lisp/doc-view.el (doc-view-open-text): Create a new "text contents" buffer and switch to it. (doc-view-toggle-display): Switch back to the document buffer and kill the "text contents" one. * etc/NEWS: Mention the change. diff --git a/etc/NEWS b/etc/NEWS index 87645de3184..f133769bebf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -149,6 +149,13 @@ This affects calls to 'warn', 'lwarn', 'display-warning', and In most cases, having it enabled leads to a large amount of false positives. +** DocView + +--- +*** Dedicated buffer for plain text contents. +When switching to the plain text contents with 'doc-view-open-text', +DocView now creates a dedicated buffer to display it. 'C-c C-c' gets you +back to real DocView buffer if it still exists. * New Modes and Packages in Emacs 31.1 diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 5a3ec04c165..da9ae991f57 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1768,34 +1768,25 @@ For now these keys are useful: (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))) (page (doc-view-current-page))) (if (file-readable-p txt) - (let ((inhibit-read-only t) - (buffer-undo-list t) - (dv-bfn doc-view--buffer-file-name)) - (erase-buffer) - ;; FIXME: Replacing the buffer's PDF content with its txt rendering - ;; is pretty risky. We should probably use *another* - ;; buffer instead, so there's much less risk of - ;; overwriting the PDF file with some text rendering. - (set-buffer-multibyte t) - (insert-file-contents txt) - (doc-view--text-view-mode) - (setq-local doc-view--buffer-file-name dv-bfn) - (set-buffer-modified-p nil) - (doc-view-minor-mode) - (goto-char (point-min)) - ;; Put point at the start of the page the user was - ;; reading. Pages are separated by Control-L characters. - (re-search-forward page-delimiter nil t (1- page)) - (add-hook 'write-file-functions - (lambda () - ;; FIXME: If the user changes major mode and then - ;; saves the buffer, the PDF file will be clobbered - ;; with its txt rendering! - (when (eq major-mode 'doc-view--text-view-mode) - (error "Cannot save text contents of document %s" - buffer-file-name))) - nil t)) - (doc-view-doc->txt txt 'doc-view-open-text))))) + (let ((dv-bfn doc-view--buffer-file-name) + (dv-text-buffer-name (format "%s/text" (buffer-name)))) + ;; Prepare the text buffer + (with-current-buffer (get-buffer-create dv-text-buffer-name) + (let ((inhibit-read-only t) + (buffer-undo-list t)) + (erase-buffer) + (set-buffer-multibyte t) + (insert-file-contents txt) + (doc-view--text-view-mode) + (setq-local doc-view--buffer-file-name dv-bfn) + (set-buffer-modified-p nil) + (doc-view-minor-mode) + (goto-char (point-min)) + ;; Put point at the start of the page the user was + ;; reading. Pages are separated by Control-L characters. + (re-search-forward page-delimiter nil t (1- page)))) + (switch-to-buffer (get-buffer dv-text-buffer-name))) + (doc-view-doc->txt txt 'doc-view-open-text))))) ;;;;; Toggle between editing and viewing @@ -1816,14 +1807,11 @@ For now these keys are useful: (doc-view-fallback-mode) (doc-view-minor-mode 1)) ((eq major-mode 'doc-view--text-view-mode) - (let ((buffer-undo-list t)) - ;; We're currently viewing the document's text contents, so switch - ;; back to . - (setq buffer-read-only nil) - (insert-file-contents doc-view--buffer-file-name nil nil nil t) - (doc-view-fallback-mode) - (doc-view-minor-mode 1) - (set-buffer-modified-p nil))) + ;; We're currently viewing the document's text contents, switch to + ;; the buffer visiting the real document and kill myself. + (let ((dv-buffer (find-buffer-visiting doc-view--buffer-file-name))) + (kill-buffer) + (switch-to-buffer dv-buffer))) (t ;; Switch to doc-view-mode (when (and (buffer-modified-p) commit 2f5af5cab3869af426631735f12acf30798136bf Author: Stefan Kangas Date: Wed Jul 24 23:52:34 2024 +0200 ; * etc/NEWS: Fix header level. diff --git a/etc/NEWS b/etc/NEWS index a1e0d3ab935..87645de3184 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -162,10 +162,10 @@ That convention was: '(error &rest ARGS)'. * Lisp Changes in Emacs 31.1 +++ -*** Support interactive D-Bus authorization. +** Support interactive D-Bus authorization. A new ':authorizable t' parameter has been added to 'dbus-call-method' and 'dbus-call-method-asynchronously' to allow the user to interactively -authorize the invoked D-Bus method (e.g., via polkit). +authorize the invoked D-Bus method (for example via polkit). ** The customization group 'wp' has been removed. It has been obsolete since Emacs 26.1. Use the group 'text' instead. commit 0ae70433eabe9cf672a7f0f0803f72ad136b1344 Author: Stefan Kangas Date: Wed Jul 24 23:48:05 2024 +0200 Delete defgroup "wp" obsolete since Emacs 26 * lisp/cus-edit.el (wp): Delete defgroup obsolete since Emacs 26. (text): Don't inherit obsolete customization group 'wp'. * lisp/finder.el (finder-known-keywords): Delete 'wp' keyword. diff --git a/etc/NEWS b/etc/NEWS index d5cee7b7372..a1e0d3ab935 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -167,6 +167,9 @@ A new ':authorizable t' parameter has been added to 'dbus-call-method' and 'dbus-call-method-asynchronously' to allow the user to interactively authorize the invoked D-Bus method (e.g., via polkit). +** The customization group 'wp' has been removed. +It has been obsolete since Emacs 26.1. Use the group 'text' instead. + * Changes in Emacs 31.1 on Non-Free Operating Systems diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 5fd3629e57d..9f5ac47490c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -175,16 +175,9 @@ "Support for editing files." :group 'emacs) -(defgroup wp nil - "Support for editing text files. -Use group `text' for this instead. This group is obsolete." - :group 'emacs) - (defgroup text nil "Support for editing text files." - :group 'emacs - ;; Inherit from deprecated `wp' for compatibility, for now. - :group 'wp) + :group 'emacs) (defgroup data nil "Support for editing binary data files." diff --git a/lisp/finder.el b/lisp/finder.el index 1cf607c03c0..167c2079954 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -71,8 +71,7 @@ (text . "editing text files") (tools . "programming tools") (unix . "UNIX feature interfaces and emulators") - (vc . "version control") - (wp . "use keyword `text' instead; this keyword is obsolete")) + (vc . "version control")) "Association list of the standard \"Keywords:\" headers. Each element has the form (KEYWORD . DESCRIPTION).") commit a6a4ad13e48c656a530bea37d251a2dc55cc47d8 Author: Stefan Kangas Date: Wed Jul 24 23:41:39 2024 +0200 (error): Remove support for old calling convention * lisp/subr.el (error): Remove support for the Emacs 22 calling convention '(error &rest args)'. diff --git a/etc/NEWS b/etc/NEWS index d683db606ec..d5cee7b7372 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -155,6 +155,9 @@ positives. * Incompatible Lisp Changes in Emacs 31.1 +** The obsolete calling convention of 'error' has been removed. +That convention was: '(error &rest ARGS)'. + * Lisp Changes in Emacs 31.1 diff --git a/lisp/subr.el b/lisp/subr.el index 1389f446d35..fc847049332 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -463,8 +463,7 @@ Also see `ignore'." (declare (pure t) (side-effect-free error-free)) t) -;; Signal a compile-error if the first arg is missing. -(defun error (&rest args) +(defun error (string &rest args) "Signal an error, making a message by passing ARGS to `format-message'. Errors cause entry to the debugger when `debug-on-error' is non-nil. This can be overridden by `debug-ignored-errors'. @@ -481,9 +480,8 @@ for the sake of consistency. To alter the look of the displayed error messages, you can use the `command-error-function' variable." - (declare (ftype (function (&rest t) nil)) - (advertised-calling-convention (string &rest args) "23.1")) - (signal 'error (list (apply #'format-message args)))) + (declare (ftype (function (string &rest t) nil))) + (signal 'error (list (apply #'format-message string args)))) (defun user-error (format &rest args) "Signal a user error, making a message by passing ARGS to `format-message'. commit baf9f1210a3e44aa19d9ac90e5a4faca214127a7 Author: Andrea Corallo Date: Wed Jul 24 14:08:31 2024 +0200 Add some basic checking for function type declarations * lisp/emacs-lisp/byte-run.el (byte-run--anonymize-arg-list): New function. (byte-run--set-function-type): Add some basic checking for the function type being declared. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 75cfc7b32d3..f1486f70634 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -222,12 +222,27 @@ So far, FUNCTION can only be a symbol, not a lambda expression." (cadr elem))) val))))) +(defalias 'byte-run--anonymize-arg-list + #'(lambda (arg-list) + (mapcar (lambda (x) + (if (memq x '(&optional &rest)) + x + t)) + arg-list))) + (defalias 'byte-run--set-function-type - #'(lambda (f _args val &optional f2) + #'(lambda (f args val &optional f2) (when (and f2 (not (eq f2 f))) (error "`%s' does not match top level function `%s' inside function type \ declaration" f2 f)) + (unless (and (length= val 3) + (eq (car val) 'function) + (listp (car (cdr val)))) + (error "Type `%s' is not valid a function type" val)) + (unless (equal (byte-run--anonymize-arg-list args) + (byte-run--anonymize-arg-list (car (cdr val)))) + (error "Type `%s' incompatible with function arguments `%s'" val args)) (list 'function-put (list 'quote f) ''function-type (list 'quote val)))) commit df25bd12fc323b2e6ac76f05882d3902ce92b4cf Merge: d458664e893 976416bebe2 Author: Andrea Corallo Date: Wed Jul 24 15:49:23 2024 +0200 Merge from savannah/emacs-30 976416bebe2 Fix some function type declaration 23549d71751 * src/image.c (gui_put_x_image): Avoid memory leak. cb633820c15 ; * doc/misc/use-package.texi (Getting Started): Fix word... commit d458664e893cd74f46bf9d00559ff5386c3dbf44 Author: Michael Albinus Date: Wed Jul 24 15:27:58 2024 +0200 Adapt Tramp tests * test/lisp/net/tramp-archive-tests.el (ert-resource-directory-format) (ert-resource-directory-trim-left-regexp) (ert-resource-directory-trim-right-regexp, ert-resource-directory) (ert-resource-file): Don't define. (tramp-archive--test-emacs28-p): Remove. (top): Remove unneeded skips. Use original objects instead of their `tramp-compat-' counterparts when possible. * test/lisp/net/tramp-tests.el (seq): Don't require. (lock-file-name-transforms, process-file-return-signal-string) (remote-file-name-inhibit-locks, dired-copy-dereference): Don't declare. (ert-resource-directory-format) (ert-resource-directory-trim-left-regexp) (ert-resource-directory-trim-right-regexp, ert-resource-directory) (ert-resource-file): Don't define. (tramp--test-emacs28-p): Remove. (top): Remove unneeded skips. Use original objects instead of their `tramp-compat-' counterparts when possible. diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 1ca2fa9b9b3..94bb245ee4a 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -33,50 +33,6 @@ (require 'tramp-archive) (defvar tramp-persistency-file-name) -;; `ert-resource-file' was introduced in Emacs 28.1. -(unless (macrop 'ert-resource-file) - (eval-and-compile - (defvar ert-resource-directory-format "%s-resources/" - "Format for `ert-resource-directory'.") - (defvar ert-resource-directory-trim-left-regexp "" - "Regexp for `string-trim' (left) used by `ert-resource-directory'.") - (defvar ert-resource-directory-trim-right-regexp - (rx (? "-test" (? "s")) ".el") - "Regexp for `string-trim' (right) used by `ert-resource-directory'.") - - (defmacro ert-resource-directory () - "Return absolute file name of the resource directory for this file. - -The path to the resource directory is the \"resources\" directory -in the same directory as the test file. - -If that directory doesn't exist, use the directory named like the -test file but formatted by `ert-resource-directory-format' and trimmed -using `string-trim' with arguments -`ert-resource-directory-trim-left-regexp' and -`ert-resource-directory-trim-right-regexp'. The default values mean -that if called from a test file named \"foo-tests.el\", return -the absolute file name for \"foo-resources\"." - `(let* ((testfile ,(or (bound-and-true-p byte-compile-current-file) - (and load-in-progress load-file-name) - buffer-file-name)) - (default-directory (file-name-directory testfile))) - (file-truename - (if (file-accessible-directory-p "resources/") - (expand-file-name "resources/") - (expand-file-name - (format - ert-resource-directory-format - (string-trim testfile - ert-resource-directory-trim-left-regexp - ert-resource-directory-trim-right-regexp))))))) - - (defmacro ert-resource-file (file) - "Return file name of resource file named FILE. -A resource file is in the resource directory as per -`ert-resource-directory'." - `(expand-file-name ,file (ert-resource-directory))))) - (defvar tramp-archive-test-file-archive (ert-resource-file "foo.tar.gz") "The test file archive.") @@ -121,12 +77,6 @@ the origin of the temporary TMPFILE, have no write permissions." (directory-files tmpfile 'full directory-files-no-dot-files-regexp)) (delete-directory tmpfile))) -(defun tramp-archive--test-emacs28-p () - "Check for Emacs version >= 28.1. -Some semantics has been changed for there, without new functions or -variables, so we check the Emacs version directly." - (>= emacs-major-version 28)) - (ert-deftest tramp-archive-test00-availability () "Test availability of archive file name functions." :expected-result (if tramp-archive-enabled :passed :failed) @@ -881,7 +831,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (let ((fsi (file-system-info tramp-archive-test-archive))) (skip-unless fsi) (should (and (consp fsi) - (tramp-compat-length= fsi 3) + (length= fsi 3) (numberp (nth 0 fsi)) ;; FREE and AVAIL are always 0. (zerop (nth 1 fsi)) @@ -925,13 +875,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (dolist (default-directory (append `(,temporary-file-directory) - ;; Starting Emacs in a directory which has - ;; `tramp-archive-file-name-regexp' syntax is - ;; supported only with Emacs > 27.2 (sigh!). - ;; (Bug#48476) - (and (tramp-archive--test-emacs28-p) - `(,(file-name-as-directory - tramp-archive-test-directory))))) + `(,(file-name-as-directory tramp-archive-test-directory)))) (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo"))) (should (string-match diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e958cd354bc..7673ee88569 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -46,7 +46,6 @@ (require 'dired-aux) (require 'tramp) (require 'ert-x) -(require 'seq) ; For `seq-random-elt', autoloaded since Emacs 28.1 (require 'tar-mode) (require 'trace) (require 'vc) @@ -75,60 +74,10 @@ (defvar tramp-remote-process-environment) (defvar tramp-use-connection-share) -;; Needed for Emacs 27. -(defvar lock-file-name-transforms) -(defvar process-file-return-signal-string) -(defvar remote-file-name-inhibit-locks) -(defvar dired-copy-dereference) - ;; Declared in Emacs 30. (defvar remote-file-name-access-timeout) (defvar remote-file-name-inhibit-delete-by-moving-to-trash) -;; `ert-resource-file' was introduced in Emacs 28.1. -(unless (macrop 'ert-resource-file) - (eval-and-compile - (defvar ert-resource-directory-format "%s-resources/" - "Format for `ert-resource-directory'.") - (defvar ert-resource-directory-trim-left-regexp "" - "Regexp for `string-trim' (left) used by `ert-resource-directory'.") - (defvar ert-resource-directory-trim-right-regexp - (rx (? "-test" (? "s")) ".el") - "Regexp for `string-trim' (right) used by `ert-resource-directory'.") - - (defmacro ert-resource-directory () - "Return absolute file name of the resource directory for this file. - -The path to the resource directory is the \"resources\" directory -in the same directory as the test file. - -If that directory doesn't exist, use the directory named like the -test file but formatted by `ert-resource-directory-format' and trimmed -using `string-trim' with arguments -`ert-resource-directory-trim-left-regexp' and -`ert-resource-directory-trim-right-regexp'. The default values mean -that if called from a test file named \"foo-tests.el\", return -the absolute file name for \"foo-resources\"." - `(let* ((testfile ,(or (bound-and-true-p byte-compile-current-file) - (and load-in-progress load-file-name) - buffer-file-name)) - (default-directory (file-name-directory testfile))) - (file-truename - (if (file-accessible-directory-p "resources/") - (expand-file-name "resources/") - (expand-file-name - (format - ert-resource-directory-format - (string-trim testfile - ert-resource-directory-trim-left-regexp - ert-resource-directory-trim-right-regexp))))))) - - (defmacro ert-resource-file (file) - "Return file name of resource file named FILE. -A resource file is in the resource directory as per -`ert-resource-directory'." - `(expand-file-name ,file (ert-resource-directory))))) - ;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1. ;; Adapting `tramp-remote-path' happens also there. (unless (boundp 'ert-remote-temporary-file-directory) @@ -2350,8 +2299,6 @@ is greater than 10. (skip-unless (tramp--test-enabled)) ;; Methods with a share do not expand "/path/..". (skip-unless (not (tramp--test-share-p))) - ;; The bugs are fixed in Emacs 28.1. - (skip-unless (tramp--test-emacs28-p)) (should (string-equal @@ -2646,18 +2593,15 @@ This checks also `file-name-as-directory', `file-name-directory', (should (string-equal (buffer-string) "foo")) (should (= point (point)))) ;; Insert another string. - ;; `replace-string-in-region' was introduced in Emacs 28.1. - (when (tramp--test-emacs28-p) - (let ((point (point))) - (with-no-warnings - (replace-string-in-region "foo" "bar" (point-min) (point-max))) - (goto-char point) - (should - (equal - (insert-file-contents tmp-name nil nil nil 'replace) - `(,(expand-file-name tmp-name) 3))) - (should (string-equal (buffer-string) "foo")) - (should (= point (point))))) + (let ((point (point))) + (replace-string-in-region "foo" "bar" (point-min) (point-max)) + (goto-char point) + (should + (equal + (insert-file-contents tmp-name nil nil nil 'replace) + `(,(expand-file-name tmp-name) 3))) + (should (string-equal (buffer-string) "foo")) + (should (= point (point)))) ;; Error case. (delete-file tmp-name) (should-error @@ -2762,9 +2706,9 @@ This checks also `file-name-as-directory', `file-name-directory', ;; `tramp-test39-make-lock-file-name'. ;; Do not overwrite if excluded. - (cl-letf (((symbol-function #'y-or-n-p) #'tramp-compat-always) + (cl-letf (((symbol-function #'y-or-n-p) #'always) ;; Ange-FTP. - ((symbol-function #'yes-or-no-p) #'tramp-compat-always)) + ((symbol-function #'yes-or-no-p) #'always)) (write-region "foo" nil tmp-name nil nil nil 'mustbenew)) (should-error (cl-letf (((symbol-function #'y-or-n-p) #'ignore) @@ -2831,8 +2775,6 @@ This checks also `file-name-as-directory', `file-name-directory', (skip-unless (tramp--test-enabled)) (skip-unless (not (tramp--test-ange-ftp-p))) (skip-unless (executable-find "gzip")) - ;; The function was introduced in Emacs 28.1. - (skip-unless (boundp 'tar-goto-file)) (let* ((default-directory ert-remote-temporary-file-directory) (archive (ert-resource-file "foo.tar.gz")) @@ -2846,8 +2788,7 @@ This checks also `file-name-as-directory', `file-name-directory', (copy-file archive tmp-file 'ok) ;; Read archive. Check contents of foo.txt, and modify it. Save. (with-current-buffer (setq buffer1 (find-file-noselect tmp-file)) - ;; The function was introduced in Emacs 28.1. - (with-no-warnings (should (tar-goto-file "foo.txt"))) + (should (tar-goto-file "foo.txt")) (save-current-buffer (setq buffer2 (tar-extract)) (should (string-equal (buffer-string) "foo\n")) @@ -2864,8 +2805,7 @@ This checks also `file-name-as-directory', `file-name-directory', (kill-buffer buffer2) ;; Read archive. Check contents of modified foo.txt. (with-current-buffer (setq buffer1 (find-file-noselect tmp-file)) - ;; The function was introduced in Emacs 28.1. - (with-no-warnings (should (tar-goto-file "foo.txt"))) + (should (tar-goto-file "foo.txt")) (save-current-buffer (setq buffer2 (tar-extract)) (should (string-equal (buffer-string) "foo\nbar\n"))))) @@ -3304,46 +3244,45 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (delete-directory tmp-name1 'recursive) (delete-directory tmp-name2 'recursive))) - ;; Copy symlink to directory. Implemented since Emacs 28.1. - (when (boundp 'copy-directory-create-symlink) - (dolist (copy-directory-create-symlink '(nil t)) - (unwind-protect - (tramp--test-ignore-make-symbolic-link-error - ;; Copy to file name. - (make-directory tmp-name1) - (write-region "foo" nil tmp-name4) - (make-symbolic-link tmp-name1 tmp-name7) - (should (file-directory-p tmp-name1)) - (should (file-exists-p tmp-name4)) - (should (file-symlink-p tmp-name7)) - (copy-directory tmp-name7 tmp-name2) - (if copy-directory-create-symlink - (should - (string-equal - (file-symlink-p tmp-name2) (file-symlink-p tmp-name7))) - (should (file-directory-p tmp-name2))) - ;; Copy to directory name. - (delete-directory tmp-name2 'recursive) - (make-directory tmp-name2) - (should (file-directory-p tmp-name2)) - (copy-directory tmp-name7 (file-name-as-directory tmp-name2)) - (if copy-directory-create-symlink - (should - (string-equal - (file-symlink-p - (expand-file-name - (file-name-nondirectory tmp-name7) tmp-name2)) - (file-symlink-p tmp-name7))) - (should - (file-directory-p + ;; Copy symlink to directory. + (dolist (copy-directory-create-symlink '(nil t)) + (unwind-protect + (tramp--test-ignore-make-symbolic-link-error + ;; Copy to file name. + (make-directory tmp-name1) + (write-region "foo" nil tmp-name4) + (make-symbolic-link tmp-name1 tmp-name7) + (should (file-directory-p tmp-name1)) + (should (file-exists-p tmp-name4)) + (should (file-symlink-p tmp-name7)) + (copy-directory tmp-name7 tmp-name2) + (if copy-directory-create-symlink + (should + (string-equal + (file-symlink-p tmp-name2) (file-symlink-p tmp-name7))) + (should (file-directory-p tmp-name2))) + ;; Copy to directory name. + (delete-directory tmp-name2 'recursive) + (make-directory tmp-name2) + (should (file-directory-p tmp-name2)) + (copy-directory tmp-name7 (file-name-as-directory tmp-name2)) + (if copy-directory-create-symlink + (should + (string-equal + (file-symlink-p (expand-file-name - (file-name-nondirectory tmp-name7) tmp-name2))))) + (file-name-nondirectory tmp-name7) tmp-name2)) + (file-symlink-p tmp-name7))) + (should + (file-directory-p + (expand-file-name + (file-name-nondirectory tmp-name7) tmp-name2))))) - ;; Cleanup. - (ignore-errors - (delete-directory tmp-name1 'recursive) - (delete-directory tmp-name2 'recursive) - (delete-directory tmp-name7 'recursive)))))))) + ;; Cleanup. + (ignore-errors + (delete-directory tmp-name1 'recursive) + (delete-directory tmp-name2 'recursive) + (delete-directory tmp-name7 'recursive))))))) (ert-deftest tramp-test16-directory-files () "Check `directory-files'." @@ -3376,14 +3315,12 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (should (equal (directory-files tmp-name1 'full directory-files-no-dot-files-regexp) `(,tmp-name2 ,tmp-name3))) - ;; Check the COUNT arg. It exists since Emacs 28. - (when (tramp--test-emacs28-p) - (with-no-warnings - (should - (equal - (directory-files - tmp-name1 nil directory-files-no-dot-files-regexp nil 1) - '("bla")))))) + ;; Check the COUNT arg. + (should + (equal + (directory-files + tmp-name1 nil directory-files-no-dot-files-regexp nil 1) + '("bla")))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) @@ -4096,12 +4033,10 @@ They might differ only in time attributes or directory size." tmp-name2 nil (rx bos "b"))) (should (equal (mapcar #'car attr) '("bar" "boz"))) - ;; Check the COUNT arg. It exists since Emacs 28. - (when (tramp--test-emacs28-p) - (with-no-warnings - (setq attr (directory-files-and-attributes - tmp-name2 nil (rx bos "b") nil nil 1)) - (should (equal (mapcar #'car attr) '("bar")))))) + ;; Check the COUNT arg. + (setq attr (directory-files-and-attributes + tmp-name2 nil (rx bos "b") nil nil 1)) + (should (equal (mapcar #'car attr) '("bar")))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) @@ -4141,12 +4076,10 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (or (zerop (file-attribute-user-id (file-attributes tmp-name1))) (tramp--test-sshfs-p)) (should-not (file-writable-p tmp-name1))) - ;; Check the NOFOLLOW arg. It exists since Emacs 28. For - ;; regular files, there shouldn't be a difference. - (when (tramp--test-emacs28-p) - (with-no-warnings - (set-file-modes tmp-name1 #o222 'nofollow) - (should (= (file-modes tmp-name1 'nofollow) #o222)))) + ;; Check the NOFOLLOW arg. For regular files, there + ;; shouldn't be a difference. + (set-file-modes tmp-name1 #o222 'nofollow) + (should (= (file-modes tmp-name1 'nofollow) #o222)) ;; Setting the mode for not existing files shall fail. (should-error (set-file-modes tmp-name2 #o777) @@ -4155,15 +4088,13 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." ;; Cleanup. (ignore-errors (delete-file tmp-name1))) - ;; Check the NOFOLLOW arg. It exists since Emacs 28. It is - ;; implemented for tramp-gvfs.el and tramp-sh.el. However, - ;; tramp-gvfs,el does not support creating symbolic links. And - ;; in tramp-sh.el, we must ensure that the remote chmod command - ;; supports the "-h" argument. - (when (and (tramp--test-emacs28-p) (tramp--test-sh-p) - (tramp-get-remote-chmod-h tramp-test-vec)) + ;; Check the NOFOLLOW arg. It is implemented for tramp-gvfs.el + ;; and tramp-sh.el. However, tramp-gvfs,el does not support + ;; creating symbolic links. And in tramp-sh.el, we must ensure + ;; that the remote chmod command supports the "-h" argument. + (when (and (tramp--test-sh-p) (tramp-get-remote-chmod-h tramp-test-vec)) (unwind-protect - (with-no-warnings + (progn (write-region "foo" nil tmp-name1) (should (file-exists-p tmp-name1)) (make-symbolic-link tmp-name1 tmp-name2) @@ -4256,7 +4187,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should-error (make-symbolic-link tmp-name1 tmp-name2 0) :type 'file-already-exists))) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'always)) (make-symbolic-link tmp-name1 tmp-name2 0) (should (string-equal @@ -4336,7 +4267,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should-error (add-name-to-file tmp-name1 tmp-name2 0) :type 'file-already-exists)) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'always)) (add-name-to-file tmp-name1 tmp-name2 0) (should (file-regular-p tmp-name2))) (add-name-to-file tmp-name1 tmp-name2 'ok-if-already-exists) @@ -4548,16 +4479,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; `tmp-name3' does not exist. (should (file-newer-than-file-p tmp-name2 tmp-name3)) (should-not (file-newer-than-file-p tmp-name3 tmp-name1)) - ;; Check the NOFOLLOW arg. It exists since Emacs 28. For - ;; regular files, there shouldn't be a difference. - (when (tramp--test-emacs28-p) - (with-no-warnings - (set-file-times tmp-name1 (seconds-to-time 60) 'nofollow) - (should - (time-equal-p - (file-attribute-modification-time - (file-attributes tmp-name1)) - (seconds-to-time 60))))))) + ;; Check the NOFOLLOW arg. For regular files, there + ;; shouldn't be a difference. + (set-file-times tmp-name1 (seconds-to-time 60) 'nofollow) + (should + (time-equal-p + (file-attribute-modification-time (file-attributes tmp-name1)) + (seconds-to-time 60))))) ;; Cleanup. (ignore-errors @@ -4890,8 +4818,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Ange-FTP does not support this. (unless (tramp--test-ange-ftp-p) (should-not - (file-name-completion - "a" (tramp-compat-file-name-concat tmp-name "fuzz")))) + (file-name-completion "a" (file-name-concat tmp-name "fuzz")))) ;; Ange-FTP does not support predicates. (unless (tramp--test-ange-ftp-p) (should @@ -5219,7 +5146,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (goto-char (point-min)) (while (search-forward-regexp ansi-color-control-seq-regexp nil t) - (replace-match "" nil nil)) + (replace-match "")) (should (string-equal (if destination (format "%s\n" fnnd) "") (buffer-string))) @@ -5234,7 +5161,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (goto-char (point-min)) (while (search-forward-regexp ansi-color-control-seq-regexp nil t) - (replace-match "" nil nil)) + (replace-match "")) (should (string-equal (if destination (format "%s\n%s\n" fnnd fnnd) "") @@ -5480,7 +5407,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." ;; We do expect an established connection already, ;; `file-truename' does it by side-effect. Suppress ;; `tramp--test-enabled', in order to keep the connection. - (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp-compat-always)) + (cl-letf (((symbol-function #'tramp--test-enabled) #'always)) (file-truename ert-remote-temporary-file-directory) (funcall (ert-test-body ert-test)))))) @@ -5906,7 +5833,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." (when-let ((default-directory ert-remote-temporary-file-directory) (mi (memory-info))) (should (consp mi)) - (should (tramp-compat-length= mi 4)) + (should (length= mi 4)) (dotimes (i (length mi)) (should (natnump (nth i mi)))))) @@ -5967,7 +5894,7 @@ INPUT, if non-nil, is a string sent to the process." ;; "ls" could produce colorized output. (goto-char (point-min)) (while (search-forward-regexp ansi-color-control-seq-regexp nil t) - (replace-match "" nil nil)) + (replace-match "")) (should (string-equal (format "%s\n" (file-name-nondirectory tmp-name)) @@ -6303,8 +6230,7 @@ INPUT, if non-nil, is a string sent to the process." ;; `local-variable' is buffer-local due to explicit setting. ;; We need `with-no-warnings', because `defvar-local' is not ;; called at toplevel. - (with-no-warnings - (defvar-local local-variable 'buffer)) + (with-no-warnings (defvar-local local-variable 'buffer)) (with-temp-buffer (should (eq local-variable 'buffer))) @@ -6486,7 +6412,7 @@ INPUT, if non-nil, is a string sent to the process." (unless (tramp--test-container-oob-p) (make-directory tmp-name) (should (file-directory-p tmp-name)) - (while (tramp-compat-length< (string-join orig-exec-path ":") 5000) + (while (length< (string-join orig-exec-path ":") 5000) (let ((dir (make-temp-file (file-name-as-directory tmp-name) 'dir))) (should (file-directory-p dir)) @@ -6503,7 +6429,7 @@ INPUT, if non-nil, is a string sent to the process." ;; Ignore trailing newline. (setq path (substring (shell-command-to-string "echo $PATH") nil -1)) ;; The shell doesn't handle such long strings. - (unless (tramp-compat-length> + (unless (length> path (tramp-get-connection-property tramp-test-vec "pipe-buf" 4096)) @@ -6707,8 +6633,7 @@ INPUT, if non-nil, is a string sent to the process." :type 'file-error)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (cl-letf (((symbol-function #'yes-or-no-p) - #'tramp-compat-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'always)) (should (stringp (make-auto-save-file-name)))))))) ;; Cleanup. @@ -6854,25 +6779,18 @@ INPUT, if non-nil, is a string sent to the process." :type 'file-error)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'always)) (should (stringp (car (find-backup-file-name tmp-name1))))))) ;; Cleanup. (ignore-errors (delete-file tmp-name1)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password))))) -;; The functions were introduced in Emacs 28.1. (ert-deftest tramp-test39-make-lock-file-name () "Check `make-lock-file-name', `lock-file', `unlock-file' and `file-locked-p'." (skip-unless (tramp--test-enabled)) (skip-unless (not (tramp--test-ange-ftp-p))) - ;; Since Emacs 28.1. - (skip-unless (and (fboundp 'lock-file) (fboundp 'unlock-file))) - (skip-unless (and (fboundp 'file-locked-p) (fboundp 'make-lock-file-name))) - ;; `lock-file', `unlock-file', `file-locked-p' and - ;; `make-lock-file-name' exist since Emacs 28.1. We don't want to - ;; see compiler warnings for older Emacsen. (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) @@ -6889,13 +6807,13 @@ INPUT, if non-nil, is a string sent to the process." (unwind-protect (progn ;; A simple file lock. - (should-not (with-no-warnings (file-locked-p tmp-name1))) - (with-no-warnings (lock-file tmp-name1)) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) + (should-not (file-locked-p tmp-name1)) + (lock-file tmp-name1) + (should (eq (file-locked-p tmp-name1) t)) ;; If it is locked already, nothing changes. - (with-no-warnings (lock-file tmp-name1)) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) + (lock-file tmp-name1) + (should (eq (file-locked-p tmp-name1) t)) ;; `save-buffer' removes the lock. (with-temp-buffer @@ -6904,11 +6822,11 @@ INPUT, if non-nil, is a string sent to the process." (should (buffer-modified-p)) (save-buffer) (should-not (buffer-modified-p))) - (should-not (with-no-warnings (file-locked-p tmp-name1))) + (should-not (file-locked-p tmp-name1)) ;; `kill-buffer' removes the lock. - (with-no-warnings (lock-file tmp-name1)) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) + (lock-file tmp-name1) + (should (eq (file-locked-p tmp-name1) t)) (with-temp-buffer (set-visited-file-name tmp-name1) (insert "foo") @@ -6916,12 +6834,12 @@ INPUT, if non-nil, is a string sent to the process." (cl-letf (((symbol-function #'read-from-minibuffer) (lambda (&rest _args) "yes"))) (kill-buffer))) - (should-not (with-no-warnings (file-locked-p tmp-name1))) + (should-not (file-locked-p tmp-name1)) ;; `kill-buffer' should not remove the lock when the ;; connection is broken. See Bug#61663. - (with-no-warnings (lock-file tmp-name1)) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) + (lock-file tmp-name1) + (should (eq (file-locked-p tmp-name1) t)) (with-temp-buffer (set-visited-file-name tmp-name1) (insert "foo") @@ -6934,13 +6852,13 @@ INPUT, if non-nil, is a string sent to the process." ;; A new connection changes process id, and also the ;; lock file contents. But it still exists. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (should (stringp (with-no-warnings (file-locked-p tmp-name1)))) + (should (stringp (file-locked-p tmp-name1))) ;; When `remote-file-name-inhibit-locks' is set, nothing happens. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (let ((remote-file-name-inhibit-locks t)) - (with-no-warnings (lock-file tmp-name1)) - (should-not (with-no-warnings (file-locked-p tmp-name1)))) + (lock-file tmp-name1) + (should-not (file-locked-p tmp-name1))) ;; When `lock-file-name-transforms' is set, another lock ;; file is used. @@ -6948,32 +6866,31 @@ INPUT, if non-nil, is a string sent to the process." (let ((lock-file-name-transforms `((,(rx (* nonl)) ,tmp-name2)))) (should (string-equal - (with-no-warnings (make-lock-file-name tmp-name1)) - (with-no-warnings (make-lock-file-name tmp-name2)))) - (with-no-warnings (lock-file tmp-name1)) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) - (with-no-warnings (unlock-file tmp-name1)) - (should-not (with-no-warnings (file-locked-p tmp-name1)))) + (make-lock-file-name tmp-name1) + (make-lock-file-name tmp-name2))) + (lock-file tmp-name1) + (should (eq (file-locked-p tmp-name1) t)) + (unlock-file tmp-name1) + (should-not (file-locked-p tmp-name1))) ;; Steal the file lock. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?s))) - (with-no-warnings (lock-file tmp-name1))) - (should (eq (with-no-warnings (file-locked-p tmp-name1)) t)) + (lock-file tmp-name1)) + (should (eq (file-locked-p tmp-name1) t)) ;; Ignore the file lock. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?p))) - (with-no-warnings (lock-file tmp-name1))) - (should (stringp (with-no-warnings (file-locked-p tmp-name1)))) + (lock-file tmp-name1)) + (should (stringp (file-locked-p tmp-name1))) ;; Quit the file lock machinery. (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?q))) - (with-no-warnings - (should-error - (lock-file tmp-name1) - :type 'file-locked)) + (should-error + (lock-file tmp-name1) + :type 'file-locked) ;; The same for `write-region'. (should-error (write-region "foo" nil tmp-name1) @@ -6986,14 +6903,14 @@ INPUT, if non-nil, is a string sent to the process." (should-error (set-visited-file-name tmp-name1) :type 'file-locked))) - (should (stringp (with-no-warnings (file-locked-p tmp-name1))))) + (should (stringp (file-locked-p tmp-name1)))) ;; Cleanup. (ignore-errors (delete-file tmp-name1)) - (with-no-warnings (unlock-file tmp-name1)) - (with-no-warnings (unlock-file tmp-name2)) - (should-not (with-no-warnings (file-locked-p tmp-name1))) - (should-not (with-no-warnings (file-locked-p tmp-name2)))) + (unlock-file tmp-name1) + (unlock-file tmp-name2) + (should-not (file-locked-p tmp-name1)) + (should-not (file-locked-p tmp-name2))) (unwind-protect ;; Create temporary file. This shall check for sensible @@ -7010,20 +6927,17 @@ INPUT, if non-nil, is a string sent to the process." :type 'file-error)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'always)) (write-region "foo" nil tmp-name1)))) ;; Cleanup. (ignore-errors (delete-file tmp-name1)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password))))) -;; The functions were introduced in Emacs 28.1. (ert-deftest tramp-test39-detect-external-change () "Check that an external file modification is reported." (skip-unless (tramp--test-enabled)) (skip-unless (not (tramp--test-ange-ftp-p))) - ;; Since Emacs 28.1. - (skip-unless (and (fboundp 'lock-file) (fboundp 'file-locked-p))) (dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil))) (dolist (create-lockfiles '(nil t)) @@ -7081,8 +6995,7 @@ INPUT, if non-nil, is a string sent to the process." (should (file-locked-p tmp-name))))) ;; `save-buffer' removes the file lock. - (cl-letf (((symbol-function #'yes-or-no-p) - #'tramp-compat-always) + (cl-letf (((symbol-function #'yes-or-no-p) #'always) ((symbol-function #'read-char-choice) (lambda (&rest _) ?y))) (should (buffer-modified-p)) @@ -7127,12 +7040,6 @@ INPUT, if non-nil, is a string sent to the process." (delete-directory tmp-file) (should-not (file-exists-p tmp-file)))) -(defun tramp--test-emacs28-p () - "Check for Emacs version >= 28.1. -Some semantics has been changed for there, without new functions -or variables, so we check the Emacs version directly." - (>= emacs-major-version 28)) - (defun tramp--test-emacs29-p () "Check for Emacs version >= 29.1. Some semantics has been changed for there, without new functions @@ -7729,7 +7636,7 @@ This requires restrictions of file name syntax." (when-let ((fsi (file-system-info ert-remote-temporary-file-directory))) (should (consp fsi)) - (should (tramp-compat-length= fsi 3)) + (should (length= fsi 3)) (dotimes (i (length fsi)) (should (natnump (or (nth i fsi) 0)))))) @@ -8322,8 +8229,6 @@ Since it unloads Tramp, it shall be the last test to run." (macrop x)) (string-prefix-p "tramp" (symbol-name x)) (string-match-p (rx bol "with" (| "tramp" "parsed")) (symbol-name x)) - ;; `tramp-completion-mode' is autoloaded in Emacs < 28.1. - (not (eq 'tramp-completion-mode x)) ;; `tramp-register-archive-file-name-handler' is autoloaded ;; in Emacs < 29.1. (not (eq 'tramp-register-archive-file-name-handler x)) commit c4e8112f983a2add3253e5607f0c29f70e5b4081 Author: Michael Albinus Date: Wed Jul 24 15:25:55 2024 +0200 Remove Emacs 27 compatibility from Tramp * doc/misc/tramp.texi (Frequently Asked Questions): Adapt supported Emacs versions. * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.8.0-pre". * lisp/net/tramp-compat.el (tramp-compat-file-modes) (tramp-compat-set-file-modes, tramp-compat-set-file-times) (tramp-compat-directory-files) (tramp-compat-directory-files-and-attributes) (tramp-compat-directory-empty-p, tramp-compat-null-device) (tramp-compat-string-replace, tramp-compat-string-search) (tramp-compat-make-lock-file-name) (tramp-compat-file-name-concat) (tramp-compat-replace-regexp-in-region, tramp-compat-length<) (tramp-compat-length>, tramp-compat-length=) (tramp-compat-always): Remove. * lisp/net/tramp-adb.el: * lisp/net/tramp-androidsu.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-cache.el: * lisp/net/tramp-cmds.el: * lisp/net/tramp-compat.el: * lisp/net/tramp-crypt.el: * lisp/net/tramp-fuse.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-message.el: * lisp/net/tramp-sh.el: * lisp/net/tramp-smb.el: * lisp/net/tramp-sshfs.el: * lisp/net/tramp-sudoedit.el: * lisp/net/tramp.el: Use original objects instead of their `tramp-compat-' counterparts when possible. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 69572a139ff..eddf0272641 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3361,11 +3361,10 @@ files, set user option @code{remote-file-name-inhibit-auto-save-visited} to non-@code{nil}. @vindex lock-file-name-transforms -And still more issues to handle. Since @w{Emacs 28}, file locks use a -similar user option as auto-save files, called -@code{lock-file-name-transforms}. By default this user option is -@code{nil}, meaning to keep file locks in the same directory as the -original file. +And still more issues to handle. File locks use a similar user option +as auto-save files, called @code{lock-file-name-transforms}. By +default this user option is @code{nil}, meaning to keep file locks in +the same directory as the original file. If you change @code{lock-file-name-transforms} in order to keep file locks for remote files somewhere else, you will lose Emacs's feature @@ -5154,8 +5153,8 @@ Where is the latest @value{tramp}? @item Which systems does it work on? -The package works successfully on @w{Emacs 27}, @w{Emacs 28}, @w{Emacs -29}, and @w{Emacs 30}. +The package works successfully on @w{Emacs 28}, @w{Emacs 29}, @w{Emacs +30}, and @w{Emacs 31}. While Unix and Unix-like systems are the primary remote targets, @value{tramp} has equal success connecting to other platforms, such as diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index b17dde18656..71ed247c6df 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -7,10 +7,10 @@ @c In the Tramp GIT, the version number and the bug report address @c are auto-frobbed from configure.ac. -@set trampver 2.7.2-pre +@set trampver 2.8.0-pre @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org -@set emacsver 27.1 +@set emacsver 28.1 @c Other flags from configuration. @set instprefix /usr/local diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index b26a93fc6e4..3b8a930cb57 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -228,7 +228,7 @@ arguments to pass to the OPERATION." (when (string-match (rx bol (group (+ (not blank))) (+ blank) "device" eol) line) ;; Replace ":" by "#". - `(nil ,(tramp-compat-string-replace + `(nil ,(string-replace ":" tramp-prefix-port-format (match-string 1 line))))) (tramp-process-lines nil tramp-adb-program "devices"))) @@ -329,10 +329,10 @@ arguments to pass to the OPERATION." v (format "%s -d -a -l %s %s | cat" (tramp-adb-get-ls-command v) (tramp-shell-quote-argument - (tramp-compat-file-name-concat localname ".")) + (file-name-concat localname ".")) (tramp-shell-quote-argument - (tramp-compat-file-name-concat localname "..")))) - (tramp-compat-replace-regexp-in-region + (file-name-concat localname "..")))) + (replace-regexp-in-region (rx (literal (file-name-unquote (file-name-as-directory localname)))) "" (point-min)) (widen))) @@ -373,7 +373,7 @@ Emacs dired can't find files." (search-forward-regexp (rx blank (group blank (regexp tramp-adb-ls-date-year-regexp) blank)) nil t) - (replace-match "0\\1" "\\1" nil) + (replace-match "0\\1" "\\1") ;; Insert missing "/". (when (looking-at-p (rx (regexp tramp-adb-ls-date-time-regexp) (+ blank) eol)) @@ -650,7 +650,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; KEEP-DATE handling. (when keep-date - (tramp-compat-set-file-times + (set-file-times newname (file-attribute-modification-time (file-attributes filename)) (unless ok-if-already-exists 'nofollow))))) @@ -946,7 +946,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" (let* ((host (tramp-file-name-host vec)) (port (tramp-file-name-port-or-default vec)) (devices (mapcar #'cadr (tramp-adb-parse-device-names nil)))) - (tramp-compat-string-replace + (string-replace tramp-prefix-port-format ":" (cond ((member host devices) host) ;; This is the case when the host is connected to the default port. @@ -956,15 +956,14 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" ;; An empty host name shall be mapped as well, when there ;; is exactly one entry in `devices'. ((and (tramp-string-empty-or-nil-p host) - (tramp-compat-length= devices 1)) + (length= devices 1)) (car devices)) ;; Try to connect device. ((and tramp-adb-connect-if-not-connected - (tramp-compat-length> host 0) + (length> host 0) (tramp-adb-execute-adb-command vec "connect" - (tramp-compat-string-replace - tramp-prefix-port-format ":" host))) + (string-replace tramp-prefix-port-format ":" host))) ;; When new device connected, running other adb command (e.g. ;; adb shell) immediately will fail. To get around this ;; problem, add sleep 0.1 second here. @@ -977,7 +976,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" "Execute an adb command. Insert the result into the connection buffer. Return nil on error and non-nil on success." - (when (and (tramp-compat-length> (tramp-file-name-host vec) 0) + (when (and (length> (tramp-file-name-host vec) 0) ;; The -s switch is only available for ADB device commands. (not (member (car args) '("connect" "disconnect")))) (setq args (append (list "-s" (tramp-adb-get-device vec)) args))) @@ -1021,7 +1020,7 @@ error and non-nil on success." ;; system, but this requires changes in core Tramp. (goto-char (point-min)) (while (search-forward-regexp (rx (+ "\r") eol) nil t) - (replace-match "" nil nil))))))) + (replace-match ""))))))) (defun tramp-adb-send-command-and-check (vec command &optional exit-status command-augmented-p) diff --git a/lisp/net/tramp-androidsu.el b/lisp/net/tramp-androidsu.el index dae90202478..473cecf7a1b 100644 --- a/lisp/net/tramp-androidsu.el +++ b/lisp/net/tramp-androidsu.el @@ -304,15 +304,14 @@ FUNCTION." "Like `tramp-handle-make-process', but modified for Android." (tramp-skeleton-make-process args nil nil (let* ((env (mapcar - (lambda (elt) - (when (tramp-compat-string-search "=" elt) elt)) + (lambda (elt) (when (string-search "=" elt) elt)) tramp-remote-process-environment)) ;; We use as environment the difference to toplevel ;; `process-environment'. (env (dolist (elt process-environment env) (when (and - (tramp-compat-string-search "=" elt) + (string-search "=" elt) (not (member elt (default-toplevel-value 'process-environment)))) diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 59c4223794c..3e6c483a47f 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -602,7 +602,7 @@ offered." (defun tramp-archive-handle-directory-file-name (directory) "Like `directory-file-name' for file archives." (with-parsed-tramp-archive-file-name directory nil - (if (and (tramp-compat-length> localname 0) + (if (and (length> localname 0) (eq (aref localname (1- (length localname))) ?/) (not (string= localname "/"))) (substring directory 0 -1) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 30c38d19fb7..9d7fb488412 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -271,8 +271,7 @@ Remove also properties of all files in subdirectories." (dolist (key (hash-table-keys tramp-cache-data)) (when (and (tramp-file-name-p key) (stringp (tramp-file-name-localname key)) - (tramp-compat-string-search - directory (tramp-file-name-localname key))) + (string-search directory (tramp-file-name-localname key))) (remhash key tramp-cache-data))) ;; Remove file properties of symlinks. (when (and (stringp truename) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 5b2646a0b03..09c48db0562 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -287,7 +287,7 @@ non-nil." (defun tramp-cleanup-all-buffers () "Kill all remote buffers." (interactive) - (let ((tramp-cleanup-some-buffers-hook '(tramp-compat-always))) + (let ((tramp-cleanup-some-buffers-hook '(always))) (tramp-cleanup-some-buffers))) ;;; Rename @@ -472,8 +472,7 @@ ESC or `q' to quit without changing further buffers, (dolist (buffer (tramp-list-remote-buffers)) (switch-to-buffer buffer) (let* ((bfn (buffer-file-name)) - (new-bfn (and (stringp bfn) - (tramp-compat-string-replace source target bfn))) + (new-bfn (and (stringp bfn) (string-replace source target bfn))) (prompt (format-message "Set visited file name to `%s' [Type yn!eq or %s] " new-bfn (key-description (vector help-char))))) @@ -827,7 +826,7 @@ buffer in your bug report. (insert "\nload-path shadows:\n==================\n") (ignore-errors (mapc - (lambda (x) (when (tramp-compat-string-search "tramp" x) (insert x "\n"))) + (lambda (x) (when (string-search "tramp" x) (insert x "\n"))) (split-string (list-load-path-shadows t) "\n"))) ;; Append buffers only when we are in message mode. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 8781230c00c..ec74d9bb76e 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -24,8 +24,8 @@ ;;; Commentary: ;; Tramp's main Emacs version for development is Emacs 30. This -;; package provides compatibility functions for Emacs 27, Emacs 28 and -;; Emacs 29. +;; package provides compatibility functions for Emacs 28, Emacs 29 and +;; Emacs 30. ;;; Code: @@ -79,8 +79,7 @@ (if-let ((xdg (xdg-cache-home)) ((file-directory-p xdg)) ((file-writable-p xdg))) - ;; We can use `file-name-concat' starting with Emacs 28.1. - (prog1 (setq xdg (concat (file-name-as-directory xdg) "emacs")) + (prog1 (setq xdg (file-name-concat xdg "emacs")) (make-directory xdg t)) (eval (car (get 'temporary-file-directory 'standard-value)) t))) "The default value of `temporary-file-directory' for Tramp.") @@ -99,152 +98,6 @@ Add the extension of F, if existing." tramp-temp-name-prefix tramp-compat-temporary-file-directory) dir-flag (file-name-extension f t))) -;; `file-modes', `set-file-modes' and `set-file-times' got argument -;; FLAG in Emacs 28.1. -(defalias 'tramp-compat-file-modes - (if (equal (func-arity #'file-modes) '(1 . 2)) - #'file-modes - (lambda (filename &optional _flag) - (file-modes filename)))) - -(defalias 'tramp-compat-set-file-modes - (if (equal (func-arity #'set-file-modes) '(2 . 3)) - #'set-file-modes - (lambda (filename mode &optional _flag) - (set-file-modes filename mode)))) - -(defalias 'tramp-compat-set-file-times - (if (equal (func-arity #'set-file-times) '(1 . 3)) - #'set-file-times - (lambda (filename &optional timestamp _flag) - (set-file-times filename timestamp)))) - -;; `directory-files' and `directory-files-and-attributes' got argument -;; COUNT in Emacs 28.1. -(defalias 'tramp-compat-directory-files - (if (equal (func-arity #'directory-files) '(1 . 5)) - #'directory-files - (lambda (directory &optional full match nosort _count) - (directory-files directory full match nosort)))) - -(defalias 'tramp-compat-directory-files-and-attributes - (if (equal (func-arity #'directory-files-and-attributes) '(1 . 6)) - #'directory-files-and-attributes - (lambda (directory &optional full match nosort id-format _count) - (directory-files-and-attributes directory full match nosort id-format)))) - -;; `directory-empty-p' is new in Emacs 28.1. -(defalias 'tramp-compat-directory-empty-p - (if (fboundp 'directory-empty-p) - #'directory-empty-p - (lambda (dir) - (and (file-directory-p dir) - (null (tramp-compat-directory-files - dir nil directory-files-no-dot-files-regexp t 1)))))) - -;; Function `null-device' is new in Emacs 28.1. -(defalias 'tramp-compat-null-device - (if (fboundp 'null-device) - #'null-device - (lambda () - (if (tramp-tramp-file-p default-directory) "/dev/null" null-device)))) - -;; Function `string-replace' is new in Emacs 28.1. -(defalias 'tramp-compat-string-replace - (if (fboundp 'string-replace) - #'string-replace - (lambda (from-string to-string in-string) - (let (case-fold-search) - (replace-regexp-in-string - (regexp-quote from-string) to-string in-string t t))))) - -;; Function `string-search' is new in Emacs 28.1. -(defalias 'tramp-compat-string-search - (if (fboundp 'string-search) - #'string-search - (lambda (needle haystack &optional start-pos) - (let (case-fold-search) - (string-match-p (regexp-quote needle) haystack start-pos))))) - -;; Function `make-lock-file-name' is new in Emacs 28.1. -(defalias 'tramp-compat-make-lock-file-name - (if (fboundp 'make-lock-file-name) - #'make-lock-file-name - (lambda (filename) - (expand-file-name - (concat - ".#" (file-name-nondirectory filename)) - (file-name-directory filename))))) - -;; Function `file-name-concat' is new in Emacs 28.1. -(defalias 'tramp-compat-file-name-concat - (if (fboundp 'file-name-concat) - #'file-name-concat - (lambda (directory &rest components) - (let ((components (cl-remove-if (lambda (el) - (or (null el) (equal "" el))) - components)) - file-name-handler-alist) - (if (null components) - directory - (apply #'tramp-compat-file-name-concat - (concat (unless (or (equal "" directory) (null directory)) - (file-name-as-directory directory)) - (car components)) - (cdr components))))))) - -;; Function `replace-regexp-in-region' is new in Emacs 28.1. -(defalias 'tramp-compat-replace-regexp-in-region - (if (fboundp 'replace-regexp-in-region) - #'replace-regexp-in-region - (lambda (regexp replacement &optional start end) - (if start - (when (< start (point-min)) - (error "Start before start of buffer")) - (setq start (point))) - (if end - (when (> end (point-max)) - (error "End after end of buffer")) - (setq end (point-max))) - (save-excursion - (let ((matches 0) - (case-fold-search nil)) - (goto-char start) - (while (search-forward-regexp regexp end t) - (replace-match replacement t) - (setq matches (1+ matches))) - (and (not (zerop matches)) - matches)))))) - -;; `length<', `length>' and `length=' are added to Emacs 28.1. -(defalias 'tramp-compat-length< - (if (fboundp 'length<) - #'length< - (lambda (sequence length) - (< (length sequence) length)))) - -(defalias 'tramp-compat-length> - (if (fboundp 'length>) - #'length> - (lambda (sequence length) - (> (length sequence) length)))) - -(defalias 'tramp-compat-length= - (if (fboundp 'length=) - #'length= - (lambda (sequence length) - (= (length sequence) length)))) - -;; `always' is introduced with Emacs 28.1. -(defalias 'tramp-compat-always - (if (fboundp 'always) - #'always - (lambda (&rest _arguments) - "Do nothing and return t. -This function accepts any number of ARGUMENTS, but ignores them. -Also see `ignore'." - t))) - ;; `permission-denied' is introduced in Emacs 29.1. (defconst tramp-permission-denied (if (get 'permission-denied 'error-conditions) 'permission-denied 'file-error) @@ -274,7 +127,7 @@ Also see `ignore'." #'take (lambda (n list) (when (and (natnump n) (> n 0)) - (if (tramp-compat-length< list n) + (if (length< list n) list (butlast list (- (length list) n))))))) ;; Function `ntake' is new in Emacs 29.1. @@ -283,7 +136,7 @@ Also see `ignore'." #'ntake (lambda (n list) (when (and (natnump n) (> n 0)) - (if (tramp-compat-length< list n) + (if (length< list n) list (nbutlast list (- (length list) n))))))) ;; Function `string-equal-ignore-case' is new in Emacs 29.1. diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index d44a656035d..4f19ddb75fc 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -831,15 +831,13 @@ WILDCARD is not supported." "Like `set-file-modes' for Tramp files." (tramp-skeleton-set-file-modes-times-uid-gid filename (let (tramp-crypt-enabled) - (tramp-compat-set-file-modes - (tramp-crypt-encrypt-file-name filename) mode flag)))) + (set-file-modes (tramp-crypt-encrypt-file-name filename) mode flag)))) (defun tramp-crypt-handle-set-file-times (filename &optional time flag) "Like `set-file-times' for Tramp files." (tramp-skeleton-set-file-modes-times-uid-gid filename (let (tramp-crypt-enabled) - (tramp-compat-set-file-times - (tramp-crypt-encrypt-file-name filename) time flag)))) + (set-file-times (tramp-crypt-encrypt-file-name filename) time flag)))) (defun tramp-crypt-handle-set-file-uid-gid (filename &optional uid gid) "Like `tramp-set-file-uid-gid' for Tramp files." diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index 3d42948043c..127303dfae1 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -63,8 +63,7 @@ (append '("." "..") (tramp-fuse-remove-hidden-files - (tramp-compat-directory-files - (tramp-fuse-local-file-name directory)))))))) + (directory-files (tramp-fuse-local-file-name directory)))))))) (if full ;; Massage the result. (let ((local (rx @@ -207,7 +206,7 @@ It has the same meaning as `remote-file-name-inhibit-cache'.") (delete (tramp-file-name-unify vec) tramp-fuse-mount-points)) ;; Give the caches a chance to expire. (sleep-for 1) - (when (tramp-compat-directory-empty-p mount-point) + (when (directory-empty-p mount-point) (delete-directory mount-point)))) (defun tramp-fuse-local-file-name (filename) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 381a5efc77f..1f61c5fdd36 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1169,7 +1169,7 @@ file names." (delete-file file))) (directory-files directory 'full directory-files-no-dot-files-regexp)) - (unless (tramp-compat-directory-empty-p directory) + (unless (directory-empty-p directory) (tramp-error v 'file-error "Couldn't delete non-empty %s" directory))) @@ -1203,7 +1203,7 @@ file names." (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) - (setq name (tramp-compat-file-name-concat dir name))) + (setq name (file-name-concat dir name))) ;; If NAME is not a Tramp file, run the real handler. (if (not (tramp-tramp-file-p name)) (tramp-run-real-handler #'expand-file-name (list name)) @@ -1465,7 +1465,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." (defun tramp-gvfs-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." (tramp-skeleton-file-name-all-completions filename directory - (unless (tramp-compat-string-search "/" filename) + (unless (string-search "/" filename) (all-completions filename (with-parsed-tramp-file-name (expand-file-name directory) nil @@ -1533,12 +1533,9 @@ If FILE-SYSTEM is non-nil, return file system attributes." (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) ;; Fix action names. - string (tramp-compat-string-replace - "attributes changed" "attribute-changed" string) - string (tramp-compat-string-replace - "changes done" "changes-done-hint" string) - string (tramp-compat-string-replace - "renamed to" "moved" string)) + string (string-replace "attributes changed" "attribute-changed" string) + string (string-replace "changes done" "changes-done-hint" string) + string (string-replace "renamed to" "moved" string)) ;; https://bugs.launchpad.net/bugs/1742946 (when (string-match-p @@ -2145,7 +2142,7 @@ Their full names are (vec (make-tramp-file-name :method "mtp" ;; A host name cannot contain spaces. - :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) + :host (string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device :method method :host (tramp-gvfs-url-host (nth 5 volume)) @@ -2462,7 +2459,7 @@ VEC is used only for traces." (vec (make-tramp-file-name :method "mtp" ;; A host name cannot contain spaces. - :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) + :host (string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device :method method :host (tramp-gvfs-url-host (nth 5 volume)) @@ -2476,7 +2473,7 @@ VEC is used only for traces." ;; Adapt default host name, supporting /mtp:: when possible. (setq tramp-default-host-alist (append - `(("mtp" nil ,(if (tramp-compat-length= devices 1) (car devices) ""))) + `(("mtp" nil ,(if (length= devices 1) (car devices) ""))) (delete (assoc "mtp" tramp-default-host-alist) tramp-default-host-alist))))) diff --git a/lisp/net/tramp-message.el b/lisp/net/tramp-message.el index 36079c8844c..df3e9c2a616 100644 --- a/lisp/net/tramp-message.el +++ b/lisp/net/tramp-message.el @@ -190,13 +190,13 @@ They are completed by `M-x TAB' only in Tramp debug buffers." "Get the debug file name for VEC." (declare (tramp-suppress-trace t)) (expand-file-name - (tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec)) + (string-replace "/" " " (tramp-debug-buffer-name vec)) tramp-compat-temporary-file-directory)) (defun tramp-trace-buffer-name (vec) "A name for the trace buffer for VEC." (declare (tramp-suppress-trace t)) - (tramp-compat-string-replace "*debug" "*trace" (tramp-debug-buffer-name vec))) + (string-replace "*debug" "*trace" (tramp-debug-buffer-name vec))) (defvar tramp-trace-functions nil "A list of non-Tramp functions to be traced with `tramp-verbose' > 10.") diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 8fde854a97b..b011b7ca3d4 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1909,9 +1909,9 @@ ID-FORMAT valid values are `string' and `integer'." "Like `file-name-all-completions' for Tramp files." (tramp-skeleton-file-name-all-completions filename directory (with-parsed-tramp-file-name (expand-file-name directory) nil - (when (and (not (tramp-compat-string-search "/" filename)) + (when (and (not (string-search "/" filename)) (tramp-connectable-p v)) - (unless (tramp-compat-string-search "/" filename) + (unless (string-search "/" filename) (all-completions filename (with-tramp-file-property v localname "file-name-all-completions" @@ -2228,7 +2228,7 @@ file names." ;; KEEP-DATE handling. (when (and keep-date (not copy-keep-date)) - (tramp-compat-set-file-times + (set-file-times newname file-times (unless ok-if-already-exists 'nofollow))) ;; Set the mode. @@ -2505,8 +2505,7 @@ The method used must be an out-of-band method." copy-args (flatten-tree (mapcar - (lambda (x) (if (tramp-compat-string-search " " x) - (split-string x) x)) + (lambda (x) (if (string-search " " x) (split-string x) x)) copy-args)) copy-env (apply #'tramp-expand-args v 'tramp-copy-env nil spec) remote-copy-program @@ -2805,7 +2804,7 @@ The method used must be an out-of-band method." (save-restriction (narrow-to-region beg-marker end-marker) ;; Some busyboxes are reluctant to discard colors. - (unless (tramp-compat-string-search + (unless (string-search "color" (tramp-get-connection-property v "ls" "")) (goto-char (point-min)) (while (search-forward-regexp ansi-color-control-seq-regexp nil t) @@ -2892,7 +2891,7 @@ the result will be a local, non-Tramp, file name." (tramp-run-real-handler #'expand-file-name (list name dir)) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) - (setq name (tramp-compat-file-name-concat dir name))) + (setq name (file-name-concat dir name))) ;; Dissect NAME. (with-parsed-tramp-file-name name nil ;; If connection is not established yet, run the real handler. @@ -2983,7 +2982,7 @@ will be used." (heredoc (and (not (bufferp stderr)) (stringp program) (string-match-p (rx "sh" eol) program) - (tramp-compat-length= args 2) + (length= args 2) (string-equal "-c" (car args)) ;; Don't if there is a quoted string. (not (string-match-p (rx (any "'\"")) (cadr args))) @@ -2992,7 +2991,7 @@ will be used." ;; When PROGRAM is nil, we just provide a tty. (args (if (not heredoc) args (let ((i 250)) - (while (and (not (tramp-compat-length< (cadr args) i)) + (while (and (not (length< (cadr args) i)) (string-match " " (cadr args) i)) (setcdr args @@ -3011,7 +3010,7 @@ will be used." (env (dolist (elt (cons prompt process-environment) env) (or (member elt (default-toplevel-value 'process-environment)) - (if (tramp-compat-string-search "=" elt) + (if (string-search "=" elt) (setq env (append env `(,elt))) (setq uenv (cons elt uenv)))))) (env (setenv-internal @@ -3244,7 +3243,7 @@ will be used." ;; We use as environment the difference to toplevel `process-environment'. (dolist (elt process-environment) (or (member elt (default-toplevel-value 'process-environment)) - (if (tramp-compat-string-search "=" elt) + (if (string-search "=" elt) (setq env (append env `(,elt))) (setq uenv (cons elt uenv))))) (setq env (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep)) @@ -3773,7 +3772,7 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Make events a list of symbols. events (mapcar - (lambda (x) (intern-soft (tramp-compat-string-replace "_" "-" x))) + (lambda (x) (intern-soft (string-replace "_" "-" x))) (split-string events "," 'omit)))) ;; "gio monitor". ((setq command (tramp-get-remote-gio-monitor v)) @@ -3831,12 +3830,9 @@ Fall back to normal file name handler if no Tramp handler exists." (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) ;; Fix action names. - string (tramp-compat-string-replace - "attributes changed" "attribute-changed" string) - string (tramp-compat-string-replace - "changes done" "changes-done-hint" string) - string (tramp-compat-string-replace - "renamed to" "moved" string)) + string (string-replace "attributes changed" "attribute-changed" string) + string (string-replace "changes done" "changes-done-hint" string) + string (string-replace "renamed to" "moved" string)) (catch 'doesnt-work ;; https://bugs.launchpad.net/bugs/1742946 @@ -3871,7 +3867,7 @@ Fall back to normal file name handler if no Tramp handler exists." (setq string (substring string pos))) ;; Delete empty lines. - (setq string (tramp-compat-string-replace "\n\n" "\n" string)) + (setq string (string-replace "\n\n" "\n" string)) (while (string-match (rx @@ -3924,9 +3920,7 @@ Fall back to normal file name handler if no Tramp handler exists." (list proc (mapcar - (lambda (x) - (intern-soft - (tramp-compat-string-replace "_" "-" (downcase x)))) + (lambda (x) (intern-soft (string-replace "_" "-" (downcase x)))) (split-string (match-string 1 line) "," 'omit)) (or (match-string 2 line) (file-name-nondirectory @@ -4050,8 +4044,8 @@ Only send the definition if it has not already been done." vec 5 (format-message "Sending script `%s'" name) ;; In bash, leading TABs like in `tramp-bundle-read-file-names' ;; could result in unwanted command expansion. Avoid this. - (setq script (tramp-compat-string-replace - (make-string 1 ?\t) (make-string 8 ? ) script)) + (setq script + (string-replace (make-string 1 ?\t) (make-string 8 ? ) script)) ;; Expand format specifiers. (unless (setq script (tramp-expand-script vec script)) (tramp-error @@ -4141,7 +4135,7 @@ variable PATH." (pipe-buf (tramp-get-remote-pipe-buf vec)) tmpfile chunk chunksize) (tramp-message vec 5 "Setting $PATH environment variable") - (if (tramp-compat-length< command pipe-buf) + (if (length< command pipe-buf) (tramp-send-command vec command) ;; Use a temporary file. We cannot use `write-region' because ;; setting the remote path happens in the early connection @@ -4793,12 +4787,12 @@ means standard output and thus the current buffer), or nil (which means discard it)." (tramp-call-process nil tramp-encoding-shell - (when (and input (not (tramp-compat-string-search "%s" cmd))) input) + (when (and input (not (string-search "%s" cmd))) input) (if (eq output t) t nil) nil tramp-encoding-command-switch (concat - (if (tramp-compat-string-search "%s" cmd) (format cmd input) cmd) + (if (string-search "%s" cmd) (format cmd input) cmd) (if (stringp output) (concat " >" output) "")))) (defconst tramp-inline-compress-commands @@ -6003,13 +5997,12 @@ function cell is returned to be applied on a buffer." (with-tramp-connection-property (tramp-get-process vec) prop (tramp-find-inline-encoding vec) (tramp-get-connection-property (tramp-get-process vec) prop))) - (prop1 (if (tramp-compat-string-search "encoding" prop) + (prop1 (if (string-search "encoding" prop) "inline-compress" "inline-decompress")) compress) ;; The connection property might have been cached. So we must ;; send the script to the remote side - maybe. - (when (and coding (symbolp coding) - (tramp-compat-string-search "remote" prop)) + (when (and coding (symbolp coding) (string-search "remote" prop)) (let ((name (symbol-name coding))) (while (string-match "-" name) (setq name (replace-match "_" nil t name))) @@ -6021,7 +6014,7 @@ function cell is returned to be applied on a buffer." ;; Return the value. (cond ((and compress (symbolp coding)) - (if (tramp-compat-string-search "decompress" prop1) + (if (string-search "decompress" prop1) `(lambda (beg end) (,coding beg end) (let ((coding-system-for-write 'binary) @@ -6040,16 +6033,15 @@ function cell is returned to be applied on a buffer." (,coding (point-min) (point-max))))) ((symbolp coding) coding) - ((and compress (tramp-compat-string-search "decoding" prop)) + ((and compress (string-search "decoding" prop)) (format ;; Windows shells need the program file name after ;; the pipe symbol be quoted if they use forward ;; slashes as directory separators. (cond - ((and (tramp-compat-string-search "local" prop) - (eq system-type 'windows-nt)) - "(%s | \"%s\")") - ((tramp-compat-string-search "local" prop) "(%s | %s)") + ((and (string-search "local" prop) (eq system-type 'windows-nt)) + "(%s | \"%s\")") + ((string-search "local" prop) "(%s | %s)") (t "(%s | %s >%%s)")) coding compress)) (compress @@ -6057,14 +6049,13 @@ function cell is returned to be applied on a buffer." ;; Windows shells need the program file name after ;; the pipe symbol be quoted if they use forward ;; slashes as directory separators. - (if (and (tramp-compat-string-search "local" prop) - (eq system-type 'windows-nt)) + (if (and (string-search "local" prop) (eq system-type 'windows-nt)) "(%s <%%s | \"%s\")" "(%s <%%s | %s)") compress coding)) - ((tramp-compat-string-search "decoding" prop) + ((string-search "decoding" prop) (cond - ((tramp-compat-string-search "local" prop) (format "%s" coding)) + ((string-search "local" prop) (format "%s" coding)) (t (format "%s >%%s" coding)))) (t (format "%s <%%s" coding))))))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index c6c3caabdcf..1f4ee8bc8e5 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -485,7 +485,7 @@ arguments to pass to the OPERATION." (let* ((share (tramp-smb-get-share v)) (localname (file-name-as-directory - (tramp-compat-string-replace + (string-replace "\\" "/" (tramp-smb-get-localname v)))) (tmpdir (tramp-compat-make-temp-name)) (args (list (concat "//" host "/" share) "-E")) @@ -572,7 +572,7 @@ arguments to pass to the OPERATION." ;; Handle KEEP-DATE argument. (when keep-date - (tramp-compat-set-file-times + (set-file-times newname (file-attribute-modification-time (file-attributes dirname)) (unless ok-if-already-exists 'nofollow))) @@ -656,7 +656,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; KEEP-DATE handling. (when keep-date - (tramp-compat-set-file-times + (set-file-times newname (file-attribute-modification-time (file-attributes filename)) (unless ok-if-already-exists 'nofollow))))) @@ -716,7 +716,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) - (setq name (tramp-compat-file-name-concat dir name))) + (setq name (file-name-concat dir name))) ;; If NAME is not a Tramp file, run the real handler. (if (not (tramp-tramp-file-p name)) (tramp-run-real-handler #'expand-file-name (list name)) @@ -780,7 +780,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (with-tramp-file-property v localname "file-acl" (when (tramp-smb-remote-acl-p v) (let* ((share (tramp-smb-get-share v)) - (localname (tramp-compat-string-replace + (localname (string-replace "\\" "/" (tramp-smb-get-localname v))) (args (list (concat "//" host "/" share) "-E")) (options tramp-smb-options)) @@ -845,8 +845,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; Check result. (when entry - (list (and (tramp-compat-string-search "d" (nth 1 entry)) - t) ;0 file type + (list (and (string-search "d" (nth 1 entry)) t) ;0 file type -1 ;1 link count (cons tramp-unknown-id-string tramp-unknown-id-integer) ;2 uid @@ -981,7 +980,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (mapcar (lambda (x) (list - (if (tramp-compat-string-search "d" (nth 1 x)) + (if (string-search "d" (nth 1 x)) (file-name-as-directory (nth 0 x)) (nth 0 x)))) (tramp-smb-get-file-entries directory)))))))) @@ -1020,7 +1019,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (defun tramp-smb-handle-file-writable-p (filename) "Like `file-writable-p' for Tramp files." (if (file-exists-p filename) - (tramp-compat-string-search + (string-search "w" (or (file-attribute-modes (file-attributes filename)) "")) (let ((dir (file-name-directory filename))) (and (file-exists-p dir) @@ -1083,14 +1082,14 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (sort entries (lambda (x y) - (if (tramp-compat-string-search "t" switches) + (if (string-search "t" switches) ;; Sort by date. (time-less-p (nth 3 y) (nth 3 x)) ;; Sort by name. (string-lessp (nth 0 x) (nth 0 y)))))) ;; Handle "-F" switch. - (when (tramp-compat-string-search "F" switches) + (when (string-search "F" switches) (mapc (lambda (x) (unless (string-empty-p (car x)) @@ -1121,7 +1120,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (expand-file-name (nth 0 x) (file-name-directory filename)) 'string))))) - (when (tramp-compat-string-search "l" switches) + (when (string-search "l" switches) (insert (format "%10s %3d %-8s %-8s %8s %s " @@ -1150,7 +1149,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (put-text-property start (point) 'dired-filename t)) ;; Insert symlink. - (when (and (tramp-compat-string-search "l" switches) + (when (and (string-search "l" switches) (stringp (file-attribute-type attr))) (insert " -> " (file-attribute-type attr)))) @@ -1369,11 +1368,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (when (and (stringp acl-string) (tramp-smb-remote-acl-p v)) (let* ((share (tramp-smb-get-share v)) - (localname (tramp-compat-string-replace - "\\" "/" (tramp-smb-get-localname v))) + (localname (string-replace "\\" "/" (tramp-smb-get-localname v))) (args (list (concat "//" host "/" share) "-E" "-S" - (tramp-compat-string-replace - "\n" "," acl-string))) + (string-replace "\n" "," acl-string))) (options tramp-smb-options)) (if (tramp-string-empty-or-nil-p user) @@ -1492,7 +1489,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; Save exit. ;; FIXME: Does `tramp-get-connection-buffer' return the proper value? (with-current-buffer (tramp-get-connection-buffer v) - (if (tramp-compat-string-search tramp-temp-buffer-name (buffer-name)) + (if (string-search tramp-temp-buffer-name (buffer-name)) (progn (set-process-buffer (tramp-get-connection-process v) nil) (kill-buffer (current-buffer))) @@ -1765,12 +1762,10 @@ are listed. Result is the list (LOCALNAME MODE SIZE MTIME)." mode (or (match-string 1 line) "") mode (format "%s%s" - (if (tramp-compat-string-search "D" mode) "d" "-") + (if (string-search "D" mode) "d" "-") (mapconcat (lambda (_x) "") " " - (format - "r%sx" - (if (tramp-compat-string-search "R" mode) "-" "w")))) + (format "r%sx" (if (string-search "R" mode) "-" "w")))) line (substring line 0 -6)) (cl-return)) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index c75796d3b36..1031e71a994 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -301,15 +301,13 @@ arguments to pass to the OPERATION." "Like `set-file-modes' for Tramp files." (unless (and (eq flag 'nofollow) (file-symlink-p filename)) (tramp-skeleton-set-file-modes-times-uid-gid filename - (tramp-compat-set-file-modes - (tramp-fuse-local-file-name filename) mode flag)))) + (set-file-modes (tramp-fuse-local-file-name filename) mode flag)))) (defun tramp-sshfs-handle-set-file-times (filename &optional timestamp flag) "Like `set-file-times' for Tramp files." (unless (and (eq flag 'nofollow) (file-symlink-p filename)) (tramp-skeleton-set-file-modes-times-uid-gid filename - (tramp-compat-set-file-times - (tramp-fuse-local-file-name filename) timestamp flag)))) + (set-file-times (tramp-fuse-local-file-name filename) timestamp flag)))) (defun tramp-sshfs-handle-write-region (start end filename &optional append visit lockname mustbenew) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index c82cd2dc0e1..1ffe789746a 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -305,7 +305,7 @@ absolute file names." ;; Set the time and mode. Mask possible errors. (when keep-date (ignore-errors - (tramp-compat-set-file-times + (set-file-times newname file-times (unless ok-if-already-exists 'nofollow)) (set-file-modes newname file-modes))) @@ -371,7 +371,7 @@ the result will be a local, non-Tramp, file name." (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) - (setq name (tramp-compat-file-name-concat dir name))) + (setq name (file-name-concat dir name))) ;; If NAME is not a Tramp file, run the real handler. (if (not (tramp-tramp-file-p name)) (tramp-run-real-handler #'expand-file-name (list name)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 22b3ef84626..4151b811b42 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1716,7 +1716,7 @@ This is HOST, if non-nil. Otherwise, do a lookup in `tramp-default-host-alist' and `tramp-default-host'." (declare (tramp-suppress-trace t)) (let ((result - (or (and (tramp-compat-length> host 0) host) + (or (and (length> host 0) host) (let ((choices tramp-default-host-alist) lhost item) (while choices @@ -1728,7 +1728,7 @@ This is HOST, if non-nil. Otherwise, do a lookup in lhost) tramp-default-host))) ;; We must mark, whether a default value has been used. - (if (or (tramp-compat-length> host 0) (null result)) + (if (or (length> host 0) (null result)) result (propertize result 'tramp-default t)))) @@ -1772,8 +1772,7 @@ default values are used." (setq v (tramp-dissect-hop-name hop) hop (and hop (tramp-make-tramp-hop-name v)))) (let ((tramp-default-host - (or (and v (not (tramp-compat-string-search - "%h" (tramp-file-name-host v))) + (or (and v (not (string-search "%h" (tramp-file-name-host v))) (tramp-file-name-host v)) tramp-default-host))) (setq method (tramp-find-method method user host) @@ -2100,7 +2099,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user', "Report progress of an operation for Tramp." (let* ((parameters (cdr reporter)) (message (aref parameters 3))) - (when (tramp-compat-string-search message (or (current-message) "")) + (when (string-search message (or (current-message) "")) (progress-reporter-update reporter value suffix)))) ;;;###tramp-autoload @@ -2269,7 +2268,7 @@ If optional FLAG is `nofollow', do not follow FILENAME if it is a symbolic link. If the file modes of FILENAME cannot be determined, return the value of `default-file-modes', without execute permissions." - (or (tramp-compat-file-modes filename flag) + (or (file-modes filename flag) (logand (default-file-modes) #o0666))) (defun tramp-replace-environment-variables (filename) @@ -3106,7 +3105,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST." (defun tramp-completion-handle-file-name-nondirectory (filename) "Like `file-name-nondirectory' for partial Tramp files." - (tramp-compat-string-replace (file-name-directory filename) "" filename)) + (string-replace (file-name-directory filename) "" filename)) (defun tramp-parse-default-user-host (method) "Return a list of (user host) tuples allowed to access for METHOD. @@ -3354,7 +3353,7 @@ BODY is the backend specific code." (if (and delete-by-moving-to-trash ,trash) ;; Move non-empty dir to trash only if recursive deletion was ;; requested. - (if (not (or ,recursive (tramp-compat-directory-empty-p ,directory))) + (if (not (or ,recursive (directory-empty-p ,directory))) (tramp-error v 'file-error "Directory is not empty, not moving to trash") (move-file-to-trash ,directory)) @@ -4011,7 +4010,7 @@ Let-bind it when necessary.") ;; Otherwise, remove any trailing slash from localname component. ;; Method, host, etc, are unchanged. (while (with-parsed-tramp-file-name directory nil - (and (tramp-compat-length> localname 0) + (and (length> localname 0) (eq (aref localname (1- (length localname))) ?/) (not (string= localname "/")))) (setq directory (substring directory 0 -1))) @@ -4029,7 +4028,7 @@ Let-bind it when necessary.") (lambda (x) (cons x (file-attributes (if full x (expand-file-name x directory)) id-format))) - (tramp-compat-directory-files directory full match nosort count))) + (directory-files directory full match nosort count))) (defun tramp-handle-dired-uncache (dir) "Like `dired-uncache' for Tramp files." @@ -4046,7 +4045,7 @@ Let-bind it when necessary.") (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) - (setq name (tramp-compat-file-name-concat dir name))) + (setq name (file-name-concat dir name))) ;; If NAME is not a Tramp file, run the real handler. (if (not (tramp-tramp-file-p name)) (tramp-run-real-handler #'expand-file-name (list name)) @@ -4212,8 +4211,7 @@ Let-bind it when necessary.") ;; "." and ".." are never interesting as completions, and are ;; actually in the way in a directory with only one file. See ;; file_name_completion() in dired.c. - (when (and (consp fnac) - (tramp-compat-length= (delete "./" (delete "../" fnac)) 1)) + (when (and (consp fnac) (length= (delete "./" (delete "../" fnac)) 1)) (setq fnac (delete "./" (delete "../" fnac)))) (or (try-completion @@ -4446,7 +4444,7 @@ existing) are returned." (list filename switches wildcard full-directory-p)) ;; `ls-lisp' always returns full listings. We must remove ;; superfluous parts. - (unless (tramp-compat-string-search "l" switches) + (unless (string-search "l" switches) (save-excursion (goto-char (point-min)) (while (setq start @@ -4723,7 +4721,7 @@ It is not guaranteed, that all process attributes as described in (defun tramp-get-lock-file (file) "Read lockfile info of FILE. Return nil when there is no lockfile." - (when-let ((lockname (tramp-compat-make-lock-file-name file))) + (when-let ((lockname (make-lock-file-name file))) (or (file-symlink-p lockname) (and (file-readable-p lockname) (with-temp-buffer @@ -4785,7 +4783,7 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.") (match-string 2 info) (match-string 3 info))) (throw 'dont-lock nil))) - (when-let ((lockname (tramp-compat-make-lock-file-name file)) + (when-let ((lockname (make-lock-file-name file)) ;; USER@HOST.PID[:BOOT_TIME] (info (format @@ -4833,7 +4831,7 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.") ;; connection. See Bug#61663. (if-let ((v (tramp-dissect-file-name file)) ((process-live-p (tramp-get-process v))) - (lockname (tramp-compat-make-lock-file-name file))) + (lockname (make-lock-file-name file))) (delete-file lockname) ;; Trigger the unlock error. Be quiet if user isn't ;; interested in lock files. See Bug#70900. @@ -5076,13 +5074,13 @@ should be set connection-local.") (adb-file-name-handler-p (tramp-adb-file-name-p v)) (env (mapcar (lambda (elt) - (when (tramp-compat-string-search "=" elt) elt)) + (when (string-search "=" elt) elt)) tramp-remote-process-environment)) ;; We use as environment the difference to toplevel ;; `process-environment'. (env (dolist (elt process-environment env) (when (and - (tramp-compat-string-search "=" elt) + (string-search "=" elt) (not (member elt (default-toplevel-value 'process-environment)))) @@ -5149,8 +5147,7 @@ should be set connection-local.") ;; Command could be too long, for example due to a longish PATH. (when (and sh-file-name-handler-p - (tramp-compat-length> - (string-join command) (tramp-get-remote-pipe-buf v))) + (length> (string-join command) (tramp-get-remote-pipe-buf v))) (signal 'error (cons "Command too long:" command))) (setq @@ -7021,7 +7018,7 @@ If VEC is `tramp-null-hop', return local null device." null-device (with-tramp-connection-property vec "null-device" (let ((default-directory (tramp-make-tramp-file-name vec))) - (tramp-compat-null-device))))) + (null-device))))) ;; Checklist for `tramp-unload-hook' ;; - Unload all `tramp-*' packages diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 8b2700a0d96..2ffea846ecb 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,8 +7,8 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.7.2-pre -;; Package-Requires: ((emacs "27.1")) +;; Version: 2.8.0-pre +;; Package-Requires: ((emacs "28.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.7.2-pre" +(defconst tramp-version "2.8.0-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -76,9 +76,9 @@ "The repository revision of the Tramp sources.") ;; Check for Emacs version. -(let ((x (if (not (string-version-lessp emacs-version "27.1")) +(let ((x (if (not (string-version-lessp emacs-version "28.1")) "ok" - (format "Tramp 2.7.2-pre is not fit for %s" + (format "Tramp 2.8.0-pre is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) commit 976416bebe278a7cf65ab58b1918c9c27e3a09bd Author: Andrea Corallo Date: Wed Jul 24 15:17:19 2024 +0200 Fix some function type declaration * lisp/window.el (get-lru-window, get-largest-window): Fix function type declaration. * lisp/subr.el (error): Likewise. diff --git a/lisp/subr.el b/lisp/subr.el index 5a4ef38c3fe..b382fa9f771 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -481,7 +481,7 @@ for the sake of consistency. To alter the look of the displayed error messages, you can use the `command-error-function' variable." - (declare (ftype (function (string &rest t) nil)) + (declare (ftype (function (&rest t) nil)) (advertised-calling-convention (string &rest args) "23.1")) (signal 'error (list (apply #'format-message args)))) diff --git a/lisp/window.el b/lisp/window.el index 60040f18bc7..006cfa19525 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2515,7 +2515,7 @@ have special meanings: Any other value of ALL-FRAMES means consider all windows on the selected frame and no others." - (declare (ftype (function (&optional t t t) (or window null))) + (declare (ftype (function (&optional t t t t) (or window null))) (side-effect-free error-free)) (let ((windows (window-list-1 nil 'nomini all-frames)) best-window best-time second-best-window second-best-time time) @@ -2595,7 +2595,7 @@ have special meanings: Any other value of ALL-FRAMES means consider all windows on the selected frame and no others." - (declare (ftype (function (&optional t t t) (or window null))) + (declare (ftype (function (&optional t t t t) (or window null))) (side-effect-free error-free)) (let ((best-size 0) best-window size) commit 23549d7175108ca632375f9cc4390ff3e53e4d1e Author: Po Lu Date: Wed Jul 24 20:06:15 2024 +0800 * src/image.c (gui_put_x_image): Avoid memory leak. diff --git a/src/image.c b/src/image.c index 96280f3ef46..db1b05cbcd7 100644 --- a/src/image.c +++ b/src/image.c @@ -4176,7 +4176,7 @@ static void gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, Emacs_Pixmap pixmap, int width, int height) { -#if defined USE_CAIRO || defined HAVE_HAIKU +#if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS eassert (pimg == pixmap); #elif defined HAVE_X_WINDOWS GC gc; @@ -4188,12 +4188,7 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, XFreeGC (FRAME_X_DISPLAY (f), gc); #elif defined HAVE_ANDROID android_put_image (pixmap, pimg); -#endif - -#ifdef HAVE_NS - eassert (pimg == pixmap); - ns_retain_object (pimg); -#endif +#endif /* HAVE_ANDROID */ } /* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches commit cb633820c151c9cf428a88f43b0a62f185c4f587 Author: Eli Zaretskii Date: Wed Jul 24 14:01:01 2024 +0300 ; * doc/misc/use-package.texi (Getting Started): Fix wording. diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index 8a7af5bc6f6..9e11b349f20 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -180,8 +180,8 @@ loading actually occurs. As you might expect, you can use The above declarations will load the @samp{foo} package immediately. In most cases, this is not necessary or desirable, as that will slow down Emacs startup. Instead, you should try to set things up so that -packages are only loaded when they are actually needed -(``autoloading''). If you have installed a package from @acronym{GNU} +packages are only loaded when they are actually needed (this is known as +``autoloading''). If you have installed a package from @acronym{GNU} @acronym{ELPA} that provides its own autoloads, it is often enough to say: commit 135ce96f1efd051c7bdd1a95670465a09502fa55 Merge: e673492f74c 3a76354e092 Author: Po Lu Date: Wed Jul 24 12:01:02 2024 +0800 Merge from savannah/emacs-30 3a76354e092 Adapt last change to non-NS systems commit 3a76354e092f291037367b65b24c1963fd0fe31f Author: Po Lu Date: Wed Jul 24 11:59:53 2024 +0800 Adapt last change to non-NS systems * src/image.c (xpm_load_image): Also check whether mask_img is NULL. diff --git a/src/image.c b/src/image.c index f869a95c15d..96280f3ef46 100644 --- a/src/image.c +++ b/src/image.c @@ -6508,7 +6508,8 @@ xpm_load_image (struct frame *f, if (ximg) { image_destroy_x_image (ximg); - image_destroy_x_image (mask_img); + if (mask_img) + image_destroy_x_image (mask_img); image_clear_image (f, img); } return 0; commit e673492f74c1068b75b3d2ff48cdd64474078268 Merge: db40b65825f b5543c54bf0 Author: Po Lu Date: Wed Jul 24 11:58:29 2024 +0800 Merge from savannah/emacs-30 b5543c54bf0 Fix NULL pointer dereferences in xpm_load_image commit b5543c54bf08c4fa4cae6b7f404a37a2aee60cdf Author: Po Lu Date: Wed Jul 24 11:57:28 2024 +0800 Fix NULL pointer dereferences in xpm_load_image * src/image.c (x_destroy_x_image): Correct test condition. (xpm_load_image): Do not release image data if it is still to be created. diff --git a/src/image.c b/src/image.c index 5aabb517f30..f869a95c15d 100644 --- a/src/image.c +++ b/src/image.c @@ -3886,7 +3886,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth, static void x_destroy_x_image (XImage *ximg) { - if (ximg) + if (ximg->data) { xfree (ximg->data); ximg->data = NULL; @@ -6505,9 +6505,12 @@ xpm_load_image (struct frame *f, failure: image_error ("Invalid XPM3 file (%s)", img->spec); - image_destroy_x_image (ximg); - image_destroy_x_image (mask_img); - image_clear_image (f, img); + if (ximg) + { + image_destroy_x_image (ximg); + image_destroy_x_image (mask_img); + image_clear_image (f, img); + } return 0; #undef match commit db40b65825f311aaa908f7c169ff6ad3ec5a40e6 Merge: a793305d166 1ee8579eb7d Author: Po Lu Date: Wed Jul 24 11:41:58 2024 +0800 Merge from savannah/emacs-30 1ee8579eb7d Fix bug#72255 05629d3af0a Delete redundant "a.k.a." in use-package.texi c7609464f70 Document (use-package 'emacs) declarations de9f9add138 Improve 'emacs-news-view-mode' menus and bindings 7588e1f8a9f ; * src/xdisp.c (Fformat_mode_line): Doc fix. 2074e94c3b1 Fix disappearing bar cursor on Hebrew text (bug#72230) 1aaadc8aec5 Fix DocView with DVI files c1382257aa8 ; Fix typo in use-package.texi caf7426f0ca FIx spurious fontification of variable in Java Mode 9b426e15abd Correctly typeset nil and t in texinfo f050b9c5033 Fix Tramp IPv6 handling in tests 46b192c04b1 Update to Org 9.7.8-5-gfdf0e0 87f41b937bc Fix Ftreesit_parser_create commit a793305d166939f26e6fb5418186bb11e65f0e0b Merge: 6d22bd4d3a0 ed38fcc0170 Author: Po Lu Date: Wed Jul 24 11:41:58 2024 +0800 ; Merge from savannah/emacs-30 The following commit was skipped: ed38fcc0170 Fix segfault when deleting tree-sitter query (bug#72238) commit 6d22bd4d3a0a9cb55bbfffb29ed3e3190c63b565 Merge: 19a18e487b8 c66bda1a19a Author: Po Lu Date: Wed Jul 24 11:41:58 2024 +0800 Merge from savannah/emacs-30 c66bda1a19a Improve treesit-node-child-by-field-name docstring 85773ab9771 Minor copyedits in tree-sitter starting guide 2dacec1609a Update tag for prebuilt tree-sitter grammars 68615a38669 Fix punctuation and doc style in treesit.c 00adee897ac ; Fix punctuation in docs ab29b28d4ba Fix DocView with PostScript files commit 1ee8579eb7d7aae9405f33099559ac8205a59be2 Author: Po Lu Date: Wed Jul 24 11:38:54 2024 +0800 Fix bug#72255 * src/image.c (struct image_type): Minor grammatical corrections. (image_destroy_x_image): [HAVE_NS]: Do not release Emacs_Pix_Containers, which are identical to Emacs_Pixmaps and consequently always released with the `struct image'. (bug#72255) diff --git a/src/image.c b/src/image.c index 3d761bd48be..5aabb517f30 100644 --- a/src/image.c +++ b/src/image.c @@ -1328,11 +1328,11 @@ struct image_type image type. Value is true if SPEC is valid. */ bool (*valid_p) (Lisp_Object spec); - /* Load IMG which is used on frame F from information contained in - IMG->spec. Value is true if successful. */ + /* Load IMG which is to be used on frame F from information contained + in IMG->spec. Value is true if successful. */ bool (*load_img) (struct frame *f, struct image *img); - /* Free resources of image IMG which is used on frame F. */ + /* Free such resources of image IMG as are used on frame F. */ void (*free_img) (struct frame *f, struct image *img); #ifdef WINDOWSNT @@ -4153,16 +4153,16 @@ image_destroy_x_image (Emacs_Pix_Container pimg) eassert (input_blocked_p ()); if (pimg) { -#ifdef USE_CAIRO -#endif /* USE_CAIRO */ +#if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS + /* On these systems, Emacs_Pix_Containers always point to the same + data as pixmaps in `struct image', and therefore must never be + freed separately. */ +#endif /* USE_CAIRO || HAVE_HAIKU || HAVE_NS */ #ifdef HAVE_NTGUI /* Data will be freed by DestroyObject. */ pimg->data = NULL; xfree (pimg); #endif /* HAVE_NTGUI */ -#ifdef HAVE_NS - ns_release_object (pimg); -#endif /* HAVE_NS */ } #endif } commit 05629d3af0acc74b197f00504eae544081b32020 Author: Stefan Kangas Date: Tue Jul 23 23:32:56 2024 +0200 Delete redundant "a.k.a." in use-package.texi * doc/misc/use-package.texi (Getting Started): Delete redundant acronym "a.k.a.". (Bug#66350) diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index 309315db23d..8a7af5bc6f6 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -177,13 +177,13 @@ loading actually occurs. As you might expect, you can use @end group @end lisp -The above declarations will load the @samp{foo} package -immediately. In most cases, this is not necessary or desirable, as -that will slow down Emacs startup. Instead, you should try to set -things up so that packages are only loaded when they are actually -needed (a.k.a. ``autoloading''). If you have installed a package from -@acronym{GNU} @acronym{ELPA} that provides its own autoloads, it is often -enough to say: +The above declarations will load the @samp{foo} package immediately. In +most cases, this is not necessary or desirable, as that will slow down +Emacs startup. Instead, you should try to set things up so that +packages are only loaded when they are actually needed +(``autoloading''). If you have installed a package from @acronym{GNU} +@acronym{ELPA} that provides its own autoloads, it is often enough to +say: @lisp @group commit 19a18e487b8e2f0c1627b9cc98e601327e884eb2 Author: Juri Linkov Date: Tue Jul 23 21:00:23 2024 +0300 * lisp/isearch.el: Exit Isearch after deleting the frame (bug#41338). (isearch-mode): Add 'isearch-done' to 'delete-frame-functions'. (isearch-done): Remove 'isearch-done' from 'delete-frame-functions'. diff --git a/lisp/isearch.el b/lisp/isearch.el index 0fe759959d1..315fd36cfea 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1339,6 +1339,7 @@ used to set the value of `isearch-regexp-function'." (add-hook 'pre-command-hook 'isearch-pre-command-hook) (add-hook 'post-command-hook 'isearch-post-command-hook) (add-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer) + (add-hook 'delete-frame-functions 'isearch-done) (add-hook 'kbd-macro-termination-hook 'isearch-done) ;; If the keyboard is not up and the last event did not come from @@ -1458,6 +1459,7 @@ If NOPUSH is non-nil, we don't push the string on the search ring." (remove-hook 'pre-command-hook 'isearch-pre-command-hook) (remove-hook 'post-command-hook 'isearch-post-command-hook) (remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer) + (remove-hook 'delete-frame-functions 'isearch-done) (remove-hook 'kbd-macro-termination-hook 'isearch-done) (when (buffer-live-p isearch--current-buffer) (with-current-buffer isearch--current-buffer commit 6760cedc5e0e8dc2a49d3d13e54f5f153df5a3d0 Author: Juri Linkov Date: Tue Jul 23 20:51:43 2024 +0300 * lisp/isearch.el: Preserve original value of overriding-terminal-local-map. (isearch--saved-local-map): New variable (bug#72229). (isearch-mode): Set isearch--saved-local-map to overriding-terminal-local-map. (isearch-done): Set overriding-terminal-local-map back to isearch--saved-local-map. (isearch-mouse-2): Let-bind overriding-terminal-local-map to isearch--saved-local-map. (isearch-done): Move comment intended to be docstring to docstring. diff --git a/lisp/isearch.el b/lisp/isearch.el index dc9edf267f2..0fe759959d1 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -972,6 +972,7 @@ Each element is an `isearch--state' struct where the slots are ;; The value of input-method-function when isearch is invoked. (defvar isearch-input-method-function nil) +(defvar isearch--saved-local-map nil) (defvar isearch--saved-overriding-local-map nil) ;; Minor-mode-alist changes - kind of redundant with the @@ -1321,6 +1322,7 @@ used to set the value of `isearch-regexp-function'." (setq isearch-mode " Isearch") ;; forward? regexp? (force-mode-line-update) + (setq isearch--saved-local-map overriding-terminal-local-map) (setq overriding-terminal-local-map isearch-mode-map) (run-hooks 'isearch-mode-hook) ;; Remember the initial map possibly modified @@ -1439,10 +1441,12 @@ The last thing is to trigger a new round of lazy highlighting." (defun isearch-done (&optional nopush edit) "Exit Isearch mode. +Called by all commands that terminate isearch-mode. For successful search, pass no args. For a failing search, NOPUSH is t. For going to the minibuffer to edit the search string, -NOPUSH is t and EDIT is t." +NOPUSH is t and EDIT is t. +If NOPUSH is non-nil, we don't push the string on the search ring." (when isearch-resume-in-command-history (add-to-history 'command-history @@ -1460,9 +1464,7 @@ NOPUSH is t and EDIT is t." (setq isearch--current-buffer nil) (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) - ;; Called by all commands that terminate isearch-mode. - ;; If NOPUSH is non-nil, we don't push the string on the search ring. - (setq overriding-terminal-local-map nil) + (setq overriding-terminal-local-map isearch--saved-local-map) ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) (isearch-dehighlight) @@ -2676,7 +2678,7 @@ Otherwise invoke whatever the calling mouse-2 command sequence is bound to outside of Isearch." (interactive "e") (let ((w (posn-window (event-start click))) - (binding (let ((overriding-terminal-local-map nil) + (binding (let ((overriding-terminal-local-map isearch--saved-local-map) ;; Key search depends on mode (bug#47755) (isearch-mode nil)) (key-binding (this-command-keys-vector) t)))) commit c7609464f701775088184bbfc61907cd9276437c Author: Stefan Kangas Date: Tue Jul 23 15:12:01 2024 +0200 Document (use-package 'emacs) declarations * doc/misc/use-package.texi (The @code{emacs} package): New node. (Bug#66350) diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index c4b8209be70..309315db23d 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -252,6 +252,7 @@ on Emacs start. @xref{Installing packages}, for details. * Forcing loading:: Loading packages immediately. * Conditional loading:: Loading packages conditionally. * Loading sequentially:: Loading packages in sequence. +* The @code{emacs} package:: Customizing built-in variables. * Load dependencies:: Don't load without dependencies. * Manual installation:: Loading manually installed packages. @end menu @@ -567,6 +568,34 @@ registers autoloads, such as @code{:bind} or @code{:hook} it is possible that your package will never be loaded if you do not add @code{:demand t} to those declarations. +@node The @code{emacs} package +@section Customizing built-in variables +@cindex customizing built-in variables + +Some users want to put all their customizations in use-package +declarations, even for variables, hooks, and options that are always +available, without loading any package.@footnote{In other words, they +are either preloaded in Emacs or defined in Emacs' C sources.} + +For that purpose, you can use the no-op @samp{emacs} package: + +@lisp +@group +(use-package emacs + :init + (setq custom-file "~/.emacs.d/emacs-custom.el") + (load custom-file) + (setq frame-title-format "%b") + :custom + (use-short-answers t)) +@end group +@end lisp + +This declaration takes advantage of the fact that @w{@code{(featurep +'emacs)}} always returns true, and has no special meaning beyond that. +It simply provides a way to organize your customizations, without +loading anything. + @node Load dependencies @section Prevent loading if dependencies are missing @cindex prevent loading package if dependencies are missing commit f521235656040dbae8406682976233f771c0c81c Author: Po Lu Date: Tue Jul 23 20:44:06 2024 +0800 Better reproduce mouse event coalescence during touch event translation * lisp/touch-screen.el (touch-screen-handle-touch): Save the confines of the current mouse glyph before initiating simple translation. diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el index 58f47a19bbe..e4bbcda0134 100644 --- a/lisp/touch-screen.el +++ b/lisp/touch-screen.el @@ -1728,8 +1728,26 @@ functions undertaking event management themselves to call ;; `mouse-1-menu' instead and wait for the up ;; event to display the menu. (setcar (nthcdr 3 tool-list) 'mouse-1-menu) - (progn (setcar (nthcdr 3 tool-list) 'mouse-drag) - (throw 'input-event (list 'down-mouse-1 position)))) + (progn + (setcar (nthcdr 3 tool-list) 'mouse-drag) + ;; Record the extents of the glyph beneath this + ;; touch point to avoid generating extraneous events + ;; when it next moves. + (setcar + (nthcdr 5 touch-screen-current-tool) + (let* ((edges (window-inside-pixel-edges window)) + (point (posn-x-y position)) + (frame-offsets (if (framep window) + '(0 . 0) + (cons (car edges) + (cadr edges))))) + (remember-mouse-glyph (or (and (framep window) window) + (window-frame window)) + (+ (car point) + (car frame-offsets)) + (+ (cdr point) + (cdr frame-offsets))))) + (throw 'input-event (list 'down-mouse-1 position)))) (and point ;; Start the long-press timer. (touch-screen-handle-timeout nil))))))) commit de9f9add1383c6154805ad4b3738af4c896522e4 Author: Robert Pluim Date: Tue Jul 23 11:33:44 2024 +0200 Improve 'emacs-news-view-mode' menus and bindings * lisp/textmodes/emacs-news-mode.el (emacs-news-mode-map): Move non-editing commands from here... (emacs-news-common-map): ... to here. (emacs-news-view-mode): Remove hard-coded 'special-mode' bindings. (emacs-news-view-mode-map): Inherit from 'special-mode-map' and 'emacs-news-common-map' here instead. (emacs-news-mode--menu-common-1): New defconst for menu items common to 'news-mode' and 'news-view-mode'. (emacs-news-mode--menu-common-2): Second new defconst for common items. (emacs-news-mode-menu): Use them. (emacs-news-view-mode-menu): New menu, which omits the buffer editing commands. This builds on the fix for Bug#72080. diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index ca897ec4567..edeb1540feb 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -47,40 +47,53 @@ "C-c C-b" #'outline-backward-same-level "C-c C-n" #'outline-next-visible-heading "C-c C-p" #'outline-previous-visible-heading - "C-c C-u" #'outline-up-heading) - -(defvar-keymap emacs-news-mode-map - :parent emacs-news-common-map + "C-c C-u" #'outline-up-heading + ;; `news-mode' motion commands. "C-c C-s" #'emacs-news-next-untagged-entry "C-c C-r" #'emacs-news-previous-untagged-entry - "C-c C-t" #'emacs-news-cycle-tag - "C-c C-d" #'emacs-news-delete-temporary-markers "C-c C-g" #'emacs-news-goto-section "C-c C-j" #'emacs-news-find-heading - "C-c C-e" #'emacs-news-count-untagged-entries + "C-c C-e" #'emacs-news-count-untagged-entries) + +(defvar-keymap emacs-news-mode-map + :parent emacs-news-common-map "C-x C-q" #'emacs-news-view-mode + ;; `news-mode' editing commands. + "C-c C-t" #'emacs-news-cycle-tag + "C-c C-d" #'emacs-news-delete-temporary-markers " " #'emacs-news-open-line) +(defconst emacs-news-mode--menu-common-1 + '(["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"] + ["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"] + ["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"] + "--")) + +(defconst emacs-news-mode--menu-common-2 + '(["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"] + ["Goto Heading" emacs-news-find-heading :help "Prompt for heading and go to it"] + "--")) + (easy-menu-define emacs-news-mode-menu emacs-news-mode-map "Menu for `emacs-news-mode'." - '("News" - ["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"] - ["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"] - ["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"] + `("News" + ,@emacs-news-mode--menu-common-1 ["Cycle Tag" emacs-news-cycle-tag :help "Cycle documentation tag of current entry"] ["Delete Tags" emacs-news-delete-temporary-markers :help "Delete all documentation tags in buffer"] "--" - ["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"] - ["Goto Heading" emacs-news-find-heading :help "Prompt for heading and go to it"] - "--" + ,@emacs-news-mode--menu-common-2 ["Enter View Mode" emacs-news-view-mode :help "Enter view-only mode"])) -(defvar emacs-news-view-mode-map - ;; This is defined this way instead of inheriting because we're - ;; deriving the mode from `special-mode' and want the keys from there. - (let ((map (copy-keymap emacs-news-common-map))) - (keymap-set map "C-x C-q" #'emacs-news-mode) - map)) +(defvar-keymap emacs-news-view-mode-map + :parent (make-composed-keymap emacs-news-common-map special-mode-map) + "C-x C-q" #'emacs-news-mode) + +(easy-menu-define emacs-news-view-mode-menu emacs-news-view-mode-map + "Menu for `emacs-news-view-mode'." + `("News" + ,@emacs-news-mode--menu-common-1 + ,@emacs-news-mode--menu-common-2 + ["Enter NEWS Mode" emacs-news-mode :help "Enter NEWS mode"])) (defvar emacs-news-mode-font-lock-keywords `(("^---$" 0 'emacs-news-does-not-need-documentation) @@ -111,17 +124,7 @@ "Major mode for viewing the Emacs NEWS file." (setq buffer-read-only t) (emacs-news--buttonize) - (button-mode) - ;; Bind useful browsing keys. - (keymap-local-set "q" 'quit-window) - (keymap-local-set "SPC" 'scroll-up-command) - (keymap-local-set "S-SPC" 'scroll-down-command) - (keymap-local-set "DEL" 'scroll-down-command) - (keymap-local-set "?" 'describe-mode) - (keymap-local-set "h" 'describe-mode) - (keymap-local-set ">" 'end-of-buffer) - (keymap-local-set "<" 'beginning-of-buffer) - (keymap-local-set "g" 'revert-buffer)) + (button-mode)) (defun emacs-news--fill-paragraph (&optional justify) (cond commit 7588e1f8a9fc95a199a2a32242b5224021a44458 Author: Eli Zaretskii Date: Tue Jul 23 14:07:30 2024 +0300 ; * src/xdisp.c (Fformat_mode_line): Doc fix. diff --git a/src/xdisp.c b/src/xdisp.c index 7d31813a57e..baf181cba1c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28133,7 +28133,7 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line, 1, 4, 0, - doc: /* Format a string out of a mode line format specification. + doc: /* Return a string formatted according to mode-line format specification. First arg FORMAT specifies the mode line format (see `mode-line-format' for details) to use. commit cc6324d9dca662ea0ca9439411f4852b85e18986 Author: Visuwesh Date: Wed Jul 17 09:11:04 2024 +0530 Don't highlight matches in dired query-replace commands * lisp/dired-aux.el (dired-do-query-replace-regexp) (dired-do-replace-regexp-as-diff) (dired-do-find-regexp-and-replace): Turn off lazy highlighting when reading the regexp from the user to avoid highlighting regexp matches in the dired buffer. (bug#72147) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e06e36aaa75..decd9702eaf 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3801,9 +3801,10 @@ Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit the query-replace loop (\\[keyboard-quit], RET or q), you can resume the query replace with the command \\[fileloop-continue]." (interactive - (let ((common - (query-replace-read-args - "Query replace regexp in marked files" t t))) + (let* ((query-replace-lazy-highlight) + (common + (query-replace-read-args + "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common) (nth 2 common))) dired-mode) (dolist (file (dired-get-marked-files nil nil #'dired-nondirectory-p nil t)) @@ -3825,9 +3826,10 @@ Third arg DELIMITED (prefix arg) means replace only word-delimited matches. The replacements are displayed in the buffer *replace-diff* that you can later apply as a patch after reviewing the changes." (interactive - (let ((common - (query-replace-read-args - "Replace regexp as diff in marked files" t t))) + (let* ((query-replace-lazy-highlight) + (common + (query-replace-read-args + "Replace regexp as diff in marked files" t t))) (list (nth 0 common) (nth 1 common) (nth 2 common)))) (dired-post-do-command) (multi-file-replace-regexp-as-diff @@ -3901,7 +3903,8 @@ REGEXP should use constructs supported by your local `grep' command. Also see `query-replace' for user options that affect how this function works." (interactive - (let ((common + (let* ((query-replace-lazy-highlight) + (common (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common))) commit 2074e94c3b1800b795c11658f35fc30e74ecfb60 Author: Gerd Möllmann Date: Tue Jul 23 08:15:09 2024 +0200 Fix disappearing bar cursor on Hebrew text (bug#72230) * src/nsterm.m (ns_draw_window_cursor): Compute the correct bar cursor rectangle for R2L before setting the clipping. diff --git a/src/nsterm.m b/src/nsterm.m index 794630de1c1..2aadada2df6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3026,7 +3026,7 @@ External call (RIF): draw cursor. Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. -------------------------------------------------------------------------- */ { - NSRect r, s; + NSRect r; int fx, fy, h, cursor_height; struct frame *f = WINDOW_XFRAME (w); struct glyph *phys_cursor_glyph; @@ -3076,6 +3076,12 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. /* The bar cursor should never be wider than the glyph. */ if (cursor_width < w->phys_cursor_width) w->phys_cursor_width = cursor_width; + + /* If the character under cursor is R2L, draw the bar cursor + on the right of its glyph, rather than on the left. */ + cursor_glyph = get_phys_cursor_glyph (w); + if ((cursor_glyph->resolved_level & 1) != 0) + fx += cursor_glyph->pixel_width - w->phys_cursor_width; } /* If we have an HBAR, "cursor_width" MAY specify height. */ else if (cursor_type == HBAR_CURSOR) @@ -3126,18 +3132,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. [ctx restoreGraphicsState]; break; case HBAR_CURSOR: - NSRectFill (r); - [ctx restoreGraphicsState]; - break; case BAR_CURSOR: - s = r; - /* If the character under cursor is R2L, draw the bar cursor - on the right of its glyph, rather than on the left. */ - cursor_glyph = get_phys_cursor_glyph (w); - if ((cursor_glyph->resolved_level & 1) != 0) - s.origin.x += cursor_glyph->pixel_width - s.size.width; - - NSRectFill (s); + NSRectFill (r); [ctx restoreGraphicsState]; break; } commit 1519c758a5a62b10f355097b066f4b88d3762bc4 Author: Stefan Kangas Date: Tue Jul 23 04:03:58 2024 +0200 * src/comp.c (obj_to_reloc): Use eassume. diff --git a/src/comp.c b/src/comp.c index 08c272bed70..44ab6b34939 100644 --- a/src/comp.c +++ b/src/comp.c @@ -956,7 +956,7 @@ obj_to_reloc (Lisp_Object obj) xsignal1 (Qnative_ice, build_string ("can't find data in relocation containers")); - assume (false); + eassume (false); found: eassert (XFIXNUM (idx) < reloc.array.len); commit 1aaadc8aec5272d453b996ca4b4761f3da6a17db Author: Manuel Giraud Date: Mon Jul 22 20:44:46 2024 +0200 Fix DocView with DVI files * lisp/doc-view.el (doc-view-pdf/ps->png): Use `doc-view-pdf->png-converter-function' for DVI files, too, since they are converted to PDF earlier. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 65ac6e00768..e7d7ed4a862 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1328,7 +1328,7 @@ is named like ODF with the extension turned to pdf." "Convert PDF-PS to PNG asynchronously." (funcall (pcase doc-view-doc-type - ((or 'pdf 'odf 'epub 'cbz 'fb2 'xps 'oxps) + ((or 'pdf 'odf 'epub 'cbz 'fb2 'xps 'oxps 'dvi) doc-view-pdf->png-converter-function) ('djvu #'doc-view-djvu->tiff-converter-ddjvu) (_ #'doc-view-ps->png-converter-ghostscript)) commit c1382257aa8b46286ddfc85817957543a90958b7 Author: Stefan Kangas Date: Mon Jul 22 18:04:30 2024 +0200 ; Fix typo in use-package.texi * doc/misc/use-package.texi (Getting Started): Fix typo. Problem reported by GitHub user Paul Jensen (psnj) in: https://github.com/jwiegley/use-package/pull/1070/ diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index 99348398550..c4b8209be70 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -182,7 +182,7 @@ immediately. In most cases, this is not necessary or desirable, as that will slow down Emacs startup. Instead, you should try to set things up so that packages are only loaded when they are actually needed (a.k.a. ``autoloading''). If you have installed a package from -@acronym{GNU} @acronym{ELPA} that provides it's own autoloads, it is often +@acronym{GNU} @acronym{ELPA} that provides its own autoloads, it is often enough to say: @lisp commit caf7426f0ca280b7cf40736e595cad8f7361152f Author: Alan Mackenzie Date: Mon Jul 22 12:24:43 2024 +0000 FIx spurious fontification of variable in Java Mode This fixes bug#72126. * lisp/progmodes/cc-engine.el (c-forward-<>-arglist): Remove tentative type identifier from c-record-type-identifiers should it turn out not to be a type. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index e9e58f45aa8..4c319a78e01 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8771,6 +8771,7 @@ multi-line strings (but not C++, for example)." ;; This function might do hidden buffer changes. (let ((start (point)) + (old-record-type-identifiers c-record-type-identifiers) (old-found-types (copy-hash-table c-found-types)) ;; If `c-record-type-identifiers' is set then activate ;; recording of any found types that constitute an argument in @@ -8807,7 +8808,8 @@ multi-line strings (but not C++, for example)." (nconc c-record-found-types c-record-type-identifiers))) t) - (setq c-found-types old-found-types) + (setq c-record-type-identifiers old-record-type-identifiers + c-found-types old-found-types) (goto-char start) nil)))) commit d995429e7bc2bc5b5d87db45dbbaca121f8118e5 Author: Stefan Kangas Date: Mon Jul 22 12:21:25 2024 +0200 Use SBYTES instead of strlen in treesit.c * src/treesit.c (treesit_ensure_query_compiled) (Ftreesit_node_child_by_field_name, treesit_initialize_query): Use SBYTES instead of strlen. diff --git a/src/treesit.c b/src/treesit.c index a420ef77b2d..c95a9fb9b01 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1310,9 +1310,7 @@ treesit_ensure_query_compiled (Lisp_Object query, Lisp_Object *signal_symbol, /* Create TSQuery. */ uint32_t error_offset; TSQueryError error_type; - char *treesit_source = SSDATA (source); - treesit_query = ts_query_new (treesit_lang, treesit_source, - strlen (treesit_source), + treesit_query = ts_query_new (treesit_lang, SSDATA (source), SBYTES (source), &error_offset, &error_type); if (treesit_query == NULL) { @@ -2159,11 +2157,10 @@ Return nil if there is no such child. If NODE is nil, return nil. */) CHECK_STRING (field_name); treesit_initialize (); - char *name_str = SSDATA (field_name); TSNode treesit_node = XTS_NODE (node)->node; TSNode child - = ts_node_child_by_field_name (treesit_node, name_str, - strlen (name_str)); + = ts_node_child_by_field_name (treesit_node, SSDATA (field_name), + SBYTES (field_name)); if (ts_node_is_null (child)) return Qnil; @@ -2888,10 +2885,9 @@ treesit_initialize_query (Lisp_Object query, const TSLanguage *lang, or a cons. */ if (CONSP (query)) query = Ftreesit_query_expand (query); - char *query_string = SSDATA (query); uint32_t error_offset; TSQueryError error_type; - *ts_query = ts_query_new (lang, query_string, strlen (query_string), + *ts_query = ts_query_new (lang, SSDATA (query), SBYTES (query), &error_offset, &error_type); if (*ts_query == NULL) { commit 9b426e15abd320f9c53692bb6f5834967e6e1a37 Author: Stefan Kangas Date: Mon Jul 22 10:14:25 2024 +0200 Correctly typeset nil and t in texinfo * doc/emacs/package.texi (Fetching Package Sources): * doc/lispref/display.texi (Image Descriptors): * doc/lispref/windows.texi (Buffer Display Action Alists): * doc/misc/gnus-faq.texi (FAQ 5-4): Correctly typeset nil and t. diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 22d91b6dbe1..2022ea61f6b 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -693,9 +693,9 @@ an Org file. @item :make A string or list of strings providing the target or targets defined in -the repository Makefile which should run before building the Info -file. Only takes effect when @code{package-vc-allow-build-commands} -is non-nil. +the repository Makefile which should run before building the Info file. +Only takes effect when @code{package-vc-allow-build-commands} is +non-@code{nil}. @item :shell-command A string providing the shell command to run before building the Info diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 81e534a5357..f283d680d2e 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6177,7 +6177,7 @@ or @code{:flip} is changed. If @code{:original-map} is not specified when creating an image with @code{create-image}, it will be computed based on the supplied @code{:map}, as well as any of @code{:scale}, @code{:rotation}, or -@code{:flip} which are non-nil. +@code{:flip} which are non-@code{nil}. Conversely, if @code{:original-map} is specified but @code{:map} is not, @code{:map} will be computed based on @code{:original-map}, diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 2b1b0d704a0..f5963d984e9 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3312,12 +3312,11 @@ only addressee. @vindex pop-up-frames@r{, a buffer display action alist entry} @item pop-up-frames -The value controls whether @code{display-buffer} may display buffers -by making new frames. It has the same meaning as the -@code{pop-up-frames} variable and takes precedence over it when present. -Its main intended purpose is to override a non-nil value of the -variable for particular buffers which the user prefers to keep -in the selected frame. +The value controls whether @code{display-buffer} may display buffers by +making new frames. It has the same meaning as the @code{pop-up-frames} +variable and takes precedence over it when present. Its main intended +purpose is to override a non-@code{nil} value of the variable for +particular buffers which the user prefers to keep in the selected frame. @vindex parent-frame@r{, a buffer display action alist entry} @item parent-frame diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index a773d48417c..c21f19cc784 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1173,12 +1173,11 @@ to postings you send to the gmane hierarchy, use send to groups containing the string binaries in their name etc. -You can instead of specifying a regexp specify a function -which is evaluated, only if it returns true, the -corresponding settings take effect. Two interesting -candidates for this are message-news-p which returns t if -the current Group is a newsgroup and the corresponding -message-mail-p. +You can instead of specifying a regexp specify a function which is +evaluated, only if it returns true, the corresponding settings take +effect. Two interesting candidates for this are @code{message-news-p} +which returns @code{t} if the current Group is a newsgroup and the +corresponding @code{message-mail-p}. Note that all forms that match are applied, that means in the example below, when I post to commit f050b9c5033ef92ac299d3da30774bc228fd0e08 Author: Michael Albinus Date: Mon Jul 22 09:56:52 2024 +0200 Fix Tramp IPv6 handling in tests * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Improve message. * lisp/net/tramp-integration.el (shortdoc): Add further examples of `file-remote-p'. * lisp/net/tramp.el (tramp-handle-file-remote-p): Extend docstring. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate): Extend tests. (tramp-test06-directory-file-name) (tramp-test26-file-name-completion) (tramp-test26-interactive-file-name-completion): Better handling of IPv6 hosts. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b1820b3e2fe..381a5efc77f 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -2217,8 +2217,8 @@ connection if a previous connection has died for some reason." (unless (tramp-gvfs-connection-mounted-p vec) (let ((method (tramp-file-name-method vec)) - (user (tramp-file-name-user vec)) - (host (tramp-file-name-host vec)) + (user-domain (tramp-file-name-user-domain vec)) + (host-port (tramp-file-name-host-port vec)) (localname (tramp-file-name-unquote-localname vec)) (object-path (tramp-gvfs-object-path (tramp-make-tramp-file-name vec 'noloc)))) @@ -2246,9 +2246,9 @@ connection if a previous connection has died for some reason." (with-tramp-progress-reporter vec 3 (format "Opening connection for %s%s using %s" - (if (tramp-string-empty-or-nil-p user) - "" (concat user "@")) - host method) + (if (tramp-string-empty-or-nil-p user-domain) + "" (concat user-domain "@")) + host-port method) ;; Enable `auth-source'. (tramp-set-connection-property @@ -2296,13 +2296,14 @@ connection if a previous connection has died for some reason." (with-timeout ((tramp-get-method-parameter vec 'tramp-connection-timeout tramp-connection-timeout) - (if (tramp-string-empty-or-nil-p (tramp-file-name-user vec)) + (if (tramp-string-empty-or-nil-p user-domain) (tramp-error vec 'file-error - "Timeout reached mounting %s using %s" host method) + "Timeout reached mounting %s using %s" host-port method) (tramp-error vec 'file-error - "Timeout reached mounting %s@%s using %s" user host method))) + "Timeout reached mounting %s@%s using %s" + user-domain host-port method))) (while (not (tramp-get-file-property vec "/" "fuse-mountpoint")) (read-event nil nil 0.1))) diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index e1f0b2a3495..56deaf9066b 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -275,9 +275,14 @@ NAME must be equal to `tramp-current-connection'." ;;; Integration of shortdoc.el: (with-eval-after-load 'shortdoc - (dolist (elem '((file-remote-p + (dolist (elem `((file-remote-p :eval (file-remote-p "/ssh:user@host:/tmp/foo") - :eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method)) + :eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method) + :eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host) + ;; We don't want to see the text properties. + :no-eval (file-remote-p "/sudo::/tmp/foo" 'user) + :result ,(substring-no-properties + (file-remote-p "/sudo::/tmp/foo" 'user))) (file-local-name :eval (file-local-name "/ssh:user@host:/tmp/foo")) (file-local-copy diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index df8ca151718..8fde854a97b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5289,7 +5289,7 @@ connection if a previous connection has died for some reason." "" (concat " " process-name)) (if (tramp-string-empty-or-nil-p l-user) "" (concat l-user "@")) - l-host l-method) + (tramp-file-name-host-port hop) l-method) (tramp-send-command vec command t t) (tramp-process-actions p vec @@ -5317,7 +5317,7 @@ connection if a previous connection has died for some reason." (if (tramp-string-empty-or-nil-p (tramp-file-name-user vec)) "" (concat (tramp-file-name-user vec) "@")) - (tramp-file-name-host vec) + (tramp-file-name-host-port vec) (tramp-file-name-method vec)) (tramp-open-connection-setup-interactive-shell p vec)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5c7236011b8..22b3ef84626 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4290,7 +4290,10 @@ Let-bind it when necessary.") (file-regular-p (file-truename filename)))))))) (defun tramp-handle-file-remote-p (filename &optional identification connected) - "Like `file-remote-p' for Tramp files." + "Like `file-remote-p' for Tramp files. +It supports the additional IDENTIFICATION `hop'. +For the `host' IDENTIFICATION, both host name and port number (if +existing) are returned." ;; We do not want traces in the debug buffer. (let ((tramp-verbose (min tramp-verbose 3))) (when (tramp-tramp-file-p filename) @@ -6793,9 +6796,9 @@ Consults the auth-source package." proc "password-vector" (process-get proc 'tramp-vector))) (key (tramp-make-tramp-file-name vec 'noloc)) (method (tramp-file-name-method vec)) - (user (or (tramp-file-name-user-domain vec) - (tramp-get-connection-property key "login-as"))) - (host (tramp-file-name-host-port vec)) + (user-domain (or (tramp-file-name-user-domain vec) + (tramp-get-connection-property key "login-as"))) + (host-port (tramp-file-name-host-port vec)) (pw-prompt (string-trim-left (or prompt @@ -6823,9 +6826,9 @@ Consults the auth-source package." (setq auth-info (car (auth-source-search - :max 1 :user user :host host :port method - :require (cons :secret (and user '(:user))) - :create (and user t))) + :max 1 :user user-domain :host host-port :port method + :require (cons :secret (and user-domain '(:user))) + :create (and user-domain t))) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 786700c727e..e958cd354bc 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -848,19 +848,20 @@ is greater than 10. (should (string-equal (file-remote-p "/method:[::1]:" 'localname) "")) (should (string-equal (file-remote-p "/method:[::1]:" 'hop) nil)) - ;; No expansion. + ;; No expansion. Hop. (should (string-equal - (file-remote-p "/method:user@[::1]:") - (format "/%s:%s@%s:" "method" "user" "[::1]"))) + (file-remote-p "/method:user@[::1]#1234:") + (format "/%s:%s@%s#%s:" "method" "user" "[::1]" "1234"))) (should (string-equal - (file-remote-p "/method:user@[::1]:" 'method) "method")) - (should - (string-equal (file-remote-p "/method:user@[::1]:" 'user) "user")) - (should - (string-equal (file-remote-p "/method:user@[::1]:" 'host) "::1")) + (file-remote-p "/method:user@[::1]#1234:" 'method) "method")) + (should (string-equal (file-remote-p "/method:user@[::1]#1234:" 'user) + "user")) + (should (string-equal + (file-remote-p "/method:user@[::1]#1234:" 'host) "::1#1234")) (should (string-equal - (file-remote-p "/method:user@[::1]:" 'localname) "")) - (should (string-equal (file-remote-p "/method:user@[::1]:" 'hop) nil)) + (file-remote-p "/method:user@[::1]#1234:" 'localname) "")) + (should (string-equal + (file-remote-p "/method:user@[::1]#1234:" 'hop) nil)) ;; Local file name part. (should (string-equal (file-remote-p "/-:host:/:" 'localname) "/:")) @@ -1244,6 +1245,20 @@ is greater than 10. (should (string-equal (file-remote-p "/user@[::1]:" 'localname) "")) (should (string-equal (file-remote-p "/user@[::1]:" 'hop) nil)) + ;; No expansion. Hop. + (should (string-equal + (file-remote-p "/user@[::1]#1234:") + (format "/%s@%s#%s:" "user" "[::1]" "1234"))) + (should (string-equal + (file-remote-p "/user@[::1]#1234:" 'method) "default-method")) + (should + (string-equal (file-remote-p "/user@[::1]#1234:" 'user) "user")) + (should + (string-equal (file-remote-p "/user@[::1]#1234:" 'host) "::1#1234")) + (should + (string-equal (file-remote-p "/user@[::1]#1234:" 'localname) "")) + (should (string-equal (file-remote-p "/user@[::1]#1234:" 'hop) nil)) + ;; Local file name part. (should (string-equal (file-remote-p "/host:/:" 'localname) "/:")) (should (string-equal (file-remote-p "/host::" 'localname) ":")) @@ -1886,19 +1901,20 @@ is greater than 10. (should (string-equal (file-remote-p "/[method/::1]" 'localname) "")) (should (string-equal (file-remote-p "/[method/::1]" 'hop) nil)) - ;; No expansion. + ;; No expansion. Hop. + (should (string-equal + (file-remote-p "/[method/user@::1#1234]") + (format "/[%s/%s@%s#%s]" "method" "user" "::1" "1234"))) (should (string-equal - (file-remote-p "/[method/user@::1]") - (format "/[%s/%s@%s]" "method" "user" "::1"))) + (file-remote-p "/[method/user@::1#1234]" 'method) "method")) (should (string-equal - (file-remote-p "/[method/user@::1]" 'method) "method")) + (file-remote-p "/[method/user@::1#1234]" 'user) "user")) (should (string-equal - (file-remote-p "/[method/user@::1]" 'user) "user")) + (file-remote-p "/[method/user@::1#1234]" 'host) "::1#1234")) (should (string-equal - (file-remote-p "/[method/user@::1]" 'host) "::1")) + (file-remote-p "/[method/user@::1#1234]" 'localname) "")) (should (string-equal - (file-remote-p "/[method/user@::1]" 'localname) "")) - (should (string-equal (file-remote-p "/[method/user@::1]" 'hop) nil)) + (file-remote-p "/[method/user@::1#1234]" 'hop) nil)) ;; Local file name part. (should (string-equal (file-remote-p "/[/host]/:" 'localname) "/:")) @@ -2425,16 +2441,22 @@ This checks also `file-name-as-directory', `file-name-directory', ;; which ruins the tests. (let ((tramp-default-method (file-remote-p ert-remote-temporary-file-directory 'method)) - (host (file-remote-p ert-remote-temporary-file-directory 'host))) + (host-port + (file-remote-p ert-remote-temporary-file-directory 'host))) (dolist (file `(,(format "/%s::" tramp-default-method) ,(format "/-:%s:" - (if (string-match-p tramp-ipv6-regexp host) - (concat - tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) - host)))) + ;; `(file-remote-p ... 'host)' eliminates IPv6 + ;; delimiters. Add them. + (if (string-match tramp-ipv6-regexp host-port) + (replace-match + (format + "%s\\&%s" + tramp-prefix-ipv6-format tramp-postfix-ipv6-format) + nil nil host-port) + host-port)))) (should (string-equal (directory-file-name file) file)) (should (string-equal @@ -4796,8 +4818,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (host (file-remote-p ert-remote-temporary-file-directory 'host)) (orig-syntax tramp-syntax) (minibuffer-completing-file-name t)) - (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) - (setq host (match-string 1 host))) + (when (and (stringp host) + (string-match + (rx (regexp tramp-prefix-port-regexp) (regexp tramp-port-regexp)) + host)) + (setq host (replace-match "" nil nil host))) (unwind-protect (dolist (syntax (if (tramp--test-expensive-test-p) @@ -4930,8 +4955,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (orig-syntax tramp-syntax) (non-essential t) (inhibit-message t)) - (when (and (stringp host) (string-match tramp-host-with-port-regexp host)) - (setq host (match-string 1 host))) + (when (and (stringp host) + (string-match + (rx (regexp tramp-prefix-port-regexp) (regexp tramp-port-regexp)) + host)) + (setq host (replace-match "" nil nil host))) ;; (trace-function #'tramp-completion-file-name-handler) ;; (trace-function #'completion-file-name-table) commit 46b192c04b162519a5e88bbf0f465a7c5e1171a9 Author: Kyle Meyer Date: Sun Jul 21 23:01:45 2024 -0400 Update to Org 9.7.8-5-gfdf0e0 diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 112832e0074..b924aed8df5 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.7.7} +\def\orgversionnumber{9.7.8} \def\versionyear{2024} % latest update \input emacsver.tex diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 75e792b74be..993e021f82e 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.7.7")) + (let ((org-release "9.7.8")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.7.7-2-gf308d3")) + (let ((org-git-version "release_9.7.8-5-gfdf0e0")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 5fc523a7647..8ca9a4b716b 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.7.7 +;; Version: 9.7.8 ;; This file is part of GNU Emacs. ;; @@ -19620,7 +19620,7 @@ ELEMENT." (if level (1+ level) 0)))) ((item plain-list) (org-list-item-body-column post-affiliated)) (t - (goto-char start) + (when start (goto-char start)) (current-indentation)))) ((memq type '(headline inlinetask nil)) (if (org-match-line "[ \t]*$") @@ -19629,14 +19629,14 @@ ELEMENT." ((memq type '(diary-sexp footnote-definition)) 0) ;; First paragraph of a footnote definition or an item. ;; Indent like parent. - ((< (line-beginning-position) start) + ((and start (< (line-beginning-position) start)) (org--get-expected-indentation (org-element-parent element) t)) ;; At first line: indent according to previous sibling, if any, ;; ignoring footnote definitions and inline tasks, or parent's ;; contents. If `org-adapt-indentation' is `headline-data', ignore ;; previous headline data siblings. - ((= (line-beginning-position) start) + ((and start (= (line-beginning-position) start)) (catch 'exit (while t (if (= (point-min) start) (throw 'exit 0) @@ -19686,13 +19686,13 @@ ELEMENT." ;; Line above is the first one of a paragraph at the ;; beginning of an item or a footnote definition. Indent ;; like parent. - ((< (line-beginning-position) start) + ((and start (< (line-beginning-position) start)) (org--get-expected-indentation (org-element-parent element) t)) ;; Line above is the beginning of an element, i.e., point ;; was originally on the blank lines between element's start ;; and contents. - ((= (line-beginning-position) post-affiliated) + ((and post-affiliated (= (line-beginning-position) post-affiliated)) (org--get-expected-indentation element t)) ;; POS is after contents in a greater element. Indent like ;; the beginning of the element. @@ -19780,10 +19780,11 @@ Also align node properties according to `org-property-format'." (not (org--at-headline-data-p nil element)) ;; Not at headline data and previous is headline data/headline. (or (memq type '(headline inlinetask)) ; blank lines after heading - (save-excursion - (goto-char (1- (org-element-begin element))) - (or (org-at-heading-p) - (org--at-headline-data-p)))))) + (and element + (save-excursion + (goto-char (1- (org-element-begin element))) + (or (org-at-heading-p) + (org--at-headline-data-p))))))) (cond ((and (memq type '(plain-list item)) (= (line-beginning-position) (org-element-post-affiliated element))) commit da0165a01e01dcb4334feee03b462ac09ceb0f8c Author: Po Lu Date: Mon Jul 22 09:56:08 2024 +0800 Prohibit unbinding of built-in variables * src/data.c (set_internal): Signal error if a BLV with a redirect or a forwarded symbol is being unbound. * test/src/data-tests.el (binding-test-makunbound-built-in): New test. diff --git a/src/data.c b/src/data.c index 3490d4985c9..752856abf09 100644 --- a/src/data.c +++ b/src/data.c @@ -1642,7 +1642,7 @@ void set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, enum Set_Internal_Bind bindflag) { - bool voide = BASE_EQ (newval, Qunbound); + bool unbinding_p = BASE_EQ (newval, Qunbound); /* If restoring in a dead buffer, do nothing. */ @@ -1661,10 +1661,13 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, case SYMBOL_TRAPPED_WRITE: /* Setting due to thread-switching doesn't count. */ if (bindflag != SET_INTERNAL_THREAD_SWITCH) - notify_variable_watchers (symbol, voide? Qnil : newval, - (bindflag == SET_INTERNAL_BIND? Qlet : - bindflag == SET_INTERNAL_UNBIND? Qunlet : - voide? Qmakunbound : Qset), + notify_variable_watchers (symbol, (unbinding_p ? Qnil : newval), + (bindflag == SET_INTERNAL_BIND + ? Qlet + : (bindflag == SET_INTERNAL_UNBIND + ? Qunlet + : (unbinding_p + ? Qmakunbound : Qset))), where); break; @@ -1682,6 +1685,11 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, case SYMBOL_LOCALIZED: { struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); + + if (unbinding_p && blv->fwd.fwdptr) + /* Forbid unbinding built-in variables. */ + error ("Built-in variables may not be unbound"); + if (NILP (where)) XSETBUFFER (where, current_buffer); @@ -1746,16 +1754,9 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, set_blv_value (blv, newval); if (blv->fwd.fwdptr) - { - if (voide) - /* If storing void (making the symbol void), forward only through - buffer-local indicator, not through Lisp_Objfwd, etc. */ - blv->fwd.fwdptr = NULL; - else - store_symval_forwarding (blv->fwd, newval, - BUFFERP (where) - ? XBUFFER (where) : current_buffer); - } + store_symval_forwarding (blv->fwd, newval, (BUFFERP (where) + ? XBUFFER (where) + : current_buffer)); break; } case SYMBOL_FORWARDED: @@ -1763,6 +1764,11 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, struct buffer *buf = BUFFERP (where) ? XBUFFER (where) : current_buffer; lispfwd innercontents = SYMBOL_FWD (sym); + + if (unbinding_p) + /* Forbid unbinding built-in variables. */ + error ("Built-in variables may not be unbound"); + if (BUFFER_OBJFWDP (innercontents)) { int offset = XBUFFER_OBJFWD (innercontents)->offset; @@ -1778,14 +1784,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, } } - if (voide) - { /* If storing void (making the symbol void), forward only through - buffer-local indicator, not through Lisp_Objfwd, etc. */ - sym->u.s.redirect = SYMBOL_PLAINVAL; - SET_SYMBOL_VAL (sym, newval); - } - else - store_symval_forwarding (/* sym, */ innercontents, newval, buf); + store_symval_forwarding (/* sym, */ innercontents, newval, buf); break; } default: emacs_abort (); diff --git a/test/src/data-tests.el b/test/src/data-tests.el index a1959f62fd3..a631aabb605 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -219,6 +219,16 @@ comparing the subr with a much slower Lisp implementation." do (error "FAILED testcase %S %3S %3S %3S" pos lf cnt rcnt))))) +(ert-deftest binding-test-makunbound-built-in () + "Verify that attempts to `makunbound' built-in symbols are rejected." + (should-error (makunbound 'initial-window-system)) + (let ((initial-window-system 'x)) + (should-error (makunbound 'initial-window-system))) + (should-error + (makunbound (make-local-variable 'initial-window-system))) + (let ((initial-window-system 'x)) + (should-error (makunbound 'initial-window-system)))) + (defconst bool-vector-test-vectors '("" "0" @@ -874,5 +884,4 @@ comparing the subr with a much slower Lisp implementation." ((eq subtype 'function) (cl-functionp val)) (t (should-not (cl-typep val subtype)))))))))) - ;;; data-tests.el ends here commit 87f41b937bc06a14b3aeb12d5bf1a8b3e2ff74a1 Author: Yuan Fu Date: Sun Jul 21 17:15:44 2024 -0700 Fix Ftreesit_parser_create * src/treesit.c (Ftreesit_parser_create): Use the buffer given by the caller rather than the current buffer. diff --git a/src/treesit.c b/src/treesit.c index 416c1edf791..6e806039df0 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1450,7 +1450,9 @@ an indirect buffer. */) ts_parser_set_language (parser, lang); /* Create parser. */ - Lisp_Object lisp_parser = make_treesit_parser (Fcurrent_buffer (), + Lisp_Object lisp_buf; + XSETBUFFER (lisp_buf, buf); + Lisp_Object lisp_parser = make_treesit_parser (lisp_buf, parser, NULL, language, tag); commit ed38fcc01703d166d8a63989f8167b50ebd954a0 Author: Yuan Fu Date: Sun Jul 21 16:50:59 2024 -0700 Fix segfault when deleting tree-sitter query (bug#72238) * src/treesit.c (treesit_delete_query): Only delete query and cursor when they are non-NULL. diff --git a/src/treesit.c b/src/treesit.c index 3ae55d77a91..416c1edf791 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1224,8 +1224,10 @@ treesit_delete_parser (struct Lisp_TS_Parser *lisp_parser) void treesit_delete_query (struct Lisp_TS_Query *lisp_query) { - ts_query_delete (lisp_query->query); - ts_query_cursor_delete (lisp_query->cursor); + if (lisp_query->query) + ts_query_delete (lisp_query->query); + if (lisp_query->cursor) + ts_query_cursor_delete (lisp_query->cursor); } /* The following function is called from print.c:print_vectorlike. */ commit 4868a17396b6796b77285a3608b383aac32aee4f Author: Yuan Fu Date: Sun Jul 21 16:50:59 2024 -0700 Fix segfault when deleting tree-sitter query (bug#72238) * src/treesit.c (treesit_delete_query): Only delete query and cursor when they are non-NULL. diff --git a/src/treesit.c b/src/treesit.c index 5ed15bca788..a420ef77b2d 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1224,8 +1224,10 @@ treesit_delete_parser (struct Lisp_TS_Parser *lisp_parser) void treesit_delete_query (struct Lisp_TS_Query *lisp_query) { - ts_query_delete (lisp_query->query); - ts_query_cursor_delete (lisp_query->cursor); + if (lisp_query->query) + ts_query_delete (lisp_query->query); + if (lisp_query->cursor) + ts_query_cursor_delete (lisp_query->cursor); } /* The following function is called from print.c:print_vectorlike. */ commit c66bda1a19afd7d8391765e2ed207e44107d8a50 Author: Stefan Kangas Date: Sun Jul 21 22:20:33 2024 +0200 Improve treesit-node-child-by-field-name docstring * src/treesit.c (Ftreesit_node_child_by_field_name): Improve docstring. diff --git a/src/treesit.c b/src/treesit.c index 7c8c655f561..3ae55d77a91 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2137,7 +2137,7 @@ nil. If NODE is nil, return nil. */) DEFUN ("treesit-node-child-by-field-name", Ftreesit_node_child_by_field_name, Streesit_node_child_by_field_name, 2, 2, 0, - doc: /* Return the child of NODE with FIELD-NAME. + doc: /* Return the child of NODE with FIELD-NAME (a string). Return nil if there is no such child. If NODE is nil, return nil. */) (Lisp_Object node, Lisp_Object field_name) { commit 85773ab9771d4a382c6313803d0ffb91d379e86d Author: Stefan Kangas Date: Sun Jul 21 21:13:20 2024 +0200 Minor copyedits in tree-sitter starting guide * admin/notes/tree-sitter/starter-guide: Minor copyedits. Reflow some paragraphs. diff --git a/admin/notes/tree-sitter/starter-guide b/admin/notes/tree-sitter/starter-guide index 1ff8ffef554..72102250bbb 100644 --- a/admin/notes/tree-sitter/starter-guide +++ b/admin/notes/tree-sitter/starter-guide @@ -34,10 +34,9 @@ merged) and rebuild Emacs. * Install language definitions -Tree-sitter by itself doesn’t know how to parse any particular -language. We need to install language definitions (or “grammars”) for -a language to be able to parse it. There are a couple of ways to get -them. +Tree-sitter by itself doesn’t know how to parse any particular language. +We need to install language definitions (or “grammars”) for a language +to be able to parse it. There are a couple of ways to get them. You can use this script that I put together here: @@ -50,7 +49,7 @@ GNU/Linux and macOS, they can be downloaded here: https://github.com/casouri/tree-sitter-module/releases/tag/v2.4 -To build them yourself, run +To build them yourself, run: git clone git@github.com:casouri/tree-sitter-module.git cd tree-sitter-module @@ -73,26 +72,25 @@ automatically download and compile the language grammar for you. * Setting up for adding major mode features -Start Emacs and load tree-sitter with +Start Emacs and load tree-sitter with: (require 'treesit) -Now check if Emacs is built with tree-sitter library +Now check if Emacs is built with tree-sitter library: (treesit-available-p) -Make sure Emacs can find the language grammar you want to use +Make sure Emacs can find the language grammar you want to use: (treesit-language-available-p 'lang) * Tree-sitter major modes Tree-sitter modes should be separate major modes, so other modes -inheriting from the original mode don't break if tree-sitter is -enabled. For example js2-mode inherits js-mode, we can't enable -tree-sitter in js-mode, lest js-mode would not setup things that -js2-mode expects to inherit from. So it's best to use separate major -modes. +inheriting from the original mode don't break if tree-sitter is enabled. +For example js2-mode inherits js-mode, we can't enable tree-sitter in +js-mode, lest js-mode would not setup things that js2-mode expects to +inherit from. So it's best to use separate major modes. If the tree-sitter variant and the "native" variant could share some setup, you can create a "base mode", which only contains the common @@ -119,19 +117,18 @@ you. The query function returns a list of (capture-name . node). For font-lock, we use face names as capture names. And the captured node will be fontified in their capture name. -The capture name could also be a function, in which case (NODE -OVERRIDE START END) is passed to the function for fontification. START -and END are the start and end of the region to be fontified. The -function should only fontify within that region. The function should -also allow more optional arguments with (&rest _), for future -extensibility. For OVERRIDE check out the docstring of -treesit-font-lock-rules. +The capture name could also be a function, in which case (NODE OVERRIDE +START END) is passed to the function for fontification. START and END +are the start and end of the region to be fontified. The function +should only fontify within that region. The function should also allow +more optional arguments with (&rest _), for future extensibility. For +OVERRIDE check out the docstring of treesit-font-lock-rules. ** Query syntax There are two types of nodes, named, like (identifier), (function_definition), and anonymous, like "return", "def", "(", -"}". Parent-child relationship is expressed as +"}". Parent-child relationship is expressed as: (parent (child) (child) (child (grand_child))) @@ -155,8 +152,7 @@ The query above captures both parent and child. ["return" "continue" "break"] @keyword -The query above captures all the keywords with capture name -"keyword". +The query above captures all the keywords with capture name "keyword". These are the common syntax, see all of them in the manual ("Parsing Program Source" section). @@ -168,7 +164,7 @@ open any python source file, type M-x treesit-explore-mode RET. Now you should see the parse-tree in a separate window, automatically updated as you select text or edit the buffer. Besides this, you can consult the grammar of the language definition. For example, Python’s -grammar file is at +grammar file is at: https://github.com/tree-sitter/tree-sitter-python/blob/master/grammar.js @@ -262,7 +258,7 @@ Concretely, something like this: * Indent -Indent works like this: We have a bunch of rules that look like +Indent works like this: We have a bunch of rules that look like: (MATCHER ANCHOR OFFSET) @@ -354,9 +350,8 @@ Set ‘treesit-simple-imenu-settings’ and call * Navigation -Set ‘treesit-defun-type-regexp’ and call -‘treesit-major-mode-setup’. You can additionally set -‘treesit-defun-name-function’. +Set ‘treesit-defun-type-regexp’ and call ‘treesit-major-mode-setup’. +You can additionally set ‘treesit-defun-name-function’. * Which-func @@ -404,13 +399,12 @@ BTW ‘treesit-node-string’ does different things. * Manual I suggest you read the manual section for tree-sitter in Info. The -section is Parsing Program Source. Typing +section is Parsing Program Source. Typing: C-h i d m elisp RET g Parsing Program Source RET will bring you to that section. You don’t need to read through every -sentence, just read the text paragraphs and glance over function -names. +sentence, just read the text paragraphs and glance over function names. * Appendix 1 commit 2dacec1609a2858ad932fb766d2fb77e3bdeb23f Author: Stefan Kangas Date: Sun Jul 21 21:07:19 2024 +0200 Update tag for prebuilt tree-sitter grammars * admin/notes/tree-sitter/starter-guide: Update tag for prebuilt tree-sitter grammars to point to 2.4. diff --git a/admin/notes/tree-sitter/starter-guide b/admin/notes/tree-sitter/starter-guide index b07c80b203c..1ff8ffef554 100644 --- a/admin/notes/tree-sitter/starter-guide +++ b/admin/notes/tree-sitter/starter-guide @@ -48,7 +48,7 @@ C++, Rust, JSON, Go, HTML, JavaScript, CSS, Python, Typescript, C#, etc. Better yet, I pre-built these language definitions for GNU/Linux and macOS, they can be downloaded here: - https://github.com/casouri/tree-sitter-module/releases/tag/v2.1 + https://github.com/casouri/tree-sitter-module/releases/tag/v2.4 To build them yourself, run commit 68615a386699f8e6108cb294a2cbc5664948af39 Author: Stefan Kangas Date: Sun Jul 21 17:46:12 2024 +0200 Fix punctuation and doc style in treesit.c * src/treesit.c (Ftreesit_parser_included_ranges) (Ftreesit_query_capture, treesit_traverse_sibling_helper) (treesit_traverse_match_predicate): Fix punctiation and documentation style in comments and docstrings. diff --git a/src/treesit.c b/src/treesit.c index a0e41add475..7c8c655f561 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -404,7 +404,7 @@ init_treesit_functions (void) buffer's parser list. The discussion can be found in bug#59693. */ -/*** Initialization */ +/*** Initialization */ static Lisp_Object Vtreesit_str_libtree_sitter; static Lisp_Object Vtreesit_str_tree_sitter; @@ -431,7 +431,7 @@ static Lisp_Object Vtreesit_str_pred; functions. Remember to update docstrings when changing this value. If we think of programs and AST, it is very rare for any program to - have a very deep AST. For example, you would need 1000+ levels of + have a very deep AST. For example, you would need 1000+ levels of nested if-statements, or a struct somehow nested for 1000+ levels. It's hard for me to imagine any hand-written or machine generated program to be like that. So I think 1000 is already generous. If @@ -485,10 +485,9 @@ treesit_initialize (void) } -/*** Loading language library */ +/*** Loading language library */ -/* Translates a symbol treesit- to a C name - treesit_. */ +/* Translate a symbol treesit- to a C name treesit_. */ static void treesit_symbol_to_c_name (char *symbol_name) { @@ -758,7 +757,7 @@ Return nil if a grammar library for LANGUAGE is not available. */) } -/*** Parsing functions */ +/*** Parsing functions */ static void treesit_check_parser (Lisp_Object obj) @@ -873,7 +872,7 @@ treesit_record_change (ptrdiff_t start_byte, ptrdiff_t old_end_byte, } } -/* Comment (ref:visible-beg-null) The purpose of visible_beg/end is to +/* Comment (ref:visible-beg-null) The purpose of visible_beg/end is to keep track of "which part of the buffer does the tree-sitter tree see", in order to update the tree correctly. Visible_beg/end have two purposes: they "clip" buffer changes within them, and they @@ -1150,7 +1149,7 @@ treesit_read_buffer (void *parser, uint32_t byte_index, } -/*** Functions for parser and node object */ +/*** Functions for parser and node object */ /* Wrap the parser in a Lisp_Object to be used in the Lisp machine. */ @@ -1566,7 +1565,7 @@ treesit_parser_live_p (Lisp_Object parser) } -/*** Parser API */ +/*** Parser API */ DEFUN ("treesit-parser-root-node", Ftreesit_parser_root_node, Streesit_parser_root_node, @@ -1739,7 +1738,7 @@ See also `treesit-parser-set-included-ranges'. */) /* When the parser doesn't have a range set and we call ts_parser_included_ranges on it, it doesn't return an empty list, - but rather return DEFAULT_RANGE. (A single range where start_byte + but rather return DEFAULT_RANGE. (A single range where start_byte = 0, end_byte = UINT32_MAX). So we need to track whether the parser is ranged ourselves. */ if (NILP (XTS_PARSER (parser)->last_set_ranges)) @@ -1842,8 +1841,8 @@ treesit_check_node (Lisp_Object obj) xsignal1 (Qtreesit_node_buffer_killed, obj); } -/* Checks that OBJ is a positive integer and it is within the visible - portion of BUF. */ +/* Check that OBJ is a positive integer and it is within the visible + portion of BUF. */ static void treesit_check_position (Lisp_Object obj, struct buffer *buf) { @@ -2360,7 +2359,7 @@ produced by tree-sitter. */) } -/*** Query functions */ +/*** Query functions */ /* Convert a Lisp string to its printed representation in the tree-sitter query syntax. */ @@ -2998,7 +2997,7 @@ the query. */) test for predicates. If predicates pass, then all good, if predicates don't pass, revert the result back to the result before this loop (PREV_RESULT). (Predicates control the entire - match.) This way we don't need to create a list of captures in + match.) This way we don't need to create a list of captures in every for loop and nconc it to RESULT every time. That is indeed the initial implementation in which Yoav found nconc being the bottleneck (98.4% of the running time spent on nconc). */ @@ -3076,7 +3075,7 @@ the query. */) } -/*** Navigation */ +/*** Navigation */ static inline void treesit_assume_true (bool val) @@ -3193,7 +3192,7 @@ treesit_traverse_sibling_helper (TSTreeCursor *cursor, if (ts_node_eq (first_child, start)) return false; - /* PROBE is always DELTA siblings ahead of CURSOR. */ + /* PROBE is always DELTA siblings ahead of CURSOR. */ TSTreeCursor probe = ts_tree_cursor_copy (cursor); /* This is position of PROBE minus position of CURSOR. */ ptrdiff_t delta = 0; @@ -3477,7 +3476,7 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred, return true; } } - /* Returning false is better than UB. */ + /* Returning false is better than UB. */ return false; } @@ -3990,7 +3989,7 @@ DEFUN ("treesit-available-p", Ftreesit_available_p, } -/*** Initialization */ +/*** Initialization */ /* Initialize the tree-sitter routines. */ void commit 00adee897ac95912cb9ad6bd8a8d161db71945ac Author: Stefan Kangas Date: Sun Jul 21 16:33:08 2024 +0200 ; Fix punctuation in docs diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index a385d06bb1d..1527e42bbfe 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2044,7 +2044,7 @@ sequences. For example, to bind @kbd{C-c h} to the string @end example Non-@acronym{ASCII} characters can be specified directly in the -string. To bind to e.g. @samp{ol@'a}, use: +string. To bind to e.g. @samp{ol@'a}, use: @example (keymap-global-set "C-c h" (key-description "ol@'a")) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 8f22e3c88da..88520874c8e 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -2198,7 +2198,7 @@ The line numbers are displayed in a special face @code{line-number}. The current line number is displayed in a different face, @code{line-number-current-line}, so you can make the current line's number have a distinct appearance, which will help locating the line -showing point. Additional faces @code{line-number-major-tick} and +showing point. Additional faces @code{line-number-major-tick} and @code{line-number-minor-tick} can be used to highlight the line numbers of lines which are a multiple of certain numbers. Customize @code{display-line-numbers-major-tick} and diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi index 5225dfccbd0..1884ee76219 100644 --- a/doc/emacs/fortran-xtra.texi +++ b/doc/emacs/fortran-xtra.texi @@ -124,7 +124,7 @@ check the outermost block since that may be incomplete. @findex f90-beginning-of-block @item C-M-p Move to the start of the current code block -(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This +(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This is like @code{fortran-end-of-block}, but moves backwards. @end table diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index e1fbf9768af..b5f2c5f5e84 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1543,7 +1543,7 @@ After customizing the variable @code{tab-bar-select-tab-modifiers} to specify one or more @var{modifier} keys, you can select a tab by its ordinal number using one of the specified modifiers in combination with the tab number to select. The number 9 can be used to select the -last tab. You can select any modifiers supported by Emacs, +last tab. You can select any modifiers supported by Emacs, @pxref{Modifier Keys}. To display the tab number alongside the tab name, you can customize another variable @code{tab-bar-tab-hints}. This will help you decide which numerical key to press to select the diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index e4993fb0014..c385d6b0b3d 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -1488,7 +1488,7 @@ the Emacs Lisp Reference Manual @cindex coding standards for Emacs submissions Contributed code should follow the GNU Coding Standards -@url{https://www.gnu.org/prep/standards/}. This may also be available +@url{https://www.gnu.org/prep/standards/}. This may also be available in info on your system. If it doesn't, we'll need to find someone to fix the code before we diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 303efa05d82..8897129d1b0 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -177,7 +177,7 @@ current directory as a tag named @var{name} @findex vc-retrieve-tag @item C-x v r @var{name} @key{RET} For all registered files at or below the current directory level, -retrieve the tagged revision @var{name}. This command will switch to a +retrieve the tagged revision @var{name}. This command will switch to a branch if @var{name} is a branch name and your VCS distinguishes branches from tags. (@code{vc-retrieve-tag}). diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 4649cd59962..bc4dc31bf4c 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -130,7 +130,7 @@ Boston, MA 02110-1301 USA @end iftex @ifnottex -Printed copies available from @uref{https://shop.fsf.org/}. Published by: +Printed copies available from @uref{https://shop.fsf.org/}. Published by: @example GNU Press, https://www.fsf.org/licensing/gnu-press/ @@ -1969,7 +1969,7 @@ argument is the string of characters, the second and third arguments are numbers that indicate the beginning (inclusive) and end (exclusive) of the substring. The numbers are a count of the number of characters (including spaces and punctuation) from the beginning of -the string. Note that the characters in a string are numbered from +the string. Note that the characters in a string are numbered from zero, not one. @need 800 @@ -5314,7 +5314,7 @@ Looking at the @code{let*} expression in @code{append-to-buffer}: @noindent we see that @code{append-to} is bound to the value returned by the -@w{@code{(get-buffer-create buffer)}}. On the next line, +@w{@code{(get-buffer-create buffer)}}. On the next line, @code{append-to} is used as an argument to @code{get-buffer-window-list}; this would not be possible with the @code{let} expression. Note that @code{point} is automatically bound @@ -16099,7 +16099,7 @@ placing point somewhere in the buffer, typing @kbd{M-:}, typing the and then typing @key{RET}. This causes Emacs to evaluate the expression in the minibuffer, but to use as the value of point the position of point in the @file{*scratch*} buffer. (@kbd{M-:} is the -key binding for @code{eval-expression}. Also, @code{nil} does not +key binding for @code{eval-expression}. Also, @code{nil} does not appear in the @file{*scratch*} buffer since the expression is evaluated in the minibuffer.) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index a9da6c75367..60de1cc1183 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1741,7 +1741,7 @@ this is @code{nil}. @item @var{dx}, @var{dy} These are the pixel offsets of the click relative to the top left corner of the @var{object}'s glyph that is the nearest one to the -click. The relevant @var{object}s can be either a buffer, or a string, +click. The relevant @var{object}s can be either a buffer, or a string, or an image, see above. If @var{object} is @code{nil} or a string, the coordinates are relative to the top left corner of the character glyph clicked on. Note that the offsets are always zero on text-mode diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 139fdcfc101..81e534a5357 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2771,7 +2771,7 @@ width of the vertical and horizontal lines to draw; they default to (1 . 1). A negative horizontal or vertical width @minus{}@var{n} means to draw a line of width @var{n} that occupies the space of the underlying text, thus avoiding any increase in the character height or -width. For simplification the width could be specified with only a +width. For simplification the width could be specified with only a single number @var{n} instead of a list, such case is equivalent to @code{((abs @var{n}) . @var{n})}. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 1a8f3812f1e..70db8521481 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2708,7 +2708,7 @@ file names (@pxref{Magic File Names}). @defmac file-name-unquote name This macro removes the quotation prefix @samp{/:} from the file -@var{name}, if any. If @var{name} is a remote file name, the local +@var{name}, if any. If @var{name} is a remote file name, the local part of @var{name} is unquoted. @end defmac @@ -2740,7 +2740,7 @@ This function creates a temporary file and returns its name. Emacs creates the temporary file's name by adding to @var{prefix} some random characters that are different in each Emacs job. The result is guaranteed to be a newly created file, containing @var{text} if that's -given as a string and empty otherwise. On MS-DOS, this function can +given as a string and empty otherwise. On MS-DOS, this function can truncate @var{prefix} to fit into the 8+3 file-name limits. If @var{prefix} is a relative file name, it is expanded against @code{temporary-file-directory}. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index f3d4f5347b3..7c7823b5f9b 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -4530,7 +4530,7 @@ and a few other such modes) has been made more generic over the years, so if your language seems somewhat similar to one of those languages, you might try to use that engine. @c FIXME: documentation? Another one is SMIE which takes an approach in the spirit -of Lisp sexps and adapts it to non-Lisp languages. Yet another one is +of Lisp sexps and adapts it to non-Lisp languages. Yet another one is to rely on a full-blown parser, for example, the tree-sitter library. @menu diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi index 60cff9d1891..eb0b4ca213c 100644 --- a/doc/lispref/package.texi +++ b/doc/lispref/package.texi @@ -387,7 +387,7 @@ following queries: @table @asis @item archive-contents -Return a lisp form describing the archive contents. The form is a list +Return a lisp form describing the archive contents. The form is a list of 'package-desc' structures (see @file{package.el}), except the first element of the list is the archive version. @@ -398,7 +398,7 @@ Return the long description of the package. Return the signature for the file. @item -Return the file. This will be the tarball for a multi-file +Return the file. This will be the tarball for a multi-file package, or the single file for a simple package. @end table diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index ead7833af61..37cfe264157 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -450,7 +450,7 @@ in the buffer, or in the region if the region is active. @cindex line number This function returns the line number in the current buffer corresponding to the buffer position @var{pos}. If @var{pos} is -@code{nil} or omitted, the current buffer position is used. If +@code{nil} or omitted, the current buffer position is used. If @var{absolute} is @code{nil}, the default, counting starts at @code{(point-min)}, so the value refers to the contents of the accessible portion of the (potentially narrowed) buffer. If diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c5fbb0fb818..53468e0d252 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -135,7 +135,7 @@ stream to a different destination. @cindex program arguments All three of the subprocess-creating functions allow specifying -command-line arguments for the process to run. For @code{call-process} +command-line arguments for the process to run. For @code{call-process} and @code{call-process-region}, these come in the form of a @code{&rest} argument, @var{args}. For @code{make-process}, both the program to run and its command-line arguments are specified as a list diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 6e3680bdb4f..7cefd581afb 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1771,7 +1771,7 @@ required for @code{rx-to-string} to work. Example: Another difference from @code{rx-let} is that the @var{bindings} are dynamically scoped, and thus also available in functions called from -@var{body}. However, they are not visible inside functions defined in +@var{body}. However, they are not visible inside functions defined in @var{body}. @end defmac @@ -1919,7 +1919,7 @@ symptoms less likely and help alleviate problems that do arise. @itemize @item Anchor regexps at the beginning of a line, string or buffer using -zero-width assertions (@samp{^} and @code{\`}). This takes advantage +zero-width assertions (@samp{^} and @code{\`}). This takes advantage of fast paths in the implementation and can avoid futile matching attempts. Other zero-width assertions may also bring benefits by causing a match to fail early. diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index d5695e4c83d..9b0a0d74f30 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -937,7 +937,7 @@ use instead of the default @code{equal}. @defun seq-set-equal-p sequence1 sequence2 &optional testfn This function checks whether @var{sequence1} and @var{sequence2} -contain the same elements, regardless of the order. If the optional +contain the same elements, regardless of the order. If the optional argument @var{testfn} is non-@code{nil}, it is a function of two arguments to use instead of the default @code{equal}. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 86ec82b66a1..a48e6380d32 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -970,7 +970,7 @@ you can use, see the variable's documentation string. @defvar print-integers-as-characters When this variable is non-@code{nil}, integers that represent graphic base characters will be printed using Lisp character syntax -(@pxref{Basic Char Syntax}). Other numbers are printed the usual way. +(@pxref{Basic Char Syntax}). Other numbers are printed the usual way. For example, the list @code{(4 65 -1 10)} would be printed as @samp{(4 ?A -1 ?\n)}. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 0ed1936cd84..76f15b2595c 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2613,7 +2613,7 @@ compatibility. You can do this with @code{defvaralias}. @defun defvaralias new-alias base-variable &optional docstring This function defines the symbol @var{new-alias} as a variable alias -for symbol @var{base-variable}. This means that retrieving the value +for symbol @var{base-variable}. This means that retrieving the value of @var{new-alias} returns the value of @var{base-variable}, and changing the value of @var{new-alias} changes the value of @var{base-variable}. The two aliased variable names always share the diff --git a/doc/man/etags.1 b/doc/man/etags.1 index c567c51d7ef..9b8df50a6bb 100644 --- a/doc/man/etags.1 +++ b/doc/man/etags.1 @@ -171,7 +171,7 @@ of \- means standard output; overrides default \fBTAGS\fP or \fBtags\fP. Make tags based on regexp matching for the files following this option, in addition to the tags made with the standard parsing based on -language. May be freely intermixed with filenames and the \fB\-R\fP +language. May be freely intermixed with filenames and the \fB\-R\fP option. The regexps are cumulative, i.e., each such option will add to the previous ones. The regexps are of one of the forms: .br diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index 8d802be535c..bb4beb38837 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -136,12 +136,12 @@ You can use spaces inside a password or other token by surrounding the token with either single or double quotes. You can use apostrophes inside a password or other token by -surrounding it with double quotes, e.g., @code{"he'llo"}. Similarly you +surrounding it with double quotes, e.g., @code{"he'llo"}. Similarly you can use double quotes inside a password or other token by surrounding -it with apostrophes, e.g., @code{'he"llo'}. You can't mix both (so a +it with apostrophes, e.g., @code{'he"llo'}. You can't mix both (so a password or other token can't have both apostrophes and double quotes). -All this is optional. You could just say (but we don't recommend it, +All this is optional. You could just say (but we don't recommend it, we're just showing that it's possible) @example @@ -267,7 +267,7 @@ earlier. Since Tramp has about 88 connection methods, this may be necessary if you have an unusual (see earlier comment on those) setup. The netrc format is directly translated into JSON, if you are into -that sort of thing. Just point to a JSON file with entries like this: +that sort of thing. Just point to a JSON file with entries like this: @example [ @@ -501,7 +501,9 @@ The username can also be expressed as a prefix, separated from the host with an at-sign (@code{@@}). @item gnu.org:22.gpg -The port (aka. service) to match can only be expressed after the host and separated with a colon (@code{:}). The separator can be changed through the @code{auth-source-pass-port-separator} variable. +The port (aka. service) to match can only be expressed after the host +and separated with a colon (@code{:}). The separator can be changed +through the @code{auth-source-pass-port-separator} variable. @item gnu.org:22/rms.gpg diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi index d927816c492..4bd07c8d312 100644 --- a/doc/misc/autotype.texi +++ b/doc/misc/autotype.texi @@ -290,7 +290,7 @@ be inserted. It can also be a function, which allows doing various things. The function can simply insert some text, indeed, it can be skeleton command (@pxref{Using Skeletons}). It can be a lambda function which will for example conditionally -call another function. Or it can even reset the mode for the buffer. If you +call another function. Or it can even reset the mode for the buffer. If you want to perform several such actions in order, you use a vector, i.e., several of the above elements between square brackets (@samp{[@r{@dots{}}]}). diff --git a/doc/misc/bovine.texi b/doc/misc/bovine.texi index 5cef9ffbb93..f4eb0784cb2 100644 --- a/doc/misc/bovine.texi +++ b/doc/misc/bovine.texi @@ -346,7 +346,7 @@ semantic list. @item (EXPANDFULL @var{$1} @var{nonterminal} @var{depth}) Is like @code{EXPAND}, except that the parser will iterate over @var{nonterminal} until there are no more matches. (The same way the -parser iterates over the starting rule (@pxref{Starting Rules}). This +parser iterates over the starting rule (@pxref{Starting Rules}). This lets you have much simpler rules in this specific case, and also lets you have positional information in the returned tokens, and error skipping. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 54909c130c3..384ad889ae1 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -355,7 +355,7 @@ To print the Calc manual in one huge tome, you will need the Emacs source, which contains the source code to this manual, @file{calc.texi}. Change to the @file{doc/misc} subdirectory of the Emacs source distribution, which contains source code for this manual, -and type @kbd{make calc.pdf}. (Don't worry if you get some ``overfull +and type @kbd{make calc.pdf}. (Don't worry if you get some ``overfull box'' warnings while @TeX{} runs.) The result will be this entire manual as a pdf file. @end ifnottex @@ -524,7 +524,7 @@ matrix into a @infoline 2x3 matrix. Type @w{@kbd{v u}} to unpack the rows into two separate vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums -of the two original columns. (There is also a special +of the two original columns. (There is also a special grab-and-sum-columns command, @kbd{C-x * :}.) @strong{Units conversion.} Units are entered algebraically. @@ -929,7 +929,7 @@ is Calc has added annotations to the file to help it remember the modes that were used for this formula. They are formatted like comments in the @TeX{} typesetting language, just in case you are using @TeX{} or -@LaTeX{}. (In this example @TeX{} is not being used, so you might want +@LaTeX{}. (In this example @TeX{} is not being used, so you might want to move these comments up to the top of the file or otherwise put them out of the way.) @@ -1174,7 +1174,7 @@ that arbitrary-size integers were just as easy as large integers. Arbitrary floating-point precision was the logical next step. Also, since the large integer arithmetic was there anyway it seemed only fair to give the user direct access to it, which in turn made it -practical to support fractions as well as floats. All these features +practical to support fractions as well as floats. All these features inspired me to look around for other data types that might be worth having. @@ -5762,7 +5762,7 @@ which in algebraic notation is written like @samp{ninteg(f(t), t, 0, x)} with any integrand @samp{f(t)}. Define a @kbd{z s} command and @code{Si} function that implement this. You will need to edit the default argument list a bit. As a test, @samp{Si(1)} should return -0.946083. (If you don't get this answer, you might want to check that +0.946083. (If you don't get this answer, you might want to check that Calc is in Radians mode. Also, @code{ninteg} will run a lot faster if you reduce the precision to, say, six digits beforehand.) @xref{Programming Answer 1, 1}. (@bullet{}) @@ -9758,7 +9758,7 @@ by a zero) resets the Calculator to its initial state. This clears the stack, resets all the modes to their initial values (the values that were saved with @kbd{m m} (@code{calc-save-modes})), clears the caches (@pxref{Caches}), and so on. (It does @emph{not} erase the -values of any variables.) With an argument of 0, Calc will be reset to +values of any variables.) With an argument of 0, Calc will be reset to its default state; namely, the modes will be given their default values. With a positive prefix argument, @kbd{C-x * 0} preserves the contents of the stack but resets everything else to its initial state; with a @@ -10254,7 +10254,7 @@ specified number of operations. When the Calculator is quit, as with the @kbd{q} (@code{calc-quit}) command, the undo history will be truncated to the length of the customizable variable @code{calc-undo-length} (@pxref{Customizing Calc}), which by default -is @expr{100}. (Recall that @kbd{C-x * c} is synonymous with +is @expr{100}. (Recall that @kbd{C-x * c} is synonymous with @code{calc-quit} while inside the Calculator; this also truncates the undo history.) @@ -11050,8 +11050,8 @@ calendar. Some calendars attempt to mimic the historical situation by using the Gregorian calendar for recent dates and the Julian calendar for older -dates. The @code{cal} program in most Unix implementations does this, -for example. While January 1 wasn't always the beginning of a calendar +dates. The @code{cal} program in most Unix implementations does this, +for example. While January 1 wasn't always the beginning of a calendar year, these hybrid calendars still use January 1 as the beginning of the year even for older dates. The customizable variable @code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to @@ -11405,7 +11405,7 @@ means a variable is random, and its value could be anything but is ``probably'' within one @texline @math{\sigma} @infoline @var{sigma} -of the mean value @expr{x}. An interval +of the mean value @expr{x}. An interval `@tfn{[}@var{a} @tfn{..@:} @var{b}@tfn{]}' means a variable's value is unknown, but guaranteed to lie in the specified range. Error forms are statistical or ``average case'' approximations; @@ -11862,7 +11862,7 @@ any portion of a vector or formula on the stack. @cindex Moving stack entries The command @kbd{C-x C-t} (@code{calc-transpose-lines}) will transpose the stack object determined by the point with the stack object at the -next higher level. For example, with @samp{10 20 30 40 50} on the +next higher level. For example, with @samp{10 20 30 40 50} on the stack and the point on the line containing @samp{30}, @kbd{C-x C-t} creates @samp{10 20 40 30 50}. More generally, @kbd{C-x C-t} acts on the stack objects determined by the current point (and mark) similar @@ -11871,7 +11871,7 @@ lines. With argument @var{n}, @kbd{C-x C-t} will move the stack object at the level above the current point and move it past N other objects; for example, with @samp{10 20 30 40 50} on the stack and the point on the line containing @samp{30}, @kbd{C-u 2 C-x C-t} creates -@samp{10 40 20 30 50}. With an argument of 0, @kbd{C-x C-t} will switch +@samp{10 40 20 30 50}. With an argument of 0, @kbd{C-x C-t} will switch the stack objects at the levels determined by the point and the mark. @node Editing Stack Entries @@ -12062,14 +12062,14 @@ the stack contains the sole number 5, but after @kbd{2 @key{RET} 3 K +}, the stack contains the arguments and the result: @samp{2 3 5}. With the exception of keyboard macros, this works for all commands that -take arguments off the stack. (To avoid potentially unpleasant behavior, +take arguments off the stack. (To avoid potentially unpleasant behavior, a @kbd{K} prefix before a keyboard macro will be ignored. A @kbd{K} prefix called @emph{within} the keyboard macro will still take effect.) As another example, @kbd{K a s} simplifies a formula, pushing the simplified version of the formula onto the stack after the original formula (rather than replacing the original formula). Note that you could get the same effect by typing @kbd{@key{RET} a s}, copying the -formula and then simplifying the copy. One difference is that for a very +formula and then simplifying the copy. One difference is that for a very large formula the time taken to format the intermediate copy in @kbd{@key{RET} a s} could be noticeable; @kbd{K a s} would avoid this extra work. @@ -13171,7 +13171,7 @@ Calc can display @expr{w}-bit integers using two's complement notation, although this is most useful with the binary, octal and hexadecimal display modes. This option is selected by using the @kbd{O} option prefix before setting the display radix, and a negative word -size might be appropriate (@pxref{Binary Functions}). In two's +size might be appropriate (@pxref{Binary Functions}). In two's complement notation, the integers in the (nearly) symmetric interval from @texline @math{-2^{w-1}} @@ -13502,7 +13502,7 @@ date representation, this week goes from 2013-W01-1 (December 31, All three ISO 8601 representations arrange the numbers from most significant to least significant; as well as being unambiguous representations, they are easy to sort since chronological order in -this formats corresponds to lexicographical order. The hyphens are +this formats corresponds to lexicographical order. The hyphens are sometimes omitted. The ISO 8601 standard uses a 24 hour clock; a particular time is @@ -13744,7 +13744,7 @@ order), then all other characters are ignored and this information determines the date. Otherwise, all words and numbers are isolated from the string; other characters are ignored. All words must be either month names or day-of-week names (the latter of which are -ignored). Names can be written in full or as three-letter +ignored). Names can be written in full or as three-letter abbreviations. Large numbers, or numbers with @samp{+} or @samp{-} signs, @@ -14205,9 +14205,9 @@ quotients are written using @code{\over} in @TeX{} mode (as in @code{\choose} in @TeX{} mode (as in @code{@{a \choose b@}}) and @code{\binom} in @LaTeX{} mode (as in @code{\binom@{a@}@{b@}}). Interval forms are written with @code{\ldots}, and error forms are -written with @code{\pm}. Absolute values are written as in +written with @code{\pm}. Absolute values are written as in @samp{|x + 1|}, and the floor and ceiling functions are written with -@code{\lfloor}, @code{\rfloor}, etc. The words @code{\left} and +@code{\lfloor}, @code{\rfloor}, etc. The words @code{\left} and @code{\right} are ignored when reading formulas in @TeX{} and @LaTeX{} modes. Both @code{inf} and @code{uinf} are written as @code{\infty}; when read, @code{\infty} always translates to @code{inf}. @@ -16290,7 +16290,7 @@ interpretations; the expression @samp{a/b*c} should be written @samp{(a/b)*c} or @samp{a/(b*c)}, as appropriate. Without the parentheses, Calc will interpret @samp{a/b*c} as @samp{a/(b*c)}, since in algebraic entry Calc gives division a lower precedence than -multiplication. (This is not standard across all computer languages, and +multiplication. (This is not standard across all computer languages, and Calc may change the precedence depending on the language mode being used. @xref{Language Modes}.) This default ordering can be changed by setting the customizable variable @code{calc-multiplication-has-precedence} to @@ -17456,7 +17456,7 @@ converting into a generalized time zone (see below). The Lisp function @code{math-prev-weekday-in-month} is useful for daylight saving computations. This is an internal version of the user-level @code{pwday} function described in the previous -section. It takes four arguments: The floating-point date value, +section. It takes four arguments: The floating-point date value, the corresponding six-element date list, the day-of-month number, and the weekday number (0--6). @@ -20150,7 +20150,7 @@ that the counts in the result vector don't add up to the length of the input vector.) If no prefix is given, then you will be prompted for a vector which -will be used to determine the bins. (If a positive integer is given at +will be used to determine the bins. (If a positive integer is given at this prompt, it will be still treated as if it were given as a prefix.) Each bin will consist of the interval of numbers closest to the corresponding number of this new vector; if the vector @@ -21636,7 +21636,7 @@ to @noindent Every character not part of the sub-formula @samp{b} has been changed -to a dot. (If the customizable variable +to a dot. (If the customizable variable @code{calc-highlight-selections-with-faces} is non-@code{nil}, then the characters not part of the sub-formula are de-emphasized by using a less noticeable face instead of using dots. @pxref{Displaying Selections}.) @@ -22837,12 +22837,12 @@ suitable numbers. This section describes all simplifications that are performed by the algebraic simplification mode, which is the default simplification mode. If you have switched to a different simplification mode, you can -switch back with the @kbd{m A} command. Even in other simplification +switch back with the @kbd{m A} command. Even in other simplification modes, the @kbd{a s} command will use these algebraic simplifications to simplify the formula. There is a variable, @code{AlgSimpRules}, in which you can put rewrites -to be applied. Its use is analogous to @code{EvalRules}, +to be applied. Its use is analogous to @code{EvalRules}, but without the special restrictions. Basically, the simplifier does @samp{@w{a r} AlgSimpRules} with an infinite repeat count on the whole expression being simplified, then it traverses the expression applying @@ -22991,7 +22991,7 @@ function; for example, @expr{1/@tfn{sec}(x)} is simplified to hyperbolic functions are also handled. Trigonometric functions of their inverse functions are -simplified. The expression @expr{@tfn{sin}(@tfn{arcsin}(x))} is +simplified. The expression @expr{@tfn{sin}(@tfn{arcsin}(x))} is simplified to @expr{x}, and similarly for @code{cos} and @code{tan}. Trigonometric functions of inverses of different trigonometric functions can also be simplified, as in @expr{@tfn{sin}(@tfn{arccos}(x))} @@ -27646,7 +27646,7 @@ simplifications. Most of the special limitations for @code{EvalRules} don't apply to @code{AlgSimpRules}. Calc simply does an @kbd{a r AlgSimpRules} command with an infinite repeat count as the first step of algebraic -simplifications. It then applies its own built-in simplifications +simplifications. It then applies its own built-in simplifications throughout the formula, and then repeats these two steps (along with applying the default simplifications) until no further changes are possible. @@ -27883,7 +27883,7 @@ while typing @kbd{u c au/yr @key{RET}} produces If the units you request are inconsistent with the original units, the number will be converted into your units times whatever ``remainder'' units are left over. For example, converting @samp{55 mph} into acres -produces @samp{6.08e-3 acre / (m s)}. Remainder units are expressed in terms of +produces @samp{6.08e-3 acre / (m s)}. Remainder units are expressed in terms of ``fundamental'' units like @samp{m} and @samp{s}, regardless of the input units. @@ -28257,7 +28257,7 @@ is defined to be @infoline @math{10 log10(P1/P0) dB}. @texline @math{10 \log_{10}(P_{1}/P_{0}) {\rm dB}}. (The factor of 10 is because a decibel, as its name implies, is -one-tenth of a bel. The bel, named after Alexander Graham Bell, was +one-tenth of a bel. The bel, named after Alexander Graham Bell, was considered to be too large of a unit and was effectively replaced by the decibel.) If @math{F} is a field quantity with power @math{P=k F^2}, then a reference quantity of @@ -28353,10 +28353,10 @@ capital @kbd{O} prefix is used. @tindex lufquant The @kbd{l q} (@code{calc-lu-quant}) [@code{lupquant}] command computes the power quantity corresponding to a given number of -logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the -reference level will be read from the top of the stack. (In an +logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the +reference level will be read from the top of the stack. (In an algebraic formula, @code{lupquant} can be given an optional second -argument which will be used for the reference level.) For example, +argument which will be used for the reference level.) For example, @code{20 dB @key{RET} l q} will return @code{100 mW}; @code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}. The @kbd{H l q} [@code{lufquant}] command behaves like @kbd{l q} but @@ -28469,7 +28469,7 @@ The @kbd{l *} (@code{calc-lu-times}) [@code{lupmul}] and @kbd{H l *} [@code{lufmul}] commands will ``multiply'' a logarithmic unit by a number; the @kbd{l /} (@code{calc-lu-divide}) [@code{lupdiv}] and @kbd{H l /} [@code{lufdiv}] commands will ``divide'' a logarithmic -unit by a number. Note that the reference quantities don't play a role +unit by a number. Note that the reference quantities don't play a role in this arithmetic. @node Musical Notes @@ -28528,7 +28528,7 @@ example, @code{500 Hz} gets converted to @tindex midi The @kbd{l m} (@code{calc-midi}) [@code{midi}] command converts either a frequency or a note given in scientific pitch notation to the -corresponding midi number. For example, @code{C_6} gets converted to 84 +corresponding midi number. For example, @code{C_6} gets converted to 84 and @code{440 Hz} to 69. @kindex l f @@ -28536,7 +28536,7 @@ and @code{440 Hz} to 69. @tindex freq The @kbd{l f} (@code{calc-freq}) [@code{freq}] command converts either either a midi number or a note given in scientific pitch notation to -the corresponding frequency. For example, @code{Asharp_2 + 30 cents} +the corresponding frequency. For example, @code{Asharp_2 + 30 cents} gets converted to @code{118.578040134 Hz} and @code{55} to @code{195.99771799 Hz}. @@ -29530,7 +29530,7 @@ will be computed for the surface. Data values in the graph of a function are normally computed to a precision of five digits, regardless of the current precision at the -time. This is usually more than adequate, but there are cases where +time. This is usually more than adequate, but there are cases where it will not be. For example, plotting @expr{1 + x} with @expr{x} in the interval @samp{[0 ..@: 1e-6]} will round all the data points down to 1.0! Putting the command @samp{set precision @var{n}} in the @@ -29975,7 +29975,7 @@ register will be deleted from the Calc buffer. It is possible to add additional stack entries to a register. The command @kbd{M-x calc-append-to-register} will prompt for a register, then add the stack entries in the region to the end of the register -contents. The command @kbd{M-x calc-prepend-to-register} will +contents. The command @kbd{M-x calc-prepend-to-register} will similarly prompt for a register and add the stack entries in the region to the beginning of the register contents. Both commands take @kbd{C-u} arguments, which will cause the region to be deleted after being @@ -30620,7 +30620,7 @@ like most Calc commands, but rather in regular editing buffers that are visiting your own files. Calc will try to guess an appropriate language based on the major mode -of the editing buffer. (@xref{Language Modes}.) If the current buffer is +of the editing buffer. (@xref{Language Modes}.) If the current buffer is in @code{latex-mode}, for example, Calc will set its language to @LaTeX{}. Similarly, Calc will use @TeX{} language for @code{tex-mode}, @code{plain-tex-mode} and @code{context-mode}, C language for @@ -30657,7 +30657,7 @@ on their own separate lines or in-line with the formula. If you give a positive or negative numeric prefix argument, Calc instead uses the current point as one end of the formula, and includes that many lines forward or backward (respectively, including the current -line). Explicit delimiters are not necessary in this case. +line). Explicit delimiters are not necessary in this case. With a prefix argument of zero, Calc uses the current region (delimited by point and mark) instead of formula delimiters. With a prefix @@ -31189,7 +31189,7 @@ use @kbd{C-x * u} to update the buffer by hand. @noindent The mode settings can be changed while Calc is in embedded mode, but by default they will revert to their original values when embedded mode -is ended. However, the modes saved when the mode-recording mode is +is ended. However, the modes saved when the mode-recording mode is @code{Save} (see below) and the modes in effect when the @kbd{m e} (@code{calc-embedded-preserve-modes}) command is given will be preserved when embedded mode is ended. @@ -31315,7 +31315,7 @@ on it in order to get it to notice the new annotation. Two more mode-recording modes selectable by @kbd{m R} are available which are also available outside of Embedded mode. -(@pxref{General Mode Commands}.) They are @code{Save}, in which mode +(@pxref{General Mode Commands}.) They are @code{Save}, in which mode settings are recorded permanently in your Calc init file (the file given by the variable @code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}) rather than by annotating the current document, and no-recording @@ -35645,7 +35645,7 @@ formulas in normal language modes. If @code{calc-multiplication-has-precedence} is non-@code{nil}, then multiplication has precedence (and, for certain obscure reasons, is right associative), and so for example @samp{a/b*c} will be interpreted -as @samp{a/(b*c)}. If @code{calc-multiplication-has-precedence} is +as @samp{a/(b*c)}. If @code{calc-multiplication-has-precedence} is @code{nil}, then multiplication has the same precedence as division (and, like division, is left associative), and so for example @samp{a/b*c} will be interpreted as @samp{(a/b)*c}. The default value diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index ced59c0eee6..c0819b232a4 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -182,7 +182,7 @@ modify this GNU manual.'' @end quotation @end copying -@comment Info directory entry for use by install-info. The indentation +@comment Info directory entry for use by install-info. The indentation @comment here is by request from the FSF folks. @dircategory Emacs editing modes @direntry @@ -1429,7 +1429,7 @@ continuation of the preceding @code{if}. @findex abbrev-mode @cindex Abbrev mode @ccmode{} uses Abbrev mode (@pxref{Abbrevs,,,@emacsman{}, @emacsmantitle{}}) -to accomplish this. It's therefore turned on by default in all language +to accomplish this. It's therefore turned on by default in all language modes except IDL mode, since CORBA IDL doesn't have any statements. @end deffn @@ -2704,7 +2704,7 @@ for C code in GNU programs. @item k&r @cindex K&R style -The classic Kernighan and Ritchie style for C code. If you're looking +The classic Kernighan and Ritchie style for C code. If you're looking for the style used in the 2nd edition of their book ``The C Programming Language'', then check out the @code{stroustrup} style. @@ -7591,7 +7591,7 @@ Started}. @kindex C-M-\ @emph{How do I reindent the whole file?} -Visit the file and hit @kbd{C-x h} to mark the whole buffer. Then hit +Visit the file and hit @kbd{C-x h} to mark the whole buffer. Then hit @kbd{C-M-\}. @xref{Indentation Commands}. @item diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index c3a91f7dab1..113029700ec 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -860,7 +860,7 @@ Thus @code{(cl-typep @var{object} 'null)} is equivalent to @item The type symbol @code{atom} represents all objects that are not cons -cells. Thus @code{(cl-typep @var{object} 'atom)} is equivalent to +cells. Thus @code{(cl-typep @var{object} 'atom)} is equivalent to @code{(atom @var{object})}. @item @@ -2191,7 +2191,7 @@ term restricts the search to just the specified property. The Properties,,,elisp}. @item for @var{var} being the frames -This clause iterates over all Emacs frames. The clause @code{screens} is +This clause iterates over all Emacs frames. The clause @code{screens} is a synonym for @code{frames}. The frames are visited in @code{next-frame} order starting from @code{selected-frame}. diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index a98b738e73e..e2e9de729de 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1255,7 +1255,7 @@ object. Example: @end lisp With the @code{dbus-introspect} function it is possible to explore the -interfaces of @samp{org.freedesktop.Hal} service. It offers the +interfaces of @samp{org.freedesktop.Hal} service. It offers the interfaces @samp{org.freedesktop.Hal.Manager} for the object at the path @samp{/org/freedesktop/Hal/Manager} as well as the interface @samp{org.freedesktop.Hal.Device} for all objects prefixed with the @@ -1970,7 +1970,7 @@ If this variable is non-@code{nil}, D-Bus specific debug messages are raised. Input parameters of @code{dbus-call-method}, @code{dbus-call-method-asynchronously}, @code{dbus-send-signal}, @code{dbus-register-method}, @code{dbus-register-property} and -@code{dbus-register-signal} are checked for correct D-Bus types. If +@code{dbus-register-signal} are checked for correct D-Bus types. If there is a type mismatch, the Lisp error @code{wrong-type-argument} @code{D-Bus @var{arg}} is raised. diff --git a/doc/misc/ebrowse.texi b/doc/misc/ebrowse.texi index dca6266d8ae..27a5deb86d9 100644 --- a/doc/misc/ebrowse.texi +++ b/doc/misc/ebrowse.texi @@ -513,8 +513,8 @@ practical than to clutter up the buffer list with dozens of member buffers. If you want to display more than one member list at a time you can -@dfn{freeze} its member buffer. Freezing a member buffer prevents it -from being overwritten the next time you display a member list. You can +@dfn{freeze} its member buffer. Freezing a member buffer prevents it +from being overwritten the next time you display a member list. You can toggle this buffer status at any time. Every member list display command in the tree buffer can be used with a @@ -747,7 +747,7 @@ menu. @cindex unmark all @item M a Unmark all classes. With prefix argument @kbd{C-u}, mark all classes in -the tree. Since this command operates on the whole buffer, it can also be +the tree. Since this command operates on the whole buffer, it can also be found in the buffer's object menu. @end table diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index ae179832753..4ed3fc9d1df 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -1120,7 +1120,7 @@ number. It also holds a list of @code{ede-target} objects and a list of sub projects, or more @code{ede-project} objects. New project types must subclass @code{ede-project} to add special -behavior. New project types also need to subclass @code{ede-target} to +behavior. New project types also need to subclass @code{ede-target} to add specialty behavior. In this way, the common @ede{} interface is designed to work against diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi index 749025c870b..ae107323d9c 100644 --- a/doc/misc/ediff.texi +++ b/doc/misc/ediff.texi @@ -135,10 +135,10 @@ The architecture and the interface are, of course, drastically different. When Ediff starts up, it displays a small control window, which accepts the Ediff commands, and two or three windows displaying the files to be compared -or merged. The control window can be in its own small frame or it can be -part of a bigger frame that displays other buffers. In any case, it is +or merged. The control window can be in its own small frame or it can be +part of a bigger frame that displays other buffers. In any case, it is important that the control window be active (i.e., be the one receiving the -keystrokes) when you use Ediff. You can switch to other Emacs buffers at +keystrokes) when you use Ediff. You can switch to other Emacs buffers at will and even edit the files currently being compared with Ediff and then switch back to Ediff at any time by activating the appropriate Emacs windows. @@ -156,13 +156,13 @@ Compare two files. @item ediff-backup @findex ediff-backup -Compare a file with its backup. If there are several numerical backups, use -the latest. If the file is itself a backup, then compare it with its +Compare a file with its backup. If there are several numerical backups, use +the latest. If the file is itself a backup, then compare it with its original. @item ediff-current-file @findex ediff-current-file -Compare the buffer with its file on disk. This function can be used as a +Compare the buffer with its file on disk. This function can be used as a safe version of @code{revert-buffer}. @item ediff-buffers @@ -220,14 +220,14 @@ Compare text visible in 2 windows line-by-line. @findex ediff-regions-wordwise Compare regions word-by-word. The regions can come from the same buffer and they can even overlap. You will be asked to specify the buffers that -contain the regions, which you want to compare. For each buffer, you will -also be asked to mark the regions to be compared. Pay attention to the +contain the regions, which you want to compare. For each buffer, you will +also be asked to mark the regions to be compared. Pay attention to the messages that appear in the minibuffer. @item ediff-regions-linewise @findex ediff-regions-linewise Similar to @code{ediff-windows-linewise}, but compares the regions -line-by-line. See @code{ediff-windows-linewise} for more details. +line-by-line. See @code{ediff-windows-linewise} for more details. @item ediff-revision @findex ediff-revision @@ -246,7 +246,7 @@ will be able to patch the files selectively. @xref{Session Groups}, for more details. Since the patch might be in a buffer or a file, you will be asked which is -the case. To avoid this extra prompt, you can invoke this command with a +the case. To avoid this extra prompt, you can invoke this command with a prefix argument. With an odd prefix argument, Ediff assumes the patch is in a file; with an even argument, a buffer is assumed. @@ -280,7 +280,7 @@ This function would refuse to apply a multifile patch to a buffer. Use modified by the @code{patch} utility). Since the patch might be in a buffer or a file, you will be asked which is -the case. To avoid this extra prompt, you can invoke this command with a +the case. To avoid this extra prompt, you can invoke this command with a prefix argument. With an odd prefix argument, Ediff assumes the patch is in a file; with an even argument, a buffer is assumed. @@ -683,7 +683,7 @@ again puts Ediff back in the original state. @vindex ediff-ignore-case-option @vindex ediff-ignore-case-option3 @vindex ediff-ignore-case -Toggle case sensitivity in the diff program. All diffs are recomputed. +Toggle case sensitivity in the diff program. All diffs are recomputed. Case sensitivity is controlled by the variables @code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3}, and @code{ediff-ignore-case}, which are explained elsewhere. @@ -814,7 +814,7 @@ it. Typing @kbd{$$} again undoes this setting. @kindex $* When merging files with large number of differences, it is sometimes convenient to be able to skip the difference regions for which you already -decided which variant is most appropriate. Typing @kbd{$*} will accomplish +decided which variant is most appropriate. Typing @kbd{$*} will accomplish precisely this. To be more precise, this toggles the check for whether the current merge is @@ -898,9 +898,9 @@ child Ediff session for comparing regions in buffers A, B, or C as follows. First, you will be asked whether you want to compare the fine differences -between the currently highlighted buffers on a word-by-word basis. If you +between the currently highlighted buffers on a word-by-word basis. If you accept, a child Ediff session will start using the currently highlighted -regions. Ediff will let you step over the differences word-wise. +regions. Ediff will let you step over the differences word-wise. If you reject the offer, you will be asked to select regions of your choice. @@ -1054,9 +1054,9 @@ directories. @cindex Directory difference buffer Sometimes it is desirable to copy some files from one directory to another -without exiting Ediff. The @emph{directory difference buffer}, which is +without exiting Ediff. The @emph{directory difference buffer}, which is displayed by typing @kbd{D} as discussed above, can be used for this -purpose. If a file is, say, in Ediff's Directory A, but is missing in +purpose. If a file is, say, in Ediff's Directory A, but is missing in Ediff's Directory B (Ediff will refuse to override existing files), then typing @kbd{C} or clicking mouse button 2 over that file (which must be displayed in directory difference buffer) will copy that file from @@ -1130,7 +1130,7 @@ for hiding or, with @kbd{=m}, for further operations. The comparison operations @kbd{==}, @kbd{=h}, and @kbd{=m} can recurse into subdirectories to see if they have identical contents (so the user will not -need to descend into those subdirectories manually). These commands ask the +need to descend into those subdirectories manually). These commands ask the user whether or not to do a recursive descent. @@ -1221,7 +1221,7 @@ of Ediff. @vindex ediff-after-setup-windows-hook These two hooks are called before and after Ediff sets up its window configuration. These hooks are run each time Ediff rearranges windows to -its liking. This happens whenever it detects that the user changed the +its liking. This happens whenever it detects that the user changed the windows setup. @item ediff-suspend-hook @@ -1323,7 +1323,7 @@ Hooks run after setting up the registry for all active Ediff session. @item ediff-before-session-group-setup-hook @vindex ediff-before-session-group-setup-hook Hooks run before setting up a control panel for a group of related Ediff -sessions. Can be used, for example, to save window configuration to restore +sessions. Can be used, for example, to save window configuration to restore later. @item ediff-after-session-group-setup-hook @vindex ediff-after-session-group-setup-hook @@ -1598,21 +1598,21 @@ problem. @vindex ediff-ignore-case-option @vindex ediff-ignore-case-option3 @vindex ediff-ignore-case -Finally, Ediff can be told to ignore the case of the letters. This behavior +Finally, Ediff can be told to ignore the case of the letters. This behavior can be toggled with @kbd{#c} and it is controlled with three variables: @code{ediff-ignore-case-option}, @code{ediff-ignore-case-option3}, and @code{ediff-ignore-case}. The variable @code{ediff-ignore-case-option} specifies the option to pass -to the diff program for comparing two files or buffers. For GNU -@code{diff}, this option is @code{"-i"}. The variable +to the diff program for comparing two files or buffers. For GNU +@code{diff}, this option is @code{"-i"}. The variable @code{ediff-ignore-case-option3} specifies the option to pass to the -@code{diff3} program in order to make it case-insensitive. GNU @code{diff3} +@code{diff3} program in order to make it case-insensitive. GNU @code{diff3} does not have such an option, so when merging or comparing three files with this program, ignoring the letter case is not supported. The variable @code{ediff-ignore-case} controls whether Ediff starts out by -ignoring letter case or not. It can be set in @file{.emacs} using +ignoring letter case or not. It can be set in @file{.emacs} using @code{setq-default}. When case sensitivity is toggled, all difference @@ -1875,11 +1875,11 @@ Customize interface instead of using @code{setq} directly.) @item ediff-coding-system-for-read @vindex ediff-coding-system-for-read This variable specifies the coding system to use when reading the output -that the programs @code{diff3} and @code{diff} send to Emacs. The default +that the programs @code{diff3} and @code{diff} send to Emacs. The default is @code{raw-text}, and this should work fine in Unix and in most -cases under Windows NT/98/2000. There are @code{diff} programs -for which the default option doesn't work under Windows. In such cases, -@code{raw-text-dos} might work. If not, you will have to experiment with +cases under Windows NT/98/2000. There are @code{diff} programs +for which the default option doesn't work under Windows. In such cases, +@code{raw-text-dos} might work. If not, you will have to experiment with other coding systems or use GNU diff. @item ediff-patch-program @@ -1992,7 +1992,7 @@ the difference region from the ancestor buffer, if available ======= end @end example -The above is the default template for the combined region. The user can +The above is the default template for the combined region. The user can customize this template using the variable @code{ediff-combination-pattern}. @@ -2000,11 +2000,11 @@ customize this template using the variable The variable @code{ediff-combination-pattern} specifies the template that determines how the combined merged region looks like. The template is represented as a list of the form @code{(STRING1 Symbol1 STRING2 Symbol2 -STRING3 Symbol3 STRING4)}. The symbols here must be atoms of the form -@code{A}, @code{B}, or @code{Ancestor}. They determine the order in which +STRING3 Symbol3 STRING4)}. The symbols here must be atoms of the form +@code{A}, @code{B}, or @code{Ancestor}. They determine the order in which the corresponding difference regions (from buffers A, B, and the ancestor buffer) are displayed in the merged region of buffer C@. The strings in the -template determine the text that separates the aforesaid regions. The +template determine the text that separates the aforesaid regions. The default template is @smallexample @@ -2014,8 +2014,8 @@ default template is @noindent (this is one long line) and the corresponding combined region is shown -above. The order in which the regions are shown (and the separator -strings) can be changed by changing the above template. It is even +above. The order in which the regions are shown (and the separator +strings) can be changed by changing the above template. It is even possible to add or delete region specifiers in this template (although the only possibly useful such modification seems to be the deletion of the ancestor). @@ -2154,7 +2154,7 @@ change this variable. @vindex ediff-merge-filename-prefix When merge buffers are saved automatically as directed by @code{ediff-autostore-merges}, Ediff attaches a prefix to each file, as -specified by the variable @code{ediff-merge-filename-prefix}. The default +specified by the variable @code{ediff-merge-filename-prefix}. The default is @code{merge_}, but this can be changed by the user. @node Support for Version Control @@ -2318,9 +2318,9 @@ unconditionally (e.g., by making @code{ediff-janitor} into one of these hooks). @item ediff-keep-tmp-versions @vindex ediff-keep-tmp-versions -Default is @code{nil}. If @code{t}, the versions of the files being +Default is @code{nil}. If @code{t}, the versions of the files being compared or merged using operations such as @code{ediff-revision} or -@code{ediff-merge-revisions} are not deleted on exit. The normal action is +@code{ediff-merge-revisions} are not deleted on exit. The normal action is to clean up and delete these version files. @item ediff-grab-mouse diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index c5ba6c8609f..411450cdc42 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -773,7 +773,7 @@ corrupted while unpacking and Emacs will not start. If it is still not working, send mail to the @email{help-gnu-emacs@@gnu.org} mailing list, describing what you've -done, and what you are seeing. (The more information you send the more +done, and what you are seeing. (The more information you send the more likely it is that you'll receive a helpful response.) @node Virus @@ -1592,7 +1592,7 @@ smtpmail is loaded, then you'll need to change @code{smtpmail-smtp-server}. If you are experiencing problems with sending large messages, check -the value of the variable @code{smtpmail-debug-info}. If it is +the value of the variable @code{smtpmail-debug-info}. If it is non-@code{nil}, you should set it to @code{nil}: @node Incoming mail with Rmail @@ -1908,9 +1908,9 @@ See the following two URLs for details: @cindex MSVC++, compiling within Emacs @findex compile -This is an app note on how to use Microsoft Visual C++ with Emacs. The +This is an app note on how to use Microsoft Visual C++ with Emacs. The experiments done below were done with Emacs 19.34.1 on Windows 95, -using Visual C++ 4.0 Standard Edition. Your mileage may vary. +using Visual C++ 4.0 Standard Edition. Your mileage may vary. This writeup assumes minimal knowledge of Emacs hacking on the part of the reader. @@ -1939,14 +1939,14 @@ For all versions of Windows you can alternatively set the variables just inside Emacs by using @code{setenv} calls in your init file. @xref{Installing Emacs,,Where do I put my init file?}. -You should now be able to compile from Emacs. Load a source file from -a VC++ project. Type @kbd{M-x compile}. Replace the proposed command line +You should now be able to compile from Emacs. Load a source file from +a VC++ project. Type @kbd{M-x compile}. Replace the proposed command line with: @example nmake -f @var{ProjectName}.mak @end example -You will find that this defaults to a debug build. You can change it +You will find that this defaults to a debug build. You can change it to a release build with: @example nmake -f @var{ProjectName}.mak CFG="@var{ProjectName} - Win32 Release" @@ -2018,21 +2018,21 @@ click on @code{Customize...}. In the @code{Tools} tab, click on @file{emacsclientw.exe} file in your Emacs bin directory, and select it. For arguments, use @option{+$(CurLine)} @option{"$(FilePath)"} and for the directory use the @code{$(WkspDir)} -(the quotes around FilePath handle paths with spaces in them). Set the -Menu Text to say "Em&acs". The @option{+$(CurLine)} will set point in -Emacs to the same line as the cursor position in VC++. The ampersand +(the quotes around FilePath handle paths with spaces in them). Set the +Menu Text to say "Em&acs". The @option{+$(CurLine)} will set point in +Emacs to the same line as the cursor position in VC++. The ampersand in the word @code{Em&acs} allows you to select emacs from the keyboard. (E is already used for the OLE control test container.) -You should now be able to go to any source file in your project. Then, -use the pull-down menu @code{Tools->Emacs}. The active file in your +You should now be able to go to any source file in your project. Then, +use the pull-down menu @code{Tools->Emacs}. The active file in your VC++ IDE should now be front and center in Emacs, all ready to edit as -you wish. If you use keystrokes to work the menus, try @kbd{Alt-T A} to -move the file into Emacs. Binding this tool to a keystroke will be +you wish. If you use keystrokes to work the menus, try @kbd{Alt-T A} to +move the file into Emacs. Binding this tool to a keystroke will be left as an exercise for the student. If you have the option of saving files before running tools, make sure -this option is set. (I don't see it on VC++ 4.0.) +this option is set. (I don't see it on VC++ 4.0.) @node Borland C++ Builder @section Emacs and Borland C++ Builder @@ -2072,8 +2072,8 @@ Free native Windows binaries. For those that don't Cygwin may be an option. From Jay Rogers: Some versions of the perl debugger itself need to be patched to work -with emacs. They are perl versions 5.001 and less, and version -5.004_01. To fix, locate and change the code similar to the following +with emacs. They are perl versions 5.001 and less, and version +5.004_01. To fix, locate and change the code similar to the following code in lib/perl5db.pl @example if (-e "/dev/tty") @{ @@ -2273,7 +2273,7 @@ If you have general questions about Emacs, the best places to start looking are @ref{Top,,, emacs, The GNU Emacs Manual}, and @ref{Top,,, efaq, the standard Emacs FAQ}. In Emacs, you can browse the manual using Info by typing @kbd{C-h r}, -and you can view the FAQ by typing @kbd{C-h C-f}. Other resources include: +and you can view the FAQ by typing @kbd{C-h C-f}. Other resources include: @itemize @item @uref{https://www.gnu.org/software/emacs/, The Emacs website} diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index f56888aac3f..fd98088bc7c 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3693,7 +3693,7 @@ feature. Emacs has a list of local variables that are known to be safe to set. If a file tries to set any variable outside this list, it asks the -user to confirm whether the variables should be set. You can also tell +user to confirm whether the variables should be set. You can also tell Emacs whether to allow the evaluation of Emacs Lisp code found at the bottom of files by setting the variable @code{enable-local-eval}. @@ -3836,7 +3836,7 @@ in the distribution. To build Emacs from source for MS-DOS, see the instructions in the file @file{msdos/INSTALL} in the distribution. The DOS port builds and runs on plain DOS, and also on all versions of MS-Windows from version 3.X -onwards, including Windows XP and Vista. Pre-built binaries may be +onwards, including Windows XP and Vista. Pre-built binaries may be available at @uref{https://www.delorie.com/pub/djgpp/current/v2gnu/emacs.README} @@ -4762,14 +4762,14 @@ these systems, you should configure @code{movemail} to use @code{flock}. Ron Isaacson says: When you hit @kbd{r} to reply in Rmail, by default it Ccs all of the original recipients (everyone on the original @samp{To} and @samp{CC} -lists). With a prefix argument (i.e., typing @kbd{C-u} before @kbd{r}), +lists). With a prefix argument (i.e., typing @kbd{C-u} before @kbd{r}), it replies only to the sender. However, going through the whole @kbd{C-u} business every time you want to reply is a pain. This is the best fix I've been able to come up with: @lisp (defun rmail-reply-t () - "Reply only to the sender of the current message. (See rmail-reply.)" + "Reply only to the sender of the current message. (See rmail-reply.)" (interactive) (rmail-reply t)) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 85fef6be553..ba7aeb448e5 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1313,7 +1313,7 @@ based on compile-time information. The language server reports the regions by periodically sending a @code{textDocument/inactiveRegions} notification for each managed -buffer (@pxref{Eglot and Buffers}). Normally, unknown server +buffer (@pxref{Eglot and Buffers}). Normally, unknown server notifications are ignored by Eglot, but we're going change that. Both the announcement of the client capability and the handling of the @@ -1353,7 +1353,7 @@ called @code{eglot-clangd}, so that the method would be simplified: However, this would require that users tweak @code{eglot-server-program} to tell Eglot instantiate such sub-classes instead of the generic @code{eglot-lsp-server} (@pxref{Setting Up LSP -Servers}). For the purposes of this particular demonstration, we're +Servers}). For the purposes of this particular demonstration, we're going to use the more hacky regexp route which doesn't require that. Note, however, that detecting server versions before announcing new diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index ef7ea614f8b..22bef4739a4 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -379,7 +379,7 @@ This variable is @code{resize} by default, which means that images that are bigger than the Emacs window are resized so that they fit. If you set this to @code{nil}, large images are not displayed in Emacs, but can instead be displayed externally (e.g., with -@samp{ImageMagick} or @samp{xv}). Setting this variable to @code{t} +@samp{ImageMagick} or @samp{xv}). Setting this variable to @code{t} disables this check and makes the library display all inline images as inline, regardless of their size. diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index cecde5f3232..109dbd0f0ce 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -203,11 +203,11 @@ different Emacs versions. @cindex interactive testing @findex ert -You can run the tests that are currently defined in your Emacs with -the command @kbd{M-x ert @key{RET} t @key{RET}}. (For an -explanation of the @code{t} argument, @pxref{Test Selectors}.) ERT will pop -up a new buffer, the ERT results buffer, showing the results of the -tests run. It looks like this: +You can run the tests that are currently defined in your Emacs with the +command @kbd{M-x ert @key{RET} t @key{RET}}. (For an explanation of the +@code{t} argument, @pxref{Test Selectors}.) ERT will pop up a new +buffer, the ERT results buffer, showing the results of the tests run. +It looks like this: @example Selector: t diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index fa410a89761..30825a497a9 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -329,7 +329,7 @@ form} or in @dfn{Lisp form}. You can use the semicolon (@code{;}) to separate multiple command invocations on a single line, executing each in turn. You can also -separate commands with @code{&&} or @code{||}. When using @code{&&}, +separate commands with @code{&&} or @code{||}. When using @code{&&}, Eshell will execute the second command only if the first succeeds (i.e.@: has an exit status of 0); with @code{||}, Eshell will execute the second command only if the first fails. @@ -1977,7 +1977,7 @@ Matches one or more copies of the glob pattern @var{x}. Thus, etc. @item @var{x}~@var{y} -Matches anything that matches the pattern @var{x} but not @var{y}. For +Matches anything that matches the pattern @var{x} but not @var{y}. For example, @samp{[[:digit:]]#~4?} matches @file{1} and @file{12}, but not @file{42}. Note that unlike in Zsh, only a single @samp{~} operator can be used in a pattern, and it cannot be inside of a group @@ -2398,9 +2398,9 @@ Adds the text passed to it to the clipboard. @findex eshell-close-target You can, of course, define your own virtual targets. These are entries in @code{eshell-virtual-targets} with the form @samp{(@var{filename} -@var{output-function} @var{pass-mode})}. The first element, +@var{output-function} @var{pass-mode})}. The first element, @var{filename}, is the device name, usually of the form -@samp{"/dev/@var{name}"}. The second, @var{output-function}, should be a +@samp{"/dev/@var{name}"}. The second, @var{output-function}, should be a function: Eshell will repeatedly call it with the redirected output. This argument can also be an @code{eshell-generic-target} instance. In this case, Eshell will repeatedly call the generic function @@ -2529,7 +2529,7 @@ for the built-in functions and some common external commands, and you can define your own for any command. @kindex TAB -Eshell completion also works for Lisp forms and glob patterns. If the +Eshell completion also works for Lisp forms and glob patterns. If the point is on a Lisp form, then @key{TAB} will behave similarly to completion in @code{elisp-mode} and @code{lisp-interaction-mode}. For glob patterns, the pattern will be removed from the input line, and @@ -2967,7 +2967,7 @@ Also a new @command{less} buffer was created with nothing in it@dots{} If @command{less.exe} is invoked from the Eshell command line, the expected output is written to the buffer. -Note that this happens on NT-Emacs 20.6.1 on Windows 2000. The term.el +Note that this happens on NT-Emacs 20.6.1 on Windows 2000. The term.el package and the supplied shell both use the @command{cmdproxy} program for running shells. diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 615ab76c326..0a16f2561f7 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -131,7 +131,7 @@ Quoted from RFC 1777: @quotation [LDAP] is designed to provide access to the X.500 Directory while not incurring the resource requirements of the Directory Access Protocol -(DAP). This protocol is specifically targeted at simple management +(DAP). This protocol is specifically targeted at simple management applications and browser applications that provide simple read/write interactive access to the X.500 Directory, and is intended to be a complement to the DAP itself. @@ -564,7 +564,7 @@ to customize in this process. Before doing any query you will need to set the directory server. You need to specify the name of the host machine running the server software -and the protocol to use. If you do not set the server in any fashion, +and the protocol to use. If you do not set the server in any fashion, EUDC will ask you for one when you make your first query. You can set the server by selecting one from your hotlist of servers @@ -579,9 +579,9 @@ buffer will be displayed where you can edit the search base and other parameters for the server. @defvar eudc-server -The name or IP address of the remote directory server. A TCP port number +The name or IP address of the remote directory server. A TCP port number may be specified by appending a colon and a number to the name of the -server. You will not need this unless your server runs on a port other +server. You will not need this unless your server runs on a port other than the default (which depends on the protocol). If the directory server resides on your own computer (which is the case if you use the BBDB back end) then @samp{localhost} is a reasonable value but @@ -609,12 +609,12 @@ attributes you want to see, if different from the server defaults. @defvar eudc-default-return-attributes A list of the default attributes to extract from directory entries. If set to the symbol @code{all} then all available attributes are -returned. A value of @code{nil}, the default, means to return the +returned. A value of @code{nil}, the default, means to return the default attributes as configured in the server. @end defvar -The server may return several matching records to a query. Some of the -records may however not contain all the attributes you requested. You can +The server may return several matching records to a query. Some of the +records may however not contain all the attributes you requested. You can discard those records. @defopt eudc-strict-return-matches @@ -626,32 +626,32 @@ attributes are ignored. Default is @code{t}. @subsection Duplicate Attributes Directory standards may authorize different instances of the same -attribute in a record. For instance the record of a person may contain +attribute in a record. For instance the record of a person may contain several email fields containing different email addresses, in which case EUDC will consider the attribute duplicated. -EUDC has several methods to deal with duplicated attributes. The +EUDC has several methods to deal with duplicated attributes. The available methods are: @table @code @item list -Makes a list with the different values of the duplicate attribute. The +Makes a list with the different values of the duplicate attribute. The record is returned with only one instance of the attribute with a list -of all the different values as a value. This is the default method that +of all the different values as a value. This is the default method that is used to handle duplicate fields for which no other method has been specified. @item first Discards all the duplicate values of the field keeping only the first one. @item concat -Concatenates the different values using a newline as a separator. The +Concatenates the different values using a newline as a separator. The record keeps only one instance of the field the value of which is a single multi-line string. @item duplicate Duplicates the whole record into as many instances as there are different -values for the field. This is the default for the email field. Thus a +values for the field. This is the default for the email field. Thus a record containing 3 different email addresses is duplicated into three -different records each having a single email address. This is +different records each having a single email address. This is particularly useful in combination with @code{select} as the method to handle multiple matches in inline expansion queries (@pxref{Inline Query Expansion}) because you are presented with the 3 addresses in a @@ -667,7 +667,7 @@ A method to handle entries containing duplicate attributes. This is either an alist of elements @code{(@var{attr} . @var{method})}, or a symbol @var{method}. The alist form of the variable associates a method to an individual attribute name; the second form specifies a method applicable -to all attribute names. Available methods are: @code{list}, +to all attribute names. Available methods are: @code{list}, @code{first}, @code{concat}, and @code{duplicate} (see above). The default is @code{list}. @end defvar @@ -678,8 +678,8 @@ to all attribute names. Available methods are: @code{list}, @section Query Form The simplest way to query your directory server is to use the query -form. You display the query form with the @samp{Query with Form} menu -item or by invoking the command @kbd{M-x eudc-query-form}. The attribute +form. You display the query form with the @samp{Query with Form} menu +item or by invoking the command @kbd{M-x eudc-query-form}. The attribute names presented in this form are defined by the @code{eudc-query-form-attributes} variable (unless a non-@code{nil} argument is supplied to @code{eudc-query-form}). @@ -717,7 +717,7 @@ names for directory attribute names. This variable is ignored if @defvar eudc-user-attribute-names-alist This is an alist of user-defined names for the directory attributes used in -query/response forms. Prompt strings for attributes that are not in this +query/response forms. Prompt strings for attributes that are not in this alist are derived by splitting the attribute name at underscores and capitalizing the individual words. @end defvar @@ -893,7 +893,7 @@ against the @code{cn} attribute of LDAP servers: @defvar eudc-inline-expansion-format This variable lets you control exactly what is inserted into the -buffer upon an inline expansion request. It can be set to @code{nil}, +buffer upon an inline expansion request. It can be set to @code{nil}, to a function, or to a list. Default is @code{nil}. When the value is a list, the first element is a string passed to @@ -926,7 +926,7 @@ any of the formats: Email address specifications, as are generated by inline expansion, need to comply with RFC 5322 in order to be useful in email -messages. When an invalid address specification is present in an email +messages. When an invalid address specification is present in an email message header, the message is likely to be rejected by a receiving MTA. It is hence recommended to switch old configurations, which use a list value, to the new @code{nil}, or function value type since it diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 6b605a6c095..af9639ebb5a 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -194,7 +194,7 @@ The following statuses are defined: @item [@var{nerrors} @var{nwarnings} ...] @tab Normal operation. @var{nerrors} and @var{nwarnings} are, respectively, the total number of errors and warnings found during the last buffer -check, for all backends. They may be followed by other totals for +check, for all backends. They may be followed by other totals for other types of diagnostics (@pxref{Flymake error types}). @item @code{Wait} diff --git a/doc/misc/forms.texi b/doc/misc/forms.texi index e0221d90fd9..226445ff9a0 100644 --- a/doc/misc/forms.texi +++ b/doc/misc/forms.texi @@ -298,9 +298,9 @@ Similar to @code{forms-next-field} but moves backwards. @item M-x forms-save-buffer @kindex C-x C-s @itemx C-x C-s -Forms mode replacement for @code{save-buffer}. When executed in the +Forms mode replacement for @code{save-buffer}. When executed in the forms buffer it will save the contents of the (modified) data buffer -instead. In Forms mode this function will be bound to @kbd{C-x C-s}. +instead. In Forms mode this function will be bound to @kbd{C-x C-s}. @findex forms-print @item M-x forms-print @@ -374,10 +374,10 @@ string @code{forms-field-sep}, which is @code{"\t"} (a Tab) by default. If the format of the data file is not suitable enough you can define the filter functions @code{forms-read-file-filter} and @code{forms-write-file-filter}. @code{forms-read-file-filter} is called -when the data file is read from disk into the data buffer. It operates -on the data buffer, ignoring read-only protections. When the data file +when the data file is read from disk into the data buffer. It operates +on the data buffer, ignoring read-only protections. When the data file is saved to disk @code{forms-write-file-filter} is called to cancel the -effects of @code{forms-read-file-filter}. After being saved, +effects of @code{forms-read-file-filter}. After being saved, @code{forms-read-file-filter} is called again to prepare the data buffer for further processing. @@ -488,7 +488,7 @@ The default value is @code{"\^k"}, the character Control-K@. Example: @findex forms-read-file-filter @item forms-read-file-filter This variable holds the name of a function to be called after the data -file has been read in. This can be used to transform the contents of the +file has been read in. This can be used to transform the contents of the data file into a format more suitable for forms processing. If it is @code{nil}, no function is called. For example, to maintain a gzipped database: @@ -533,7 +533,7 @@ modified, just before updating the Forms data file. If it is @findex forms-insert-after @item forms-insert-after If this variable is not @code{nil}, new records are created @emph{after} the -current record. Also, upon visiting a file, the initial position will be +current record. Also, upon visiting a file, the initial position will be at the last record instead of the first one. @findex forms-check-number-of-fields @@ -798,8 +798,8 @@ newline in a field, while @code{forms-multi-line} was @code{nil}. @item Field separator occurs in record - update refused! The current record contains the field separator string inside one of the -fields. It can not be written back to the data file, for it would -corrupt it. Probably you inserted the field separator string in a field. +fields. It can not be written back to the data file, for it would +corrupt it. Probably you inserted the field separator string in a field. @item Record number @var{xx} out of range 1..@var{yy} A jump was made to non-existing record @var{xx}. @var{yy} denotes the @@ -813,7 +813,7 @@ An attempt was made to enable edit mode on a file that has been write protected. @item Search failed: @var{regexp} -The @var{regexp} could not be found in the data file. Forward searching +The @var{regexp} could not be found in the data file. Forward searching is done from the current location until the end of the file, then retrying from the beginning of the file until the current location. Backward searching is done from the current location until the beginning @@ -828,7 +828,7 @@ Forms mode's idea of the number of records has been adjusted to the number of records actually present in the data file. @item Problem saving buffers? -An error occurred while saving the data file buffer. Most likely, Emacs +An error occurred while saving the data file buffer. Most likely, Emacs did ask to confirm deleting the buffer because it had been modified, and you said ``no''. @end table diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 33c9f3bea81..a773d48417c 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -115,7 +115,7 @@ development version that became Gnus 5.12. * FAQ 2-4:: My group buffer becomes a bit crowded, is there a way to sort my groups into categories so I can easier browse through them? -* FAQ 2-5:: How to manually sort the groups in Group buffer? How to +* FAQ 2-5:: How to manually sort the groups in Group buffer? How to sort the groups in a topic? @end menu @@ -146,7 +146,7 @@ what's this? @subsubheading Answer You get the message described in the q/a pair above while -starting Gnus, right? It's another symptom for the same +starting Gnus, right? It's another symptom for the same problem, so read the answer above. @node FAQ 2-3 @@ -190,7 +190,7 @@ groups nicely indented. @node FAQ 2-5 @subsubheading Question 2.5 -How to manually sort the groups in Group buffer? How to +How to manually sort the groups in Group buffer? How to sort the groups in a topic? @subsubheading Answer @@ -583,7 +583,7 @@ each POP3 mail source. @xref{Mail Source Specifiers}, for details on * FAQ 4-8:: Is there anything I can do to make poorly formatted mails more readable? * FAQ 4-9:: Is there a way to automatically ignore posts by specific - authors or with specific words in the subject? And can I + authors or with specific words in the subject? And can I highlight more interesting ones in some way? * FAQ 4-10:: How can I disable threading in some (e.g., mail-) groups, or set other variables specific for some groups? @@ -593,7 +593,7 @@ each POP3 mail source. @xref{Mail Source Specifiers}, for details on displays in group buffer is by far to high, especially in mail groups. Is this a bug? * FAQ 4-13:: I don't like the layout of summary and article buffer, - how to change it? Perhaps even a three pane display? + how to change it? Perhaps even a three pane display? * FAQ 4-14:: I don't like the way the Summary buffer looks, how to tweak it? * FAQ 4-15:: How to split incoming mails in several groups? @@ -750,7 +750,7 @@ other deuglifications). @subsubheading Question 4.9 Is there a way to automatically ignore posts by specific -authors or with specific words in the subject? And can I +authors or with specific words in the subject? And can I highlight more interesting ones in some way? @subsubheading Answer @@ -876,7 +876,7 @@ groups again). @subsubheading Question 4.13 I don't like the layout of summary and article buffer, how -to change it? Perhaps even a three pane display? +to change it? Perhaps even a three pane display? @subsubheading Answer @@ -1056,7 +1056,7 @@ of the variables @code{shr-color-visible-distance-min} and signature...? * FAQ 5-4:: Can I set things like From, Signature etc. group based on the group I post too? -* FAQ 5-5:: Is there a spell-checker? Perhaps even on-the-fly +* FAQ 5-5:: Is there a spell-checker? Perhaps even on-the-fly spell-checking? * FAQ 5-6:: Can I set the dictionary based on the group I'm posting to? @@ -1212,7 +1212,7 @@ at the bottom. @node FAQ 5-5 @subsubheading Question 5.5 -Is there a spell-checker? Perhaps even on-the-fly spell-checking? +Is there a spell-checker? Perhaps even on-the-fly spell-checking? @subsubheading Answer @@ -1562,7 +1562,7 @@ gnu.emacs.gnus and want to archive it there are several solutions. The first and easiest is to save it to a file by saying @kbd{O f}. However, wouldn't it be much more convenient to have more direct access to -the archived message from Gnus? If you say yes, put this +the archived message from Gnus? If you say yes, put this snippet by Frank Haun in @file{~/.gnus.el}: @@ -1584,7 +1584,7 @@ more then one article." @noindent You can now say @kbd{M-x my-archive-article} in summary buffer to -archive the article under the cursor in a nnml group. (Change nnml to +archive the article under the cursor in a nnml group. (Change nnml to your preferred back end.) Of course you can also make sure the cache is enabled by saying @@ -1664,7 +1664,7 @@ follows a slightly different approach, here all article where the read mark is set are expirable. To activate auto-expire, include auto-expire in the -Group parameters for the group. (Hit @kbd{G +Group parameters for the group. (Hit @kbd{G c} in summary buffer with point over the group to change group parameters). For total-expire add total-expire to the group-parameters. @@ -1808,7 +1808,7 @@ other possibility is to set, again in the summary buffer, downloadable (%) marks for the articles you want by typing @kbd{@@} with point over the article and then typing @kbd{J u}. -What's the difference? Well, process marks are erased as +What's the difference? Well, process marks are erased as soon as you exit the summary buffer while downloadable marks are permanent. You can actually set downloadable marks in several groups then use fetch session ('J s' in diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index d0ede930996..f4c87bd64dd 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5837,7 +5837,7 @@ Mail a very wide reply to the author of the current article (@code{gnus-summary-very-wide-reply}). A @dfn{very wide reply} is a reply that goes out to all people listed in the @code{To}, @code{From} (or @code{Reply-To}) and @code{Cc} headers in all the process/prefixed -articles. This command uses the process/prefix convention. If given a +articles. This command uses the process/prefix convention. If given a prefix argument, the body of the current article will also be yanked. @item S V @@ -7424,7 +7424,7 @@ meaningful. Here's one example: @end lisp And another example: the protonmail bridge adds fake message-ids to -@code{References} in message headers, which can confuse threading. To +@code{References} in message headers, which can confuse threading. To remove these spurious ids @lisp @@ -10558,7 +10558,7 @@ course, it'll make group entry somewhat slow. @vindex gnus-refer-thread-use-search If @code{gnus-refer-thread-use-search} is @code{nil} (the default) -then thread-referral only looks for articles in the current group. If +then thread-referral only looks for articles in the current group. If this variable is @code{t} the server to which the current group belongs is searched (provided that searching is available for the server's backend). If this variable is a list of servers, each server @@ -14706,7 +14706,7 @@ Here's a complete example @code{nnimap} backend with a client-side If you're using Google's Gmail, you may want to see your Gmail labels when reading your mail. Gnus can give you this information if you ask -for @samp{X-GM-LABELS} in the variable @code{gnus-extra-headers}. For +for @samp{X-GM-LABELS} in the variable @code{gnus-extra-headers}. For example: @example @@ -15387,7 +15387,7 @@ corresponding keywords. @item :mailbox The name of the mailbox to get mail from. The default is @samp{INBOX} -which normally is the mailbox which receives incoming mail. Instead of +which normally is the mailbox which receives incoming mail. Instead of a single mailbox, this can be a list of mailboxes to fetch mail from. @item :predicate @@ -20602,7 +20602,7 @@ key will lead to creation of @file{ADAPT} files.) @cindex score file atoms @item score-fn The value of this entry should be one or more user-defined function -names in parentheses. Each function will be called in order and the +names in parentheses. Each function will be called in order and the returned value is required to be an integer. @example @@ -22355,7 +22355,7 @@ calling @code{nnmairix-search} with @samp{f:From}. @item G G o @kindex G G o @r{(Summary)} @findex nnmairix-goto-original-article -(Only in @code{nnmairix} groups!) Tries determine the group this article +(Only in @code{nnmairix} groups!) Tries determine the group this article originally came from and displays the article in this group, so that, e.g., replying to this article the correct posting styles/group parameters are applied (@code{nnmairix-goto-original-article}). This @@ -26641,13 +26641,13 @@ data across multiple machines. Very often, you want all your marks (what articles you've read, which ones were important, and so on) to be synchronized between several -machines. With IMAP, that's built into the protocol, so you can read +machines. With IMAP, that's built into the protocol, so you can read nnimap groups from many machines and they are automatically -synchronized. But NNTP, nnrss, and many other backends do not store +synchronized. But NNTP, nnrss, and many other backends do not store marks, so you have to do it locally. The Gnus Cloud package stores the marks, plus any files you choose, on -an IMAP server in a special folder. It's like a +an IMAP server in a special folder. It's like a DropTorrentSyncBoxOakTree(TM).@footnote{The name ``Gnus Cloud'' parodizes but otherwise has little to do with ``cloud computing'', a @url{https://www.gnu.org/philosophy/words-to-avoid.html#CloudComputing, @@ -26661,17 +26661,17 @@ misleading term normally best avoided}.} @node Gnus Cloud Setup @subsection Gnus Cloud Setup -Setting up the Gnus Cloud takes less than a minute. From the Group +Setting up the Gnus Cloud takes less than a minute. From the Group buffer: -Press @kbd{^} to go to the Server buffer. Here you'll see all the +Press @kbd{^} to go to the Server buffer. Here you'll see all the servers that Gnus knows. @xref{Server Buffer}. Then press @kbd{i} to mark any servers as cloud-synchronized (their marks are synchronized). Then press @kbd{I} to mark a single server as the cloud host (it must be an IMAP server, and will host a special IMAP folder with all the -synchronization data). This will set the variable +synchronization data). This will set the variable @code{gnus-cloud-method} (using the Customize facilities), then ask you to optionally upload your first CloudSynchronizationDataPack(TM). @@ -26691,37 +26691,37 @@ Download the latest Gnus Cloud data. @item ~ ~ @findex gnus-cloud-upload-all-data @cindex cloud, download -Upload the local Gnus Cloud data. Creates a new +Upload the local Gnus Cloud data. Creates a new CloudSynchronizationDataPack(TM). @end table -But wait, there's more. Of course there's more. So much more. You can +But wait, there's more. Of course there's more. So much more. You can customize all of the following. @defvar gnus-cloud-synced-files These are the files that will be part of every -CloudSynchronizationDataPack(TM). They are included in every upload, -so don't synchronize a lot of large files. Files under 100Kb are best. +CloudSynchronizationDataPack(TM). They are included in every upload, +so don't synchronize a lot of large files. Files under 100Kb are best. @end defvar @defvar gnus-cloud-storage-method -This is a choice from several storage methods. It's highly recommended -to use the EPG facilities. It will be automatic if have GnuPG -installed and EPG loaded. Otherwise, you could use Base64+gzip, +This is a choice from several storage methods. It's highly recommended +to use the EPG facilities. It will be automatic if have GnuPG +installed and EPG loaded. Otherwise, you could use Base64+gzip, Base64, or no encoding. @end defvar @defvar gnus-cloud-interactive When this is set, and by default it is, the Gnus Cloud package will -ask you for confirmation here and there. Leave it on until you're +ask you for confirmation here and there. Leave it on until you're comfortable with the package. @end defvar @defvar gnus-cloud-method The name of the IMAP server to store the -CloudSynchronizationDataPack(TM)s. It's easiest to set this from the +CloudSynchronizationDataPack(TM)s. It's easiest to set this from the Server buffer (@pxref{Gnus Cloud Setup}). @end defvar diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index 7446f3ee9f4..40d5d13b51f 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -1167,7 +1167,7 @@ An assoc of @code{(point . @var{face-symbol})} or . end)} elements, in descending order of point value (i.e., from the file's end to its beginning). The map is in reverse order because inserting a @samp{