[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android 804b76ba8db: Merge remote-tracking branch 'origin/master
From: |
Po Lu |
Subject: |
feature/android 804b76ba8db: Merge remote-tracking branch 'origin/master' into feature/android |
Date: |
Wed, 29 Mar 2023 21:14:21 -0400 (EDT) |
branch: feature/android
commit 804b76ba8db20d65106394f08e807bdc93c2c55d
Merge: 219bfea874b bfa3500c3c6
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/android
---
etc/NEWS | 15 ++++++
lisp/emacs-lisp/cl-macs.el | 33 ++++++------
lisp/emacs-lisp/macroexp.el | 5 ++
lisp/net/dbus.el | 6 ++-
lisp/net/tramp-gvfs.el | 95 ++++++++++++++++++----------------
lisp/progmodes/eglot.el | 2 +-
test/infra/Dockerfile.emba | 13 +++--
test/lisp/emacs-lisp/bytecomp-tests.el | 6 +++
8 files changed, 108 insertions(+), 67 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 6a39cddcaac..2e2812e3b93 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -455,6 +455,21 @@ was to catch all errors, add an explicit handler for
'error', or use
This warning can be suppressed using 'with-suppressed-warnings' with
the warning name 'suspicious'.
+---
+*** Warn about 'unwind-protect' without unwind forms.
+The compiler now warns when the 'unwind-protect' form is used without
+any unwind forms, as in
+
+ (unwind-protect (read buffer))
+
+because the behaviour is identical to that of the argument; there is
+no protection of any kind. Perhaps the intended unwind forms have
+been misplaced or forgotten, or the use of 'unwind-protect' could be
+simplified away.
+
+This warning can be suppressed using 'with-suppressed-warnings' with
+the warning name 'suspicious'.
+
+++
** New function 'file-user-uid'.
This function is like 'user-uid', but is aware of file name handlers,
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index cffe8b09f53..8dc8b475a7f 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2758,26 +2758,29 @@ Each PLACE may be a symbol, or any generalized variable
allowed by `setf'.
;; Common-Lisp's `psetf' does the first, so we'll do the same.
(if (null bindings)
(if (and (null binds) (null simplebinds)) (macroexp-progn body)
+ (let ((body-form
+ (macroexp-progn
+ (append
+ (delq nil
+ (mapcar (lambda (x)
+ (pcase x
+ ;; If there's no vnew, do nothing.
+ (`(,_vold ,_getter ,setter ,vnew)
+ (funcall setter vnew))))
+ binds))
+ body))))
`(let* (,@(mapcar (lambda (x)
(pcase-let ((`(,vold ,getter ,_setter ,_vnew) x))
(list vold getter)))
binds)
,@simplebinds)
- (unwind-protect
- ,(macroexp-progn
- (append
- (delq nil
- (mapcar (lambda (x)
- (pcase x
- ;; If there's no vnew, do nothing.
- (`(,_vold ,_getter ,setter ,vnew)
- (funcall setter vnew))))
- binds))
- body))
- ,@(mapcar (lambda (x)
- (pcase-let ((`(,vold ,_getter ,setter ,_vnew) x))
- (funcall setter vold)))
- binds))))
+ ,(if binds
+ `(unwind-protect ,body-form
+ ,@(mapcar (lambda (x)
+ (pcase-let ((`(,vold ,_getter ,setter ,_vnew)
x))
+ (funcall setter vold)))
+ binds))
+ body-form))))
(let* ((binding (car bindings))
(place (car binding)))
(gv-letplace (getter setter) place
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 8cb67c3b8b5..b05aba3e1a7 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -383,6 +383,11 @@ Assumes the caller has bound
`macroexpand-all-environment'."
(format-message "missing `while' condition")
`(signal 'wrong-number-of-arguments '(while 0))
nil 'compile-only form))
+ (`(unwind-protect ,expr)
+ (macroexp-warn-and-return
+ (format-message "`unwind-protect' without unwind forms")
+ (macroexp--expand-all expr)
+ (list 'suspicious 'unwind-protect) t form))
(`(setq ,(and var (pred symbolp)
(pred (not booleanp)) (pred (not keywordp)))
,expr)
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index f35d11db152..fff860b05c3 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -371,7 +371,11 @@ object is returned instead of a list containing this
single Lisp object.
(apply
#'dbus-message-internal dbus-message-type-method-call
bus service path interface method #'dbus-call-method-handler args))
- (result (cons :pending nil)))
+ (result (unless executing-kbd-macro (cons :pending nil))))
+
+ ;; While executing a keyboard macro, we run into an infinite loop,
+ ;; receiving the event -1. So we don't try to get the result.
+ ;; (Bug#62018)
;; Wait until `dbus-call-method-handler' has put the result into
;; `dbus-return-values-table'. If no timeout is given, use the
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f925d2f3da5..d44fd55b225 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -119,8 +119,6 @@
(defconst tramp-gvfs-enabled
(ignore-errors
(and (featurep 'dbusbind)
- (autoload 'zeroconf-init "zeroconf")
- (tramp-compat-funcall 'dbus-get-unique-name :system)
(tramp-compat-funcall 'dbus-get-unique-name :session)
(or (tramp-process-running-p "gvfs-fuse-daemon")
(tramp-process-running-p "gvfsd-fuse"))))
@@ -224,6 +222,13 @@ It has been changed in GVFS 1.14.")
"The name of the \"listMountTypes\" method.
It has been changed in GVFS 1.14.")
+(defconst tramp-gvfs-mounttypes
+ (and tramp-gvfs-enabled
+ (dbus-call-method
+ :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
+ tramp-gvfs-interface-mounttracker tramp-gvfs-listmounttypes))
+ "The list of supported mount types of the mount tracking interface.")
+
(defconst tramp-gvfs-listmounts
(if (member "ListMounts" tramp-gvfs-methods-mounttracker)
"ListMounts"
@@ -2188,11 +2193,7 @@ connection if a previous connection has died for some
reason."
("afp". "afp-volume")
("gdrive" . "google-drive")))
method)
- (with-tramp-dbus-call-method vec t
- :session tramp-gvfs-service-daemon
- tramp-gvfs-path-mounttracker
- tramp-gvfs-interface-mounttracker
- tramp-gvfs-listmounttypes))
+ tramp-gvfs-mounttypes)
(tramp-error vec 'file-error "Method `%s' not supported by GVFS"
method)))
;; For password handling, we need a process bound to the connection
@@ -2538,43 +2539,45 @@ This uses \"avahi-browse\" in case D-Bus is not enabled
in Avahi."
;; Suppress D-Bus error messages and Tramp traces.
(let ((tramp-verbose 0)
tramp-gvfs-dbus-event-vector fun)
- ;; Add completion functions for services announced by DNS-SD.
- ;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
- (zeroconf-init tramp-gvfs-zeroconf-domain)
- (when (setq fun (or (and (zeroconf-list-service-types)
- #'tramp-zeroconf-parse-device-names)
- (and (executable-find "avahi-browse")
- #'tramp-gvfs-parse-device-names)))
- (when (member "afp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "afp" `((,fun "_afpovertcp._tcp"))))
- (when (member "dav" tramp-gvfs-methods)
- (tramp-set-completion-function
- "dav" `((,fun "_webdav._tcp")
- (,fun "_webdavs._tcp"))))
- (when (member "davs" tramp-gvfs-methods)
- (tramp-set-completion-function
- "davs" `((,fun "_webdav._tcp")
- (,fun "_webdavs._tcp"))))
- (when (member "ftp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "ftp" `((,fun "_ftp._tcp"))))
- (when (member "http" tramp-gvfs-methods)
- (tramp-set-completion-function
- "http" `((,fun "_http._tcp")
- (,fun "_https._tcp"))))
- (when (member "https" tramp-gvfs-methods)
- (tramp-set-completion-function
- "https" `((,fun "_http._tcp")
- (,fun "_https._tcp"))))
- (when (member "sftp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "sftp" `((,fun "_sftp-ssh._tcp")
- (,fun "_ssh._tcp")
- (,fun "_workstation._tcp"))))
- (when (member "smb" tramp-gvfs-methods)
- (tramp-set-completion-function
- "smb" `((,fun "_smb._tcp")))))
+ (when (and (autoload 'zeroconf-init "zeroconf")
+ (tramp-compat-funcall 'dbus-get-unique-name :system))
+ ;; Add completion functions for services announced by DNS-SD.
+ ;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
+ (zeroconf-init tramp-gvfs-zeroconf-domain)
+ (when (setq fun (or (and (zeroconf-list-service-types)
+ #'tramp-zeroconf-parse-device-names)
+ (and (executable-find "avahi-browse")
+ #'tramp-gvfs-parse-device-names)))
+ (when (member "afp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "afp" `((,fun "_afpovertcp._tcp"))))
+ (when (member "dav" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "dav" `((,fun "_webdav._tcp")
+ (,fun "_webdavs._tcp"))))
+ (when (member "davs" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "davs" `((,fun "_webdav._tcp")
+ (,fun "_webdavs._tcp"))))
+ (when (member "ftp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "ftp" `((,fun "_ftp._tcp"))))
+ (when (member "http" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "http" `((,fun "_http._tcp")
+ (,fun "_https._tcp"))))
+ (when (member "https" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "https" `((,fun "_http._tcp")
+ (,fun "_https._tcp"))))
+ (when (member "sftp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "sftp" `((,fun "_sftp-ssh._tcp")
+ (,fun "_ssh._tcp")
+ (,fun "_workstation._tcp"))))
+ (when (member "smb" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "smb" `((,fun "_smb._tcp"))))))
;; Add completion functions for GNOME Online Accounts.
(tramp-get-goa-accounts nil)
@@ -2604,9 +2607,9 @@ This uses \"avahi-browse\" in case D-Bus is not enabled
in Avahi."
;; * Host name completion for existing mount points (afp-server,
;; smb-server) or via smb-network or network.
;;
+;; * What's up with the other types in `tramp-gvfs-mounttypes'?
+;;
;; * Check, how two shares of the same SMB server can be mounted in
;; parallel.
-;;
-;; * What's up with ftps dns-sd afc admin computer?
;;; tramp-gvfs.el ends here
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index cc9c8115b08..3072095aeb2 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -246,7 +246,7 @@ chosen (interactively or automatically)."
("css-languageserver" "--stdio"))))
(html-mode . ,(eglot-alternatives
'(("vscode-html-language-server" "--stdio") ("html-languageserver" "--stdio"))))
((dockerfile-mode dockerfile-ts-mode) .
("docker-langserver" "--stdio"))
- ((clojure-mode clojurescript-mode
clojurec-mode)
+ ((clojure-mode clojurescript-mode
clojurec-mode clojure-ts-mode)
. ("clojure-lsp"))
((csharp-mode csharp-ts-mode)
. ,(eglot-alternatives
diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba
index c7a5b36749c..f8a10f913ef 100644
--- a/test/infra/Dockerfile.emba
+++ b/test/infra/Dockerfile.emba
@@ -64,17 +64,22 @@ FROM emacs-base as emacs-eglot
RUN apt-get update && \
apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
- snapd wget lsb-release software-properties-common gpg \
+ wget lsb-release software-properties-common gpg \
&& rm -rf /var/lib/apt/lists/*
# A recent clangd. It must be at least clangd 14, which is in Debian
# bookworm.
RUN bash -c "$(wget --no-check-certificate -O - https://apt.llvm.org/llvm.sh)"
+RUN ln -s /usr/bin/clangd-15 /usr/bin/clangd
-# A recent pylsp. Since Debian bookworm there is the package
+# A recent pylsp. In Debian bookworm there is the package
# python3-pylsp.
-# RUN snap install core
-# RUN snap install pylsp
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
+ python3-pyls \
+ && rm -rf /var/lib/apt/lists/*
+# eglot.el knows pyls. However, eglot-tests.el checks only for pylsp.
+RUN ln -s /usr/bin/pyls /usr/bin/pylsp
COPY . /checkout
WORKDIR /checkout
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 2cd4dd75742..5bad1ce41a8 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -1461,6 +1461,12 @@ literals (Bug#20852)."
'((suspicious condition-case))
"Warning: `condition-case' without handlers")
+ (test-suppression
+ '(defun zot (x)
+ (unwind-protect (print x)))
+ '((suspicious unwind-protect))
+ "Warning: `unwind-protect' without unwind forms")
+
(test-suppression
'(defun zot ()
(let ((_ 1))