From fc6bcb89803a37e106f302282bff162e5d90bc40 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 26 Jun 2023 13:25:45 +0000 Subject: [PATCH 1/3] CC Mode: Fix parenthesis bug in XEmacs part of macro * lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace): Correct confused parentheses. --- lisp/progmodes/cc-defs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From 748b1f1f48e28339e5f479a9aaba5eadd9c69ab2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 26 Jun 2023 15:48:48 +0200 Subject: [PATCH 2/3] Fix Tramp mount-spec * lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): The mount-spec could contain an optional trailing slash. (Bug#64278) * lisp/net/tramp-rclone.el (tramp-rclone-handle-file-system-info): Check return code of command. --- lisp/net/tramp-fuse.el | 13 +++++++++++-- lisp/net/tramp-rclone.el | 38 +++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 21 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) From 3a50773ab0071addba98249d26c309f5fb78bd74 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 26 Jun 2023 11:25:14 -0400 Subject: [PATCH 3/3] startup.el: Don't override init.el custom of `debug-ignored-errors` * lisp/startup.el (startup--load-user-init-file): Undo commit 4302bc9b0f12. Mimic the code we use for `debug-on-error` instead. --- lisp/startup.el | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index 484c8f57a9f..5a389294e78 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1025,13 +1025,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))) @@ -1041,17 +1049,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))) @@ -1059,11 +1061,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 @@ -1102,11 +1100,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 @@ -1126,10 +1120,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))))