commit 4a1f2053cdce65efd00de4e211de89f56a549a61 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun Jul 7 08:51:16 2024 +0300 ; Avoid byte-compiler warning in package.el * lisp/emacs-lisp/package.el (lm-package-needs-footer-line): Declare. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b0ba886df74..7cae8d68bc0 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1161,6 +1161,7 @@ Signal an error if the entire string was not used." (declare-function lm-keywords-list "lisp-mnt" (&optional file)) (declare-function lm-maintainers "lisp-mnt" (&optional file)) (declare-function lm-authors "lisp-mnt" (&optional file)) +(declare-function lm-package-needs-footer-line "lisp-mnt" (&optional file)) (defun package-buffer-info () "Return a `package-desc' describing the package in the current buffer. commit 17807a3144045305334c85b248ff6cdd93681ab6 Author: Stefan Kangas Date: Sun Jul 7 04:31:01 2024 +0200 Fix fontification of network files in `awk-mode` * lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Fix fontification of special network file names such as "/inet4/tcp/0/localhost/daytime". See Info node '(gawk) TCP/IP Networking'. diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 937a965d4ed..e377c4831fc 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -1011,9 +1011,11 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\ ;; Do the same (almost) with ;; (regexp-opt '("/inet/tcp/lport/rhost/rport" "/inet/udp/lport/rhost/rport" ;; "/inet/raw/lport/rhost/rport") 'words) + ;; , replacing "inet" with "inet[46]?" + ;; , replacing "lport", "rhost", and "rport" with "[[:alnum:]]+". ;; This cannot be combined with the above pattern, because the match number ;; for the (optional) closing \" would then exceed 9. - '("\\(\"/inet/\\(\\(raw\\|\\(tc\\|ud\\)p\\)/lport/rhost/rport\\)\\)\\>\ + '("\\(\"/inet[46]?/\\(\\(raw\\|\\(tc\\|ud\\)p\\)/[[:alnum:]]+/[[:alnum:]]+/[[:alnum:]]+\\)\\)\\>\ \\(\\(\"\\)\\|\\([^\"/\n\r][^\"\n\r]*\\)?$\\)" (1 font-lock-variable-name-face t) (6 font-lock-variable-name-face t t)) commit 13ab972bc89ca747d0ba2969c2ab84bf8a496bcc Merge: 14d2e89af17 8589fd9cae2 Author: Po Lu Date: Sun Jul 7 10:24:47 2024 +0800 Merge from savannah/emacs-30 8589fd9cae2 * src/androidvfs.c (android_saf_check_nonnull): Fix typo. commit 8589fd9cae2fbff8bf8eddd055fc1e60fa0df6f2 Author: Po Lu Date: Sun Jul 7 10:24:24 2024 +0800 * src/androidvfs.c (android_saf_check_nonnull): Fix typo. diff --git a/src/androidvfs.c b/src/androidvfs.c index 2427708be34..833c6b1b2a7 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -3168,7 +3168,7 @@ android_saf_exception_check (int n, ...) Value is 1 if it be NULL, 0 otherwise. */ static int -android_saf_check_nonnull (jobject object, int n, ...) +android_saf_check_nonnull (const void *object, int n, ...) { va_list ap; commit 14d2e89af1750135fb778e682d543f10d11f5f47 Merge: f0f54b1cb91 99e510977b2 Author: Po Lu Date: Sun Jul 7 10:23:08 2024 +0800 Merge from savannah/emacs-30 99e510977b2 Correct JNI string error checking and miscellaneous corre... bbe95a8ceab Correctly highlight SYMTAB in `awk-mode` 9625e4af994 Fix formatting of tables with thead/tfoot but no tbody commit f0f54b1cb91c4094f242ce26f89f7631619656dd Merge: 247b88e5c57 83234cc1dbb Author: Po Lu Date: Sun Jul 7 10:23:08 2024 +0800 ; Merge from savannah/emacs-30 The following commit was skipped: 83234cc1dbb (buf_bytepos_to_charpos): Fix mixup introduced in commit ... commit 247b88e5c57c1be27c52cd882680b6a6ea892abe Merge: 745eae00d41 48f4c9cbbc1 Author: Po Lu Date: Sun Jul 7 10:23:08 2024 +0800 Merge from savannah/emacs-30 48f4c9cbbc1 ; Reflow "Commentary" in lisp-mnt.el 22155753a46 ; * lisp/emacs-lisp/comp-run.el (native--compile-async): ... 235b9e85a67 package-buffer-info: Move 'require' earlier commit 99e510977b22ca60e48b2af70a3c2cdbd90b2b01 Author: Po Lu Date: Sun Jul 7 10:19:31 2024 +0800 Correct JNI string error checking and miscellaneous corrections * src/android-emacs.c (main): Do not attempt to load the bootstrap class path, which is redundant on all Android releases. * src/android.c (initEmacs, android_browse_url): Do not assume exceptions will be raised if GetStringUTFChars fails. Decode Android JNI strings as Qandroid_jni. * src/androidvfs.c (android_saf_check_nonnull): New function. (android_saf_new_mkdir): Likewise. diff --git a/src/android-emacs.c b/src/android-emacs.c index 5a43445612a..d68734da1bd 100644 --- a/src/android-emacs.c +++ b/src/android-emacs.c @@ -52,49 +52,6 @@ main (int argc, char **argv) args[0] = (char *) "/system/bin/app_process"; #endif /* __x86_64__ || __aarch64__ || __mips64 */ - /* Machines with ART require the boot classpath to be manually - specified. Machines with Dalvik however refuse to do so, as they - open the jars inside the BOOTCLASSPATH environment variable at - startup, resulting in the following crash: - - W/dalvikvm( 1608): Refusing to reopen boot DEX - '/system/framework/core.jar' - W/dalvikvm( 1608): Refusing to reopen boot DEX - '/system/framework/bouncycastle.jar' - E/dalvikvm( 1608): Too many exceptions during init (failed on - 'Ljava/io/IOException;' 'Re-opening BOOTCLASSPATH DEX files is - not allowed') - E/dalvikvm( 1608): VM aborting */ - -#if HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL - if (android_get_device_api_level () < 21) - { - bootclasspath = NULL; - goto skip_setup; - } -#else /* !HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */ - if (__ANDROID_API__ < 21) - { - bootclasspath = NULL; - goto skip_setup; - } -#endif /* HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */ - - /* Next, obtain the boot class path. */ - bootclasspath = getenv ("BOOTCLASSPATH"); - - if (!bootclasspath) - { - fprintf (stderr, "The BOOTCLASSPATH environment variable" - " is not set. As a result, Emacs does not know" - " how to start app_process.\n" - "This is likely a change in the Android platform." - " Please report this to bug-gnu-emacs@gnu.org.\n"); - return 1; - } - - skip_setup: - /* And the Emacs class path. */ emacs_class_path = getenv ("EMACS_CLASS_PATH"); @@ -115,23 +72,11 @@ main (int argc, char **argv) if (ld_library_path) setenv ("LD_LIBRARY_PATH", ld_library_path, 1); - if (bootclasspath) + if (asprintf (&bootclasspath, "-Djava.class.path=%s", + emacs_class_path) < 0) { - if (asprintf (&bootclasspath, "-Djava.class.path=%s:%s", - bootclasspath, emacs_class_path) < 0) - { - perror ("asprintf"); - return 1; - } - } - else - { - if (asprintf (&bootclasspath, "-Djava.class.path=%s", - emacs_class_path) < 0) - { - perror ("asprintf"); - return 1; - } + perror ("asprintf"); + return 1; } args[1] = bootclasspath; diff --git a/src/android.c b/src/android.c index 3c0e3ee1558..f90ebc04925 100644 --- a/src/android.c +++ b/src/android.c @@ -2019,6 +2019,8 @@ NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, c_argument = (*env)->GetStringUTFChars (env, (jstring) dump_file_object, NULL); + if (!c_argument) + emacs_abort (); /* Copy the Java string data once. */ dump_file = strdup (c_argument); @@ -6497,18 +6499,18 @@ android_browse_url (Lisp_Object url, Lisp_Object send) buffer = (*android_java_env)->GetStringUTFChars (android_java_env, (jstring) value, NULL); - android_exception_check_1 (value); + android_exception_check_nonnull ((void *) buffer, value); /* Otherwise, build the string describing the error. */ - tem = build_string_from_utf8 (buffer); + tem = build_unibyte_string (buffer); (*android_java_env)->ReleaseStringUTFChars (android_java_env, (jstring) value, buffer); - /* And return it. */ + /* And decode and return the same. */ ANDROID_DELETE_LOCAL_REF (value); - return tem; + return code_convert_string_norecord (tem, Qandroid_jni, false); } /* Tell the system to restart Emacs in a short amount of time, and diff --git a/src/androidvfs.c b/src/androidvfs.c index 346eb639b11..2427708be34 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -3162,6 +3162,37 @@ android_saf_exception_check (int n, ...) return 1; } +/* Verify that OBJECT is non-NULL. If NULL, free each of the N local + references given as arguments, and clear exceptions. + + Value is 1 if it be NULL, 0 otherwise. */ + +static int +android_saf_check_nonnull (jobject object, int n, ...) +{ + va_list ap; + + if (object) + return 0; + + va_start (ap, n); + + /* Clear the active exception, making it safe to subsequently call + other JNI functions. */ + (*android_java_env)->ExceptionClear (android_java_env); + + /* Delete each of the N arguments. */ + + while (n > 0) + { + ANDROID_DELETE_LOCAL_REF (va_arg (ap, jobject)); + n--; + } + + va_end (ap); + return 1; +} + /* Content authority-based vnode implementation. @@ -6428,7 +6459,7 @@ android_saf_new_mkdir (struct android_vnode *vnode, mode_t mode) new_doc_id = (*android_java_env)->GetStringUTFChars (android_java_env, new_id, NULL); - if (android_saf_exception_check (3, name, id, uri)) + if (android_saf_check_nonnull (new_doc_id, 3, name, id, uri)) return -1; xfree (vp->document_id); commit 745eae00d4178906eda58c26d0d132fbd32b3ff7 Author: Stefan Kangas Date: Sun Jul 7 03:50:35 2024 +0200 Fontify `mkbool` as function in `awk-mode` * lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Fontify 'mkbool' function, added in gawk version 5.2. See Info node '(gawk) Boolean Functions'. diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index e299f4fa8d2..c520c3def71 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -1035,8 +1035,8 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\ '("adump" "and" "asort" "asorti" "atan2" "bindtextdomain" "close" "compl" "cos" "dcgettext" "dcngettext" "exp" "extension" "fflush" "gensub" "gsub" "index" "int" "isarray" "length" "log" "lshift" - "match" "mktime" "or" "patsplit" "print" "printf" "rand" "rshift" - "sin" "split" "sprintf" "sqrt" "srand" "stopme" + "match" "mkbool" "mktime" "or" "patsplit" "print" "printf" "rand" + "rshift" "sin" "split" "sprintf" "sqrt" "srand" "stopme" "strftime" "strtonum" "sub" "substr" "system" "systime" "tolower" "toupper" "typeof" "xor") t) commit bbe95a8ceabfa1f4ad2064e1607fe64cf56434fd Author: Stefan Kangas Date: Sun Jul 7 03:39:37 2024 +0200 Correctly highlight SYMTAB in `awk-mode` * lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Fix typo for "SYMTAB" (see Info node '(gawk) Auto-set'). diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index e299f4fa8d2..4b8cb0eff47 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -990,7 +990,7 @@ "ERRNO" "FIELDWIDTHS" "FILENAME" "FNR" "FPAT" "FS" "FUNCTAB" "IGNORECASE" "LINT" "NF" "NR" "OFMT" "OFS" "ORS" "PREC" "PROCINFO" "RLENGTH" "ROUNDMODE" "RS" "RSTART" "RT" "SUBSEP" - "SYNTAB" "TEXTDOMAIN") t) "\\>") + "SYMTAB" "TEXTDOMAIN") t) "\\>") 'font-lock-variable-name-face) ;; Special file names. (acm, 2002/7/22) commit 2e9777512a0cd2fb2e60706d6908247496faeeec Author: Yuan Fu Date: Sat Jul 6 14:07:39 2024 -0700 Add a heuristic for type font-lock in rust-ts-mode (bug#69625) * lisp/progmodes/rust-ts-mode.el: (rust-ts-mode--font-lock-settings): Add rule. diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index baf0e1ec013..cdbf381d023 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -267,7 +267,11 @@ to be checked as its standard input." eos) @font-lock-type-face)) ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) - ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))) + ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope)) + ;; Sometimes the parser can't determine if an identifier is a type, + ;; so we use this heuristic. See bug#69625 for the full discussion. + ((identifier) @font-lock-type-face + (:match ,(rx bos upper) @font-lock-type-face))) :language 'rust :feature 'property commit 9625e4af9946436cea6ba3f41f6c384634bcc999 Author: JD Smith <93749+jdtsmith@users.noreply.github.com> Date: Sat Jul 6 09:22:33 2024 -0400 Fix formatting of tables with thead/tfoot but no tbody Correctly handle formatting of tables containing thead and/or tfoot, but without any tbody, to prevent including thead/tfoot content twice within the table's derived body. * lisp/net/shr.el (shr--fix-tbody): Omit 'thead' and 'tfoot' from implicit body. (Bug#71685) * test/lisp/net/shr-resources/table.html: * test/lisp/net/shr-resources/table.txt: New tests for table rendering. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 3dadcb9a09b..fb72ea6aa67 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -2261,8 +2261,9 @@ See `outline-search-function' for BOUND, MOVE, BACKWARD and LOOKING-AT." (defun shr--fix-tbody (tbody) (nconc (list 'tbody (dom-attributes tbody)) (cl-loop for child in (dom-children tbody) - collect (if (or (stringp child) - (not (eq (dom-tag child) 'tr))) + for tag = (and (not (stringp child)) (dom-tag child)) + unless (or (eq tag 'thead) (eq tag 'tfoot)) + collect (if (not (eq tag 'tr)) (list 'tr nil (list 'td nil child)) child)))) diff --git a/test/lisp/net/shr-resources/table.html b/test/lisp/net/shr-resources/table.html new file mode 100644 index 00000000000..c5e8875ac91 --- /dev/null +++ b/test/lisp/net/shr-resources/table.html @@ -0,0 +1,7 @@ + + + + +5678 + +
AB
12
34
AB
diff --git a/test/lisp/net/shr-resources/table.txt b/test/lisp/net/shr-resources/table.txt new file mode 100644 index 00000000000..70939effb63 --- /dev/null +++ b/test/lisp/net/shr-resources/table.txt @@ -0,0 +1,5 @@ + A B + 1 2 + 3 4 + 5678 + A B commit 83234cc1dbbe19450d2fc8cc27509ee4b05c4877 Author: Stefan Monnier Date: Thu Jun 27 15:36:28 2024 -0400 (buf_bytepos_to_charpos): Fix mixup introduced in commit b300052fb4ef Backport of commit 1b595b4598e7 since it turns out this "minor typo" had disastrous consequences in pathological cases and explains some of the problems seen in bug#71644 and bug#63040. * src/marker.c (buf_bytepos_to_charpos): Don't compare byte-positions with char-positions. diff --git a/src/marker.c b/src/marker.c index f016bf9c088..9aaa2e7402c 100644 --- a/src/marker.c +++ b/src/marker.c @@ -358,11 +358,11 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) { CONSIDER (tail->bytepos, tail->charpos); - /* If we are down to a range of 50 chars, + /* If we are down to a range of DISTANCE bytes, don't bother checking any other markers; scan the intervening chars directly now. */ - if (best_above - bytepos < distance - || bytepos - best_below < distance) + if (best_above_byte - bytepos < distance + || bytepos - best_below_byte < distance) break; else distance += BYTECHAR_DISTANCE_INCREMENT; commit 48f4c9cbbc1297eeb2299928bd415c891b98d999 Author: Stefan Kangas Date: Sat Jul 6 19:34:28 2024 +0200 ; Reflow "Commentary" in lisp-mnt.el * lisp/emacs-lisp/lisp-mnt.el: Reflow "Commentary" section. diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index f111a77663c..8b0494dc5cb 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -71,8 +71,8 @@ ;; ;; Eric S. Raymond ;; ;; * Maintainer line --- should be a single name/address as in the Author -;; line, or an address only. If there is no maintainer -;; line, the person(s) in the Author field are presumed to be it. +;; line, or an address only. If there is no maintainer line, the person(s) in +;; the Author field are presumed to be it. ;; The idea behind these two fields is to be able to write a Lisp function ;; that does "send mail to the author" without having to mine the name out by ;; hand. Please be careful about surrounding the network address with <> if commit 22155753a464ceb7cd4f3387738e0dbca8acbd19 Author: Eli Zaretskii Date: Sat Jul 6 20:32:49 2024 +0300 ; * lisp/emacs-lisp/comp-run.el (native--compile-async): Improve warning. diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index 17a9ab71f7e..a659d7f68b7 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -447,7 +447,7 @@ bytecode definition was not changed in the meantime)." (append comp-files-queue `((,file . ,load))) added-something t) (display-warning 'native-compiler - (format "No write access for %s skipping." + (format "Cannot write %s; skipping." out-filename))))))) ;; Perhaps nothing passed `native--compile-async-skip-p'? (when (and added-something commit d826240fa56230ef1561d5b4807284ce98a8c6b6 Author: Stefan Kangas Date: Sat Jul 6 17:36:30 2024 +0200 checkdoc: Relax footer line check for recent Emacs * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Don't require a footer line unless 'lm-package-needs-footer-line' returns true. diff --git a/etc/NEWS b/etc/NEWS index 3d2b86cfb6a..ba58fa7b319 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -70,6 +70,26 @@ Advanced" node in the EWW manual. By customizing 'shr-image-zoom-levels', you can change the list of zoom levels that SHR cycles through when calling 'shr-zoom-image'. +** Emacs Lisp mode + +--- +*** Checkdoc no longer warns about missing footer lines in some cases. +Emacs Lisp libraries have traditionally ended with a footer line +(sometimes referred to as "terminating comment"). Their purpose was to +easily detect files that had been truncated in transit on ancient and +less reliable connections: + + ;; some-cool-package.el ends here + +'checkdoc' will no longer warn if that line is missing for packages that +explicitly only support Emacs 30.1 or later, as specified in the +"Package-Requires" header. The reason for keeping the warning for +packages that support earlier versions of Emacs is that package.el in +those versions can't install packages where that line is missing. + +This change affects both 'M-x checkdoc' and the corresponding flymake +backend. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 11d335d811a..a329638ed1c 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2476,21 +2476,30 @@ Code:, and others referenced in the style guide." ;; * Library footer (save-excursion (goto-char (point-max)) - (if (not (re-search-backward - ;; This should match the requirement in - ;; `package-buffer-info'. - (concat "^;;; " (regexp-quote (concat fn fe)) " ends here") - nil t)) - (if (checkdoc-y-or-n-p "No identifiable footer! Add one?") - (progn - (goto-char (point-max)) - (insert "\n(provide '" fn ")\n\n;;; " fn fe " ends here\n")) - (checkdoc-create-error - (format "The footer should be: (provide '%s)\\n;;; %s%s ends here" - fn fn fe) - ;; The buffer may be empty. - (max (point-min) (1- (point-max))) - (point-max))))) + (let* ((footer-line (lm-package-needs-footer-line))) + (if (not (re-search-backward + ;; This should match the requirement in + ;; `package-buffer-info'. + (if footer-line + (concat "^;;; " (regexp-quote (concat fn fe)) " ends here") + (concat "\n(provide '" fn ")\n")) + nil t)) + (if (checkdoc-y-or-n-p (if footer-line + "No identifiable footer! Add one?" + "No `provide' statement! Add one?")) + (progn + (goto-char (point-max)) + (insert (if footer-line + (concat "\n(provide '" fn ")\n\n;;; " fn fe " ends here\n") + (concat "\n(provide '" fn ")\n")))) + (checkdoc-create-error + (if footer-line + (format "The footer should be: (provide '%s)\\n;;; %s%s ends here" + fn fn fe) + (format "The footer should be: (provide '%s)\\n" fn)) + ;; The buffer may be empty. + (max (point-min) (1- (point-max))) + (point-max)))))) err)) ;; The below checks will not return errors if the user says NO commit 3cde0066998bc46a44a38583970d748badb0b850 Author: Stefan Kangas Date: Sat Jul 6 17:09:24 2024 +0200 Make `lm-homepage` into an obsolete alias for 'lm-website' * lisp/emacs-lisp/lisp-mnt.el (lm-homepage): Make into an obsolete function alias for 'lm-website'. diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index e3741242f59..006e0fb4ead 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -557,7 +557,6 @@ absent, return nil." (if (and page (string-match (rx bol "<" (+ nonl) ">" eol) page)) (substring page 1 -1) page))) -(defalias 'lm-homepage #'lm-website) ; for backwards-compatibility ;;; Verification and synopses @@ -688,6 +687,7 @@ Prompts for bug subject TOPIC. Leaves you in a mail buffer." (define-obsolete-function-alias 'lm-code-mark #'lm-code-start "30.1") (define-obsolete-function-alias 'lm-commentary-mark #'lm-commentary-start "30.1") (define-obsolete-function-alias 'lm-history-mark #'lm-history-start "30.1") +(define-obsolete-function-alias 'lm-homepage #'lm-website "31.1") (provide 'lisp-mnt) commit af21ac1665832247605ba4835ce823e87efa4208 Author: Stefan Kangas Date: Sat Jul 6 17:02:34 2024 +0200 Make `lm-verify` obsolete in favor of checkdoc * lisp/emacs-lisp/lisp-mnt.el (lm-verify): Make obsolete in favor of checkdoc. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index bda5150cf07..11d335d811a 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2473,8 +2473,7 @@ Code:, and others referenced in the style guide." (setq err (or - ;; * A footer. Not compartmentalized from lm-verify: too bad. - ;; The following is partially clipped from lm-verify + ;; * Library footer (save-excursion (goto-char (point-max)) (if (not (re-search-backward diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 841f1ce3b9c..e3741242f59 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -576,7 +576,7 @@ says display \"OK\" in temp buffer for files that have no problems. Optional argument VERBOSE specifies verbosity level. Optional argument NON-FSF-OK if non-nil means a non-FSF copyright notice is allowed." - ;; FIXME: Make obsolete in favor of checkdoc? + (declare (obsolete checkdoc "31.1")) (interactive (list nil nil t)) (let* ((ret (and verbose "Ok")) name) commit c302c5fab0c8dee12e7b19925452871ddb09c0b2 Author: Stefan Kangas Date: Sat Jul 6 16:41:33 2024 +0200 Add new function `lm-package-needs-footer-line` * lisp/emacs-lisp/lisp-mnt.el (lm-package-needs-footer-line): Factor out new function... * lisp/emacs-lisp/package.el (package-buffer-info): ...from here. * lisp/emacs-lisp/lisp-mnt.el (lm-verify): Use above new function. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm-tests--lm-package-needs-footer-line/empty-dependencies) (lm-tests--lm-package-needs-footer-line/old-version) (lm-tests--lm-package-needs-footer-line/new-version): New tests. diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index f111a77663c..841f1ce3b9c 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -1,7 +1,6 @@ ;;; lisp-mnt.el --- utility functions for Emacs Lisp maintainers -*- lexical-binding:t -*- -;; Copyright (C) 1992, 1994, 1997, 2000-2024 Free Software Foundation, -;; Inc. +;; Copyright (C) 1992-2024 Free Software Foundation, Inc. ;; Author: Eric S. Raymond ;; Maintainer: emacs-devel@gnu.org @@ -106,8 +105,10 @@ ;; * Code line --- exists so Lisp can know where commentary and/or ;; change-log sections end. ;; -;; * Footer line --- marks end-of-file so it can be distinguished from -;; an expanded formfeed or the results of truncation. +;; * Footer line --- marks end-of-file so it can be distinguished +;; from an expanded formfeed or the results of truncation. This is +;; required for a package to be installable by package.el in Emacs 29.1 +;; or earlier, but is optional in later versions. ;;; Code: @@ -467,6 +468,29 @@ package version (a string)." (lm--prepare-package-dependencies (package-read-from-string (mapconcat #'identity require-lines " ")))))) +(defun lm-package-needs-footer-line (&optional file) + "Return non-nil if package in current buffer needs a footer line. + +Footer lines (sometimes referred to as \"terminating comments\") look +like this: + + ;;; some-cool-package.el ends here + +Such lines are required for a package to be installable by package.el in +Emacs 29.1 or earlier, but are optional in later versions. If the +package depends on a version of Emacs where package.el requires such +comments, or if no version requirement is specified, return non-nil. + +If optional argument FILE is non-nil, use that file instead of the +current buffer." + (lm-with-file file + ;; Starting in Emacs 30.1, avoid warning if the minimum Emacs + ;; version is specified as 30.1 or later. + (let ((min-emacs (cadar (seq-filter (lambda (x) (eq (car x) 'emacs)) + (lm-package-requires))))) + (or (null min-emacs) + (version< min-emacs "30.1"))))) + (defun lm-keywords (&optional file) "Return the keywords given in file FILE, or current buffer if FILE is nil. The return is a `downcase'-ed string, or nil if no keywords @@ -593,11 +617,12 @@ copyright notice is allowed." ((not (lm-code-start)) "Can't find a `Code' section marker") ((progn - (goto-char (point-max)) - (not - (re-search-backward - (rx bol ";;; " (regexp name) " ends here") - nil t))) + (when (lm-package-needs-footer-line) + (goto-char (point-max)) + (not + (re-search-backward + (rx bol ";;; " (regexp name) " ends here") + nil t)))) "Can't find the footer line") ((not (and (lm-copyright-mark) (lm-crack-copyright))) "Can't find a valid copyright notice") diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fac824d44a4..b0ba886df74 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1174,23 +1174,18 @@ boundaries." (let ((file-name (match-string-no-properties 1)) (desc (match-string-no-properties 2)) (start (line-beginning-position))) + (require 'lisp-mnt) ;; This warning was added in Emacs 27.1, and should be removed at ;; the earliest in version 31.1. The idea is to phase out the ;; requirement for a "footer line" without unduly impacting users ;; on earlier Emacs versions. See Bug#26490 for more details. (unless (search-forward (concat ";;; " file-name ".el ends here") nil 'move) - ;; Starting in Emacs 30.1, avoid warning if the minimum Emacs - ;; version is specified as 30.1 or later. - (let ((min-emacs (cadar (seq-filter (lambda (x) (eq (car x) 'emacs)) - (lm-package-requires))))) - (when (or (null min-emacs) - (version< min-emacs "30.1")) - (lwarn '(package package-format) :warning - "Package lacks a terminating comment")))) + (when (lm-package-needs-footer-line) + (lwarn '(package package-format) :warning + "Package lacks a terminating comment"))) ;; Try to include a trailing newline. (forward-line) (narrow-to-region start (point)) - (require 'lisp-mnt) ;; Use some headers we've invented to drive the process. (let* (;; Prefer Package-Version; if defined, the package author ;; probably wants us to use it. Otherwise try Version. diff --git a/test/lisp/emacs-lisp/lisp-mnt-tests.el b/test/lisp/emacs-lisp/lisp-mnt-tests.el index e32480ada46..147062cba29 100644 --- a/test/lisp/emacs-lisp/lisp-mnt-tests.el +++ b/test/lisp/emacs-lisp/lisp-mnt-tests.el @@ -49,6 +49,19 @@ (project "0.9.8") (xref "1.6.2") (eldoc "1.14.0") (seq "2.23") (external-completion "0.1")))))) +(ert-deftest lm-tests--lm-package-needs-footer-line/empty-dependencies () + (with-temp-buffer + (should (lm-package-needs-footer-line)))) + +(ert-deftest lm-tests--lm-package-needs-footer-line/old-version () + (with-temp-buffer + (insert ";; Package-Requires: ((emacs \"29.1\"))\n") + (should (lm-package-needs-footer-line)))) + +(ert-deftest lm-tests--lm-package-needs-footer-line/new-version () + (with-temp-buffer + (insert ";; Package-Requires: ((emacs \"30.1\"))\n") + (should (not (lm-package-needs-footer-line))))) (ert-deftest lm--tests-lm-website () (with-temp-buffer commit 235b9e85a672fa1e24ba12a00af62b3307f0d4c0 Author: Stefan Kangas Date: Sat Jul 6 15:19:10 2024 +0200 package-buffer-info: Move 'require' earlier * lisp/emacs-lisp/package.el (package-buffer-info): Move 'require' earlier, before it is needed. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fac824d44a4..53d04b0d5ec 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1174,6 +1174,7 @@ boundaries." (let ((file-name (match-string-no-properties 1)) (desc (match-string-no-properties 2)) (start (line-beginning-position))) + (require 'lisp-mnt) ;; This warning was added in Emacs 27.1, and should be removed at ;; the earliest in version 31.1. The idea is to phase out the ;; requirement for a "footer line" without unduly impacting users @@ -1190,7 +1191,6 @@ boundaries." ;; Try to include a trailing newline. (forward-line) (narrow-to-region start (point)) - (require 'lisp-mnt) ;; Use some headers we've invented to drive the process. (let* (;; Prefer Package-Version; if defined, the package author ;; probably wants us to use it. Otherwise try Version. commit 38ce85c547cac4023260be37f1b60af2c1f22d20 Merge: 7f631a3e2ac f910514721e Author: Eli Zaretskii Date: Sat Jul 6 07:42:51 2024 -0400 Merge from origin/emacs-30 f910514721e Fix treesit range rule for jsdoc de3fa00a614 Fix documentation of 'balance-windows' c986387c79f nnatom: Ensure some parsed values are one line 2fb6a98ecfa nnfeed: (Mostly) fix group descriptions 74b82e6802e Eglot: support deprecated MarkedString (bug#71353) a6a588ccf10 ; * doc/lispref/strings.texi (Creating Strings): Followup... a3e57a29bec ; Fix doc string of 'string-fill' 1b5cf29431a Fix returning to original TTY frame after 'rmail-reply' 814710067f0 Improve warnings from native compiler cefec59df7b Document adding package dependency on Emacs version d190cb0e886 Fix file-name detection in Dired under -F commit f910514721e2eac1535d51ccebf7f136be3ba57f Author: Vincenzo Pupillo Date: Thu Jun 27 16:13:58 2024 +0200 Fix treesit range rule for jsdoc The parser for jsdoc is local, so it is necessary for the range rule to take this into account. * lisp/progmodes/js.el (js-ts-mode): Add ':local' keyword. (js-ts-language-at-point): Remove 'js-ts-language-at-point'. (Bug#71776) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 529b31669ed..31e8f2924ac 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3636,10 +3636,16 @@ Check if a node type is available, then return the right indent rules." :override t '((escape_sequence) @font-lock-escape-face) + ;; "document" should be first, to avoid overlap. + :language 'jsdoc + :override t + :feature 'document + '((document) @font-lock-doc-face) + :language 'jsdoc :override t :feature 'keyword - '((tag_name) @font-lock-keyword-face) + '((tag_name) @font-lock-constant-face) :language 'jsdoc :override t @@ -3649,17 +3655,12 @@ Check if a node type is available, then return the right indent rules." :language 'jsdoc :override t :feature 'property - '((type) @font-lock-variable-use-face) + '((type) @font-lock-type-face) :language 'jsdoc :override t :feature 'definition - '((identifier) @font-lock-variable-name-face) - - :language 'jsdoc - :override t - :feature 'comment - '((description) @font-lock-comment-face)) + '((identifier) @font-lock-variable-name-face)) "Tree-sitter font-lock settings.") (defun js--fontify-template-string (node override start end &rest _) @@ -3933,7 +3934,7 @@ See `treesit-thing-settings' for more information.") ;; Fontification. (setq-local treesit-font-lock-settings js--treesit-font-lock-settings) (setq-local treesit-font-lock-feature-list - '(( comment definition) + '(( comment document definition) ( keyword string) ( assignment constant escape-sequence jsx number pattern string-interpolation) @@ -3944,10 +3945,9 @@ See `treesit-thing-settings' for more information.") (treesit-range-rules :embed 'jsdoc :host 'javascript + :local t `(((comment) @capture (:match ,js--treesit-jsdoc-beginning-regexp @capture)))))) - (setq-local treesit-language-at-point-function #'js-ts-language-at-point) - ;; Imenu (setq-local treesit-simple-imenu-settings `(("Function" "\\`function_declaration\\'" nil nil) @@ -3989,17 +3989,6 @@ See `treesit-thing-settings' for more information.") (put-text-property ns (1+ ns) 'syntax-table syntax) (put-text-property (1- ne) ne 'syntax-table syntax))))) -(defun js-ts-language-at-point (point) - "Return the language at POINT." - (let ((node (treesit-node-at point 'javascript))) - (if (and (treesit-ready-p 'jsdoc) - (equal (treesit-node-type node) "comment") - (string-match-p - js--treesit-jsdoc-beginning-regexp - (treesit-node-text node))) - 'jsdoc - 'javascript))) - ;;;###autoload (define-derived-mode js-json-mode prog-mode "JSON" :syntax-table js-mode-syntax-table commit de3fa00a6140b19e6d62a47be721b5ca9b58438b Author: Eli Zaretskii Date: Sat Jul 6 13:44:57 2024 +0300 Fix documentation of 'balance-windows' * lisp/window.el (balance-windows): Doc fix. * doc/emacs/windows.texi (Change Window): Make the description of 'balance-windows' more accurate. (Bug#71915) diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 5ad6850fed9..60599d42020 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -300,7 +300,8 @@ Make selected window narrower (@code{shrink-window-horizontally}). Shrink this window if its buffer doesn't need so many lines (@code{shrink-window-if-larger-than-buffer}). @item C-x + -Make all windows the same height (@code{balance-windows}). +Balance the sizes of all the windows of the selected frame +(@code{balance-windows}). @end table @kindex C-x 0 @@ -373,8 +374,11 @@ lines to other windows in the frame. @kindex C-x + @findex balance-windows - You can also use @kbd{C-x +} (@code{balance-windows}) to even out the -heights of all the windows in the selected frame. + You can also use @kbd{C-x +} (@code{balance-windows}) to balance the +sizes of all the windows of the selected frame (with the exception of +the minibuffer window, @pxref{Minibuffer}). This command makes each +horizontal pair of adjacent windows the same height, and each vertical +pair of adjacent windows the same width. @node Displaying Buffers @section Displaying a Buffer in a Window diff --git a/lisp/window.el b/lisp/window.el index 0dc9421fde7..60040f18bc7 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5888,12 +5888,13 @@ is non-nil)." (setq sub (window-right sub)))))))) (defun balance-windows (&optional window-or-frame) - "Balance the sizes of windows of WINDOW-OR-FRAME. -WINDOW-OR-FRAME is optional and defaults to the selected frame. + "Balance the sizes of windows shown on the selected frame. +When called from Lisp, WINDOW-OR-FRAME is optional and defaults to the +selected frame. If WINDOW-OR-FRAME denotes a frame, balance the sizes of all -windows of that frame. If WINDOW-OR-FRAME denotes a window, -recursively balance the sizes of all child windows of that -window." +windows of that frame's root window (which excludes the mini-window). +If WINDOW-OR-FRAME denotes a window, recursively balance the sizes +of all child windows of that window." (interactive) (let* ((window (cond commit c986387c79fbae8a99352cad0113bec0b5cb11a5 Author: Daniel Semyonov Date: Tue Jul 2 02:15:24 2024 +0300 nnatom: Ensure some parsed values are one line * lisp/gnus/nnatom.el (nnatom--dom-line): New function. (nnatom--read-title, nnatom--read-description) (nnatom--read-article-or-group-authors, nnatom--read-subject) (nnatom--read-id, nnatom--read-publish, nnatom--read-update) (nnatom--read-links): Read text using `nnatom--dom-line'. (Bug#71889) diff --git a/lisp/gnus/nnatom.el b/lisp/gnus/nnatom.el index 13286159784..f6885abb634 100644 --- a/lisp/gnus/nnatom.el +++ b/lisp/gnus/nnatom.el @@ -108,15 +108,19 @@ (defvoo nnatom-read-article-function #'nnatom--read-article nil nnfeed-read-article-function) +(defun nnatom--dom-line (node) + "Return NODE's text as a single, whitespace-trimmed line." + (string-trim (replace-regexp-in-string "[\r\n]+" " " (dom-text node) t))) + (defun nnatom--read-title (group) "Return the title of GROUP, or nil." - (dom-text (dom-child-by-tag group 'title))) + (nnatom--dom-line (dom-child-by-tag group 'title))) (defvoo nnatom-read-title-function #'nnatom--read-title nil nnfeed-read-title-function) (defun nnatom--read-description (group) "Return the description of GROUP, or nil." - (dom-text (dom-child-by-tag group 'subtitle))) + (nnatom--dom-line (dom-child-by-tag group 'subtitle))) (defvoo nnatom-read-description-function #'nnatom--read-description nil nnfeed-read-description-function) @@ -125,9 +129,9 @@ (when-let ((a (mapconcat (lambda (author) - (let* ((name (dom-text (dom-child-by-tag author 'name))) + (let* ((name (nnatom--dom-line (dom-child-by-tag author 'name))) (name (unless (string-blank-p name) name)) - (email (dom-text (dom-child-by-tag author 'email))) + (email (nnatom--dom-line (dom-child-by-tag author 'email))) (email (unless (string-blank-p email) email))) (or (and name email (format "%s <%s>" name email)) name email))) (dom-children (dom-child-by-tag article-or-group 'authors)) @@ -142,7 +146,7 @@ (defun nnatom--read-subject (article) "Return the subject of ARTICLE, or nil." - (dom-text (dom-child-by-tag article 'title))) + (nnatom--dom-line (dom-child-by-tag article 'title))) (defvoo nnatom-read-subject-function #'nnatom--read-subject nil nnfeed-read-subject-function) @@ -150,7 +154,7 @@ "Return the ID of ARTICLE. If the ARTICLE doesn't contain an ID but it does contain a subject, return the subject. Otherwise, return nil." - (or (dom-text (dom-child-by-tag article 'id)) + (or (nnatom--dom-line (dom-child-by-tag article 'id)) (nnatom--read-subject article))) (defvoo nnatom-read-id-function #'nnatom--read-id nil nnfeed-read-id-function) @@ -158,14 +162,14 @@ return the subject. Otherwise, return nil." (defun nnatom--read-publish (article) "Return the date and time ARTICLE was published, or nil." (when-let (d (dom-child-by-tag article 'published)) - (date-to-time (dom-text d)))) + (date-to-time (nnatom--dom-line d)))) (defvoo nnatom-read-publish-date-function #'nnatom--read-publish nil nnfeed-read-publish-date-function) (defun nnatom--read-update (article) "Return the date and time of the last update to ARTICLE, or nil." (when-let (d (dom-child-by-tag article 'updated)) - (date-to-time (dom-text d)))) + (date-to-time (nnatom--dom-line d)))) (defvoo nnatom-read-update-date-function #'nnatom--read-update nil nnfeed-read-update-date-function) @@ -185,13 +189,13 @@ return the subject. Otherwise, return nil." (("text/html") . ,(format "[%s] " src label))))) (when-let (((or (eq l 'author) (eq l 'contributor))) - (name (dom-text (dom-child-by-tag link 'name))) + (name (nnatom--dom-line (dom-child-by-tag link 'name))) (name (if (string-blank-p name) (concat "Author" (and (< 1 (cl-incf aut)) (format " %s" aut))) name)) - (uri (dom-text (dom-child-by-tag link 'uri))) + (uri (nnatom--dom-line (dom-child-by-tag link 'uri))) ((not (string-blank-p uri)))) `(((("text/plain") . ,(format "%s: %s\n" name uri)) (("text/html") . ,(format "[%s] " commit 2fb6a98ecfa1579273a640e923f2e52f75e1f7ad Author: Daniel Semyonov Date: Tue Jul 2 01:42:26 2024 +0300 nnfeed: (Mostly) fix group descriptions * lisp/gnus/nnfeed.el (nnfeed--group-description): New function. (nnfeed-request-group-description, nnfeed-request-list-newsgroups): Use `nnfeed--group-description' and always return t if group data is found. (Bug#71888) diff --git a/lisp/gnus/nnfeed.el b/lisp/gnus/nnfeed.el index d6963b2e929..2d33d4c813b 100644 --- a/lisp/gnus/nnfeed.el +++ b/lisp/gnus/nnfeed.el @@ -630,12 +630,21 @@ Only HEADERS of a type included in MIME are considered." (deffoo nnfeed-request-type (_group &optional _article) 'unknown) +;; FIXME: Works incorrectly when a group name contains spaces as Gnus actually +;; separates the group name from the description with either a tab or a space. +(defun nnfeed--group-description (name group) + "Return a description line for a GROUP called NAME." + (when-let ((desc (aref group 5)) + ((not (string-blank-p desc)))) + (insert name "\t" desc "\n"))) + (deffoo nnfeed-request-group-description (group &optional server) (when-let ((server (or server (nnfeed--current-server-no-prefix))) (g (nnfeed--group-data group server))) (with-current-buffer nntp-server-buffer (erase-buffer) - (insert group " " (aref g 5) "\n")))) + (nnfeed--group-description group g) + t))) (deffoo nnfeed-request-list-newsgroups (&optional server) (when-let ((server (or server (nnfeed--current-server-no-prefix))) @@ -643,9 +652,8 @@ Only HEADERS of a type included in MIME are considered." ((hash-table-p s))) (with-current-buffer nntp-server-buffer (erase-buffer) - (maphash (lambda (group g) - (insert group " " (aref g 5) "\n")) - s)))) + (maphash #'nnfeed--group-description s) + t))) (deffoo nnfeed-request-rename-group (group new-name &optional server) (when-let ((server (or server (nnfeed--current-server-no-prefix))) commit 74b82e6802e65ff0ec1ac3bbc680b5db9a7f1c89 Author: João Távora Date: Sat Jul 6 10:17:42 2024 +0100 Eglot: support deprecated MarkedString (bug#71353) * lisp/progmodes/eglot.el: Make a markdown code block if MarkedString passed. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index bb6b0281d9f..574e8571cc8 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1871,15 +1871,25 @@ Doubles as an indicator of snippet support." (unless (bound-and-true-p yas-minor-mode) (yas-minor-mode 1)) (apply #'yas-expand-snippet args))))) -(defun eglot--format-markup (markup) - "Format MARKUP according to LSP's spec." - (pcase-let ((`(,string ,mode) - (if (stringp markup) (list markup 'gfm-view-mode) - (list (plist-get markup :value) - (pcase (plist-get markup :kind) - ("markdown" 'gfm-view-mode) - ("plaintext" 'text-mode) - (_ major-mode)))))) + (defun eglot--format-markup (markup) + "Format MARKUP according to LSP's spec. +MARKUP is either an LSP MarkedString or MarkupContent object." + (let (string mode language) + (cond ((stringp markup) + (setq string markup + mode 'gfm-view-mode)) + ((setq language (plist-get markup :language)) + ;; Deprecated MarkedString + (setq string (concat "```" language "\n" + (plist-get markup :value) "\n```") + mode 'gfm-view-mode)) + (t + ;; MarkupContent + (setq string (plist-get markup :value) + mode (pcase (plist-get markup :kind) + ("markdown" 'gfm-view-mode) + ("plaintext" 'text-mode) + (_ major-mode))))) (with-temp-buffer (setq-local markdown-fontify-code-blocks-natively t) (insert string) commit a6a588ccf10bacb0c196f695dee9c7333af7e776 Author: Eli Zaretskii Date: Sat Jul 6 11:36:44 2024 +0300 ; * doc/lispref/strings.texi (Creating Strings): Followup to last change. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 6e5c3521135..e290e2e7a6b 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -406,11 +406,12 @@ that matches @var{trim-right} from @var{string}. Both regexps default to @samp{[ \t\n\r]+}. @end defun -@defun string-fill string length -Attempt to Word-wrap @var{string} so that no lines are longer than -@var{length}. Filling is done on whitespace boundaries only. If -there are individual words that are longer than @var{length}, these -will not be shortened. +@defun string-fill string width +Attempt to Word-wrap @var{string} so that it displays with lines no +wider than @var{width}. Filling is done on whitespace boundaries only. +If there are individual words that are longer than @var{width}, these +will not be shortened, and therefore @var{string} might be shown with +lines wider than @var{width} in that case. @end defun @defun string-limit string length &optional end coding-system commit a3e57a29becdc028d5a5059c35b5f7be7c1510e4 Author: Eli Zaretskii Date: Sat Jul 6 11:28:39 2024 +0300 ; Fix doc string of 'string-fill' * lisp/emacs-lisp/subr-x.el (string-fill): Rename LENGTH to WIDTH and update the doc string accordingly. (Bug#71856) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index e62a08b7a8b..e725c490aba 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -159,16 +159,16 @@ removed." blank blank))) ;;;###autoload -(defun string-fill (string length) - "Try to word-wrap STRING so that no lines are longer than LENGTH. -Wrapping is done where there is whitespace. If there are -individual words in STRING that are longer than LENGTH, the -result will have lines that are longer than LENGTH." +(defun string-fill (string width) + "Try to word-wrap STRING so that it displays with lines no wider than WIDTH. +STRING is wrapped where there is whitespace in it. If there are +individual words in STRING that are wider than WIDTH, the result +will have lines that are wider than WIDTH." (declare (important-return-value t)) (with-temp-buffer (insert string) (goto-char (point-min)) - (let ((fill-column length) + (let ((fill-column width) (adaptive-fill-mode nil)) (fill-region (point-min) (point-max))) (buffer-string))) commit 1b5cf29431a0727329d5e223be68ea2499d872ea Author: Eli Zaretskii Date: Sat Jul 6 10:32:39 2024 +0300 Fix returning to original TTY frame after 'rmail-reply' * lisp/mail/rmail.el (rmail-start-mail): Record the frame from which an Rmail command, such as 'rmail-mail' or 'rmail-reply', was invoked. (rmail--find-orig-rmail-frame): New function. (rmail-mail-return): Use 'rmail--find-orig-rmail-frame' to find the original frame, and make it the top frame on its TTY terminal. (Bug#69738) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 2b119c7a5c7..f22161f766d 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3686,7 +3686,12 @@ If BUFFER is not swapped, yank out of its message viewer buffer." other-headers) (let ((switch-function (cond (same-window nil) - (rmail-mail-new-frame 'switch-to-buffer-other-frame) + (rmail-mail-new-frame + (progn + ;; Record the frame from which we invoked this command. + (modify-frame-parameters (selected-frame) + '((rmail-orig-frame . t))) + 'switch-to-buffer-other-frame)) (t 'switch-to-buffer-other-window))) yank-action) (if replybuffer @@ -3716,6 +3721,11 @@ If BUFFER is not swapped, yank out of its message viewer buffer." (modify-frame-parameters (selected-frame) '((mail-dedicated-frame . t))))))) +(defun rmail--find-orig-rmail-frame () + (car (filtered-frame-list + (lambda (frame) + (eq (frame-parameter frame 'rmail-orig-frame) t))))) + (defun rmail-mail-return (&optional newbuf) "Try to return to Rmail from the mail window. If optional argument NEWBUF is specified, it is the Rmail buffer @@ -3757,9 +3767,19 @@ to switch to." ;; probably wants to delete it now. ((display-multi-frame-p) (delete-frame)) - ;; The previous frame is where normally they have the Rmail buffer - ;; displayed. - (t (other-frame -1)))) + (t + ;; Try to find the original Rmail frame and make it the top frame. + (let ((fr (selected-frame)) + (orig-fr (rmail--find-orig-rmail-frame))) + (if orig-fr + (progn + (modify-frame-parameters orig-fr '((rmail-orig-frame . nil))) + (select-frame-set-input-focus orig-fr)) + ;; If we cannot find the frame from which we started, punt, and + ;; display the previous frame, which is where they normally have + ;; the Rmail buffer displayed. + (other-frame -1)) + (delete-frame fr))))) (defun rmail-mail () "Send mail in another window. commit 814710067f0558e308c7020b22e455fe0ece7878 Author: Eli Zaretskii Date: Fri Jul 5 22:00:08 2024 +0300 Improve warnings from native compiler * src/comp.c (syms_of_comp) : Rename from 'comp'. * src/lread.c (maybe_swap_for_eln): * lisp/emacs-lisp/comp.el (comp--fwprop): * lisp/emacs-lisp/comp-run.el (comp--accept-and-process-async-output, native--compile-async): Adjust to the new symbol. diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index 8e08eca7442..17a9ab71f7e 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -195,7 +195,7 @@ processes from `comp-async-compilations'" (if native-comp-async-report-warnings-errors (let ((warning-suppress-types (if (eq native-comp-async-report-warnings-errors 'silent) - (cons '(comp) warning-suppress-types) + (cons '(native-compiler) warning-suppress-types) warning-suppress-types)) (regexp (if (eq native-comp-async-warnings-errors-kind 'all) "^.*?\\(?:Error\\|Warning\\): .*$" @@ -211,7 +211,7 @@ processes from `comp-async-compilations'" (accept-process-output process) (goto-char (or comp-last-scanned-async-output (point-min))) (while (re-search-forward regexp nil t) - (display-warning 'comp (match-string 0))) + (display-warning 'native-compiler (match-string 0))) (setq comp-last-scanned-async-output (point-max))))) (accept-process-output process))) @@ -446,7 +446,7 @@ bytecode definition was not changed in the meantime)." (setf comp-files-queue (append comp-files-queue `((,file . ,load))) added-something t) - (display-warning 'comp + (display-warning 'native-compiler (format "No write access for %s skipping." out-filename))))))) ;; Perhaps nothing passed `native--compile-async-skip-p'? diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 6c56fd78859..2844e89c661 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2792,7 +2792,7 @@ Return t if something was changed." finally (when (= i 100) (display-warning - 'comp + 'native-compiler (format "fwprop pass jammed into %s?" (comp-func-name f)))) (comp-log (format "Propagation run %d times\n" i) 2)) (comp--rewrite-non-locals) diff --git a/src/comp.c b/src/comp.c index df7fa3a5199..3b372145d07 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5756,7 +5756,7 @@ natively-compiled one. */); DEFSYM (Qd_ephemeral, "d-ephemeral"); /* Others. */ - DEFSYM (Qcomp, "comp"); + DEFSYM (Qnative_compiler, "native-compiler"); DEFSYM (Qfixnum, "fixnum"); DEFSYM (Qscratch, "scratch"); DEFSYM (Qlate, "late"); diff --git a/src/lread.c b/src/lread.c index 1bc5b0c993d..3feb27eda46 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1887,7 +1887,7 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, return; Vdelayed_warnings_list = Fcons (list2 - (Qcomp, + (Qnative_compiler, CALLN (Fformat, build_string ("Cannot look up .eln file " "for %s because no source " commit cefec59df7b24887496dafc32eae69083dfa60f2 Author: Stefan Kangas Date: Fri Jul 5 13:58:07 2024 +0200 Document adding package dependency on Emacs version * doc/lispref/package.texi (Simple Packages, Multi-file Packages): Document how to make a package depend on a specific version of Emacs. diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi index 421e64dd5d1..40c550b56b4 100644 --- a/doc/lispref/package.texi +++ b/doc/lispref/package.texi @@ -192,10 +192,11 @@ used as the long description. (When displaying the description, Emacs omits the @samp{;;; Commentary:} line, as well as the leading comment characters in the commentary itself.) - If the file has a @samp{Package-Requires} header, that is used as -the package dependencies. In the above example, the package depends -on the @samp{flange} package, version 1.0 or higher. @xref{Library -Headers}, for a description of the @samp{Package-Requires} header. If + If the file has a @samp{Package-Requires} header, that is used as the +package dependencies. In the above example, the package depends on the +@samp{flange} package, version 1.0 or higher. @xref{Library Headers}, +for a description of the @samp{Package-Requires} header. To depend on a +specific version of Emacs, specify @samp{emacs} as the package name. If the header is omitted, the package has no dependencies. The @samp{Keywords} and @samp{URL} headers are optional, but recommended. @@ -247,9 +248,10 @@ is the brief description. @var{requirements} is a list of required packages and their versions. Each element in this list should have the form @code{(@var{dep-name} -@var{dep-version})}, where @var{dep-name} is a symbol whose name is -the dependency's package name, and @var{dep-version} is the -dependency's version (a string). +@var{dep-version})}, where @var{dep-name} is a symbol whose name is the +dependency's package name, and @var{dep-version} is the dependency's +version (a string). The spacial value @samp{emacs} means that the +package depends on the given version of Emacs. @end defun If the content directory contains a file named @file{README}, this commit d190cb0e886f3d748ddbb8bf915c19149d00c0c4 Author: Eli Zaretskii Date: Fri Jul 5 13:58:11 2024 +0300 Fix file-name detection in Dired under -F * lisp/files.el (insert-directory-clean): Support all the symbols appended to file names by the -F/--classify option of 'ls'. See https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg00366.html for the details. diff --git a/lisp/files.el b/lisp/files.el index 042b8e2d515..c518273bd29 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8087,8 +8087,8 @@ Valid wildcards are `*', `?', `[abc]' and `[a-z]'." (end (insert-directory-adj-pos (+ beg (read (current-buffer))) error-lines))) - (if (memq (char-after end) '(?\n ?\s)) - ;; End is followed by \n or by " -> ". + (if (memq (char-after end) '(?\n ?\s ?/ ?* ?@ ?% ?= ?|)) + ;; End is followed by \n or by output of -F. (put-text-property start end 'dired-filename t) ;; It seems that we can't trust ls's output as to ;; byte positions of filenames.