1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-04 14:40:54 -08:00

Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-07-05 08:45:06 +08:00
commit 2443f4ec77
13 changed files with 110 additions and 29 deletions

View file

@ -2255,6 +2255,12 @@ to visit one of these files. @kbd{M-x recentf-save-list} saves the
current @code{recentf-list} to a file, and @kbd{M-x recentf-edit-list}
edits it.
@vindex remote-file-name-access-timeout
If you use remote files, you might also consider customizing
@code{remote-file-name-access-timeout}, which is the number of
seconds after which the check whether a remote file shall be used
in Recentf is stopped. This prevents Emacs being blocked.
@c FIXME partial-completion-mode (complete.el) is obsolete.
The @kbd{M-x ffap} command generalizes @code{find-file} with more
powerful heuristic defaults (@pxref{FFAP}), often based on the text at

View file

@ -2812,9 +2812,13 @@ frame parameters you don't want to be restored; they will then be set
according to your customizations in the init file.
@vindex desktop-files-not-to-save
@vindex remote-file-name-access-timeout
Information about buffers visiting remote files is not saved by
default. Customize the variable @code{desktop-files-not-to-save} to
change this.
change this. In this case, you might also consider customizing
@code{remote-file-name-access-timeout}, which is the number of
seconds after which buffer restoration of a remote file is
stopped. This prevents Emacs being blocked.
@vindex desktop-restore-eager
By default, all the buffers in the desktop are restored in one go.

View file

@ -5158,10 +5158,10 @@ In order to disable those optimizations, set user option
@vindex remote-file-name-access-timeout
Some packages, like @file{desktop.el} or @file{recentf.el}, access
remote files when loaded. If the respective file is not accessible,
remote files when loaded. If the requested file is not accessible,
@value{tramp} could block. In order to check whether this could
happen, add a test via @code{access-file} with a proper timeout prior
loading these packages:
to loading these packages:
@lisp
@group
@ -5181,6 +5181,12 @@ If the connection to the remote host isn't established yet, and if
this requires an interactive password, the timeout check doesn't work
properly.
@c Since Emacs 30.
@strong{Note}: In recent versions of Emacs, both packages already
apply this check. You just need to customize
@code{remote-file-name-access-timeout} to the desired timeout (in
seconds).
@item
Does @value{tramp} support @acronym{SSH} security keys?

View file

@ -476,6 +476,25 @@ which makes them visually distinct from subroutine prototypes.
CPerl mode supports the new keywords for exception handling and the
object oriented syntax which were added in Perl 5.36 and 5.38.
** Emacs Sessions (Desktop)
+++
*** Restoring buffers visiting remote files can now time out.
When a buffer is restored which visits a remote file, the restoration
of the session could hang if the remote host is off-line or slow to
respond. Setting the user option 'remote-file-name-access-timeout' to
a positive number will abandon the attempt to restore such buffers
after a timeout of that many seconds, thus allowing the rest of
desktop restoration to continue.
** Recentf
+++
*** Checking recent remote files can now time out.
Similarly to buffer restoration by "desktop", 'recentf-mode' checking
of the accessibility of remote files can now time out if
`remote-file-name-access-timeout' is set to a positive number.
* New Modes and Packages in Emacs 30.1

View file

@ -397,7 +397,12 @@ or `desktop-modes-not-to-save'."
(defcustom desktop-files-not-to-save
"\\(\\`/[^/:]*:\\|(ftp)\\'\\)"
"Regexp identifying files whose buffers are to be excluded from saving.
The default value excludes buffers visiting remote files."
The default value excludes buffers visiting remote files.
If you modify this such that buffers visiting remote files are not excluded,
you may wish customizing `remote-file-name-access-timeout' to a non-nil
value, to avoid hanging the desktop restoration because some remote
host is off-line."
:type '(choice (const :tag "None" nil)
regexp)
:group 'desktop)
@ -1499,6 +1504,11 @@ This function is called from `window-configuration-change-hook'."
(desktop-clear)
(desktop-read desktop-dirname))
;; ----------------------------------------------------------------------------
(defun desktop-access-file (filename)
"Check whether FILENAME is accessible."
(ignore-errors (not (access-file filename "Restoring desktop buffer"))))
(defvar desktop-buffer-major-mode)
(defvar desktop-buffer-locals)
(defvar auto-insert) ; from autoinsert.el
@ -1508,8 +1518,8 @@ This function is called from `window-configuration-change-hook'."
_buffer-misc)
"Restore a file buffer."
(when buffer-filename
(if (or (file-exists-p buffer-filename)
(let ((msg (format "Desktop: File \"%s\" no longer exists."
(if (or (desktop-access-file buffer-filename)
(let ((msg (format "Desktop: File \"%s\" no longer accessible."
buffer-filename)))
(if desktop-missing-file-warning
(y-or-n-p (concat msg " Re-create buffer? "))

View file

@ -3998,9 +3998,14 @@ Let-bind it when necessary.")
(with-parsed-tramp-file-name filename v
(with-tramp-timeout
(timeout
(unless (when-let ((p (tramp-get-connection-process v)))
(and (process-live-p p)
(tramp-get-connection-property p "connected")))
(tramp-cleanup-connection v 'keep-debug 'keep-password))
(tramp-error
v 'file-error
(format "%s: Timeout %s second(s) accessing %s" string timeout filename)))
(format
"%s: Timeout %s second(s) accessing %s" string timeout filename)))
(setq filename (file-truename filename))
(if (file-exists-p filename)
(unless

View file

@ -10219,7 +10219,11 @@ point unchanged and return nil."
(prog1
(setq found
(c-syntactic-re-search-forward
"[;:,]\\|\\(=\\|\\s(\\)"
;; Consider making the next regexp a
;; c-lang-defvar (2023-07-04).
(if (c-major-mode-is 'objc-mode)
"\\(?:@end\\)\\|[;:,]\\|\\(=\\|[[(]\\)"
"[;:,]\\|\\(=\\|\\s(\\)")
limit 'limit t))
(setq got-init
(and found (match-beginning 1))))

View file

@ -387,7 +387,7 @@
(parse-sexp-lookup-properties
(cc-eval-when-compile
(boundp 'parse-sexp-lookup-properties))))
,(c-make-font-lock-search-form regexp highlights))
,(c-make-font-lock-search-form regexp highlights t))
nil)))
(defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights)

View file

@ -462,12 +462,20 @@ so that all identifiers are recognized as words.")
c-before-change-check-unbalanced-strings
c-parse-quotes-before-change
c-before-change-fix-comment-escapes)
(c objc) '(c-extend-region-for-CPP
c-depropertize-CPP
c-truncate-bs-cache
c-before-change-check-unbalanced-strings
c-parse-quotes-before-change
c-before-change-fix-comment-escapes)
c '(c-extend-region-for-CPP
c-depropertize-CPP
c-truncate-bs-cache
c-before-change-check-unbalanced-strings
c-parse-quotes-before-change
c-before-change-fix-comment-escapes)
objc '(c-extend-region-for-CPP
c-depropertize-CPP
c-truncate-bs-cache
c-before-change-check-unbalanced-strings
c-unmark-<>-around-region
c-before-change-check-<>-operators
c-parse-quotes-before-change
c-before-change-fix-comment-escapes)
java '(c-parse-quotes-before-change
c-unmark-<>-around-region
c-before-change-check-unbalanced-strings
@ -504,14 +512,24 @@ parameters \(point-min) and \(point-max).")
c-after-change-escape-NL-in-string
c-after-change-mark-abnormal-strings
c-change-expand-fl-region)
(c objc) '(c-depropertize-new-text
c-after-change-fix-comment-escapes
c-after-change-escape-NL-in-string
c-parse-quotes-after-change
c-after-change-mark-abnormal-strings
c-extend-font-lock-region-for-macros
c-neutralize-syntax-in-CPP
c-change-expand-fl-region)
c '(c-depropertize-new-text
c-after-change-fix-comment-escapes
c-after-change-escape-NL-in-string
c-parse-quotes-after-change
c-after-change-mark-abnormal-strings
c-extend-font-lock-region-for-macros
c-neutralize-syntax-in-CPP
c-change-expand-fl-region)
objc '(c-depropertize-new-text
c-after-change-fix-comment-escapes
c-after-change-escape-NL-in-string
c-parse-quotes-after-change
c-after-change-mark-abnormal-strings
c-unmark-<>-around-region
c-extend-font-lock-region-for-macros
c-neutralize-syntax-in-CPP
c-restore-<>-properties
c-change-expand-fl-region)
c++ '(c-depropertize-new-text
c-after-change-fix-comment-escapes
c-after-change-escape-NL-in-string

View file

@ -1305,7 +1305,8 @@ or \"${ foo }\" will not.")
"A sequence for recommended version number schemes in Perl.")
(defconst cperl--single-attribute-rx
`(sequence ,cperl--basic-identifier-rx
`(sequence word-start
,cperl--basic-identifier-rx
(optional (sequence "("
(0+ (not (in ")")))
")")))
@ -1552,7 +1553,7 @@ the last)."
(if attr (concat
"\\("
cperl-maybe-white-and-comment-rex ; whitespace-comments
"\\(\\sw\\|_\\)+" ; attr-name
"\\(\\<\\sw\\|_\\)+" ; attr-name
;; attr-arg (1 level of internal parens allowed!)
"\\((\\(\\\\.\\|[^\\()]\\|([^\\()]*)\\)*)\\)?"
"\\(" ; optional : (XXX allows trailing???)
@ -6003,7 +6004,11 @@ default function."
;; ... or the start of a "sloppy" signature
(sequence (eval cperl--sloppy-signature-rx)
;; arbtrarily continue "a few lines"
(repeat 0 200 (not (in "{"))))))))
(repeat 0 200 (not (in "{"))))
;; make sure we have a reasonably
;; short match for an incomplete sub
(not (in ";{("))
buffer-end))))
'(1 (if (match-beginning 3)
'font-lock-variable-name-face
'font-lock-function-name-face)

View file

@ -112,11 +112,15 @@ must return non-nil to exclude it."
:group 'recentf
:type '(repeat (choice regexp function)))
(defun recentf-access-file (filename)
"Check whether FILENAME is accessible."
(ignore-errors (not (access-file filename "Checking recentf file"))))
(defun recentf-keep-default-predicate (file)
"Return non-nil if FILE should be kept in the recent list.
It handles the case of remote files as well."
(cond
((file-remote-p file nil t) (file-readable-p file))
((file-remote-p file nil t) (recentf-access-file file))
((file-remote-p file))
((file-readable-p file))))

View file

@ -4735,7 +4735,7 @@ impose the use of a shell (with its need to quote arguments)."
(when (buffer-live-p buf)
(remove-function (process-filter proc)
nonce)
(display-buffer buf))))
(display-buffer buf '(nil (allow-no-window . t))))))
`((name . ,nonce)))))))
;; Otherwise, command is executed synchronously.
(shell-command-on-region (point) (point) command

View file

@ -233,7 +233,7 @@ attributes, prototypes and signatures."
'font-lock-constant-face)))
;; The signature
(goto-char (point-min))
(search-forward-regexp "\\(\$top\\),\\(\$down\\)")
(search-forward-regexp "\\(\\$top\\),\\(\\$down\\)")
(should (equal (get-text-property (match-beginning 1) 'face)
'font-lock-variable-name-face))
(should (equal (get-text-property (match-beginning 1) 'face)