[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android 822bc6afd65: Merge remote-tracking branch 'origin/master
From: |
Po Lu |
Subject: |
feature/android 822bc6afd65: Merge remote-tracking branch 'origin/master' into feature/android |
Date: |
Mon, 26 Jun 2023 20:43:46 -0400 (EDT) |
branch: feature/android
commit 822bc6afd65738dc20f455a17b42eb27741f4fd3
Merge: d95c5680f96 3a50773ab00
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/android
---
lisp/net/tramp-fuse.el | 13 +++++++++++--
lisp/net/tramp-rclone.el | 38 +++++++++++++++++++-------------------
lisp/progmodes/cc-defs.el | 4 ++--
lisp/startup.el | 44 +++++++++++++++++++++-----------------------
4 files changed, 53 insertions(+), 46 deletions(-)
diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el
index 99360c2c28e..aadc64666a5 100644
--- a/lisp/net/tramp-fuse.el
+++ b/lisp/net/tramp-fuse.el
@@ -174,12 +174,21 @@ It has the same meaning as
`remote-file-name-inhibit-cache'.")
(or (tramp-get-file-property vec "/" "mounted")
(let* ((default-directory tramp-compat-temporary-file-directory)
(command (format "mount -t fuse.%s" (tramp-file-name-method
vec)))
- (mount (shell-command-to-string command)))
+ (mount (shell-command-to-string command))
+ (mount-spec (split-string (tramp-fuse-mount-spec vec) ":"
'omit)))
(tramp-message vec 6 "%s\n%s" command mount)
+ ;; The mount-spec contains a trailing local file name part,
+ ;; which might not be visible, for example with rclone
+ ;; mounts of type "memory" or "gdrive". Make it optional.
+ (setq mount-spec
+ (if (cdr mount-spec)
+ (rx (literal (car mount-spec))
+ ":" (? (literal (cadr mount-spec))))
+ (car mount-spec)))
(tramp-set-file-property
vec "/" "mounted"
(when (string-match
- (rx bol (group (literal (tramp-fuse-mount-spec vec)))
+ (rx bol (group (regexp mount-spec))
" on " (group (+ (not blank))) blank)
mount)
(tramp-set-file-property
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 02e96e10438..f71e4f732e2 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -300,25 +300,25 @@ file names."
(setq filename (file-name-directory filename)))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-message v 5 "file system info: %s" localname)
- (tramp-rclone-send-command v "about" (concat host ":"))
- (with-current-buffer (tramp-get-connection-buffer v)
- (let (total used free)
- (goto-char (point-min))
- (while (not (eobp))
- (when (looking-at (rx "Total: " (+ blank) (group (+ digit))))
- (setq total (string-to-number (match-string 1))))
- (when (looking-at (rx "Used: " (+ blank) (group (+ digit))))
- (setq used (string-to-number (match-string 1))))
- (when (looking-at (rx "Free: " (+ blank) (group (+ digit))))
- (setq free (string-to-number (match-string 1))))
- (forward-line))
- (when used
- ;; The used number of bytes is not part of the result. As
- ;; side effect, we store it as file property.
- (tramp-set-file-property v localname "used-bytes" used))
- ;; Result.
- (when (and total free)
- (list total free (- total free))))))))
+ (when (zerop (tramp-rclone-send-command v "about" (concat host ":")))
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (let (total used free)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (when (looking-at (rx "Total: " (+ blank) (group (+ digit))))
+ (setq total (string-to-number (match-string 1))))
+ (when (looking-at (rx "Used: " (+ blank) (group (+ digit))))
+ (setq used (string-to-number (match-string 1))))
+ (when (looking-at (rx "Free: " (+ blank) (group (+ digit))))
+ (setq free (string-to-number (match-string 1))))
+ (forward-line))
+ (when used
+ ;; The used number of bytes is not part of the result.
+ ;; As side effect, we store it as file property.
+ (tramp-set-file-property v localname "used-bytes" used))
+ ;; Result.
+ (when (and total free)
+ (list total free (- total free)))))))))
(defun tramp-rclone-handle-rename-file
(filename newname &optional ok-if-already-exists)
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index f9b63cbeed6..1d7f90ed428 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1870,9 +1870,9 @@ with value CHAR in the region [FROM to)."
'(looking-at
"\\([;#]\\|\\'\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s$\\|\\s<\\|\\s>\\|\\s!\\)")
'(or (looking-at
- "\\([;#]\\|\\'\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s$\\|\\s<\\|\\s>\\)"
+ "\\([;#]\\|\\'\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s$\\|\\s<\\|\\s>\\)")
(let ((prop (c-get-char-property (point) 'syntax-table)))
- (equal prop '(14))))))) ; '(14) is generic comment delimiter.
+ (equal prop '(14)))))) ; '(14) is generic comment delimiter.
(defsubst c-intersect-lists (list alist)
diff --git a/lisp/startup.el b/lisp/startup.el
index 2ba84a471af..572fba92984 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1038,13 +1038,21 @@ init-file, or to a default value if loading is not
possible."
(debug-on-error-should-be-set nil)
(debug-on-error-initial
(if (eq init-file-debug t)
- 'startup
+ 'startup--witness ;Dummy but recognizable non-nil value.
init-file-debug))
+ (d-i-e-from-init-file nil)
+ (d-i-e-initial
+ ;; Use (startup--witness) instead of nil, so we can detect when the
+ ;; init files set `debug-ignored-errors' to nil.
+ (if init-file-debug '(startup--witness) debug-ignored-errors))
;; The init file might contain byte-code with embedded NULs,
;; which can cause problems when read back, so disable nul
;; byte detection. (Bug#52554)
(inhibit-null-byte-detection t))
- (let ((debug-on-error debug-on-error-initial))
+ (let ((debug-on-error debug-on-error-initial)
+ ;; If they specified --debug-init, enter the debugger
+ ;; on any error whatsoever.
+ (debug-ignored-errors d-i-e-initial))
(condition-case-unless-debug error
(when init-file-user
(let ((init-file-name (funcall filename-function)))
@@ -1054,17 +1062,11 @@ init-file, or to a default value if loading is not
possible."
;; `user-init-file'.
(setq user-init-file t)
(when init-file-name
- ;; If they specified --debug-init, enter the debugger
- ;; on any error whatsoever.
- (let ((debug-ignored-errors
- (if (and init-file-debug (not noninteractive))
- nil
- debug-ignored-errors)))
- (load (if (equal (file-name-extension init-file-name)
- "el")
- (file-name-sans-extension init-file-name)
- init-file-name)
- 'noerror 'nomessage)))
+ (load (if (equal (file-name-extension init-file-name)
+ "el")
+ (file-name-sans-extension init-file-name)
+ init-file-name)
+ 'noerror 'nomessage))
(when (and (eq user-init-file t) alternate-filename-function)
(let ((alt-file (funcall alternate-filename-function)))
@@ -1072,11 +1074,7 @@ init-file, or to a default value if loading is not
possible."
(setq init-file-name alt-file))
(and (equal (file-name-extension alt-file) "el")
(setq alt-file (file-name-sans-extension alt-file)))
- (let ((debug-ignored-errors
- (if (and init-file-debug (not noninteractive))
- nil
- debug-ignored-errors)))
- (load alt-file 'noerror 'nomessage))))
+ (load alt-file 'noerror 'nomessage)))
;; If we did not find the user's init file, set
;; user-init-file conclusively. Don't let it be
@@ -1115,11 +1113,7 @@ init-file, or to a default value if loading is not
possible."
(not inhibit-default-init))
;; Prevent default.el from changing the value of
;; `inhibit-startup-screen'.
- (let ((inhibit-startup-screen nil)
- (debug-ignored-errors
- (if (and init-file-debug (not noninteractive))
- nil
- debug-ignored-errors)))
+ (let ((inhibit-startup-screen nil))
(load "default" 'noerror 'nomessage))))
(error
(display-warning
@@ -1139,10 +1133,14 @@ the `--debug-init' option to view a complete error
backtrace."
;; If we can tell that the init file altered debug-on-error,
;; arrange to preserve the value that it set up.
+ (or (eq debug-ignored-errors d-i-e-initial)
+ (setq d-i-e-from-init-file (list debug-ignored-errors)))
(or (eq debug-on-error debug-on-error-initial)
(setq debug-on-error-should-be-set t
debug-on-error-from-init-file debug-on-error)))
+ (when d-i-e-from-init-file
+ (setq debug-ignored-errors (car d-i-e-from-init-file)))
(when debug-on-error-should-be-set
(setq debug-on-error debug-on-error-from-init-file))))