From 99253f79703535ab7bd500fc39b33dc0a966333d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 23 Feb 2025 06:19:26 +0100 Subject: [PATCH 01/11] ; * etc/TODO: New section "Make it easier to contribute". --- etc/TODO | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/etc/TODO b/etc/TODO index 95c2167645a..3c628c60bd7 100644 --- a/etc/TODO +++ b/etc/TODO @@ -222,6 +222,31 @@ https://lists.gnu.org/r/emacs-devel/2008-08/msg00456.html * Important features +** Make it easier to contribute + +*** New script to catch common mistakes in patches. +Examples of things to catch are missing or malformed ChangeLog, style +issues in C, Lisp, and Texinfo, etc. There is no need to be overly +ambitious in a first draft, making a start is better than nothing. It +could draw inspiration from checkpatch.pl used by the Linux kernel. + +*** New make target or script to run tests for changed files. +This might require some kind of data structure mapping a source file to +the tests which exercise some of the code in that source file. The +first approximation is to run FOO-tests when you modify a file FOO, but +some FOO's get used in many places in the test suite, so this is not a +simple 1:1 relation. Then we could ask contributors to run the relevant +tests as part of the submission process. + +*** Automated emails to contributors when their commits make tests fail +Having EMBA or something similar email the guilty parties in case of +new test failures (or maybe even warnings) would be great. + +*** Automated testing of patches submitted to the bug tracker +Create a bot that can run the above "check patch" script, and perhaps +even run unit tests, for every patch submitted to the bug tracker, and +then send an automated email with the results. Can EMBA help with this? + ** Speed up Elisp execution *** Speed up function calls From 63adf9dcf53ac64585803fe5f9ad0acb107a9f9f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 24 Feb 2025 03:45:18 +0100 Subject: [PATCH 02/11] ; Reflow some cl-lib docstrings * lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Reflow docstrings. --- lisp/emacs-lisp/cl-macs.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index b07a881ba48..555b4f018ad 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2067,15 +2067,15 @@ a `let' form, except that the list of symbols can be computed at run-time." ;;;###autoload (defmacro cl-flet (bindings &rest body) "Make local function definitions. -Each definition can take the form (FUNC EXP) where -FUNC is the function name, and EXP is an expression that returns the -function value to which it should be bound, or it can take the more common -form (FUNC ARGLIST BODY...) which is a shorthand -for (FUNC (lambda ARGLIST BODY)). -FUNC is defined only within FORM, not BODY, so you can't write -recursive function definitions. Use `cl-labels' for that. See -info node `(cl) Function Bindings' for details. +Each definition can take the form (FUNC EXP) where FUNC is the function +name, and EXP is an expression that returns the function value to which +it should be bound, or it can take the more common form (FUNC ARGLIST +BODY...) which is a shorthand for (FUNC (lambda ARGLIST BODY)). + +FUNC is defined only within FORM, not BODY, so you can't write recursive +function definitions. Use `cl-labels' for that. See Info node +`(cl) Function Bindings' for details. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) @@ -2250,12 +2250,14 @@ Like `cl-flet' but the definitions can refer to previous ones. ;;;###autoload (defmacro cl-labels (bindings &rest body) "Make local (recursive) function definitions. -BINDINGS is a list of definitions of the form (FUNC ARGLIST BODY...) where -FUNC is the function name, ARGLIST its arguments, and BODY the -forms of the function body. FUNC is defined in any BODY, as well -as FORM, so you can write recursive and mutually recursive -function definitions. See info node `(cl) Function Bindings' for -details. + +BINDINGS is a list of definitions of the form (FUNC ARGLIST BODY...) +where FUNC is the function name, ARGLIST its arguments, and BODY the +forms of the function body. + +FUNC is defined in any BODY, as well as FORM, so you can write recursive +and mutually recursive function definitions. See Info node +`(cl) Function Bindings' for details. \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) (debug cl-flet)) From 0be5f9115ec8828bcc50389ca30f76fa1ad5f364 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 24 Feb 2025 14:20:44 +0800 Subject: [PATCH 03/11] ; * etc/images/README (Files): Add an entry for last-page.xpm --- etc/images/README | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/images/README b/etc/images/README index cc8966d7800..66b489d555d 100644 --- a/etc/images/README +++ b/etc/images/README @@ -83,6 +83,7 @@ Emacs images and their source in the GNOME icons stock/ directory: lock-ok.xpm data/stock_lock-ok lock.xpm data/stock_lock next-page.xpm navigation/stock_next-page + last-page.xpm mirrored from navigation/stock_next-page redo.xpm generic/stock_redo refresh.xpm generic/stock_refresh search-replace.xpm slightly modified generic/stock_search-and-replace From 94c0ea39a5af6f0979e769fc8a053ac60b561367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= Date: Mon, 24 Feb 2025 10:32:47 +0100 Subject: [PATCH 04/11] * doc/misc/efaq.texi (New in Emacs 30): Fix typo. (Bug#76518) --- doc/misc/efaq.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 4f936014ed1..56eccfd9456 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -943,7 +943,7 @@ Emacs has been ported to the Android operating system. See the file to build it. @item -New user option @code{trusted-contents} to allow potentially dangerous +New user option @code{trusted-content} to allow potentially dangerous Emacs features which could execute arbitrary Lisp code. Use this variable to list files and directories whose contents Emacs should trust, thus allowing those potentially dangerous features when those From 8a8c25eaccd7adee45a291ba97e828528083f4d9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 24 Feb 2025 18:26:14 +0100 Subject: [PATCH 05/11] ; Add Rudolf Schlatte to authors.el * admin/authors.el (authors-aliases): Add Rudolf Schlatte. --- admin/authors.el | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/authors.el b/admin/authors.el index 946b1598f37..96a102b3f67 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -249,6 +249,7 @@ files.") ("Rodney J. Whitby" "Rod Whitby") ("Roland B. Roberts" "Roland B Roberts" "Roland Roberts") ("Ron Schnell" "Ronnie Schnell") + ("Rudolf Schlatte" "Rudi Schlatte") ("Rui-Tao Dong" "Rui-Tao Dong ~{6-HpLN~}") ("Ryan Thompson" "Ryan .*rct@thompsonclan") (nil "rvs314") From 0c6b8643aec24935f82c63d43219f26378e3e578 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 24 Feb 2025 21:02:14 +0200 Subject: [PATCH 06/11] Fix a typo in 'window_text_pixel_size' This typo caused strange mis-behaviors in buffers with non-ASCII characters. * src/xdisp.c (window_text_pixel_size): Fix typo. (Bug#76519) --- src/xdisp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index f11a8aa6d55..eb00c510aaa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11546,6 +11546,7 @@ window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, it.bidi_p = false; int start_x; + ptrdiff_t start_bpos = BYTEPOS (startp); if (vertical_offset != 0) { int last_y; @@ -11578,6 +11579,7 @@ window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, it.current_y = (WINDOW_TAB_LINE_HEIGHT (w) + WINDOW_HEADER_LINE_HEIGHT (w)); start = clip_to_bounds (BEGV, IT_CHARPOS (it), ZV); + start_bpos = CHAR_TO_BYTE (start); start_y = it.current_y; start_x = it.current_x; } @@ -11639,7 +11641,7 @@ window_text_pixel_size (Lisp_Object window, Lisp_Object from, Lisp_Object to, it.current_y = start_y; /* If FROM is on a newline, pretend that we start at the beginning of the next line, because the newline takes no place on display. */ - if (FETCH_BYTE (start) == '\n') + if (FETCH_BYTE (start_bpos) == '\n') it.current_x = 0, it.wrap_prefix_width = 0; if (!NILP (x_limit)) { From 02c830ba22b0564f6725cd403beba4accb836061 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Thu, 20 Feb 2025 10:29:54 +0100 Subject: [PATCH 07/11] Fix ert-font-lock macro signatures * doc/misc/ert.texi (Syntax Highlighting Tests): * test/lisp/emacs-lisp/ert-font-lock-tests.el (test-line-comment-p--emacs-lisp, test-line-comment-p--shell-script) (test-line-comment-p--javascript, test-line-comment-p--python) (test-line-comment-p--c, test-macro-test--correct-highlighting) (test-macro-test--docstring, test-macro-test--failing) (test-macro-test--file, test-macro-test--file-no-asserts) (test-macro-test--file-failing): Reindent macro calls. (with-temp-buffer-str-mode): Evaluate macro arguments left-to-right. (ert-font-lock--wrap-begin-end): Use rx for more robust composition. (test-line-comment-p--php): Require that php-mode is callable, not already loaded. * lisp/emacs-lisp/ert-font-lock.el (ert-font-lock-deftest) (ert-font-lock-deftest-file): NAME is not followed by an empty list like in ert-deftest, so the optional DOCSTRING is actually the second argument. Adapt calling convention in docstring, and debug, doc-string, and indent properties accordingly (bug#76372). Fix docstring grammar, document MAJOR-MODE, and avoid referring to a file name as a path. --- doc/misc/ert.texi | 10 +-- lisp/emacs-lisp/ert-font-lock.el | 39 +++++---- test/lisp/emacs-lisp/ert-font-lock-tests.el | 94 ++++++++++----------- 3 files changed, 73 insertions(+), 70 deletions(-) diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 9e60647f3ba..e0cc415fa93 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -955,7 +955,7 @@ checking face assignment. Test assertions are included in code-level comments directly and can be read either from inline strings or files. The parser expects the input string to contain at least one assertion. -Test assertion parser extracts tests from comment-only lines. Every +The test assertion parser extracts tests from comment-only lines. Every comment assertion line starts either with a caret (@samp{^}) or an arrow (@samp{<-}). A single caret/arrow or carets should be followed immediately by the name of a face or a list of faces to be checked @@ -977,7 +977,7 @@ var variable = 11; @end example Both symbol-only @code{:face} property values and assertion face values -are normalized to single element lists so assertions below are +are normalized to single element lists so the assertions below are equivalent: @example @@ -1054,7 +1054,7 @@ definition: @lisp (ert-font-lock-deftest test-macro-test--inline - emacs-lisp-mode + emacs-lisp-mode " (defun fun ()) ;; ^ font-lock-keyword-face @@ -1068,13 +1068,13 @@ file: @lisp (ert-font-lock-deftest-file test-macro-test--file - "Test reading correct assertions from a file" + "Test reading correct assertions from a file." javascript-mode "correct.js") @end lisp The @code{ert-font-lock-deftest} and @code{ert-font-lock-deftest-file} -macros accept the same keyword parameters as @code{ert-deftest} i.e., +macros accept the same keyword arguments as @code{ert-deftest}, i.e., @code{:tag} and @code{:expected-result}. @node How to Debug Tests diff --git a/lisp/emacs-lisp/ert-font-lock.el b/lisp/emacs-lisp/ert-font-lock.el index e584eb679fd..80f4a6d5467 100644 --- a/lisp/emacs-lisp/ert-font-lock.el +++ b/lisp/emacs-lisp/ert-font-lock.el @@ -27,8 +27,8 @@ ;; highlighting provided by font-lock. ;; ;; ert-font-lock entry points are functions -;; `ert-font-lock-test-string' and `ert-font-lock-test-file' and -;; convenience macros: `ert-font-lock-deftest' and +;; `ert-font-lock-test-string' and `ert-font-lock-test-file', and +;; convenience macros `ert-font-lock-deftest' and ;; `ert-font-lock-deftest-file'. ;; ;; See unit tests in ert-font-lock-tests.el for usage examples. @@ -124,19 +124,21 @@ Argument TEST-NAME - name of the currently running ert test." (defmacro ert-font-lock-deftest (name &rest docstring-keys-mode-and-str) "Define test NAME (a symbol) using assertions from TEST-STR. -Other than MAJOR-MODE and TEST-STR parameters, this macro accepts -the same parameters and keywords as `ert-deftest' and is intended -to be used through `ert'. +The MAJOR-MODE symbol determines the syntax and font lock of TEST-STR. -\(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] \ +Except for the MAJOR-MODE and TEST-STR parameters, this macro accepts +the same arguments and keywords as `ert-deftest' and is intended to be +used through `ert'. + +\(fn NAME [DOCSTRING] [:expected-result RESULT-TYPE] \ [:tags \\='(TAG...)] MAJOR-MODE TEST-STR)" (declare (debug (&define [&name "test@" symbolp] - sexp [&optional stringp] + [&optional stringp] [&rest keywordp sexp] symbolp stringp)) - (doc-string 3) - (indent 2)) + (doc-string 2) + (indent 1)) (pcase-let ((`(,documentation ,documentation-supplied-p ,keys ,mode ,arg) @@ -159,22 +161,23 @@ to be used through `ert'. (defmacro ert-font-lock-deftest-file (name &rest docstring-keys-mode-and-file) "Define test NAME (a symbol) using assertions from FILE. -FILE - path to a file with assertions in ERT resource director as -return by `ert-resource-directory'. +FILE names a file with assertions in the ERT resource directory, as +returned by `ert-resource-directory'. The MAJOR-MODE symbol determines +the syntax and font lock of FILE's contents. -Other than MAJOR-MODE and FILE parameters, this macro accepts the -same parameters and keywords as `ert-deftest' and is intended to -be used through `ert'. +Except for the MAJOR-MODE and FILE parameters, this macro accepts the +same arguments and keywords as `ert-deftest' and is intended to be used +through `ert'. -\(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] \ +\(fn NAME [DOCSTRING] [:expected-result RESULT-TYPE] \ [:tags \\='(TAG...)] MAJOR-MODE FILE)" (declare (debug (&define [&name "test@" symbolp] - sexp [&optional stringp] + [&optional stringp] [&rest keywordp sexp] symbolp stringp)) - (doc-string 3) - (indent 2)) + (doc-string 2) + (indent 1)) (pcase-let ((`(,documentation ,documentation-supplied-p diff --git a/test/lisp/emacs-lisp/ert-font-lock-tests.el b/test/lisp/emacs-lisp/ert-font-lock-tests.el index e410cf5fa13..0c3e4405562 100644 --- a/test/lisp/emacs-lisp/ert-font-lock-tests.el +++ b/test/lisp/emacs-lisp/ert-font-lock-tests.el @@ -39,13 +39,13 @@ "Create a buffer with STR contents and MODE. " (declare (indent 1) (debug t)) `(with-temp-buffer - (insert ,str) (,mode) + (insert ,str) (goto-char (point-min)) ,@body)) (defun ert-font-lock--wrap-begin-end (re) - (concat "^" re "$")) + (rx bol (regexp re) eol)) ;;; Regexp tests ;;; @@ -97,89 +97,89 @@ (ert-deftest test-line-comment-p--emacs-lisp () (with-temp-buffer-str-mode emacs-lisp-mode - "not comment + "not comment ;; comment " - (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)))) + (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)) + (forward-line) + (should-not (ert-font-lock--line-comment-p)))) (ert-deftest test-line-comment-p--shell-script () (with-temp-buffer-str-mode shell-script-mode - "echo Not a comment + "echo Not a comment # comment " - (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)))) + (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)))) (declare-function php-mode "php-mode") (ert-deftest test-line-comment-p--php () - (skip-unless (featurep 'php-mode)) + (skip-unless (fboundp 'php-mode)) (with-temp-buffer-str-mode php-mode - "echo 'Not a comment' + "echo 'Not a comment' // comment /* comment */ " - (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)))) + (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)))) (ert-deftest test-line-comment-p--javascript () (with-temp-buffer-str-mode javascript-mode - "// comment + "// comment // comment, after a blank line var abc = function(d) {}; " - (should (ert-font-lock--line-comment-p)) + (should (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)))) + (forward-line) + (should-not (ert-font-lock--line-comment-p)))) (ert-deftest test-line-comment-p--python () (with-temp-buffer-str-mode python-mode - "# comment + "# comment # comment print(\"Hello, world!\")" - (should (ert-font-lock--line-comment-p)) + (should (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)) + (forward-line) + (should-not (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)) + (forward-line) + (should (ert-font-lock--line-comment-p)) - (forward-line) - (should-not (ert-font-lock--line-comment-p)))) + (forward-line) + (should-not (ert-font-lock--line-comment-p)))) (ert-deftest test-line-comment-p--c () (with-temp-buffer-str-mode c-mode - "// comment + "// comment /* also comment */" - (should (ert-font-lock--line-comment-p)) + (should (ert-font-lock--line-comment-p)) - (forward-line) - (should (ert-font-lock--line-comment-p)))) + (forward-line) + (should (ert-font-lock--line-comment-p)))) (ert-deftest test-parse-comments--no-assertion-error () (let* ((str " @@ -568,14 +568,14 @@ var abc = function(d) { ;; (ert-font-lock-deftest test-macro-test--correct-highlighting - emacs-lisp-mode + emacs-lisp-mode " (defun fun ()) ;; ^ font-lock-keyword-face ;; ^ font-lock-function-name-face") (ert-font-lock-deftest test-macro-test--docstring - "A test with a docstring." + "A test with a docstring." emacs-lisp-mode " (defun fun ()) @@ -583,7 +583,7 @@ var abc = function(d) { ) (ert-font-lock-deftest test-macro-test--failing - "A failing test." + "A failing test." :expected-result :failed emacs-lisp-mode " @@ -591,18 +591,18 @@ var abc = function(d) { ;; ^ wrong-face") (ert-font-lock-deftest-file test-macro-test--file - "Test reading correct assertions from a file" + "Test reading correct assertions from a file." javascript-mode "correct.js") (ert-font-lock-deftest-file test-macro-test--file-no-asserts - "Check failing on files without assertions" + "Check failing on files without assertions." :expected-result :failed javascript-mode "no-asserts.js") (ert-font-lock-deftest-file test-macro-test--file-failing - "Test reading wrong assertions from a file" + "Test reading wrong assertions from a file." :expected-result :failed javascript-mode "broken.js") From 58c7acb55543bddf4280e90c219ee5023d4898f9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 25 Feb 2025 11:26:11 +0100 Subject: [PATCH 08/11] ; Fix completion-fail-discreetly docstring typo. --- lisp/minibuffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f19fe241bfb..cfce7de8df1 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1455,7 +1455,7 @@ pair of a group title string and a list of group candidate strings." (defvar completion-tab-width nil) (defvar completion-fail-discreetly nil - "If non-nil, stay quiet when there is no match.") + "If non-nil, stay quiet when there is no match.") (defun completion--message (msg) (if completion-show-inline-help From a90da8990342c7fc0aa51ae92a0849de346a8d8b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 26 Feb 2025 03:31:57 +0100 Subject: [PATCH 09/11] ; Fix up emacs-lisp-mode docstring * lisp/progmodes/elisp-mode.el (emacs-lisp-mode, lisp-interaction-mode): Fix up docstring slightly by removing redundant and misplaced word "Commands", and prefix list with dashes. --- lisp/progmodes/elisp-mode.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index a573d9ef864..bde6b030335 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -335,9 +335,10 @@ mouse-1: Enable lexical-binding mode" mouse-face mode-line-highlight local-map ,elisp--dynlex-modeline-map))) "Major mode for editing Lisp code to run in Emacs. -Commands: -Delete converts tabs to spaces as it moves back. -Blank lines separate paragraphs. Semicolons start comments. + +- Delete converts tabs to spaces as it moves back. +- Blank lines separate paragraphs. +- Semicolons start comments. When editing Lisp data (as opposed to code), `lisp-data-mode' can be used instead. @@ -367,7 +368,7 @@ be used instead. #'elisp-completion-at-point nil 'local) (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t) (add-hook 'flymake-diagnostic-functions - #'elisp-flymake-byte-compile nil t) + #'elisp-flymake-byte-compile nil t) (add-hook 'context-menu-functions #'elisp-context-menu 10 t)) ;; Font-locking support. @@ -1330,10 +1331,9 @@ before point, and prints its value into the buffer, advancing point. Note that printing is controlled by `eval-expression-print-length' and `eval-expression-print-level'. -Commands: -Delete converts tabs to spaces as it moves back. -Paragraphs are separated only by blank lines. -Semicolons start comments. +- Delete converts tabs to spaces as it moves back. +- Paragraphs are separated only by blank lines. +- Semicolons start comments. \\{lisp-interaction-mode-map}" :abbrev-table nil From 734986349fd460e5c1f65f315e16817320026444 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Feb 2025 15:10:27 +0800 Subject: [PATCH 10/11] ; Minor Android documentation improvements * doc/emacs/android.texi (Android Startup, Android File System) (Android Document Providers): Improve phrasing. --- doc/emacs/android.texi | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index a1801d378ea..568fd8022d1 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -145,8 +145,8 @@ attempts to open the file with the wrapper will fail. @cindex /content/by-authority directory, android @cindex /content/by-authority-named directory, android Some files are given to Emacs as ``content identifiers'' that the -system provides access to outside the normal filesystem APIs. Emacs -uses pseudo-directories named @file{/content/by-authority} and +system provides access to independently of the normal filesystem APIs. +Emacs uses pseudo-directories named @file{/content/by-authority} and @file{/content/by-authority-named} to access those files. Do not make any assumptions about the contents of these directories, or try to open files in it yourself. @@ -227,9 +227,9 @@ system settings. @item Directories provided by @dfn{document providers} on Android 5.0 and -later. These directories exist outside the normal Unix filesystem, -containing files provided by external programs (@pxref{Android -Document Providers}.) +later. These directories exist independently of the Unix virtual +filesystem, containing files provided by external programs +(@pxref{Android Document Providers}.) @end itemize Despite ordinary installations of Android not having files within @@ -324,9 +324,8 @@ its name to the command @code{android-relinquish-directory-access}. The same limitations applied to the @file{/assets} directory (@pxref{Android File System}) are applied when creating sub-processes within those directories, because they do not exist within the Unix -file-system. In addition, although Emacs can normally write and -create files inside these directories, it cannot create symlinks or -hard links. +file-system. In addition, although Emacs can normally write and create +files inside these directories, it cannot create symlinks or hard links. Since document providers are allowed to perform expensive network operations to obtain file contents, a file access operation within one From f88dc0f2f9d28d0988cca54c5b9fc1ba85ce3d7e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 26 Feb 2025 14:52:26 +0200 Subject: [PATCH 11/11] ; Fix documentation of 'buffer-text-pixel-size' * doc/lispref/display.texi (Size of Displayed Text): Fix arguments of 'buffer-text-pixel-size'. (Bug#76519) --- doc/lispref/display.texi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e896b8198af..8b1847cc4dc 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2377,7 +2377,7 @@ though when this function is run from an idle timer with a delay of zero seconds. @end defun -@defun buffer-text-pixel-size &optional buffer-or-name window from to x-limit y-limit +@defun buffer-text-pixel-size &optional buffer-or-name window x-limit y-limit This is much like @code{window-text-pixel-size}, but can be used when the buffer isn't shown in a window. (@code{window-text-pixel-size} is faster when it is, so this function shouldn't be used in that case.) @@ -2388,10 +2388,14 @@ live window and defaults to the selected one; the function will compute the text dimensions as if @var{buffer} is displayed in @var{window}. The return value is a cons of the maximum pixel-width of any text line and the pixel-height of all the text lines of the -buffer specified by @var{buffer-or-name}. +accessible portion of the buffer specified by @var{buffer-or-name}. The optional arguments @var{x-limit} and @var{y-limit} have the same meaning as with @code{window-text-pixel-size}. + +If you want to measure dimensions of some part of the buffer text, +narrow the buffer to that part before calling this function +(@pxref{Narrowing}). @end defun @defun string-pixel-width string