commit adc8344e759b0aa3c919df9bdff1232d89b2e6b4 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri Sep 9 09:54:01 2022 +0800 Remove long-broken TESTRM interface * src/xrdb.c: [TESTRM]: (fatal, main): Delete functions and code block. They don't work and rely on XLIB_ILLEGAL_ACCESS. diff --git a/src/xrdb.c b/src/xrdb.c index 5ff25dde14..01c9ff5558 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -511,107 +511,3 @@ x_get_string_resource (void *v_rdb, const char *name, const char *class) return NULL; } - -/* Stand-alone test facilities. */ - -#ifdef TESTRM - -typedef char **List; -#define arg_listify(len, list) (list) -#define car(list) (*(list)) -#define cdr(list) (list + 1) -#define NIL(list) (! *(list)) -#define free_arglist(list) - -static List -member (char *elt, List list) -{ - List p; - - for (p = list; ! NIL (p); p = cdr (p)) - if (! strcmp (elt, car (p))) - return p; - - return p; -} - -static void -fatal (char *msg, char *prog) -{ - fprintf (stderr, msg, prog); - exit (1); -} - -int -main (int argc, char **argv) -{ - Display *display; - char *displayname, *resource_string, *class, *name; - XrmDatabase xdb; - List arg_list, lp; - - arg_list = arg_listify (argc, argv); - - lp = member ("-d", arg_list); - if (!NIL (lp)) - displayname = car (cdr (lp)); - else - displayname = "localhost:0.0"; - - lp = member ("-xrm", arg_list); - resource_string = NIL (lp) ? 0 : car (cdr (lp)); - - lp = member ("-c", arg_list); - if (! NIL (lp)) - class = car (cdr (lp)); - else - class = "Emacs"; - - lp = member ("-n", arg_list); - if (! NIL (lp)) - name = car (cdr (lp)); - else - name = "emacs"; - - free_arglist (arg_list); - - if (!(display = XOpenDisplay (displayname))) - fatal ("Can't open display '%s'\n", XDisplayName (displayname)); - - xdb = x_load_resources (display, resource_string, name, class); - - /* In a real program, you'd want to also do this: */ - display->db = xdb; - - while (true) - { - char query_name[90]; - char query_class[90]; - - printf ("Name: "); - fgets (query_name, 90, stdin); - - if (strlen (query_name)) - { - char *value; - - printf ("Class: "); - fgets (query_class, 90, stdin); - - value = x_get_string_resource (&xdb, query_name, query_class); - - if (value != NULL) - printf ("\t%s(%s): %s\n\n", query_name, query_class, value); - else - printf ("\tNo Value.\n\n"); - } - else - break; - } - printf ("\tExit.\n\n"); - - XCloseDisplay (display); - - return 0; -} -#endif /* TESTRM */ commit a8a1595cc36e607049e5bc39b658e085d62d83c9 Author: Stefan Kangas Date: Fri Sep 9 03:38:42 2022 +0200 Prefer defvar-keymap in proced.el * lisp/proced.el (proced-mode-map): Prefer defvar-keymap. diff --git a/lisp/proced.el b/lisp/proced.el index a27638d367..52389beff7 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -445,60 +445,58 @@ Important: the match ends just after the marker.") (,(concat "^[" (char-to-string proced-marker-char) "]") ".+" (proced-move-to-goal-column) nil (0 'proced-marked)))) -(defvar proced-mode-map - (let ((km (make-sparse-keymap))) - ;; moving - (define-key km " " 'next-line) - (define-key km "n" 'next-line) - (define-key km "p" 'previous-line) - (define-key km "\C-n" 'next-line) - (define-key km "\C-p" 'previous-line) - (define-key km "\C-?" 'previous-line) - (define-key km [?\S-\ ] 'previous-line) - (define-key km [down] 'next-line) - (define-key km [up] 'previous-line) - ;; marking - (define-key km "d" 'proced-mark) ; Dired compatibility ("delete") - (define-key km "m" 'proced-mark) - (put 'proced-mark :advertised-binding "m") - (define-key km "u" 'proced-unmark) - (define-key km "\177" 'proced-unmark-backward) - (define-key km "M" 'proced-mark-all) - (define-key km "U" 'proced-unmark-all) - (define-key km "t" 'proced-toggle-marks) - (define-key km "C" 'proced-mark-children) - (define-key km "P" 'proced-mark-parents) - ;; filtering - (define-key km "f" 'proced-filter-interactive) - (define-key km [mouse-2] 'proced-refine) - (define-key km "\C-m" 'proced-refine) - ;; sorting - (define-key km "sc" 'proced-sort-pcpu) - (define-key km "sm" 'proced-sort-pmem) - (define-key km "sp" 'proced-sort-pid) - (define-key km "ss" 'proced-sort-start) - (define-key km "sS" 'proced-sort-interactive) - (define-key km "st" 'proced-sort-time) - (define-key km "su" 'proced-sort-user) - ;; similar to `Buffer-menu-sort-by-column' - (define-key km [header-line mouse-1] 'proced-sort-header) - (define-key km [header-line mouse-2] 'proced-sort-header) - (define-key km "T" 'proced-toggle-tree) - ;; formatting - (define-key km "F" 'proced-format-interactive) - ;; operate - (define-key km "o" 'proced-omit-processes) - (define-key km "x" 'proced-send-signal) ; Dired compatibility - (define-key km "k" 'proced-send-signal) ; kill processes - (define-key km "r" 'proced-renice) ; renice processes - ;; misc - (define-key km "h" 'describe-mode) - (define-key km "?" 'proced-help) - (define-key km [remap undo] 'proced-undo) - (define-key km [remap advertised-undo] 'proced-undo) - ;; Additional keybindings are inherited from `special-mode-map' - km) - "Keymap for Proced commands.") +(defvar-keymap proced-mode-map + :doc "Keymap for Proced commands." + ;; moving + "SPC" #'next-line + "n" #'next-line + "p" #'previous-line + "C-n" #'next-line + "C-p" #'previous-line + "S-SPC" #'previous-line + "" #'next-line + "" #'previous-line + ;; marking + "d" #'proced-mark ; Dired compatibility ("delete") + "m" #'proced-mark + "u" #'proced-unmark + "DEL" #'proced-unmark-backward + "M" #'proced-mark-all + "U" #'proced-unmark-all + "t" #'proced-toggle-marks + "C" #'proced-mark-children + "P" #'proced-mark-parents + ;; filtering + "f" #'proced-filter-interactive + "" #'proced-refine + "RET" #'proced-refine + ;; sorting + "s c" #'proced-sort-pcpu + "s m" #'proced-sort-pmem + "s p" #'proced-sort-pid + "s s" #'proced-sort-start + "s S" #'proced-sort-interactive + "s t" #'proced-sort-time + "s u" #'proced-sort-user + ;; similar to `Buffer-menu-sort-by-column' + " " #'proced-sort-header + " " #'proced-sort-header + "T" #'proced-toggle-tree + ;; formatting + "F" #'proced-format-interactive + ;; operate + "o" #'proced-omit-processes + "x" #'proced-send-signal ; Dired compatibility + "k" #'proced-send-signal ; kill processes + "r" #'proced-renice ; renice processes + ;; misc + "h" #'describe-mode + "?" #'proced-help + " " #'proced-undo + " " #'proced-undo + ;; Additional keybindings are inherited from `special-mode-map' + ) +(put 'proced-mark :advertised-binding "m") (easy-menu-define proced-menu proced-mode-map "Proced Menu." commit 4ea119f7ae17d1cc8d8ce03dae6eba4ff3395d48 Author: Stefan Kangas Date: Fri Sep 9 03:05:00 2022 +0200 Set indent-tabs-mode for lisp-data-mode in .dir-locals.el * .dir-locals.el (lisp-data-mode): Enforce existing indent-tabs-mode policy. diff --git a/.dir-locals.el b/.dir-locals.el index 9882a19f85..d0cbcdfd39 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -28,6 +28,7 @@ (electric-quote-comment . nil) (electric-quote-string . nil) (mode . bug-reference-prog))) + (lisp-data-mode . ((indent-tabs-mode . nil))) (texinfo-mode . ((electric-quote-comment . nil) (electric-quote-string . nil) (mode . bug-reference-prog))) commit 816106b7e6a930d55e723e7c4d9d5f664ecd5520 Author: Stefan Kangas Date: Fri Sep 9 02:32:08 2022 +0200 Display librsvg error when loading bad SVG * src/image.c (svg_load_image): Display the error message from librsvg when parsing a bad SVG image file. * test/manual/image-tests.el (image-tests-load-image/svg-invalid): New test. diff --git a/src/image.c b/src/image.c index f5004c2c4c..549fe30ef7 100644 --- a/src/image.c +++ b/src/image.c @@ -1,6 +1,6 @@ /* Functions for image support on window system. -Copyright (C) 1989, 1992-2022 Free Software Foundation, Inc. +Copyright (C) 1989-2022 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -11491,7 +11491,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, if (!image_create_x_image_and_pixmap (f, img, width, height, 0, &ximg, 0)) { g_object_unref (pixbuf); - return 0; + return false; } init_color_table (); @@ -11536,7 +11536,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, image_put_x_image (f, img, ximg, 0); } - return 1; + return true; rsvg_error: if (rsvg_handle) @@ -11547,11 +11547,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents, if (css && !STRINGP (lcss)) xfree (css); #endif - /* FIXME: Use error->message so the user knows what is the actual - problem with the image. */ - image_error ("Error parsing SVG image"); + image_error ("Error parsing SVG image: %s", + /* The -1 removes an extra newline. */ + make_string (err->message, strlen (err->message) - 1)); g_clear_error (&err); - return 0; + return false; } #endif /* defined (HAVE_RSVG) */ diff --git a/test/manual/image-tests.el b/test/manual/image-tests.el index 2565ff29c9..c726845bd3 100644 --- a/test/manual/image-tests.el +++ b/test/manual/image-tests.el @@ -78,6 +78,17 @@ (image-tests-make-load-image-test 'xbm) (image-tests-make-load-image-test 'xpm) +(ert-deftest image-tests-load-image/svg-invalid () + (with-temp-buffer + (pop-to-buffer (current-buffer)) + (insert (propertize " " + 'display '(image :data + "invalid foo bar" + :type svg))) + (redisplay)) + (with-current-buffer "*Messages*" + (should (string-search "XML parse error" (buffer-string))))) + ;;;; image-test-size commit ef17ba83709794fe0342743397f0e68b90ea1f69 Author: Jim Porter Date: Wed Sep 7 13:58:31 2022 -0700 ; Fix a race condition in an Eshell test * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/sigpipe-exits-process): Use "|&" when creating the pipeline to prevent an extra pipe process from being started. diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el index 52a0d1eeeb..abe363bee0 100644 --- a/test/lisp/eshell/esh-proc-tests.el +++ b/test/lisp/eshell/esh-proc-tests.el @@ -128,8 +128,10 @@ (eshell-match-command-output ;; The first command is like `yes' but slower. This is to prevent ;; it from taxing Emacs's process filter too much and causing a - ;; hang. - (concat "sh -c 'while true; do echo y; sleep 1; done' | " + ;; hang. Note that we use "|&" to connect the processes so that + ;; Emacs doesn't create an extra pipe process for the first "sh" + ;; invocation. + (concat "sh -c 'while true; do echo y; sleep 1; done' |& " "sh -c 'read NAME; echo ${NAME}'") "y\n") (eshell-wait-for-subprocess t) commit 0fab6328dcc46fe8733be5b9de214a2b11b79940 Author: Richard Stallman Date: Thu Sep 8 18:10:12 2022 -0400 Decode base64 attachments revealed by decryption. * lisp/mail/rmail.el (rmail-epa-decode): New function. (rmail-epa-decrypt): Call rmail-epa-decode. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 4bfec22b3a..fed0a2057b 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4614,6 +4614,9 @@ Argument MIME is non-nil if this is a mime message." "> ") (push (rmail-epa-decrypt-1 mime) decrypts)))) + ;; Decode any base64-encoded mime sections. + (rmail-epa-decode) + (when (and decrypts (rmail-buffers-swapped-p)) (when (y-or-n-p "Replace the original message? ") (when (eq major-mode 'rmail-mode) @@ -4678,6 +4681,23 @@ Argument MIME is non-nil if this is a mime message." (unless decrypts (error "Nothing to decrypt"))))) +;; Decode all base64-encoded mime sections, so that this change +;; is made in the Rmail file, not just in the viewing buffer. +(defun rmail-epa-decode () + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "--------------[0-9a-zA-Z]+\n" nil t) + (let ((delim (concat (substring (match-string 0) 0 -1) "--\n"))) + (when (looking-at "\ +Content-Type: text/[a-z]+; charset=UTF-8; format=flowed +Content-Transfer-Encoding: base64\n") + (goto-char (match-end 0)) + (let ((start (point)) + (inhibit-read-only t)) + (search-forward delim) + (forward-line -1) + (base64-decode-region start (point)) + (forward-line 1))))))) ;;;; Desktop support commit bbfb02767d19cdd649a224dff1d958288ab58571 Merge: af49a28f9a 9acb278af5 Author: Stefan Kangas Date: Thu Sep 8 23:35:04 2022 +0200 ; Merge from origin/emacs-28 The following commit was skipped: 9acb278af5 Bump Emacs version to 28.2 commit af49a28f9a9575b1e12599faa26d0a8ff1fc5d4b Merge: 6ab183a0f9 395760dcd3 Author: Stefan Kangas Date: Thu Sep 8 23:35:04 2022 +0200 Merge from origin/emacs-28 395760dcd3 Update ChangeLog and AUTHORS for Emacs 28.2 ddabb03a01 * doc/misc/idlwave.texi (Troubleshooting): Don't say "Emac... 724444f3d5 ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. b96257162d Don't mention very old Emacs versions in docs # Conflicts: # doc/emacs/misc.texi # etc/NEWS commit 6ab183a0f9e9998996b7da86c5f78dbd1f199655 Author: Stefan Monnier Date: Thu Sep 8 16:15:04 2022 -0400 * src/keyboard.c (safe_run_hook_funcall): Fix thinko diff --git a/src/keyboard.c b/src/keyboard.c index f562b71d31..ca51c80da0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1892,7 +1892,7 @@ safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) Lisp_Object *newargs; SAFE_ALLOCA_LISP (newargs, nargs); newargs[0] = hook, newargs[1] = fun; - memcpy (args + 2, newargs + 2, (nargs - 2) * word_size); + memcpy (newargs + 2, args + 2, (nargs - 2) * word_size); internal_condition_case_n (safe_run_hooks_1, nargs, newargs, Qt, safe_run_hooks_error); SAFE_FREE (); commit 15e09908053400815e1b4127fa7a4e1ed9ef6253 Author: Stefan Monnier Date: Thu Sep 8 16:12:01 2022 -0400 * src/keyboard.c (safe_run_hook_funcall): Fix recent regression The mutation of `args` was unsafe because that array was later reused (and assumed unchanged) by the caller. https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00329.html diff --git a/src/keyboard.c b/src/keyboard.c index 77280d08c5..f562b71d31 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1880,13 +1880,22 @@ safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) static Lisp_Object safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) { - eassert (nargs >= 2); /* We need to swap args[0] and args[1] here or in `safe_run_hooks_1`. It's more convenient to do it here. */ + eassert (nargs >= 2); Lisp_Object fun = args[0], hook = args[1]; - args[0] = hook, args[1] = fun; - internal_condition_case_n (safe_run_hooks_1, nargs, args, + /* The `nargs` array cannot be mutated safely here because it is + reused by our caller `run_hook_with_args`. + We could arguably change it temporarily if we set it back + to its original state before returning, but it's too ugly. */ + USE_SAFE_ALLOCA; + Lisp_Object *newargs; + SAFE_ALLOCA_LISP (newargs, nargs); + newargs[0] = hook, newargs[1] = fun; + memcpy (args + 2, newargs + 2, (nargs - 2) * word_size); + internal_condition_case_n (safe_run_hooks_1, nargs, newargs, Qt, safe_run_hooks_error); + SAFE_FREE (); return Qnil; } commit 112cb751419e4830a036ecabd6a799feb5977455 Author: Stefan Monnier Date: Thu Sep 8 16:08:42 2022 -0400 test: Remove redundant "" arg to `mapconcat` * test/src/process-tests.el (process-test-stderr-filter): * test/src/print-tests.el (print-tests-continuous-numbering): * test/src/fns-tests.el (fns-tests-mapconcat): * test/src/data-tests.el (test-bool-vector-to-hex-string): * test/src/casefiddle-tests.el (casefiddle-tests-char-properties) (casefiddle-tests-case-table, casefiddle-tests-casing-character): * test/lisp/tabify-tests.el (tabify-tests--test-changes): * test/lisp/subr-tests.el (subr-tests-bug22027): * test/lisp/sort-tests.el (sort-tests-random-word): * test/lisp/net/hmac-md5-tests.el (hmac-md5-test-encode-string): * test/lisp/md4-tests.el (md4-tests-digest->hex): * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map): * test/lisp/dired-tests.el (dired-test-directory-files): * test/lisp/char-fold-tests.el (char-fold--random-word): * test/lisp/ansi-color-tests.el (ansi-color-incomplete-sequences-test): Remove redundant "" arg to `mapconcat`. diff --git a/test/lisp/ansi-color-tests.el b/test/lisp/ansi-color-tests.el index 1b04e8e9de..f672f33491 100644 --- a/test/lisp/ansi-color-tests.el +++ b/test/lisp/ansi-color-tests.el @@ -135,7 +135,7 @@ strings with `eq', this function compares them with `equal'." (with-temp-buffer (should (equal-including-properties filtered-str - (mapconcat ansi-filt strs "")))) + (mapconcat ansi-filt strs)))) ;; Tests for `ansi-color-filter-region' (with-temp-buffer @@ -156,7 +156,7 @@ strings with `eq', this function compares them with `equal'." (with-temp-buffer (should (ansi-color-tests-equal-props propertized-str - (mapconcat ansi-app strs "")))) + (mapconcat ansi-app strs)))) ;; Tests for `ansi-color-apply-on-region' (with-temp-buffer diff --git a/test/lisp/char-fold-tests.el b/test/lisp/char-fold-tests.el index 749ec0a8d3..e7f5ff6fd2 100644 --- a/test/lisp/char-fold-tests.el +++ b/test/lisp/char-fold-tests.el @@ -26,7 +26,7 @@ (defun char-fold--random-word (n) (mapconcat (lambda (_) (string (+ 9 (random 117)))) - (make-list n nil) "")) + (make-list n nil))) (defun char-fold--ascii-upcase (string) "Like `upcase' but acts on ASCII characters only." diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 9cf0151905..09becc7fe7 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -456,8 +456,8 @@ (dolist (file '(a b c d)) (make-empty-file (expand-file-name (symbol-name file) testdir))) (should (= 6 (length (directory-files testdir)))) - (should (equal "abcd" (mapconcat 'identity (directory-files - testdir nil nod) ""))) + (should (equal "abcd" (mapconcat #'identity (directory-files + testdir nil nod)))) (should (= 2 (length (directory-files testdir nil "[bc]")))) (should (= 3 (length (directory-files testdir nil nod nil 3)))) (dolist (file '(5 4 3 2 1)) diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index 801885c0d4..297e413d85 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -77,7 +77,7 @@ (fn3 (lambda (x _y _z) (string-to-char (format "%S" x))))) (should (equal lst (cl-map 'list fn1 lst))) (should (equal (vconcat lst2) (cl-map 'vector fn2 lst lst2))) - (should (equal (mapconcat (lambda (x) (format "%S" x)) lst "") + (should (equal (mapconcat (lambda (x) (format "%S" x)) lst) (cl-map 'string fn3 lst lst2 lst3))))) (ert-deftest cl-extra-test-maplist () diff --git a/test/lisp/md4-tests.el b/test/lisp/md4-tests.el index fb7df652bc..d1f227cb90 100644 --- a/test/lisp/md4-tests.el +++ b/test/lisp/md4-tests.el @@ -29,7 +29,7 @@ (defun md4-tests-digest->hex (str) "Print digest STR in hexadecimal." - (mapconcat (lambda (x) (format "%02x" x)) str "")) + (mapconcat (lambda (x) (format "%02x" x)) str)) (ert-deftest md4-test-rfc1320 () "Verify the test suite results in RFC 1320. diff --git a/test/lisp/net/hmac-md5-tests.el b/test/lisp/net/hmac-md5-tests.el index ce08dd89d1..09bbb8015e 100644 --- a/test/lisp/net/hmac-md5-tests.el +++ b/test/lisp/net/hmac-md5-tests.el @@ -48,7 +48,7 @@ (should (equal (encode-hex-string (hmac-md5 (decode-hex-string (mapconcat (lambda (c) (concat (list c) "d")) - (make-string 50 ?c) "")) + (make-string 50 ?c))) (decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819"))) "697eaf0aca3a3aea3a75164746ffaa79")) diff --git a/test/lisp/sort-tests.el b/test/lisp/sort-tests.el index 7f49cc38d1..d8d42452ec 100644 --- a/test/lisp/sort-tests.el +++ b/test/lisp/sort-tests.el @@ -28,7 +28,7 @@ (mapconcat (lambda (_) (string (let ((c (random 52))) (+ (if (> c 25) 71 65) c)))) - (make-list n nil) "")) + (make-list n nil))) (defun sort-tests--insert-words-sort-and-compare (words separator function reverse less-predicate) (with-temp-buffer diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 3d03057f56..4310b7291a 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -635,7 +635,7 @@ cf. Bug#25477." (let ((default "foo") res) (cl-letf (((symbol-function 'read-string) (lambda (_prompt &optional _init _hist def _inher-input) def))) - (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default ""))) + (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default))) (should (string= default res))))) (ert-deftest subr-tests--gensym () diff --git a/test/lisp/tabify-tests.el b/test/lisp/tabify-tests.el index eaa3527df0..1c8940c30f 100644 --- a/test/lisp/tabify-tests.el +++ b/test/lisp/tabify-tests.el @@ -27,9 +27,9 @@ (defun tabify-tests--test-changes (fun changes width) (with-temp-buffer (let ((tab-width width)) - (insert (mapconcat #'car changes "")) + (insert (mapconcat #'car changes)) (funcall fun (point-min) (point-max)) - (should (equal (buffer-string) (mapconcat #'cadr changes "")))))) + (should (equal (buffer-string) (mapconcat #'cadr changes)))))) (ert-deftest tabify-tests-untabify () (let ((changes '(("***\n" "***\n") diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el index eb096f2112..652af41729 100644 --- a/test/src/casefiddle-tests.el +++ b/test/src/casefiddle-tests.el @@ -57,7 +57,7 @@ errors))) (setq expected (cdr expected))))) (when errors - (ert-fail (mapconcat (lambda (line) line) (nreverse errors) ""))))) + (ert-fail (mapconcat #'identity (nreverse errors)))))) (defconst casefiddle-tests--characters @@ -98,7 +98,7 @@ errors))) (setq props (cdr props) tabs (cdr tabs) expected (cdr expected))))) (when errors - (mapconcat (lambda (line) line) (nreverse errors) ""))))) + (mapconcat #'identity (nreverse errors)))))) (ert-deftest casefiddle-tests-casing-character () @@ -116,7 +116,7 @@ errors))) (setq funcs (cdr funcs) expected (cdr expected))))) (when errors - (mapconcat (lambda (line) line) (nreverse errors) ""))))) + (mapconcat (lambda (line) line) (nreverse errors)))))) (ert-deftest casefiddle-tests-casing-word () diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 0f84b2fb77..463a894d09 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -200,8 +200,7 @@ this is exactly representable and is greater than nibbles) (setf v (nthcdr 4 v))) (mapconcat (lambda (n) (format "%X" n)) - (nreverse nibbles) - ""))) + (nreverse nibbles)))) (defun test-bool-vector-count-consecutive-tc (desc) "Run a test case for `bool-vector-count-consecutive'. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 4ef428af03..fe8df7097a 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -614,9 +614,9 @@ (should (string= (mapconcat #'identity '("Ä" "ø" "☭" "தமிழ்") "_漢字_") "Ä_漢字_ø_漢字_☭_漢字_தமிழ்")) ;; vector - (should (string= (mapconcat #'identity ["a" "b"] "") "ab")) + (should (string= (mapconcat #'identity ["a" "b"]) "ab")) ;; bool-vector - (should (string= (mapconcat #'identity [nil nil] "") "")) + (should (string= (mapconcat #'identity [nil nil]) "")) (should-error (mapconcat #'identity [nil nil t]) :type 'wrong-type-argument)) diff --git a/test/src/print-tests.el b/test/src/print-tests.el index 5c349342eb..faab196f22 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el @@ -190,7 +190,8 @@ otherwise, use a different charset." "Printing observes `print-continuous-numbering'." ;; cl-print does not support print-continuous-numbering. :expected-result (if (eq (symbol-function #'print-tests--prin1-to-string) - #'cl-prin1-to-string) :failed :passed) + #'cl-prin1-to-string) + :failed :passed) (let* ((x (list 1)) (y "hello") (g (gensym)) @@ -201,7 +202,8 @@ otherwise, use a different charset." (print-number-table nil)) (should (string-match "(#1=(1) #1# #2=\"hello\" #2#)(#3=#:g[[:digit:]]+ #3#)(#1# #2# #3#)#2#$" - (mapconcat #'print-tests--prin1-to-string `((,x ,x ,y ,y) (,g ,g) (,x ,y ,g) ,y) "")))) + (mapconcat #'print-tests--prin1-to-string + `((,x ,x ,y ,y) (,g ,g) (,x ,y ,g) ,y))))) ;; This is the special case for byte-compile-output-docform ;; mentioned in a comment in print_preprocess. When diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 6e1e148332..7d3d9eb72b 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el @@ -134,12 +134,12 @@ process to complete." (should (equal 1 (with-current-buffer stdout-buffer (point-max)))) (should (equal "hello stdout!\n" - (mapconcat #'identity (nreverse stdout-output) ""))) + (mapconcat #'identity (nreverse stdout-output)))) (should stderr-sentinel-called) (should (equal 1 (with-current-buffer stderr-buffer (point-max)))) (should (equal "hello stderr!\n" - (mapconcat #'identity (nreverse stderr-output) "")))))) + (mapconcat #'identity (nreverse stderr-output))))))) (ert-deftest set-process-filter-t () "Test setting process filter to t and back." ;; Bug#36591 commit 048b0fd0db1bae116ca8dfda461eb7de609d8b53 Author: Eli Zaretskii Date: Thu Sep 8 22:50:41 2022 +0300 ; * src/editfns.c (syms_of_editfns) : Doc fix. diff --git a/src/editfns.c b/src/editfns.c index cd5cddee79..b774e79337 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4603,10 +4603,7 @@ it to be non-nil. */); DEFSYM (Qrestrictions_locked, "restrictions-locked"); DEFVAR_LISP ("restrictions-locked", Vrestrictions_locked, - doc: /* If non-nil, restrictions are currently locked. - -This happens when `narrow-to-region', which see, is called from Lisp -with an optional argument LOCK non-nil. */); + doc: /* If non-nil, restrictions are currently locked. */); Vrestrictions_locked = Qnil; Funintern (Qrestrictions_locked, Qnil); commit b83640513808c2a88bb150550e74d3b62bb0f616 Author: Phil Sainty Date: Thu Sep 8 14:53:00 2022 +0200 Add new user option ecomplete-auto-select * lisp/ecomplete.el (ecomplete-auto-select): New user option (bug#53935). (ecomplete-display-matches): Use it. diff --git a/etc/NEWS b/etc/NEWS index 76c66a8e39..bf24665ee4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1213,6 +1213,12 @@ change the input method's translation rules, customize the user option * Changes in Specialized Modes and Packages in Emacs 29.1 +** ecomplete + +--- +*** New user option 'ecomplete-auto-select'. +If non-nil and there's only one matching option, auto-select that. + ** Dired +++ diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el index aa415a3e9e..76438fd25a 100644 --- a/lisp/ecomplete.el +++ b/lisp/ecomplete.el @@ -81,6 +81,11 @@ string that was matched." (function-item :tag "Sort by newness" ecomplete-newness) (function :tag "Other"))) +(defcustom ecomplete-auto-select nil + "Whether `ecomplete-display-matches' should automatically select a sole option." + :type 'boolean + :version "29.1") + ;;; Internal variables. (defvar ecomplete-database nil) @@ -159,10 +164,14 @@ string that was matched." (defun ecomplete-display-matches (type word &optional choose) "Display the top-rated elements TYPE that match WORD. If CHOOSE, allow the user to choose interactively between the -matches." +matches. + +Auto-select when `ecomplete-message-display-abbrev-auto-select' is +non-nil and there is only a single completion option available." (let* ((matches (ecomplete-get-matches type word)) + (match-list (and matches (split-string matches "\n"))) + (max-lines (and matches (- (length match-list) 2))) (line 0) - (max-lines (when matches (- (length (split-string matches "\n")) 2))) (message-log-max nil) command highlight) (if (not matches) @@ -173,25 +182,31 @@ matches." (progn (message "%s" matches) nil) - (setq highlight (ecomplete-highlight-match-line matches line)) - (let ((local-map (make-sparse-keymap)) - (prev-func (lambda () (setq line (max (1- line) 0)))) - (next-func (lambda () (setq line (min (1+ line) max-lines)))) - selected) - (define-key local-map (kbd "RET") - (lambda () (setq selected (nth line (split-string matches "\n"))))) - (define-key local-map (kbd "M-n") next-func) - (define-key local-map (kbd "") next-func) - (define-key local-map (kbd "M-p") prev-func) - (define-key local-map (kbd "") prev-func) - (let ((overriding-local-map local-map)) - (while (and (null selected) - (setq command (read-key-sequence highlight)) - (lookup-key local-map command)) - (apply (key-binding command) nil) - (setq highlight (ecomplete-highlight-match-line matches line)))) - (message (or selected "Abort")) - selected))))) + (if (and ecomplete-auto-select + max-lines + (zerop max-lines)) + ;; Auto-select when only one option is available. + (nth 0 match-list) + ;; Interactively choose from the filtered completions. + (let ((local-map (make-sparse-keymap)) + (prev-func (lambda () (setq line (max (1- line) 0)))) + (next-func (lambda () (setq line (min (1+ line) max-lines)))) + selected) + (define-key local-map (kbd "RET") + (lambda () (setq selected (nth line match-list)))) + (define-key local-map (kbd "M-n") next-func) + (define-key local-map (kbd "") next-func) + (define-key local-map (kbd "M-p") prev-func) + (define-key local-map (kbd "") prev-func) + (let ((overriding-local-map local-map)) + (setq highlight (ecomplete-highlight-match-line matches line)) + (while (and (null selected) + (setq command (read-key-sequence highlight)) + (lookup-key local-map command)) + (apply (key-binding command) nil) + (setq highlight (ecomplete-highlight-match-line matches line)))) + (message (or selected "Abort")) + selected)))))) (defun ecomplete-highlight-match-line (matches line) (with-temp-buffer commit f10645d26029523e8d7520b266ac7e04d8794e50 Author: Augusto Stoffel Date: Thu Sep 8 09:56:59 2022 +0200 Add prefix argument to outline-cycle-buffer * lisp/outline.el (outline-cycle-buffer): Add prefix argument to show headings up to a given level. Handle the case where the top heading level is not 1. diff --git a/lisp/outline.el b/lisp/outline.el index 9a94cad638..6579e12bfe 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1582,7 +1582,7 @@ and body between `hide all', `headings only' and `show all'. (defvar-local outline--cycle-buffer-state 'show-all "Internal variable used for tracking buffer cycle state.") -(defun outline-cycle-buffer () +(defun outline-cycle-buffer (&optional level) "Cycle visibility state of the body lines of the whole buffer. This cycles the visibility of all the subheadings and bodies of all @@ -1591,20 +1591,28 @@ the heading lines in the buffer. It cycles them between `hide all', `Hide all' means hide all the buffer's subheadings and their bodies. `Headings only' means show all the subheadings, but not their bodies. -`Show all' means show all the buffer's subheadings and their bodies." - (interactive) - (let (has-top-level) +`Show all' means show all the buffer's subheadings and their bodies. + +With a prefix argument, show headings up to that LEVEL." + (interactive (list (when current-prefix-arg + (prefix-numeric-value current-prefix-arg)))) + (let (top-level) (save-excursion (goto-char (point-min)) - (while (not (or has-top-level (eobp))) - (when (outline-on-heading-p t) - (when (= (funcall outline-level) 1) - (setq has-top-level t))) + (while (not (or (eq top-level 1) (eobp))) + (when-let ((level (and (outline-on-heading-p t) + (funcall outline-level)))) + (when (< level (or top-level most-positive-fixnum)) + (setq top-level (max level 1)))) (outline-next-heading))) (cond + (level + (outline-hide-sublevels level) + (setq outline--cycle-buffer-state 'all-heading) + (message "All headings up to level %s" level)) ((and (eq outline--cycle-buffer-state 'show-all) - has-top-level) - (outline-hide-sublevels 1) + top-level) + (outline-hide-sublevels top-level) (setq outline--cycle-buffer-state 'top-level) (message "Top level headings")) ((or (eq outline--cycle-buffer-state 'show-all) commit aa02ffb2ab06e956dfd27b9a61fc4739574215ec Author: Lars Ingebrigtsen Date: Thu Sep 8 14:23:12 2022 +0200 Fix diff-add-log-use-relative-names prompting * lisp/vc/diff-mode.el (diff-add-log-use-relative-names): Autoload to avoid prompting when set via dir-locals. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 1d2fbca0e5..4b5c21973b 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2336,6 +2336,7 @@ Call FUN with two args (BEG and END) for each hunk." (let ((inhibit-read-only t)) (undo arg))) +;;;###autoload (defcustom diff-add-log-use-relative-names nil "Use relative file names when generating ChangeLog skeletons. The files will be relative to the root directory of the VC commit e90a457c46ca9463bf77cab2d34513c45269c938 Author: Stefan Kangas Date: Thu Sep 8 12:42:50 2022 +0200 * src/xrdb.c (main) [TESTRM]: Replace gets with fgets. diff --git a/src/xrdb.c b/src/xrdb.c index faeea04a53..5ff25dde14 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -589,14 +589,14 @@ main (int argc, char **argv) char query_class[90]; printf ("Name: "); - gets (query_name); + fgets (query_name, 90, stdin); if (strlen (query_name)) { char *value; printf ("Class: "); - gets (query_class); + fgets (query_class, 90, stdin); value = x_get_string_resource (&xdb, query_name, query_class); commit 5bc44026b59daa48f3563b2592c6eeae5cee8a74 Merge: 6b7dc132af 684950eb94 Author: Eli Zaretskii Date: Thu Sep 8 11:49:17 2022 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 6b7dc132afe99e1b188882d32371b06021f64e95 Author: Sam James Date: Wed Sep 7 04:57:33 2022 +0100 Recognize zstandard (.zst) compressed Info files * lisp/info.el (Info-suffix-list): Recognize .zst file extension from the zstd compression tool. This allows reading Info pages compressed with 'zstd'. (Bug#57636) Copyright-paperwork-exempt: yes diff --git a/lisp/info.el b/lisp/info.el index 1a58910c3a..292bf93a6f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -451,6 +451,7 @@ or `Info-virtual-nodes'." (".info.z" . "gunzip") (".info.bz2" . ("bzip2" "-dc")) (".info.xz" . "unxz") + (".info.zst" . ("zstd" "-dc")) (".info" . nil) ("-info.Z" . "uncompress") ("-info.Y" . "unyabba") @@ -458,6 +459,7 @@ or `Info-virtual-nodes'." ("-info.bz2" . ("bzip2" "-dc")) ("-info.z" . "gunzip") ("-info.xz" . "unxz") + ("-info.zst" . ("zstd" "-dc")) ("-info" . nil) ("/index.Z" . "uncompress") ("/index.Y" . "unyabba") @@ -465,6 +467,7 @@ or `Info-virtual-nodes'." ("/index.z" . "gunzip") ("/index.bz2" . ("bzip2" "-dc")) ("/index.xz" . "unxz") + ("/index.zst" . ("zstd" "-dc")) ("/index" . nil) (".Z" . "uncompress") (".Y" . "unyabba") @@ -472,6 +475,7 @@ or `Info-virtual-nodes'." (".z" . "gunzip") (".bz2" . ("bzip2" "-dc")) (".xz" . "unxz") + (".zst" . ("zstd" "-dc")) ("" . nil))) "List of file name suffixes and associated decoding commands. Each entry should be (SUFFIX . STRING); the file is given to commit 684950eb945064b8273109fc165818edd470da32 Author: Michael Albinus Date: Thu Sep 8 10:36:08 2022 +0200 Make call of remote `id' more performant in Tramp * lisp/net/tramp-adb.el (tramp-adb-handle-file-exists-p): New defun. (tramp-adb-file-name-handler-alist): Use it. (tramp-adb-handle-file-executable-p) (tramp-adb-handle-file-readable-p) (tramp-adb-handle-file-writable-p) (tramp-adb-handle-get-remote-uid) (tramp-adb-handle-get-remote-gid) (tramp-adb-handle-get-remote-groups): Use caches consequently. * lisp/net/tramp-sh.el (tramp-perl-id, tramp-python-id): New defconsts. (tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid) (tramp-sh-handle-get-remote-groups): Use caches consequently. (tramp-sh-handle-file-writable-p): Use `file-writable-p'. (tramp-expand-script): Handle also "python" expansion. (tramp-get-remote-id): Do not set connection property anymore, this is done differently now. (tramp-get-remote-uid-with-id, tramp-get-remote-uid-with-perl) (tramp-get-remote-uid-with-python, tramp-get-remote-gid-with-id) (tramp-get-remote-gid-with-perl) (tramp-get-remote-gid-with-python): Remove. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-executable-p) (tramp-sudoedit-handle-file-exists-p) (tramp-sudoedit-handle-file-readable-p) (tramp-sudoedit-handle-file-writable-p): (tramp-sudoedit-handle-get-remote-uid) (tramp-sudoedit-handle-get-remote-gid) (tramp-sudoedit-handle-get-remote-groups): Use caches consequently. * lisp/net/tramp.el (tramp-check-cached-permissions): Call `tramp-get-remote-groups' only if needed. (tramp-get-remote-groups): Do not return default value. (tramp-read-id-output): New defun. * test/lisp/net/tramp-tests.el (tramp--test-deftest-with-perl): Suppress also remote `id'. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 3fb28d91ea..dfb026f834 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -127,7 +127,7 @@ It is used for TCP/IP devices." (file-directory-p . tramp-handle-file-directory-p) (file-equal-p . tramp-handle-file-equal-p) (file-executable-p . tramp-adb-handle-file-executable-p) - (file-exists-p . tramp-handle-file-exists-p) + (file-exists-p . tramp-adb-handle-file-exists-p) (file-in-directory-p . tramp-handle-file-in-directory-p) (file-local-copy . tramp-adb-handle-file-local-copy) (file-locked-p . tramp-handle-file-locked-p) @@ -489,24 +489,50 @@ Emacs dired can't find files." "Like `file-executable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-executable-p" - (tramp-adb-send-command-and-check - v (format "test -x %s" (tramp-shell-quote-argument localname)))))) + ;; Examine `file-attributes' cache to see if request can be + ;; satisfied without remote operation. + (if (tramp-file-property-p v localname "file-attributes") + (or (tramp-check-cached-permissions v ?x) + (tramp-check-cached-permissions v ?s)) + (tramp-adb-send-command-and-check + v (format "test -x %s" (tramp-shell-quote-argument localname))))))) + +(defun tramp-adb-handle-file-exists-p (filename) + "Like `file-exists-p' for Tramp files." + ;; `file-exists-p' is used as predicate in file name completion. + ;; We don't want to run it when `non-essential' is t, or there is + ;; no connection process yet. + (when (tramp-connectable-p filename) + (with-parsed-tramp-file-name filename nil + (with-tramp-file-property v localname "file-exists-p" + (if (tramp-file-property-p v localname "file-attributes") + (not (null (tramp-get-file-property v localname "file-attributes"))) + (tramp-adb-send-command-and-check + v (format "test -e %s" (tramp-shell-quote-argument localname)))))))) (defun tramp-adb-handle-file-readable-p (filename) "Like `file-readable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-readable-p" - (or (tramp-handle-file-readable-p filename) - (tramp-adb-send-command-and-check - v (format "test -r %s" (tramp-shell-quote-argument localname))))))) + ;; Examine `file-attributes' cache to see if request can be + ;; satisfied without remote operation. + (if (tramp-file-property-p v localname "file-attributes") + (tramp-handle-file-readable-p filename) + (tramp-adb-send-command-and-check + v (format "test -r %s" (tramp-shell-quote-argument localname))))))) (defun tramp-adb-handle-file-writable-p (filename) "Like `file-writable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-writable-p" (if (file-exists-p filename) - (tramp-adb-send-command-and-check - v (format "test -w %s" (tramp-shell-quote-argument localname))) + (if (tramp-file-property-p v localname "file-attributes") + ;; Examine `file-attributes' cache to see if request can + ;; be satisfied without remote operation. + (tramp-check-cached-permissions v ?w) + (tramp-adb-send-command-and-check + v (format "test -w %s" (tramp-shell-quote-argument localname)))) + ;; If file doesn't exist, check if directory is writable. (and (file-directory-p (file-name-directory filename)) (file-writable-p (file-name-directory filename))))))) @@ -1040,57 +1066,23 @@ implementation will be used." (defun tramp-adb-handle-get-remote-uid (vec id-format) "Like `tramp-get-remote-uid' for Tramp files. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-uid'. - (tramp-adb-send-command - vec - (format "id -u%s %s" - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\\$/\\\"/"))) - (with-current-buffer (tramp-get-connection-buffer vec) - ;; Read the expression. - (goto-char (point-min)) - (read (current-buffer)))) + (tramp-adb-send-command vec "id") + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "uid-%s" id-format))) (defun tramp-adb-handle-get-remote-gid (vec id-format) "Like `tramp-get-remote-gid' for Tramp files. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-gid'. - (tramp-adb-send-command - vec - (format "id -g%s %s" - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\\$/\\\"/"))) - (with-current-buffer (tramp-get-connection-buffer vec) - ;; Read the expression. - (goto-char (point-min)) - (read (current-buffer)))) + (tramp-adb-send-command vec "id") + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "gid-%s" id-format))) (defun tramp-adb-handle-get-remote-groups (vec id-format) "Like `tramp-get-remote-groups' for Tramp files. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-groups'. (tramp-adb-send-command vec "id") - (with-current-buffer (tramp-get-connection-buffer vec) - (let (groups-integer groups-string) - ;; Read the expression. - (goto-char (point-min)) - (when (re-search-forward (rx bol (+ nonl) "groups=") nil 'noerror) - (while (looking-at - (rx (group (+ digit)) "(" (group (+ (any "_" word))) ")")) - (setq groups-integer (cons (string-to-number (match-string 1)) - groups-integer) - groups-string (cons (match-string 2) groups-string)) - (goto-char (match-end 0)) - (skip-chars-forward ","))) - (tramp-set-connection-property - vec "groups-integer" - (setq groups-integer (nreverse groups-integer))) - (tramp-set-connection-property - vec "groups-string" - (setq groups-string (nreverse groups-string))) - (if (eq id-format 'integer) groups-integer groups-string)))) + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "groups-%s" id-format))) (defun tramp-adb-get-device (vec) "Return full host name from VEC to be used in shell execution. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ff153d955b..a783f8c16c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -783,6 +783,41 @@ characters need to be doubled.") Format specifiers are replaced by `tramp-expand-script', percent characters need to be doubled.") +(defconst tramp-perl-id + "%p -e ' +use strict; +use warnings; +use POSIX qw(getgroups); + +my ($user, $passwd, $uid, $gid) = getpwuid $< ; +my $group = getgrgid $gid ; +my @groups = map { $_ . \"(\" . getgrgid ($_) . \")\" } getgroups (); + +printf \"uid=%%d(%%s) gid=%%d(%%s) groups=%%s\\n\", + $uid, $user, $gid, $group, join \",\", @groups;' %n" + "Perl script printing `id' output. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") + +(defconst tramp-python-id + "%y -c ' +import os, pwd, grp; + +def idform(id): + return \"{:d}({:s})\".format(id, grp.getgrgid(id)[0]); + +uid = os.getuid(); +user = pwd.getpwuid(uid)[0]; +gid = os.getgid(); +group = grp.getgrgid(gid)[0] +groups = map(idform, os.getgrouplist(user, gid)); + +print(\"uid={:d}({:s}) gid={:d}({:s}) groups={:s}\" + .format(uid, user, gid, group, \",\".join(groups)));' %n" + "Python script printing `id' output. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") + ;; These two use base64 encoding. (defconst tramp-perl-encode-with-module "%p -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n" @@ -1524,10 +1559,16 @@ ID-FORMAT valid values are `string' and `integer'." ;; The result is cached in `tramp-get-remote-uid'. (ignore-errors (cond - ((tramp-get-remote-id vec) (tramp-get-remote-uid-with-id vec id-format)) - ((tramp-get-remote-perl vec) (tramp-get-remote-uid-with-perl vec id-format)) + ((tramp-get-remote-id vec) + (tramp-send-command vec (tramp-get-remote-id vec))) + ((tramp-get-remote-perl vec) + (tramp-maybe-send-script vec tramp-perl-id "tramp_perl_id") + (tramp-send-command vec "tramp_perl_id")) ((tramp-get-remote-python vec) - (tramp-get-remote-uid-with-python vec id-format))))) + (tramp-maybe-send-script vec tramp-python-id "tramp_python_id") + (tramp-send-command vec "tramp_python_id"))) + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "uid-%s" id-format)))) (defun tramp-sh-handle-get-remote-gid (vec id-format) "The gid of the remote connection VEC, in ID-FORMAT. @@ -1535,36 +1576,33 @@ ID-FORMAT valid values are `string' and `integer'." ;; The result is cached in `tramp-get-remote-gid'. (ignore-errors (cond - ((tramp-get-remote-id vec) (tramp-get-remote-gid-with-id vec id-format)) - ((tramp-get-remote-perl vec) (tramp-get-remote-gid-with-perl vec id-format)) + ((tramp-get-remote-id vec) + (tramp-send-command vec (tramp-get-remote-id vec))) + ((tramp-get-remote-perl vec) + (tramp-maybe-send-script vec tramp-perl-id "tramp_perl_id") + (tramp-send-command vec "tramp_perl_id")) ((tramp-get-remote-python vec) - (tramp-get-remote-gid-with-python vec id-format))))) + (tramp-maybe-send-script vec tramp-python-id "tramp_python_id") + (tramp-send-command vec "tramp_python_id"))) + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "gid-%s" id-format)))) (defun tramp-sh-handle-get-remote-groups (vec id-format) "Like `tramp-get-remote-groups' for Tramp files. ID-FORMAT valid values are `string' and `integer'." ;; The result is cached in `tramp-get-remote-groups'. - (when (tramp-get-remote-id vec) - (tramp-send-command vec (tramp-get-remote-id vec))) - (with-current-buffer (tramp-get-connection-buffer vec) - (let (groups-integer groups-string) - ;; Read the expression. - (goto-char (point-min)) - (when (re-search-forward (rx bol (+ nonl) "groups=") nil 'noerror) - (while (looking-at - (rx (group (+ digit)) "(" (group (+ (any "_" word))) ")")) - (setq groups-integer (cons (string-to-number (match-string 1)) - groups-integer) - groups-string (cons (match-string 2) groups-string)) - (goto-char (match-end 0)) - (skip-chars-forward ","))) - (tramp-set-connection-property - vec "groups-integer" - (setq groups-integer (nreverse groups-integer))) - (tramp-set-connection-property - vec "groups-string" - (setq groups-string (nreverse groups-string))) - (if (eq id-format 'integer) groups-integer groups-string)))) + (ignore-errors + (cond + ((tramp-get-remote-id vec) + (tramp-send-command vec (tramp-get-remote-id vec))) + ((tramp-get-remote-perl vec) + (tramp-maybe-send-script vec tramp-perl-id "tramp_perl_id") + (tramp-send-command vec "tramp_perl_id")) + ((tramp-get-remote-python vec) + (tramp-maybe-send-script vec tramp-python-id "tramp_python_id") + (tramp-send-command vec "tramp_python_id"))) + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "groups-%s" id-format)))) (defun tramp-sh-handle-set-file-uid-gid (filename &optional uid gid) "Like `tramp-set-file-uid-gid' for Tramp files." @@ -1694,6 +1732,8 @@ ID-FORMAT valid values are `string' and `integer'." "Like `file-readable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-readable-p" + ;; Examine `file-attributes' cache to see if request can be + ;; satisfied without remote operation. (if (tramp-file-property-p v localname "file-attributes") (tramp-handle-file-readable-p filename) (tramp-run-test "-r" filename))))) @@ -1730,8 +1770,9 @@ ID-FORMAT valid values are `string' and `integer'." (tramp-check-cached-permissions v ?w) (tramp-run-test "-w" filename)) ;; If file doesn't exist, check if directory is writable. - (and (file-exists-p (file-name-directory filename)) - (tramp-run-test "-w" (file-name-directory filename))))))) + (and + (file-directory-p (file-name-directory filename)) + (file-writable-p (file-name-directory filename))))))) (defun tramp-sh-handle-file-ownership-preserved-p (filename &optional group) "Like `file-ownership-preserved-p' for Tramp files." @@ -3971,15 +4012,15 @@ Fall back to normal file name handler if no Tramp handler exists." (defun tramp-expand-script (vec script) "Expand SCRIPT with remote files or commands. -\"%a\", \"%h\", \"%l\", \"%o\", \"%p\", \"%r\" and \"%s\" format -specifiers are replaced by the respective `awk', `hexdump', `ls', -`od', `perl', `readlink' and `stat' commands. \"%n\" is replaced -by \"2>/dev/null\", and \"%t\" is replaced by a temporary file -name. If VEC is nil, the respective local commands are used. If -there is a format specifier which cannot be expanded, this -function returns nil." +\"%a\", \"%h\", \"%l\", \"%o\", \"%p\", \"%r\", \"%s\" and \"%y\" +format specifiers are replaced by the respective `awk', +`hexdump', `ls', `od', `perl', `readlink', `stat' and `python' +commands. \"%n\" is replaced by \"2>/dev/null\", and \"%t\" is +replaced by a temporary file name. If VEC is nil, the respective +local commands are used. If there is a format specifier which +cannot be expanded, this function returns nil." (if (not (string-match-p - (rx (| bol (not (any "%"))) "%" (any "ahlnoprst")) script)) + (rx (| bol (not (any "%"))) "%" (any "ahlnoprsty")) script)) script (catch 'wont-work (let ((awk (when (string-match-p (rx (| bol (not (any "%"))) "%a") script) @@ -4010,6 +4051,11 @@ function returns nil." (if vec (tramp-get-remote-perl vec) (executable-find "perl")) (throw 'wont-work nil)))) + (python (when (string-match-p (rx (| bol (not (any "%"))) "%y") script) + (or + (if vec + (tramp-get-remote-python vec) (executable-find "python")) + (throw 'wont-work nil)))) (readlink (when (string-match-p (rx (| bol (not (any "%"))) "%r") script) (or @@ -4032,7 +4078,7 @@ function returns nil." script (format-spec-make ?a awk ?h hdmp ?l ls ?n dev ?o od ?p perl - ?r readlink ?s stat ?t tmp)))))) + ?r readlink ?s stat ?t tmp ?y python)))))) (defun tramp-maybe-send-script (vec script name) "Define in remote shell function NAME implemented as SCRIPT. @@ -5816,36 +5862,9 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." (while (and dl (setq result (tramp-find-executable vec cmd dl t t))) ;; Check POSIX parameter. (when (tramp-send-command-and-check vec (format "%s -u" result)) - (tramp-set-connection-property - vec "uid-integer" - (with-current-buffer (tramp-get-connection-buffer vec) - (goto-char (point-min)) - (read (current-buffer)))) (throw 'id-found result)) (setq dl (cdr dl)))))))) -(defun tramp-get-remote-uid-with-id (vec id-format) - "Implement `tramp-get-remote-uid' for Tramp files using `id'." - ;; `tramp-get-remote-id' sets already connection property "uid-integer". - (with-tramp-connection-property vec (format "uid-%s" id-format) - (tramp-send-command-and-read - vec - (format "%s -u%s %s" - (tramp-get-remote-id vec) - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\\$/\\\"/"))))) - -(defun tramp-get-remote-uid-with-perl (vec id-format) - "Implement `tramp-get-remote-uid' for Tramp files using a Perl script." - (tramp-send-command-and-read - vec - (format "%s -le '%s'" - (tramp-get-remote-perl vec) - (if (equal id-format 'integer) - "print $>" - "print \"\\\"\", scalar getpwuid($>), \"\\\"\"")))) - (defun tramp-get-remote-python (vec) "Determine remote `python' command." (with-tramp-connection-property vec "python" @@ -5853,46 +5872,6 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." (or (tramp-find-executable vec "python" (tramp-get-remote-path vec)) (tramp-find-executable vec "python3" (tramp-get-remote-path vec))))) -(defun tramp-get-remote-uid-with-python (vec id-format) - "Implement `tramp-get-remote-uid' for Tramp files using `python'." - (tramp-send-command-and-read - vec - (format "%s -c \"%s\"" - (tramp-get-remote-python vec) - (if (equal id-format 'integer) - "import os; print (os.getuid())" - "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')")))) - -(defun tramp-get-remote-gid-with-id (vec id-format) - "Implement `tramp-get-remote-gid' for Tramp files using `id'." - (tramp-send-command-and-read - vec - (format "%s -g%s %s" - (tramp-get-remote-id vec) - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\\$/\\\"/")))) - -(defun tramp-get-remote-gid-with-perl (vec id-format) - "Implement `tramp-get-remote-gid' for Tramp files using a Perl script." - (tramp-send-command-and-read - vec - (format "%s -le '%s'" - (tramp-get-remote-perl vec) - (if (equal id-format 'integer) - "print ($)=~/(\\d+)/)" - "print \"\\\"\", scalar getgrgid($)), \"\\\"\"")))) - -(defun tramp-get-remote-gid-with-python (vec id-format) - "Implement `tramp-get-remote-gid' for Tramp files using `python'." - (tramp-send-command-and-read - vec - (format "%s -c \"%s\"" - (tramp-get-remote-python vec) - (if (equal id-format 'integer) - "import os; print (os.getgid())" - "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')")))) - (defun tramp-get-remote-busybox (vec) "Determine remote `busybox' command." (with-tramp-connection-property vec "busybox" diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index ef0954ab83..e0b577fff8 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -442,8 +442,13 @@ the result will be a local, non-Tramp, file name." "Like `file-executable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-executable-p" - (tramp-sudoedit-send-command - v "test" "-x" (tramp-compat-file-name-unquote localname))))) + ;; Examine `file-attributes' cache to see if request can be + ;; satisfied without remote operation. + (if (tramp-file-property-p v localname "file-attributes") + (or (tramp-check-cached-permissions v ?x) + (tramp-check-cached-permissions v ?s)) + (tramp-sudoedit-send-command + v "test" "-x" (tramp-compat-file-name-unquote localname)))))) (defun tramp-sudoedit-handle-file-exists-p (filename) "Like `file-exists-p' for Tramp files." @@ -453,8 +458,10 @@ the result will be a local, non-Tramp, file name." (when (tramp-connectable-p filename) (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-exists-p" - (tramp-sudoedit-send-command - v "test" "-e" (tramp-compat-file-name-unquote localname)))))) + (if (tramp-file-property-p v localname "file-attributes") + (not (null (tramp-get-file-property v localname "file-attributes"))) + (tramp-sudoedit-send-command + v "test" "-e" (tramp-compat-file-name-unquote localname))))))) (defun tramp-sudoedit-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." @@ -483,9 +490,12 @@ the result will be a local, non-Tramp, file name." "Like `file-readable-p' for Tramp files." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-readable-p" - (or (tramp-handle-file-readable-p filename) - (tramp-sudoedit-send-command - v "test" "-r" (tramp-compat-file-name-unquote localname)))))) + ;; Examine `file-attributes' cache to see if request can be + ;; satisfied without remote operation. + (if (tramp-file-property-p v localname "file-attributes") + (tramp-handle-file-readable-p filename) + (tramp-sudoedit-send-command + v "test" "-r" (tramp-compat-file-name-unquote localname)))))) (defun tramp-sudoedit-handle-set-file-modes (filename mode &optional flag) "Like `set-file-modes' for Tramp files." @@ -597,11 +607,16 @@ the result will be a local, non-Tramp, file name." (with-parsed-tramp-file-name filename nil (with-tramp-file-property v localname "file-writable-p" (if (file-exists-p filename) - (tramp-sudoedit-send-command - v "test" "-w" (tramp-compat-file-name-unquote localname)) - (let ((dir (file-name-directory filename))) - (and (file-exists-p dir) - (file-writable-p dir))))))) + (if (tramp-file-property-p v localname "file-attributes") + ;; Examine `file-attributes' cache to see if request can + ;; be satisfied without remote operation. + (tramp-check-cached-permissions v ?w) + (tramp-sudoedit-send-command + v "test" "-w" (tramp-compat-file-name-unquote localname))) + ;; If file doesn't exist, check if directory is writable. + (and + (file-directory-p (file-name-directory filename)) + (file-writable-p (file-name-directory filename))))))) (defun tramp-sudoedit-handle-make-directory (dir &optional parents) "Like `make-directory' for Tramp files." @@ -720,43 +735,23 @@ VEC or USER, or if there is no home directory, return nil." (defun tramp-sudoedit-handle-get-remote-uid (vec id-format) "The uid of the remote connection VEC, in ID-FORMAT. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-uid'. - (if (equal id-format 'integer) - (tramp-sudoedit-send-command-and-read vec "id" "-u") - (tramp-sudoedit-send-command-string vec "id" "-un"))) + (tramp-sudoedit-send-command vec "id") + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "uid-%s" id-format))) (defun tramp-sudoedit-handle-get-remote-gid (vec id-format) "The gid of the remote connection VEC, in ID-FORMAT. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-gid'. - (if (equal id-format 'integer) - (tramp-sudoedit-send-command-and-read vec "id" "-g") - (tramp-sudoedit-send-command-string vec "id" "-gn"))) + (tramp-sudoedit-send-command vec "id") + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "gid-%s" id-format))) (defun tramp-sudoedit-handle-get-remote-groups (vec id-format) "Like `tramp-get-remote-groups' for Tramp files. ID-FORMAT valid values are `string' and `integer'." - ;; The result is cached in `tramp-get-remote-groups'. (tramp-sudoedit-send-command vec "id") - (with-current-buffer (tramp-get-connection-buffer vec) - (let (groups-integer groups-string) - ;; Read the expression. - (goto-char (point-min)) - (when (re-search-forward (rx bol (+ nonl) "groups=") nil 'noerror) - (while (looking-at - (rx (group (+ digit)) "(" (group (+ (any "_" word))) ")")) - (setq groups-integer (cons (string-to-number (match-string 1)) - groups-integer) - groups-string (cons (match-string 2) groups-string)) - (goto-char (match-end 0)) - (skip-chars-forward ","))) - (tramp-set-connection-property - vec "groups-integer" - (setq groups-integer (nreverse groups-integer))) - (tramp-set-connection-property - vec "groups-string" - (setq groups-string (nreverse groups-string))) - (if (eq id-format 'integer) groups-integer groups-string)))) + (tramp-read-id-output vec) + (tramp-get-connection-property vec (format "groups-%s" id-format))) (defun tramp-sudoedit-handle-set-file-uid-gid (filename &optional uid gid) "Like `tramp-set-file-uid-gid' for Tramp files." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index cfc005d270..cd68801c21 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5838,8 +5838,7 @@ be granted." ((eq ?s access) 3))) (file-attr (file-attributes (tramp-make-tramp-file-name vec))) (remote-uid (tramp-get-remote-uid vec 'integer)) - (remote-gid (tramp-get-remote-gid vec 'integer)) - (remote-groups (tramp-get-remote-groups vec 'integer))) + (remote-gid (tramp-get-remote-gid vec 'integer))) (or ;; Not a symlink. (eq t (file-attribute-type file-attr)) @@ -5867,7 +5866,8 @@ be granted." (and (eq access (aref (file-attribute-modes file-attr) (+ offset 3))) - (member (file-attribute-group-id file-attr) remote-groups))))) + (member (file-attribute-group-id file-attr) + (tramp-get-remote-groups vec 'integer)))))) (defmacro tramp-convert-file-attributes (vec localname id-format attr) "Convert `file-attributes' ATTR generated Tramp backend functions. @@ -6008,12 +6008,48 @@ ID-FORMAT valid values are `string' and `integer'." (defun tramp-get-remote-groups (vec id-format) "The list of groups of the remote connection VEC, in ID-FORMAT. ID-FORMAT valid values are `string' and `integer'." - (or (and (tramp-file-name-p vec) - (with-tramp-connection-property vec (format "groups-%s" id-format) - (tramp-file-name-handler #'tramp-get-remote-groups vec id-format))) - ;; Ensure there is a valid result. - (and (equal id-format 'integer) (list tramp-unknown-id-integer)) - (and (equal id-format 'string) (list tramp-unknown-id-string)))) + (and (tramp-file-name-p vec) + (with-tramp-connection-property vec (format "groups-%s" id-format) + (tramp-file-name-handler #'tramp-get-remote-groups vec id-format)))) + +(defun tramp-read-id-output (vec) + "Read in connection buffer the output of the `id' command. +Set connection properties \"{uid,gid.groups}-{integer,string}\"." + (with-current-buffer (tramp-get-connection-buffer vec) + (let (uid-integer uid-string + gid-integer gid-string + groups-integer groups-string) + (goto-char (point-min)) + ;; Read uid. + (when (re-search-forward + (rx "uid=" (group (+ digit)) "(" (group (+ (any "_" word))) ")") + nil 'noerror) + (setq uid-integer (string-to-number (match-string 1)) + uid-string (match-string 2))) + ;; Read gid. + (when (re-search-forward + (rx "gid=" (group (+ digit)) "(" (group (+ (any "_" word))) ")") + nil 'noerror) + (setq gid-integer (string-to-number (match-string 1)) + gid-string (match-string 2))) + ;; Read groups. + (when (re-search-forward (rx "groups=") nil 'noerror) + (while (looking-at + (rx (group (+ digit)) "(" (group (+ (any "_" word))) ")")) + (setq groups-integer (cons (string-to-number (match-string 1)) + groups-integer) + groups-string (cons (match-string 2) groups-string)) + (goto-char (match-end 0)) + (skip-chars-forward ","))) + ;; Set connection properties. + (tramp-set-connection-property vec "uid-integer" uid-integer) + (tramp-set-connection-property vec "uid-string" uid-string) + (tramp-set-connection-property vec "gid-integer" gid-integer) + (tramp-set-connection-property vec "gid-string" gid-string) + (tramp-set-connection-property + vec "groups-integer" (nreverse groups-integer)) + (tramp-set-connection-property + vec "groups-string" (nreverse groups-string))))) (defun tramp-local-host-p (vec) "Return t if this points to the local host, nil otherwise. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f42f6838c8..6f7c6702e7 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3622,7 +3622,9 @@ This tests also `access-file', `file-readable-p', (append '((nil "stat" nil) ;; See `tramp-sh-handle-file-truename'. - (nil "readlink" nil)) + (nil "readlink" nil) + ;; See `tramp-sh-handle-get-remote-*'. + (nil "id" nil)) tramp-connection-properties))) (progn (skip-unless (< (ert-test-result-duration result) 300)) commit e97ca476a138411c4624d76028eefba47e974e7c Author: Eli Zaretskii Date: Thu Sep 8 10:14:10 2022 +0300 ; Minor improvements in 'standard-display-by-replacement-char' * lisp/disp-table.el (standard-display-by-replacement-char): Minor improvements. Suggested by Richard Stallman . diff --git a/lisp/disp-table.el b/lisp/disp-table.el index c762b88cb6..f0ee3d1d78 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@ -337,13 +337,15 @@ which characters can be displayed and which cannot." (with-current-buffer buf (erase-buffer) (insert "\ +;; This code was produced by `standard-display-by-replacement-char'. ;; Evaluate the Lisp code below to make Emacs show the standard ;; replacement character as a substitute for each undisplayable character. ;; One way to do that is with \"C-x h M-x eval-region RET\". ;; Normally you would put this code in your Emacs initialization file, ;; perhaps conditionally based on the type of terminal, so that ;; this setup happens automatically on each startup. -(let ((tbl standard-display-table))\n") +(let ((tbl (or standard-display-table + (setq standard-display-table (make-display-table)))))\n") (while (<= ch to) (cond ((or (char-displayable-p ch) commit 9acb278af5823dcff7fb63a37399232ffa849192 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Wed Sep 7 00:25:16 2022 +0200 Bump Emacs version to 28.2 * README: * configure.ac: * msdos/sed2v2.inp: * nt/README.W32: Bump Emacs version to 28.2. diff --git a/README b/README index c949c34b4d..cbfdb258a1 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2022 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 28.1.91 of GNU Emacs, the extensible, +This directory tree holds version 28.2 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU diff --git a/configure.ac b/configure.ac index 7c98522448..2e3f8d33d6 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT(GNU Emacs, 28.1.91, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) +AC_INIT(GNU Emacs, 28.2, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index bffa9ac18c..d954130d41 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -24080,7 +24080,7 @@ Coloring: ;;;### (autoloads nil "org" "org/org.el" (0 0 0 0)) ;;; Generated autoloads from org/org.el -(push (purecopy '(org 9 5 4)) package--builtin-versions) +(push (purecopy '(org 9 5 5)) package--builtin-versions) (autoload 'org-babel-do-load-languages "org" "\ Load the languages defined in `org-babel-load-languages'. @@ -38130,7 +38130,7 @@ Exit View mode and make the current buffer editable." t nil) ;;;### (autoloads nil "viper" "emulation/viper.el" (0 0 0 0)) ;;; Generated autoloads from emulation/viper.el -(push (purecopy '(viper 3 14 1)) package--builtin-versions) +(push (purecopy '(viper 3 14 2)) package--builtin-versions) (autoload 'toggle-viper-mode "viper" "\ Toggle Viper on/off. @@ -39538,11 +39538,21 @@ Zone out, completely." t nil) ;;;;;; "eshell/em-term.el" "eshell/em-tramp.el" "eshell/em-unix.el" ;;;;;; "eshell/em-xtra.el" "faces.el" "files.el" "font-core.el" ;;;;;; "font-lock.el" "format.el" "frame.el" "help.el" "hfy-cmap.el" -;;;;;; "ibuf-ext.el" "indent.el" "international/characters.el" "international/charscript.el" -;;;;;; "international/cp51932.el" "international/emoji-zwj.el" "international/eucjp-ms.el" +;;;;;; "ibuf-ext.el" "indent.el" "international/characters.el" "international/charprop.el" +;;;;;; "international/charscript.el" "international/cp51932.el" +;;;;;; "international/emoji-zwj.el" "international/eucjp-ms.el" ;;;;;; "international/iso-transl.el" "international/mule-cmds.el" -;;;;;; "international/mule-conf.el" "international/mule.el" "isearch.el" -;;;;;; "jit-lock.el" "jka-cmpr-hook.el" "language/burmese.el" "language/cham.el" +;;;;;; "international/mule-conf.el" "international/mule.el" "international/uni-bidi.el" +;;;;;; "international/uni-brackets.el" "international/uni-category.el" +;;;;;; "international/uni-combining.el" "international/uni-comment.el" +;;;;;; "international/uni-decimal.el" "international/uni-decomposition.el" +;;;;;; "international/uni-digit.el" "international/uni-lowercase.el" +;;;;;; "international/uni-mirrored.el" "international/uni-name.el" +;;;;;; "international/uni-numeric.el" "international/uni-old-name.el" +;;;;;; "international/uni-special-lowercase.el" "international/uni-special-titlecase.el" +;;;;;; "international/uni-special-uppercase.el" "international/uni-titlecase.el" +;;;;;; "international/uni-uppercase.el" "isearch.el" "jit-lock.el" +;;;;;; "jka-cmpr-hook.el" "language/burmese.el" "language/cham.el" ;;;;;; "language/chinese.el" "language/cyrillic.el" "language/czech.el" ;;;;;; "language/english.el" "language/ethiopic.el" "language/european.el" ;;;;;; "language/georgian.el" "language/greek.el" "language/hebrew.el" diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index d6b06519b9..d0065db521 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -67,7 +67,7 @@ /^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ -/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "28.1.91"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "28.2"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ diff --git a/nt/README.W32 b/nt/README.W32 index f5a9cfb688..607f39c56b 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2022 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 28.1.91 for MS-Windows + Emacs version 28.2 for MS-Windows This README file describes how to set up and run a precompiled distribution of the latest version of GNU Emacs for MS-Windows. You commit 395760dcd35ea116dc97dc09af1c4ce1704ef61a Author: Stefan Kangas Date: Wed Sep 7 00:20:57 2022 +0200 Update ChangeLog and AUTHORS for Emacs 28.2 * ChangeLog.3: * etc/AUTHORS: * etc/NEWS: Update for Emacs 28.2. diff --git a/ChangeLog.3 b/ChangeLog.3 index eeae810145..dda171be7e 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1,3 +1,314 @@ +2022-09-06 Stefan Kangas + + * doc/misc/idlwave.texi (Troubleshooting): Don't say "Emacsen". + +2022-09-06 Stefan Kangas + + Don't mention very old Emacs versions in docs + + * doc/misc/mh-e.texi (Conventions): + * doc/misc/reftex.texi (Problems and Work-Arounds): + * doc/misc/viper.texi (Loading Viper): Delete references to + very old versions of Emacs. + +2022-09-05 Stefan Kangas + + * lisp/server.el: Improve Commentary. + +2022-09-05 Gregory Heytings + + Explain how the font appearance can be fine-tuned in fbterm. + + * doc/misc/efaq.texi (Emacs in a Linux console): Briefly document + Xft font specifications with which the font appearance can be + fine-tuned. + +2022-09-04 Kyle Meyer + + Update to Org 9.5.5 + +2022-09-03 Stefan Monnier + + * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully + + Otherwise Emacs may fail to start if it can't find a writable + `~/.emacs.d/eln-cache` directory. + Fixes bug#57562. See also Debian's bug #1017739. + +2022-09-03 Stefan Kangas + + Update acknowledgments + + * doc/emacs/ack.texi (Acknowledgments): Update. + * doc/emacs/emacs.texi (Acknowledgments): Add several names from + Author: headers. + +2022-09-01 Stefan Kangas + + Make some versions in docs match package version + + * doc/emacs/misc.texi (Interactive Shell): Bump Emacs version. + * doc/misc/ediff.texi: + * doc/misc/flymake.texi: + * doc/misc/viper.texi: Fix version to match package. + * lisp/emulation/viper.el: Make version match variable. + +2022-09-01 Stefan Kangas + + Minor doc fix; improve sorting of VC backends + + * doc/emacs/maintaining.texi (Version Control Systems): Minor doc fix; + rearrange list to put git, cvs and subversion at the top. + +2022-09-01 Eli Zaretskii + + Clarify the doc string of 'set-face-attribute' + + * lisp/faces.el (set-face-attribute): Clarify the issue with + resetting attribute values to 'unspecified' for future frames. + (Bug#57499) + +2022-08-30 Gregory Heytings + + Enable 256 colors in fbterm. + + * lisp/term/fbterm.el: New file. + + * doc/misc/efaq.texi (Emacs in a Linux console): Document the TERM + environment variable with which the new file is used. + +2022-08-30 Eli Zaretskii + + One more fix for find-file.el + + * lisp/find-file.el (ff-get-file-name): Use 'expand-file-name' + instead of 'concat', which doesn't DTRT with absolute file names. + (ff-other-file-alist): Yet another doc fix. (Bug#57325) + +2022-08-29 Gregory Heytings + + Recommend using fbterm in the Linux console. + + * doc/misc/efaq.texi (Emacs in a Linux console): New node. + (Common requests): Entry for the new node. + + * etc/PROBLEMS (Linux console problems...): Mention the new FAQ node. + +2022-08-29 Eli Zaretskii + + * lisp/find-file.el (ff-other-file-alist): Doc fix. (Bug#57325) + +2022-08-28 Eli Zaretskii + + * lisp/info.el (Info-mode): Support the Linux console better. + +2022-08-28 Eli Zaretskii + + Improve the documentation of glyphless-character display + + * lisp/international/characters.el (glyphless-char-display-control): + * src/xdisp.c (syms_of_xdisp) : Mention + the 'glyphless-char' face in the doc string. + + * doc/lispref/display.texi (Glyphless Chars): Index + 'glyphless-char' face. + +2022-08-27 Eli Zaretskii + + Fix documentation of 'glyphless-char-display' + + * src/xdisp.c (syms_of_xdisp): Doc fix. + (gui_produce_glyphs, lookup_glyphless_char_display): Fix + indentation. + +2022-08-25 Robert Pluim + + Treat smtp-auth method from auth-info as a symbol + + The lookup of the SMTP auth method is done based on symbols, but + sometimes the requested value comes from `auth-info', in which case it + is a string, so call `intern-soft' to convert it to a symbol (which + does nothing if it's already a symbol). + + * lisp/mail/smtpmail.el (smtpmail-try-auth-methods): Call + `intern-soft' on the smtp-auth key's value. (Bug#57373) + + Do not merge to master + +2022-08-25 Stefan Kangas + + * lisp/wdired.el: Improve "Commentary" section. + + * lisp/wdired.el: Doc fix; don't mention obsolete variable. + + * lisp/progmodes/etags.el (next-file): Minor doc fix. + +2022-08-25 Andreas Schwab + + * configure.ac: Move AC_LANG_PUSH/POP out of AC_CACHE_CHECK. (Bug#57380) + + (cherry picked from commit ce82300221f270241fdda1f5dfb567bdb1208543) + +2022-08-21 Kyle Meyer + + Update to Org 9.5.4-19-g4dff42 + +2022-08-21 Eli Zaretskii + + * lisp/find-file.el (ff-other-file-alist): Doc fix. (Bug#57325) + +2022-08-19 Stefan Kangas + + Resurrect obsoletion warning for two functions + + These were supposed to have been deleted, but never were. Resurrect + their obsoletion warning and let's delete them in Emacs 29 instead. + + * lisp/subr.el (process-filter-multibyte-p) + (set-process-filter-multibyte): Resurrect obsoletion warning. + * etc/NEWS: Don't announce their deletion. + +2022-08-19 Alan Mackenzie + + * src/window.c (select_window): Fix assert for buffer = non-active minibuffer + +2022-08-19 Gerd Möllmann + + Find libgccjit on macOS with Homebrew differently + + * configure.ac (MAC_LIBS): Find libgccjit's directory slightly + differently for brew installations. + +2022-08-18 Stefan Kangas + + Improve image-mode-as-hex docstring + + * lisp/image-mode.el: Fix typos. + (image-mode-as-hex): Doc fix; say that it uses 'hexl-mode' and reflow. + +2022-08-18 Stefan Kangas + + * lisp/image-mode.el (image-mode-as-hex): Fix toggle instructions. + + * lisp/image-mode.el: Improve commentary. + +2022-08-18 Colin Woodbury + + cl-reduce doc string improvement + + * lisp/emacs-lisp/cl-seq.el (cl-reduce): Explain what happens when + using :from-end (bug#57273). + +2022-08-18 Paul Eggert + + Backport tempname changes from master (bug#57129) + + * lib/tempname.c: Backport from master, which uses current Gnulib. + +2022-08-16 Stefan Kangas + + Revert "; * doc/lispintro/emacs-lisp-intro.texi: Fix typo." + + This reverts commit 9d0dba44da7ac83d018fff3c26d33dac12ebd806. + + This was not a typo, but incorrectly matching parens in Info-mode. + +2022-08-16 Stefan Kangas + + * doc/misc/gnus.texi (Article Washing): Fix Links URL. + +2022-08-12 Stefan Kangas + + Delete references to deleted library hilit19.el + + * doc/misc/gnus.texi (Compatibility): + * lisp/progmodes/f90.el: + * lisp/ps-print.el: + * lisp/vc/ediff.el: Delete references to hilit19.el. + +2022-08-12 Stefan Kangas + + Delete stale comments from Lisp Intro manual + + * doc/lispintro/emacs-lisp-intro.texi (Args as Variable or List) + (print-elements-of-list, Miscellaneous): Delete some references to + Emacs 22. + +2022-08-11 Stefan Kangas + + Don't list Emacs as requirement for built-in package + + * doc/misc/htmlfontify.texi (Requirements): Don't list Emacs as + requirement for built-in package. + +2022-08-11 YAMAMOTO Mitsuharu + + Fix wrong metrics for bitmap-only fonts with HarfBuzz 5 + + * src/ftcrfont.c (ftcrhbfont_begin_hb_font): Always use the standard + position unit value on HarfBuzz 5 and later regardless of whether the + font is bitmap-only or not. (Bug#57066) + +2022-08-09 Stefan Kangas + + Improve wording when documenting other TRAMP syntaxes + + * doc/misc/tramp.texi (Change file name syntax): Improve wording. + (Bug#57061) + +2022-08-08 Stefan Kangas + + * lisp/vc/diff-mode.el: Don't mention XEmacs. + +2022-08-08 Stefan Kangas + + Don't mention XEmacs toolbar in ediff manual + + * doc/misc/ediff.texi (Other Session Commands): Don't mention XEmacs + specific toolbar support for now. This can be changed back once the + toolbar is ported to Emacs. + +2022-08-06 Eli Zaretskii + + * etc/PROBLEMS: Problems with Alacritty and Emoji. (Bug#56952) + +2022-08-06 Yuga Ego + + Link from (emacs)Init Syntax to (elisp)Introduction + + * doc/emacs/custom.texi (Init Syntax): Link to the ELisp manual (Bug#56870) + +2022-08-06 Stefan Kangas + + Don't mention removed XEmacs support in reftex manual + + * doc/misc/reftex.texi (Installation, Imprint): Don't mention + removed XEmacs support. + +2022-08-06 Stefan Kangas + + Don't mention removed XEmacs support in idlwave manual + + * doc/misc/idlwave.texi (Lesson I---Development Cycle) + (Syntax Highlighting, Windows and macOS, Troubleshooting): Delete + most references to XEmacs. Support for it was deleted in 28.1. + +2022-08-05 Stefan Kangas + + * lisp/play/fortune.el: Doc fixes. + +2022-08-04 Stefan Kangas + + * doc/lispref/loading.texi (Autoload by Prefix): Fix typo. + +2022-08-03 Philipp Stephani + + * lisp/uniquify.el (uniquify-buffer-name-style): Quote apostrophe. + +2022-08-02 Stefan Kangas + + * lisp/term.el: Doc fix; don't mention rlogin. + 2022-07-31 Eli Zaretskii * src/lisp.h (CHECK_INTEGER): Fix the predicate. (Bug#56856) @@ -236607,7 +236918,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit 78759ddcb0fc7dd75a7a8edfb2c19dc2f1d86ee2 (inclusive). +commit ddabb03a0176beb4b7fc8d4f2267d459fd2ebded (inclusive). See ChangeLog.2 for earlier changes. ;; Local Variables: diff --git a/etc/AUTHORS b/etc/AUTHORS index 4ad8a54130..4ad9fec05e 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -103,8 +103,8 @@ Alakazam Petrofsky: changed hanoi.el Alan Mackenzie: wrote cc-awk.el and co-wrote cc-align.el cc-cmds.el cc-defs.el cc-engine.el cc-fonts.el cc-langs.el cc-mode.el cc-styles.el cc-vars.el -and changed cc-mode.texi minibuf.c bytecomp.el edebug.el follow.el - window.c display.texi subr.el syntax.texi progmodes/compile.el +and changed cc-mode.texi minibuf.c bytecomp.el window.c edebug.el + follow.el display.texi subr.el syntax.texi progmodes/compile.el programs.texi eval.c keyboard.c lisp.h modes.texi window.el windows.texi cus-start.el font-lock.el frame.c isearch.el and 167 other files @@ -994,7 +994,8 @@ and changed calc.el replace.el update-game-score.c calc-ext.el Colin Williams: changed calc.texi -Colin Woodbury: changed files.el files.texi macros.texi shortdoc.el +Colin Woodbury: changed files.el cl-seq.el files.texi macros.texi + shortdoc.el Constantin Kulikov: changed server.el startup.el @@ -2056,10 +2057,10 @@ Gregor Schmid: changed intervals.c intervals.h tcl-mode.el textprop.c Gregory Chernov: changed nnslashdot.el -Gregory Heytings: changed isearch.el minibuffer.el mini.texi quail.el - search.texi simple.el HELLO buffers.texi diff-mode.el emake facemenu.el - files.el fringe.c help-macro.el icomplete.el keyboard.c misc-lang.el - modula2.el pcmpl-gnu.el print.c pulse.el and 4 other files +Gregory Heytings: changed isearch.el minibuffer.el efaq.texi mini.texi + quail.el search.texi simple.el HELLO buffers.texi diff-mode.el emake + facemenu.el fbterm.el files.el fringe.c help-macro.el icomplete.el + keyboard.c misc-lang.el modula2.el pcmpl-gnu.el and 6 other files Grégory Mounié: changed display.texi hi-lock.el man.el xfns.c @@ -4518,7 +4519,7 @@ Philipp Stephani: wrote callint-tests.el checkdoc-tests.el and changed emacs-module.c emacs-module-tests.el configure.ac json.c process.c eval.c internals.texi json-tests.el process-tests.el alloc.c emacs-module.h.in emacs.c lread.c nsterm.m lisp.h pdumper.c bytecomp.el - callproc.c seccomp-filter.c gtkutil.c files.el and 184 other files + callproc.c seccomp-filter.c gtkutil.c files.el and 185 other files Phillip Lord: wrote ps-print-tests.el w32-feature.el and changed build-zips.sh build-dep-zips.py lisp/Makefile.in undo.c @@ -4787,7 +4788,7 @@ Robert Pluim: wrote nsm-tests.el and changed configure.ac process.c blocks.awk network-stream-tests.el font.c processes.texi ftfont.c gtkutil.c vc-git.el process-tests.el emoji-zwj.awk gnutls.el network-stream.el nsm.el tramp.texi mml-sec.el - nsterm.m unicode xfns.c auth.texi composite.c and 138 other files + nsterm.m unicode xfns.c auth.texi composite.c and 139 other files Robert Thorpe: changed cus-start.el indent.el rmail.texi @@ -5180,8 +5181,8 @@ Stefan Kangas: wrote bookmark-tests.el cal-julian-tests.el and co-wrote help-tests.el keymap-tests.el and changed efaq.texi checkdoc.el package.el cperl-mode.el bookmark.el help.el keymap.c subr.el simple.el erc.el ediff-util.el idlwave.el - time.el bytecomp-tests.el comp.el speedbar.el bytecomp.el edebug.el - emacs-lisp-intro.texi flyspell.el ibuffer.el and 1344 other files + time.el bytecomp-tests.el comp.el emacs-lisp-intro.texi speedbar.el + bytecomp.el edebug.el flyspell.el ibuffer.el and 1348 other files Stefan Merten: co-wrote rst.el diff --git a/etc/NEWS b/etc/NEWS index aeddb07170..5be6a30c24 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -36,17 +36,11 @@ startup the directory with its "*.eln" natively-compiled files for the preloaded Lisp packages, and the relative name of that directory needs therefore to be recorded in the executable as part of the build. - -* Startup Changes in Emacs 28.2 - * Changes in Emacs 28.2 This is a bug-fix release with no new features. - -* Editing Changes in Emacs 28.2 - * Changes in Specialized Modes and Packages in Emacs 28.2 @@ -65,18 +59,6 @@ terminate Emacs with 'save-buffers-kill-emacs', not with 'kill-emacs'. (This change was done in Emacs 28.1, but we didn't announce it in NEWS back then.) - -* New Modes and Packages in Emacs 28.2 - - -* Incompatible Lisp Changes in Emacs 28.2 - - -* Lisp Changes in Emacs 28.2 - - -* Changes in Emacs 28.2 on Non-Free Operating Systems - * Installation Changes in Emacs 28.1 commit ddabb03a0176beb4b7fc8d4f2267d459fd2ebded Author: Stefan Kangas Date: Tue Sep 6 23:27:01 2022 +0200 * doc/misc/idlwave.texi (Troubleshooting): Don't say "Emacsen". diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 5261f993bc..9c05a379b8 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -4174,8 +4174,8 @@ tried to install the optional modules @file{idlw-roprompt.el} or load file}}. The problem is that your Emacs is not finding the version of IDLWAVE you -installed. Many Emacsen come with an older bundled copy of IDLWAVE -(e.g., v4.7 for Emacs 21.x), which is likely what's being used instead. +installed. Emacs might come with an older bundled copy of IDLWAVE +which is likely what's being used instead. You need to make sure your Emacs @emph{load-path} contains the directory where IDLWAVE is installed (@file{/usr/local/share/emacs/site-lisp}, by default), @emph{before} Emacs's default search directories. You can commit 724444f3d5cc6ff44c126353e2f0d8f14f591271 Author: Stefan Kangas Date: Mon Sep 5 22:24:05 2022 +0200 ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 737c871d3f..1367f26acf 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2025,7 +2025,7 @@ all server buffers are finished. You can take as long as you like to edit the server buffers within Emacs, and they are @emph{not} killed when you type @kbd{C-x #} in them. -@item --parent-id @var{id} +@item --parent-id=@var{id} Open an @command{emacsclient} frame as a client frame in the parent X window with id @var{id}, via the XEmbed protocol. Currently, this option is mainly useful for developers. commit b96257162df5c899f374b9ed2c769b3838a1b368 Author: Stefan Kangas Date: Tue Sep 6 13:57:01 2022 +0200 Don't mention very old Emacs versions in docs * doc/misc/mh-e.texi (Conventions): * doc/misc/reftex.texi (Problems and Work-Arounds): * doc/misc/viper.texi (Loading Viper): Delete references to very old versions of Emacs. diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index d42f71a022..ed5c64bb47 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -333,8 +333,7 @@ Press the @key{TAB} key. Press the @key{DELETE} key. @c ------------------------- @item @key{BS} -Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or -earlier of Emacs, you will need to use the @key{DEL} key.}. +Press the @key{BACKSPACE} key. @end table @cindex Emacs, prefix argument diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 0c95b388cb..b30e5aeaa4 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -3539,18 +3539,6 @@ as a label of type @code{?p}. Argument count for this macro starts only after the @samp{@{step+@}}, also when specifying how to get context. -@item -@b{Viper mode}@* -@cindex Viper mode -@cindex Key bindings, problems with Viper mode -@findex viper-harness-minor-mode -With @i{Viper} mode prior to Vipers version 3.01, you need to protect -@RefTeX{}'s keymaps with - -@lisp -(viper-harness-minor-mode "reftex") -@end lisp - @end itemize @page diff --git a/doc/misc/viper.texi b/doc/misc/viper.texi index 97bb7d75cf..eeafd64be3 100644 --- a/doc/misc/viper.texi +++ b/doc/misc/viper.texi @@ -325,9 +325,9 @@ lines (in the given order!): @noindent in your @file{~/.emacs} file. The @file{.emacs} file is placed in your home directory and it is be executed every time you invoke Emacs. This is -the place where all general Emacs customization takes place. Beginning with -version 20.0, Emacsen have an interactive interface, which simplifies the -job of customization significantly. +the place where all general Emacs customization takes place. Emacs +has an interactive interface (@kbd{M-x customize}), which simplifies +the job of customization significantly. Viper also uses the file @file{~/.emacs.d/viper} for Viper-specific customization. The location of Viper customization file can be changed by setting the