commit 9a1e87ba4486df19259abf3564a0281d8be25e64 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Tue Dec 7 08:06:12 2021 +0100 Add vc-git-stash-pop to vc-dir-git-mode * lisp/vc/vc-git.el (vc-dir-git-mode-map): Add vc-git-stash-pop (bug#52158). diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 3ceed365ee..5c6a39aec9 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1874,7 +1874,8 @@ Returns nil if not possible." (defvar-keymap vc-dir-git-mode-map "z c" #'vc-git-stash - "z s" #'vc-git-stash-snapshot) + "z s" #'vc-git-stash-snapshot + "z p" #'vc-git-stash-pop) (define-minor-mode vc-dir-git-mode "A minor mode for git-specific commands in `vc-dir-mode' buffers. commit abf06a46b490be49f12f5509817cbb400c78bc6e Merge: bdcf3c3504 da23e607d3 Author: Stefan Kangas Date: Tue Dec 7 06:47:32 2021 +0100 Merge from origin/emacs-28 da23e607d3 Select the right buffer for event in context-menu function... commit bdcf3c3504566fd61c42b06ee41cae5c074c3c03 Author: Po Lu Date: Tue Dec 7 13:44:52 2021 +0800 Cancel xwidget progress timer when buffer is killed * lisp/xwidget.el (xwidget-webkit-buffer-kill): New function. (xwidget-webkit-mode): Add `xwidget-webkit-buffer-kill' to `kill-buffer-hook'. (bug#52344) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index cf4396fec2..ce9839ebd3 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -409,6 +409,11 @@ If N is omitted or nil, scroll backwards by one char." (with-current-buffer (xwidget-buffer xwidget) (force-mode-line-update))) +(defun xwidget-webkit-buffer-kill () + "Clean up an xwidget-webkit buffer before it is killed." + (when (timerp xwidget-webkit--progress-update-timer) + (cancel-timer xwidget-webkit--progress-update-timer))) + (defun xwidget-webkit-callback (xwidget xwidget-event-type) "Callback for xwidgets. XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget." @@ -479,6 +484,7 @@ If non-nil, plugins are enabled. Otherwise, disabled." (define-derived-mode xwidget-webkit-mode special-mode "xwidget-webkit" "Xwidget webkit view mode." (setq buffer-read-only t) + (add-hook 'kill-buffer-hook #'xwidget-webkit-buffer-kill) (setq-local tool-bar-map xwidget-webkit-tool-bar-map) (setq-local bookmark-make-record-function #'xwidget-webkit-bookmark-make-record) commit e17aea73a5b2ae5f7cbf9057d7dad286be81ffc0 Author: Eric Abrahamsen Date: Mon Dec 6 13:43:24 2021 -0800 When registering Gnus message ids, guard against no registry * lisp/gnus/gnus-registry.el (gnus-registry-register-message-ids): There are situations where this code is called without a full Gnus startup (eg, debbugs). If the registry doesn't exist, just skip this process. diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 8ce88dc81e..163d543afd 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -847,7 +847,8 @@ Overrides existing keywords with FORCE set non-nil." (defun gnus-registry-register-message-ids () "Register the Message-ID of every article in the group." (unless (or (gnus-parameter-registry-ignore gnus-newsgroup-name) - (null gnus-registry-register-all)) + (null gnus-registry-register-all) + (null (eieio-object-p gnus-registry-db))) (dolist (article gnus-newsgroup-articles) (let* ((id (gnus-registry-fetch-message-id-fast article)) (groups (gnus-registry-get-id-key id 'group))) commit bed5af1ea323a3b20ef505a05ccc69afaa9b645d Author: Stefan Kangas Date: Mon Dec 6 22:05:57 2021 +0100 Silence byte-compiler in two tests * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el: * test/lisp/mail/mail-utils-tests.el (mail-utils-tests-mail-rfc822-time-zone): Silence byte-compiler. diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el index ee52d831d6..e881e46a2d 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el @@ -325,6 +325,7 @@ ()) (with-suppressed-warnings ((obsolete defmethod) + (obsolete defgeneric) (obsolete next-method-p) (obsolete call-next-method)) (defmethod initialize-instance :after ((_this eitest-Jb) &rest _slots) diff --git a/test/lisp/mail/mail-utils-tests.el b/test/lisp/mail/mail-utils-tests.el index 5b54f2440c..f75de5c620 100644 --- a/test/lisp/mail/mail-utils-tests.el +++ b/test/lisp/mail/mail-utils-tests.el @@ -85,7 +85,8 @@ "foo@example.org\\|bar@example.org\\|baz@example.org"))) (ert-deftest mail-utils-tests-mail-rfc822-time-zone () - (should (stringp (mail-rfc822-time-zone (current-time))))) + (with-suppressed-warnings ((obsolete mail-rfc822-time-zone)) + (should (stringp (mail-rfc822-time-zone (current-time)))))) (ert-deftest mail-utils-test-mail-rfc822-date/contains-year () (should (string-match (rx " 20" digit digit " ") commit e637afce45e9a982e284d344a35b523d74d88010 Author: Stefan Kangas Date: Mon Dec 6 21:51:37 2021 +0100 Remove spurious space in byte-compiler warning * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-length-warn): Remove spurious space in byte-compiler warning. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-defun.el"): Update test. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index d6b25e0279..b1afa6fe61 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1712,10 +1712,10 @@ It is too wide if it has any lines longer than the largest of (nth 2 form))))) (when (and (consp name) (eq (car name) 'quote)) (setq name (cadr name))) - (setq name (if name (format " `%s'" name) "")) + (setq name (if name (format " `%s' " name) "")) (when (and kind docs (stringp docs) (byte-compile--wide-docstring-p docs col)) - (byte-compile-warn "%s%s docstring wider than %s characters" + (byte-compile-warn "%s%sdocstring wider than %s characters" kind name col)))) form) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 468b9b32f7..7e51f820b7 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -979,7 +979,7 @@ byte-compiled. Run with dynamic binding." (bytecomp--define-warning-file-test "warn-wide-docstring-defun.el" - "wider than .* characters") + "Warning: docstring wider than .* characters") (bytecomp--define-warning-file-test "warn-wide-docstring-defvar.el" commit 79335aa1857f85fd0ce7557200361bcba7af8466 Author: Stefan Kangas Date: Mon Dec 6 21:48:40 2021 +0100 Assume unfilled byte-compiler warnings in tests * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--define-warning-file-test): Remove workaround for filled byte-compilation warnings. See Bug#52281. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index b82afd353c..468b9b32f7 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -851,8 +851,7 @@ byte-compiled. Run with dynamic binding." (byte-compile-file ,(ert-resource-file file)) (ert-info ((buffer-string) :prefix "buffer: ") (,(if reverse 'should-not 'should) - (re-search-forward ,(string-replace " " "[ \n]+" re-warning) - nil t)))))) + (re-search-forward ,re-warning nil t)))))) (bytecomp--define-warning-file-test "error-lexical-var-with-add-hook.el" "add-hook.*lexical var") commit 5a9965f0c720698a44262160983ea089ce67f0d5 Author: Lars Ingebrigtsen Date: Mon Dec 6 21:43:39 2021 +0100 Fix previous shr-parse-style change * lisp/net/shr.el (shr-parse-style): Fix previous clean-up here (which wasn't well thought through). diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 63522b02ac..829cf151f7 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1431,9 +1431,7 @@ ones, in case fg and bg are nil." (defun shr-parse-style (style) (when style - (save-match-data - (when (string-search "\n" style) - (setq style (replace-match " " t t style)))) + (setq style (replace-regexp-in-string "\n" " " style)) (let ((plist nil)) (dolist (elem (split-string style ";")) (when elem commit 4eb749a17310952af02293d3e55ea3b75660002a Author: Tassilo Horn Date: Mon Dec 6 21:24:56 2021 +0100 dired.texi: Document dired-create-destination-dirs-on-trailing-dirsep * doc/emacs/dired.texi (Operating on Files): Document new option dired-create-destination-dirs-on-trailing-dirsep. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 0edd8bc7da..48cf5630ee 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -742,6 +742,15 @@ never creates such missing directories; the value @code{always}, means Dired automatically creates them; the value @code{ask} means Dired asks you for confirmation before creating them. +@vindex dired-create-destination-dirs-on-trailing-dirsep +If the option @code{dired-create-destination-dirs-on-trailing-dirsep} +is non-@code{nil} in addition to @code{dired-create-destination-dirs}, +a trailing directory separator at the destination directory is treated +specially. In that case, when copying to @samp{test/} and no +directory @samp{test} exists already, it will be created and the +specified source files or directories are copied into the newly +created directory. + @vindex dired-copy-preserve-time If @code{dired-copy-preserve-time} is non-@code{nil}, then copying with this command preserves the modification time of the old file in @@ -784,6 +793,14 @@ which to move the files (this is like the shell command @command{mv}). The option @code{dired-create-destination-dirs} controls whether Dired should create non-existent directories in @var{new}. +The option @code{dired-create-destination-dirs-on-trailing-dirsep}, +when set in addition to @code{dired-create-destination-dirs}, controls +wether a trailing directory separator at the destination is treated +specially. In that case, when renaming a directory @samp{old} to +@samp{new/} and no directory @samp{new} exists already, it will be +created and @samp{old} is moved into the newly created directory. +Otherwise, @samp{old} is renamed to @samp{new}. + Dired automatically changes the visited file name of buffers associated with renamed files so that they refer to the new names. commit dd2a994f0c6b8e0f725299a5b3a871578ed9d3e4 Merge: cdb4bc0a81 e135f15aac Author: Eli Zaretskii Date: Mon Dec 6 20:49:43 2021 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit cdb4bc0a81827968af755c02f8632c204ac6967a Author: Eli Zaretskii Date: Mon Dec 6 20:47:43 2021 +0200 Revert "Avoid small parasitic button on mode line" This reverts commit c9e901f4a612646be4ce06e1619897edfb073bf0. Turns out without that "ghost" button min-width doesn't work on the mode line at all... diff --git a/lisp/bindings.el b/lisp/bindings.el index 98a12a252a..ba3bf81b3e 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -501,7 +501,7 @@ mouse-1: Display Line and Column Mode Menu")) (defvar mode-line-position `((:propertize - ("" mode-line-percent-position) + (" " mode-line-percent-position) local-map ,mode-line-column-line-number-mode-map display (min-width (5.0)) mouse-face mode-line-highlight commit e135f15aac84bcc1357fe98aea56d9e198f51e8f Author: Michael Albinus Date: Mon Dec 6 19:36:15 2021 +0100 Tramp code cleanup * lisp/net/tramp.el (tramp-get-default-directory) (tramp-get-buffer-string): New defsubsts. (tramp-message, tramp-error-with-buffer) (tramp-file-name-for-operation, tramp-command-completion-p) (tramp-action-login, tramp-action-yesno, tramp-action-yn) (tramp-action-terminal, tramp-action-confirm-message) (tramp-wait-for-regexp, tramp-call-process) (tramp-call-process-region, tramp-read-passwd): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers) (tramp-reporter-dump-variable): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-gio-monitor-process-filter): * lisp/net/tramp-smb.el (tramp-smb-action-set-acl): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-name-all-completions): * test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case) (tramp-test32-shell-command): Use them. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 63eab1b31a..2eaebebed9 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -67,7 +67,7 @@ SYNTAX can be one of the symbols `default' (default), nil (mapcar (lambda (x) - (with-current-buffer x (when (tramp-tramp-file-p default-directory) x))) + (when (tramp-tramp-file-p (tramp-get-default-directory x)) x)) (buffer-list)))) ;;;###tramp-autoload @@ -593,9 +593,8 @@ buffer in your bug report. (defun tramp-reporter-dump-variable (varsym mailbuf) "Pretty-print the value of the variable in symbol VARSYM." - (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer)) - (val (with-current-buffer reporter-eval-buffer - (symbol-value varsym)))) + (when-let ((reporter-eval-buffer reporter-eval-buffer) + (val (buffer-local-value varsym reporter-eval-buffer))) (if (hash-table-p val) ;; Pretty print the cache. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 6d83ae59b0..d7af0d34bd 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1456,7 +1456,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." `file-notify' events." (let* ((events (process-get proc 'events)) (rest-string (process-get proc 'rest-string)) - (dd (with-current-buffer (process-buffer proc) default-directory)) + (dd (tramp-get-default-directory (process-buffer proc))) (ddu (regexp-quote (tramp-gvfs-url-file-name dd)))) (when rest-string (tramp-message proc 10 "Previous string:\n%s" rest-string)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 8e66363f03..c2a0231247 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2601,7 +2601,7 @@ The method used must be an out-of-band method." ;; We cannot use `insert-buffer-substring' because the Tramp ;; buffer changes its contents before insertion due to calling ;; `expand-file-name' and alike. - (insert (with-current-buffer (tramp-get-buffer v) (buffer-string))) + (insert (tramp-get-buffer-string (tramp-get-buffer v))) ;; We must enable unibyte strings, because the "--dired" ;; output counts in bytes. @@ -3160,8 +3160,7 @@ implementation will be used." (when outbuf (with-current-buffer outbuf (insert - (with-current-buffer (tramp-get-connection-buffer v) - (buffer-string)))) + (tramp-get-buffer-string (tramp-get-connection-buffer v)))) (when (and display (get-buffer-window outbuf t)) (redisplay)))) ;; When the user did interrupt, we should do it also. We use ;; return code -1 as marker. @@ -3475,8 +3474,7 @@ implementation will be used." (not (string-equal (buffer-string) - (with-current-buffer (tramp-get-buffer v) - (buffer-string)))) + (tramp-get-buffer-string (tramp-get-buffer v)))) (tramp-error v 'file-error (concat "Couldn't write region to `%s'," @@ -3770,8 +3768,7 @@ Fall back to normal file name handler if no Tramp handler exists." "Read output from \"gio monitor\" and add corresponding `file-notify' events." (let ((events (process-get proc 'events)) (remote-prefix - (with-current-buffer (process-buffer proc) - (file-remote-p default-directory))) + (file-remote-p (tramp-get-default-directory (process-buffer proc)))) (rest-string (process-get proc 'rest-string)) pos) (when rest-string diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 24119539db..34203076b2 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1436,9 +1436,9 @@ component is used as the target of the symlink." (unless (process-live-p proc) ;; Accept pending output. (while (tramp-accept-process-output proc)) - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 10 "\n%s" (buffer-string)) - (throw 'tramp-action 'ok)))) + (tramp-message + vec 10 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) + (throw 'tramp-action 'ok))) (defun tramp-smb-handle-set-file-acl (filename acl-string) "Like `set-file-acl' for Tramp files." diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 6da00f812d..0309b6b022 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -453,12 +453,13 @@ the result will be a local, non-Tramp, file name." (if (file-directory-p (expand-file-name f directory)) (file-name-as-directory f) f)) - (with-current-buffer (tramp-get-connection-buffer v) - (delq - nil - (mapcar - (lambda (l) (and (not (string-match-p "^[[:space:]]*$" l)) l)) - (split-string (buffer-string) "\n" 'omit))))))))) + (delq + nil + (mapcar + (lambda (l) (and (not (string-match-p "^[[:space:]]*$" l)) l)) + (split-string + (tramp-get-buffer-string (tramp-get-connection-buffer v)) + "\n" 'omit)))))))) (defun tramp-sudoedit-handle-file-readable-p (filename) "Like `file-readable-p' for Tramp files." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 552788b461..7dddd84e55 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1866,6 +1866,20 @@ version, the function does nothing." :user ,(file-remote-p default-directory 'user) :machine ,(file-remote-p default-directory 'host))))) +(defsubst tramp-get-default-directory (buffer) + "Return `default-directory' of BUFFER." + (buffer-local-value 'default-directory buffer)) + +(put #'tramp-get-default-directory 'tramp-suppress-trace t) + +(defsubst tramp-get-buffer-string (&optional buffer) + "Return contents of BUFFER. +If BUFFER is not a buffer, return the contents of `current-buffer'." + (with-current-buffer (if (bufferp buffer) buffer (current-buffer)) + (substring-no-properties (buffer-string)))) + +(put #'tramp-get-buffer-string 'tramp-suppress-trace t) + (defun tramp-debug-buffer-name (vec) "A name for the debug buffer for VEC." (let ((method (tramp-file-name-method vec)) @@ -2084,12 +2098,15 @@ applicable)." ;; Append connection buffer for error messages, if exists. (when (= level 1) (ignore-errors - (with-current-buffer - (if (processp vec-or-proc) - (process-buffer vec-or-proc) - (tramp-get-connection-buffer vec-or-proc 'dont-create)) - (setq fmt-string (concat fmt-string "\n%s") - arguments (append arguments (list (buffer-string))))))) + (setq fmt-string (concat fmt-string "\n%s") + arguments + (append + arguments + `(,(tramp-get-buffer-string + (if (processp vec-or-proc) + (process-buffer vec-or-proc) + (tramp-get-connection-buffer + vec-or-proc 'dont-create)))))))) ;; Translate proc to vec. (when (processp vec-or-proc) (setq vec-or-proc (process-get vec-or-proc 'vector)))) @@ -2151,8 +2168,8 @@ an input event arrives. The other arguments are passed to `tramp-error'." (and (tramp-file-name-p vec-or-proc) (tramp-get-connection-buffer vec-or-proc)))) (vec (or (and (tramp-file-name-p vec-or-proc) vec-or-proc) - (and buf (with-current-buffer buf - (tramp-dissect-file-name default-directory)))))) + (and buf (tramp-dissect-file-name + (tramp-get-default-directory buf)))))) (unwind-protect (apply #'tramp-error vec-or-proc signal fmt-string arguments) ;; Save exit. @@ -2567,8 +2584,7 @@ Must be handled by the callers." ;; PROC. ((member operation '(file-notify-rm-watch file-notify-valid-p)) (when (processp (nth 0 args)) - (with-current-buffer (process-buffer (nth 0 args)) - default-directory))) + (tramp-get-default-directory (process-buffer (nth 0 args))))) ;; VEC. ((member operation '(tramp-get-remote-gid tramp-get-remote-uid)) (tramp-make-tramp-file-name (nth 0 args))) @@ -2845,7 +2861,7 @@ whether HANDLER is to be called. Add operations defined in (defun tramp-command-completion-p (_symbol buffer) "A predicate for Tramp interactive commands. They are completed by \"M-x TAB\" only if the current buffer is remote." - (with-current-buffer buffer (tramp-tramp-file-p default-directory))) + (tramp-tramp-file-p (tramp-get-default-directory buffer))) (defun tramp-connectable-p (vec-or-filename) "Check, whether it is possible to connect the remote host w/o side-effects. @@ -4705,8 +4721,8 @@ of." (save-window-excursion (pop-to-buffer (tramp-get-connection-buffer vec)) (read-string (match-string 0))))))) - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 6 "\n%s" (buffer-string))) + (tramp-message + vec 6 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) (tramp-message vec 3 "Sending login name `%s'" user) (tramp-send-string vec (concat user tramp-local-end-of-line))) t) @@ -4749,8 +4765,8 @@ See also `tramp-action-yn'." (unless (yes-or-no-p (match-string 0)) (kill-process proc) (throw 'tramp-action 'permission-denied)) - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 6 "\n%s" (buffer-string))) + (tramp-message + vec 6 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) (tramp-send-string vec (concat "yes" tramp-local-end-of-line))) t) @@ -4763,8 +4779,8 @@ See also `tramp-action-yesno'." (unless (y-or-n-p (match-string 0)) (kill-process proc) (throw 'tramp-action 'permission-denied)) - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 6 "\n%s" (buffer-string))) + (tramp-message + vec 6 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) (tramp-send-string vec (concat "y" tramp-local-end-of-line))) t) @@ -4772,15 +4788,15 @@ See also `tramp-action-yesno'." "Tell the remote host which terminal type to use. The terminal type can be configured with `tramp-terminal-type'." (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type) - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 6 "\n%s" (buffer-string))) + (tramp-message + vec 6 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) (tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line)) t) (defun tramp-action-confirm-message (_proc vec) "Return RET in order to confirm the message." - (with-current-buffer (tramp-get-connection-buffer vec) - (tramp-message vec 6 "\n%s" (buffer-string))) + (tramp-message + vec 6 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec))) (tramp-send-string vec tramp-local-end-of-line) t) @@ -5068,8 +5084,8 @@ nil." ;; The process could have timed out, for example due to session ;; timeout of sudo. The process buffer does not exist any longer then. (ignore-errors - (with-current-buffer (process-buffer proc) - (tramp-message proc 6 "\n%s" (buffer-string)))) + (tramp-message + proc 6 "\n%s" (tramp-get-buffer-string (process-buffer proc)))) (unless found (if timeout (tramp-error @@ -5590,14 +5606,12 @@ are written with verbosity of 6." (with-temp-buffer (setq result (apply - #'call-process program infile (or destination t) display args)) + #'call-process program infile (or destination t) display args) + output (tramp-get-buffer-string destination)) ;; `result' could also be an error string. (when (stringp result) (setq error result - result 1)) - (with-current-buffer - (if (bufferp destination) destination (current-buffer)) - (setq output (buffer-string)))) + result 1))) (error (setq error (error-message-string err) result 1))) @@ -5628,10 +5642,10 @@ are written with verbosity of 6." ;; `result' could also be an error string. (when (stringp result) (signal 'file-error (list result))) - (with-current-buffer (if (bufferp buffer) buffer (current-buffer)) - (if (zerop result) - (tramp-message vec 6 "%d" result) - (tramp-message vec 6 "%d\n%s" result (buffer-string))))) + (if (zerop result) + (tramp-message vec 6 "%d" result) + (tramp-message + vec 6 "%d\n%s" result (tramp-get-buffer-string buffer)))) (error (setq result 1) (tramp-message vec 6 "%d\n%s" result (error-message-string err)))) @@ -5696,7 +5710,7 @@ Invokes `password-read' if available, `read-passwd' else." (format "%s for %s " (capitalize (match-string 1)) key)))) (auth-source-creation-prompts `((secret . ,pw-prompt))) ;; Use connection-local value. - (auth-sources (with-current-buffer (process-buffer proc) auth-sources)) + (auth-sources (buffer-local-value 'auth-sources (process-buffer proc))) ;; We suspend the timers while reading the password. (stimers (with-timeout-suspend)) auth-info auth-passwd) @@ -5922,5 +5936,11 @@ BODY is the backend specific code." ;; and friends, for most of the handlers this is the major ;; difference between the different backends. Other handlers but ;; *-process-file would profit from this as well. +;; +;; * Implement file name abbreviation for a different user. That is, +;; (abbreviate-file-name "/ssh:user1@host:/home/user2") => +;; "/ssh:user1@host:~user2". +;; +;; * Implement file name abbreviation for user and host names. ;;; tramp.el ends here diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c047f666da..a572ff83d3 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -219,8 +219,7 @@ is greater than 10. (when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3)) (untrace-all) (dolist (buf (tramp-list-tramp-buffers)) - (with-current-buffer buf - (message ";; %s\n%s" buf (buffer-string))) + (message ";; %s\n%s" buf (tramp-get-buffer-string buf)) (kill-buffer buf)))))) (defsubst tramp--test-message (fmt-string &rest arguments) @@ -5054,8 +5053,8 @@ INPUT, if non-nil, is a string sent to the process." "echo foo >&2; echo bar" (current-buffer) stderr) (should (string-equal "bar\n" (buffer-string))) ;; Check stderr. - (with-current-buffer stderr - (should (string-equal "foo\n" (buffer-string))))) + (should + (string-equal "foo\n" (tramp-get-buffer-string stderr)))) ;; Cleanup. (ignore-errors (kill-buffer stderr)))))) commit aa63064fec4b94bbe090ea17965062bfc11ee944 Author: Eli Zaretskii Date: Mon Dec 6 19:36:07 2021 +0200 Fix mode-line display on TTY frames * lisp/bindings.el (mode-line-frame-control): Remove the leading '-' before '%F' on TTY frames. It has no real purpose, and looks ugly nowadays, since it's preceded by a blank, due to the new min-width feature. diff --git a/lisp/bindings.el b/lisp/bindings.el index 8a850752fa..98a12a252a 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -288,7 +288,7 @@ mnemonics of the following coding systems: Value is used for `mode-line-frame-identification', which see." (if (or (null window-system) (eq window-system 'pc)) - "-%F " + " %F " " ")) ;; We need to defer the call to mode-line-frame-control to the time commit da23e607d33260c9aabaa3d136722a45457930dc (refs/remotes/origin/emacs-28) Author: Juri Linkov Date: Mon Dec 6 19:24:09 2021 +0200 Select the right buffer for event in context-menu functions (bug#9923) * lisp/mouse.el (context-menu-region): * lisp/progmodes/prog-mode.el (prog-context-menu): Switch to the buffer displayed by the window of the event before using syntax-ppss, char-after. diff --git a/lisp/mouse.el b/lisp/mouse.el index 5c645a4b89..8474a82111 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -479,14 +479,15 @@ Some context functions add menu items below the separator." `(menu-item "All" ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'buffer)) :help "Mark the whole buffer for a subsequent cut/copy")) - (when (let* ((pos (posn-point (event-end click))) - (char (when pos (char-after pos)))) - (or (and char (eq (char-syntax char) ?\")) - (nth 3 (save-excursion (syntax-ppss pos))))) - (define-key-after submenu [mark-string] - `(menu-item "String" - ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'string)) - :help "Mark the string at click for a subsequent cut/copy"))) + (with-current-buffer (window-buffer (posn-window (event-end click))) + (when (let* ((pos (posn-point (event-end click))) + (char (when pos (char-after pos)))) + (or (and char (eq (char-syntax char) ?\")) + (nth 3 (save-excursion (syntax-ppss pos))))) + (define-key-after submenu [mark-string] + `(menu-item "String" + ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'string)) + :help "Mark the string at click for a subsequent cut/copy")))) (define-key-after submenu [mark-line] `(menu-item "Line" ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'line)) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 4997c2746f..e43f2ff90b 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -87,7 +87,9 @@ 'mark-whole-buffer) ;; Include text-mode select menu only in strings and comments. - (when (nth 8 (save-excursion (syntax-ppss (posn-point (event-end click))))) + (when (nth 8 (save-excursion + (with-current-buffer (window-buffer (posn-window (event-end click))) + (syntax-ppss (posn-point (event-end click)))))) (text-mode-context-menu menu click)) menu) commit c9e901f4a612646be4ce06e1619897edfb073bf0 Author: Eli Zaretskii Date: Mon Dec 6 19:10:33 2021 +0200 Avoid small parasitic button on mode line * lisp/bindings.el (mode-line-position): Remove stray space character, which caused a "ghost" button on the mode line. (Bug#52332) diff --git a/lisp/bindings.el b/lisp/bindings.el index 578406dd98..8a850752fa 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -501,7 +501,7 @@ mouse-1: Display Line and Column Mode Menu")) (defvar mode-line-position `((:propertize - (" " mode-line-percent-position) + ("" mode-line-percent-position) local-map ,mode-line-column-line-number-mode-map display (min-width (5.0)) mouse-face mode-line-highlight commit a12de96455f8dc9b9a64c2d00a351cb81ffdb5bb Author: Stefan Kangas Date: Mon Dec 6 16:11:20 2021 +0100 ; * etc/tutorials/TUTORIAL.sv: Re-adjust to latest change in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv index 54756e224c..5c9703f806 100644 --- a/etc/tutorials/TUTORIAL.sv +++ b/etc/tutorials/TUTORIAL.sv @@ -1122,10 +1122,10 @@ Manualen beskriver även många andra funktioner i Emacs. * INSTALLERA PAKET ------------------ -Emacs har en stor uppsättning paket skrivna av användare, som utökar -Emacs funktionalitet. Detta kan innefatta stöd för nya språk, fler -teman, insticksmoduler för integration med externa program och mycket, -mycket annat. +Det finns en stor mängd paket för Emacs skrivna av användare, som +utökar Emacs funktionalitet. Detta kan innefatta stöd för nya språk, +fler teman, insticksmoduler för integration med externa program och +mycket, mycket annat. Skriv M-x list-packages för att se en lista över alla tillgängliga paket. I detta läge kan du installera eller avinstallera paket samt commit 2bd9d7bd0a5638cc1a5ca74cedc44ef059013f37 Author: Eli Zaretskii Date: Mon Dec 6 16:56:30 2021 +0200 ; * etc/tutorials/TUTORIAL: Minor wording change in recent addition. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index a43c5af45f..cbb333470a 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -1102,14 +1102,14 @@ The manual also describes many other Emacs features. * INSTALLING PACKAGES --------------------- -Emacs has a rich set of packages written by the community, which -extends Emacs' capabilities. These features include support for new -languages, additional themes, plugins for integrating with external -applications and much, much more. +There's a rich set of packages for Emacs written by the community, +which extend Emacs' capabilities. These packages include support for +new languages, additional themes, plugins for integrating with +external applications, and much, much more. To see a list of all available packages, type M-x list-packages. In -this mode, you can install or uninstall packages, as well as read -packages' descriptions. For more information about package +the display this shows, you can install or uninstall packages, as well +as read packages' descriptions. For more information about package management, consult the manual. commit 4d93859c871be523e58d21a5138a63a76dc4df39 Merge: 283db0d703 d529207b0e Author: Stefan Monnier Date: Mon Dec 6 09:44:18 2021 -0500 Merge remote-tracking branch 'origin/emacs-28' into trunk commit d529207b0eb26b623fadf4716581add58f2cc282 Author: Stefan Monnier Date: Mon Dec 6 09:43:13 2021 -0500 lisp/minibuffer.el: Fix for bug#52169 regression * lisp/minibuffer.el (completion-table-subvert): Make sure we return a boundary that's not outside of the limit of the string. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ca82b4a9e6..21d610fdf4 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -283,8 +283,9 @@ the form (concat S2 S)." ((eq (car-safe action) 'boundaries) (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0))) `(boundaries - ,(max (length s1) - (+ beg (- (length s1) (length s2)))) + ,(min (length string) + (max (length s1) + (+ beg (- (length s1) (length s2))))) . ,(and (eq (car-safe res) 'boundaries) (cddr res))))) ((stringp res) (if (string-prefix-p s2 res completion-ignore-case) commit 283db0d703f984bbfcbc1bde9c78fa399af36c50 Author: Stefan Kangas Date: Mon Dec 6 15:09:51 2021 +0100 * etc/tutorials/TUTORIAL.sv: Adjust to latest change in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv index dacc66d916..54756e224c 100644 --- a/etc/tutorials/TUTORIAL.sv +++ b/etc/tutorials/TUTORIAL.sv @@ -1119,6 +1119,20 @@ Emacs-manualen i noden "Dired". Manualen beskriver även många andra funktioner i Emacs. +* INSTALLERA PAKET +------------------ + +Emacs har en stor uppsättning paket skrivna av användare, som utökar +Emacs funktionalitet. Detta kan innefatta stöd för nya språk, fler +teman, insticksmoduler för integration med externa program och mycket, +mycket annat. + +Skriv M-x list-packages för att se en lista över alla tillgängliga +paket. I detta läge kan du installera eller avinstallera paket samt +läsa mer om olika paket. Se användarmanualen för mer information om +pakethantering. + + * SLUTORD --------- commit 3384efb903dc67008ca2569c9eab7b60151523cd Author: Stefan Kangas Date: Mon Dec 6 15:08:09 2021 +0100 ; * etc/tutorials/TUTORIAL: Fix typo in last commit. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index d7a298ed58..a43c5af45f 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -1105,7 +1105,7 @@ The manual also describes many other Emacs features. Emacs has a rich set of packages written by the community, which extends Emacs' capabilities. These features include support for new languages, additional themes, plugins for integrating with external -applications and much much more. +applications and much, much more. To see a list of all available packages, type M-x list-packages. In this mode, you can install or uninstall packages, as well as read commit 63c8a6066a203d872df89338c86a9fea34c36141 Author: Daniel Fleischer Date: Wed Dec 1 19:15:27 2021 +0200 Add package management to tutorial and startup screen * etc/tutorials/TUTORIAL: Add section about package installation. * lisp/startup.el (fancy-startup-tail): Add button for package-list-packages. This was discussed in: https://lists.gnu.org/r/emacs-devel/2021-12/msg00079.html diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index dcdb61f23e..d7a298ed58 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -1099,6 +1099,20 @@ manual in the node called "Dired". The manual also describes many other Emacs features. +* INSTALLING PACKAGES +--------------------- + +Emacs has a rich set of packages written by the community, which +extends Emacs' capabilities. These features include support for new +languages, additional themes, plugins for integrating with external +applications and much much more. + +To see a list of all available packages, type M-x list-packages. In +this mode, you can install or uninstall packages, as well as read +packages' descriptions. For more information about package +management, consult the manual. + + * CONCLUSION ------------ diff --git a/lisp/startup.el b/lisp/startup.el index e5e6b07b4d..3ac7532053 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1840,18 +1840,22 @@ a face or button specification." (unless concise (fancy-splash-insert :face 'variable-pitch - "\nTo start... " + "\nTo start...\t" :link `("Open a File" ,(lambda (_button) (call-interactively 'find-file)) "Specify a new file's name, to edit the file") - " " + "\t\t" :link `("Open Home Directory" ,(lambda (_button) (dired "~")) "Open your home directory, to operate on its files") - " " + "\n\t" :link `("Customize Startup" ,(lambda (_button) (customize-group 'initialization)) "Change initialization settings including this screen") + "\t" + :link `("Explore Packages" + ,(lambda (_button) (call-interactively 'package-list-packages)) + "Explore, install and remove Emacs packages (requires Internet connection)") "\n")) (fancy-splash-insert :face 'variable-pitch "To quit a partially entered command, type " commit 2e8d1ad0f206b3e1a8bd10f9def6679be5b4c086 Author: Stefan Kangas Date: Mon Dec 6 12:06:35 2021 +0100 image.c: Remove some dead code * src/image.c (gui_put_x_image): Remove dead code, commented out since 2004. diff --git a/src/image.c b/src/image.c index 278446e37f..65bf22b981 100644 --- a/src/image.c +++ b/src/image.c @@ -3064,14 +3064,6 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, XFreeGC (FRAME_X_DISPLAY (f), gc); #endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_NTGUI -#if 0 /* I don't think this is necessary looking at where it is used. */ - HDC hdc = get_frame_dc (f); - SetDIBits (hdc, pixmap, 0, height, pimg->data, &(pimg->info), DIB_RGB_COLORS); - release_frame_dc (f, hdc); -#endif -#endif /* HAVE_NTGUI */ - #ifdef HAVE_NS eassert (pimg == pixmap); ns_retain_object (pimg); @@ -10983,16 +10975,6 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f) free_color_table (); #endif XDestroyImage (ximg); - -#if 0 /* This doesn't seem to be the case. If we free the colors - here, we get a BadAccess later in image_clear_image when - freeing the colors. */ - /* We have allocated colors once, but Ghostscript has also - allocated colors on behalf of us. So, to get the - reference counts right, free them once. */ - if (img->ncolors) - x_free_colors (f, img->colors, img->ncolors); -#endif } else image_error ("Cannot get X image of `%s'; colors will not be freed",