commit 958ddc9526aa7bb1d165d45be43efc4d68589b1e (HEAD, refs/remotes/origin/master) Author: Basil L. Contovounesios Date: Thu May 7 21:40:09 2020 +0100 ; Update recent function declaration in dnd.el * lisp/dnd.el (dnd-handle-one-url): Update arglist declaration for browse-url-select-handler following recent change. diff --git a/lisp/dnd.el b/lisp/dnd.el index 298241bf17..f47f4a2c30 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -102,7 +102,8 @@ is what has been dropped. Returns ACTION." nil) (catch 'done ;; Autoloaded but the byte-compiler still complains. - (declare-function browse-url-select-handler "browse-url" (url)) + (declare-function browse-url-select-handler "browse-url" + (url &optional kind)) (let ((browser (browse-url-select-handler url 'internal))) (when browser (setq ret 'private) commit b2581eea1be1468a15927be00ba2f3f399af33a1 Author: Tassilo Horn Date: Thu May 7 19:38:57 2020 +0200 Allow browsing an URL explicitly with an internal or external browser. * lisp/net/browse-url.el (browse-url-with-browser-kind): New command. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 6dc9f8961a..d7b8521563 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -928,6 +928,34 @@ Optional prefix argument ARG non-nil inverts the value of the option browse-url-new-window-flag)) (error "No URL found")))) +;;;###autoload +(defun browse-url-with-browser-kind (kind url &optional arg) + "Browse URL with a browser of the given browser KIND. +KIND is either `internal' or `external'. + +When called interactively, the default browser kind is the +opposite of the browser kind of `browse-url-browser-function'." + (interactive + (let* ((url-arg (browse-url-interactive-arg "URL: ")) + ;; Default to the inverse kind of the default browser. + (default (if (eq (browse-url--browser-kind + browse-url-browser-function (car url-arg)) + 'internal) + 'external + 'internal)) + (k (completing-read + (format "Browser kind (default %s): " default) + '(internal external) + nil t nil nil + default))) + (cons k url-arg))) + (let ((function (browse-url-select-handler url kind))) + (unless function + (setq function (if (eq kind 'external) + #'browse-url-default-browser + #'eww))) + (funcall function url arg))) + ;;;###autoload (defun browse-url-at-mouse (event) "Ask a WWW browser to load a URL clicked with the mouse. commit b0f9cbb3da6124c540b0a577e0928e85b362b277 Author: Tassilo Horn Date: Thu May 7 13:02:13 2020 +0200 Categorize browse-url functions into internal and external ones. * lisp/net/browse-url.el: Write package documentation explaining browse-url-browser-kind symbol property. Categorize existing browse-url functions into internal and external ones. (browse-url--browser-kind, browse-url--browser-kind-mailto) (browse-url--browser-kind-man, browse-url--browser-kind-browser): New functions. (browse-url-select-handler): Add KIND argument to restrict selection. * lisp/dnd.el (dnd-handle-one-url): Only select browse-url handler of kind `internal'. * lisp/net/eww.el (eww): Add `browse-url-browser-kind' symbol property with value `internal'. diff --git a/lisp/dnd.el b/lisp/dnd.el index 102bc752b0..298241bf17 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -103,7 +103,7 @@ is what has been dropped. Returns ACTION." (catch 'done ;; Autoloaded but the byte-compiler still complains. (declare-function browse-url-select-handler "browse-url" (url)) - (let ((browser (browse-url-select-handler url))) + (let ((browser (browse-url-select-handler url 'internal))) (when browser (setq ret 'private) (funcall browser url action) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 9d7eca7228..6dc9f8961a 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -119,6 +119,17 @@ ;; could be done by setting `browse-url-browser-function' to an alist ;; but this usage is deprecated now. +;; All browser functions provided by here have a +;; `browse-url-browser-kind' symbol property set to either `internal' +;; or `external' which determines if they browse the given URL inside +;; Emacs or spawn an external application with it. Some parts of +;; Emacs make use of that, e.g., when an URL is dragged into Emacs, it +;; is not sensible to invoke an external browser with it, so here only +;; internal browsers are considered. Therefore, it is advised to put +;; that property also on custom browser functions. +;; (put 'my-browse-url-in-emacs 'browse-url-browser-kind 'internal) +;; (put 'my-browse-url-externally 'browse-url-browser-kind 'external) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Code: @@ -593,18 +604,45 @@ down (this *won't* always work)." "Wrapper command prepended to the Elinks command-line." :type '(repeat (string :tag "Wrapper"))) +(defun browse-url--browser-kind (function url) + "Return the browser kind of a browser FUNCTION for URL. +The browser kind is either `internal' (the browser runs inside +Emacs), `external' (the browser is spawned in an external +process), or nil (we don't know)." + (let ((kind (if (symbolp function) + (get function 'browse-url-browser-kind)))) + (if (functionp kind) + (funcall kind url) + kind))) + (defun browse-url--mailto (url &rest args) "Calls `browse-url-mailto-function' with URL and ARGS." (funcall browse-url-mailto-function url args)) +(defun browse-url--browser-kind-mailto (url) + (browse-url--browser-kind browse-url-mailto-function url)) +(put 'browse-url--mailto 'browse-url-browser-kind + #'browse-url--browser-kind-mailto) + (defun browse-url--man (url &rest args) "Calls `browse-url-man-function' with URL and ARGS." (funcall browse-url-man-function url args)) +(defun browse-url--browser-kind-man (url) + (browse-url--browser-kind browse-url-man-function url)) +(put 'browse-url--man 'browse-url-browser-kind + #'browse-url--browser-kind-man) + (defun browse-url--browser (url &rest args) "Calls `browse-url-browser-function' with URL and ARGS." (funcall browse-url-browser-function url args)) +(defun browse-url--browser-kind-browser (url) + (browse-url--browser-kind browse-url-browser-function url)) +(put 'browse-url--browser 'browse-url-browser-kind + #'browse-url--browser-kind-browser) + + ;;;###autoload (defvar browse-url-default-handlers '(("\\`mailto:" . browse-url--mailto) @@ -636,12 +674,16 @@ match, the URL is opened using the value of :version "28.1") ;;;###autoload -(defun browse-url-select-handler (url) - "Return a handler suitable for browsing URL. +(defun browse-url-select-handler (url &optional kind) + "Return a handler of suitable for browsing URL. This searches `browse-url-handlers', and `browse-url-default-handlers' for a matching handler. Return nil if no handler is found. +If KIND is given, the search is restricted to handlers whose +function symbol has the symbol-property `browse-url-browser-kind' +set to KIND. + Currently, it also consults `browse-url-browser-function' first if it is set to an alist, although this usage is deprecated since Emacs 28.1 and will be removed in a future release." @@ -659,7 +701,10 @@ alist is deprecated. Use `browse-url-handlers' instead.") browse-url-browser-function) browse-url-handlers browse-url-default-handlers)) - (when (string-match-p (car regex-handler) url) + (when (and (or (null kind) + (eq kind (browse-url--browser-kind + (cdr regex-handler) url))) + (string-match-p (car regex-handler) url)) (throw 'custom-url-handler (cdr regex-handler)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -930,12 +975,18 @@ The optional NEW-WINDOW argument is not used." (url-unhex-string url) url))))) +(put 'browse-url-default-windows-browser 'browse-url-browser-kind + 'external) + (defun browse-url-default-macosx-browser (url &optional _new-window) "Invoke the macOS system's default Web browser. The optional NEW-WINDOW argument is not used." (interactive (browse-url-interactive-arg "URL: ")) (start-process (concat "open " url) nil "open" url)) +(put 'browse-url-default-macosx-browser 'browse-url-browser-kind + 'external) + ;; --- Netscape --- (defun browse-url-process-environment () @@ -992,6 +1043,10 @@ instead of `browse-url-new-window-flag'." (lambda (&rest _ignore) (error "No usable browser found")))) url args)) +(put 'browse-url-default-browser 'browse-url-browser-kind + ;; Well, most probably external if we ignore w3. + 'external) + (defun browse-url-can-use-xdg-open () "Return non-nil if the \"xdg-open\" program can be used. xdg-open is a desktop utility that calls your preferred web browser." @@ -1011,6 +1066,8 @@ The optional argument IGNORED is not used." (interactive (browse-url-interactive-arg "URL: ")) (call-process "xdg-open" nil 0 nil url)) +(put 'browse-url-xdg-open 'browse-url-browser-kind 'external) + ;;;###autoload (defun browse-url-netscape (url &optional new-window) "Ask the Netscape WWW browser to load URL. @@ -1054,6 +1111,8 @@ used instead of `browse-url-new-window-flag'." `(lambda (process change) (browse-url-netscape-sentinel process ,url))))) +(put 'browse-url-netscape 'browse-url-browser-kind 'external) + (defun browse-url-netscape-sentinel (process url) "Handle a change to the process communicating with Netscape." (declare (obsolete nil "25.1")) @@ -1124,6 +1183,8 @@ used instead of `browse-url-new-window-flag'." `(lambda (process change) (browse-url-mozilla-sentinel process ,url))))) +(put 'browse-url-mozilla 'browse-url-browser-kind 'external) + (defun browse-url-mozilla-sentinel (process url) "Handle a change to the process communicating with Mozilla." (or (eq (process-exit-status process) 0) @@ -1164,6 +1225,8 @@ instead of `browse-url-new-window-flag'." '("-new-window"))) (list url))))) +(put 'browse-url-firefox 'browse-url-browser-kind 'external) + ;;;###autoload (defun browse-url-chromium (url &optional _new-window) "Ask the Chromium WWW browser to load URL. @@ -1181,6 +1244,8 @@ The optional argument NEW-WINDOW is not used." browse-url-chromium-arguments (list url))))) +(put 'browse-url-chromium 'browse-url-browser-kind 'external) + (defun browse-url-chrome (url &optional _new-window) "Ask the Google Chrome WWW browser to load URL. Default to the URL around or before point. The strings in @@ -1197,6 +1262,8 @@ The optional argument NEW-WINDOW is not used." browse-url-chrome-arguments (list url))))) +(put 'browse-url-chrome 'browse-url-browser-kind 'external) + ;;;###autoload (defun browse-url-galeon (url &optional new-window) "Ask the Galeon WWW browser to load URL. @@ -1234,6 +1301,8 @@ used instead of `browse-url-new-window-flag'." `(lambda (process change) (browse-url-galeon-sentinel process ,url))))) +(put 'browse-url-galeon 'browse-url-browser-kind 'external) + (defun browse-url-galeon-sentinel (process url) "Handle a change to the process communicating with Galeon." (declare (obsolete nil "25.1")) @@ -1280,6 +1349,8 @@ used instead of `browse-url-new-window-flag'." `(lambda (process change) (browse-url-epiphany-sentinel process ,url))))) +(put 'browse-url-epiphany 'browse-url-browser-kind 'external) + (defun browse-url-epiphany-sentinel (process url) "Handle a change to the process communicating with Epiphany." (or (eq (process-exit-status process) 0) @@ -1304,6 +1375,8 @@ currently selected window instead." file-name-handler-alist))) (if same-window (find-file url) (find-file-other-window url)))) +(put 'browse-url-emacs 'browse-url-browser-kind 'internal) + ;;;###autoload (defun browse-url-gnome-moz (url &optional new-window) "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'. @@ -1328,6 +1401,8 @@ used instead of `browse-url-new-window-flag'." '("--newwin")) (list "--raise" url)))) +(put 'browse-url-gnome-moz 'browse-url-browser-kind 'external) + ;; --- Mosaic --- ;;;###autoload @@ -1379,6 +1454,8 @@ used instead of `browse-url-new-window-flag'." (append browse-url-mosaic-arguments (list url))) (message "Starting %s...done" browse-url-mosaic-program)))) +(put 'browse-url-mosaic 'browse-url-browser-kind 'external) + ;; --- Mosaic using CCI --- ;;;###autoload @@ -1411,6 +1488,8 @@ used instead of `browse-url-new-window-flag'." (process-send-string "browse-url" "disconnect\r\n") (delete-process "browse-url")) +(put 'browse-url-cci 'browse-url-browser-kind 'external) + ;; --- Conkeror --- ;;;###autoload (defun browse-url-conkeror (url &optional new-window) @@ -1447,6 +1526,9 @@ NEW-WINDOW instead of `browse-url-new-window-flag'." "window") "buffer") url)))))) + +(put 'browse-url-conkeror 'browse-url-browser-kind 'external) + ;; --- W3 --- ;; External. @@ -1470,6 +1552,8 @@ used instead of `browse-url-new-window-flag'." (w3-fetch-other-window url) (w3-fetch url))) +(put 'browse-url-w3 'browse-url-browser-kind 'internal) + ;;;###autoload (defun browse-url-w3-gnudoit (url &optional _new-window) ;; new-window ignored @@ -1484,6 +1568,8 @@ The `browse-url-gnudoit-program' program is used with options given by (list (concat "(w3-fetch \"" url "\")") "(raise-frame)")))) +(put 'browse-url-w3-gnudoit 'browse-url-browser-kind 'internal) + ;; --- Lynx in an xterm --- ;;;###autoload @@ -1501,6 +1587,8 @@ The optional argument NEW-WINDOW is not used." ,@browse-url-xterm-args "-e" ,browse-url-text-browser ,url))) +(put 'browse-url-text-xterm 'browse-url-browser-kind 'external) + ;; --- Lynx in an Emacs "term" window --- (declare-function term-char-mode "term" ()) @@ -1575,6 +1663,8 @@ used instead of `browse-url-new-window-flag'." url "\r"))))) +(put 'browse-url-text-emacs 'browse-url-browser-kind 'internal) + ;; --- mailto --- (autoload 'rfc2368-parse-mailto-url "rfc2368") @@ -1622,6 +1712,8 @@ used instead of `browse-url-new-window-flag'." (unless (bolp) (insert "\n")))))))) +(put 'browse-url-mail 'browse-url-browser-kind 'internal) + ;; --- man --- (defvar manual-program) @@ -1633,7 +1725,9 @@ used instead of `browse-url-new-window-flag'." (setq url (replace-regexp-in-string "\\`man:" "" url)) (cond ((executable-find manual-program) (man url)) - (t (woman (replace-regexp-in-string "([[:alnum:]]+)" "" url))))) + (t (woman (replace-regexp-in-string "([[:alnum:]]+)" "" url))))) + +(put 'browse-url-man 'browse-url-browser-kind 'internal) ;; --- Random browser --- @@ -1652,6 +1746,8 @@ don't offer a form of remote control." 0 nil (append browse-url-generic-args (list url)))) +(put 'browse-url-generic 'browse-url-browser-kind 'external) + ;;;###autoload (defun browse-url-kde (url &optional _new-window) "Ask the KDE WWW browser to load URL. @@ -1662,6 +1758,8 @@ The optional argument NEW-WINDOW is not used." (apply #'start-process (concat "KDE " url) nil browse-url-kde-program (append browse-url-kde-args (list url)))) +(put 'browse-url-kde 'browse-url-browser-kind 'external) + (defun browse-url-elinks-new-window (url) "Ask the Elinks WWW browser to load URL in a new window." (let ((process-environment (browse-url-process-environment))) @@ -1671,6 +1769,8 @@ The optional argument NEW-WINDOW is not used." browse-url-elinks-wrapper (list "elinks" url))))) +(put 'browse-url-elinks-new-window 'browse-url-browser-kind 'external) + ;;;###autoload (defun browse-url-elinks (url &optional new-window) "Ask the Elinks WWW browser to load URL. @@ -1692,6 +1792,8 @@ from `browse-url-elinks-wrapper'." `(lambda (process change) (browse-url-elinks-sentinel process ,url)))))) +(put 'browse-url-elinks 'browse-url-browser-kind 'external) + (defun browse-url-elinks-sentinel (process url) "Determines if Elinks is running or a new one has to be started." ;; Try to determine if an instance is running or if we have to diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 9cf9ecea0b..a6c1abdbb1 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -310,6 +310,8 @@ the default EWW buffer." (url-retrieve url 'eww-render (list url nil (current-buffer))))) +(put 'eww 'browse-url-browser-kind 'internal) + (defun eww--dwim-expand-url (url) (setq url (string-trim url)) (cond ((string-match-p "\\`file:/" url)) commit 263ab750a5963af837fd69647071faa92093011c Author: Basil L. Contovounesios Date: Thu May 7 18:36:53 2020 +0100 ; Fix recent byte-compiler warning in dnd.el again * lisp/dnd.el (dnd-handle-one-url): Declare new autoloaded function browse-url-select-handler to silence the byte-compiler during 'make bootstrap'. diff --git a/lisp/dnd.el b/lisp/dnd.el index c185794d6e..102bc752b0 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -101,6 +101,8 @@ is what has been dropped. Returns ACTION." (throw 'done t))) nil) (catch 'done + ;; Autoloaded but the byte-compiler still complains. + (declare-function browse-url-select-handler "browse-url" (url)) (let ((browser (browse-url-select-handler url))) (when browser (setq ret 'private) commit 5b5039caa2ed5fa019cb788b04bd455e482eccf5 Author: Basil L. Contovounesios Date: Thu May 7 16:59:26 2020 +0100 ; Improve recent change to browse-url.el * lisp/net/browse-url.el (browse-url-select-handler): Use lwarn with specific warning type, as recommended in "(elisp) Warning Basics". diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 3d55ee554f..9d7eca7228 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -653,7 +653,8 @@ Emacs 28.1 and will be removed in a future release." ;; can be removed at some point in time. (when (and (consp browse-url-browser-function) (not (functionp browse-url-browser-function))) - (warn "Having `browse-url-browser-function' set to an + (lwarn 'browse-url :warning + "Having `browse-url-browser-function' set to an alist is deprecated. Use `browse-url-handlers' instead.") browse-url-browser-function) browse-url-handlers commit ddc8020327604b92e7e830708933f62a22f48f62 Author: Noam Postavsky Date: Thu Apr 30 18:55:40 2020 -0400 Don't increment array index in cl-loop twice (Bug#40727) * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Put the temp-idx increment in cl--loop-body, leaving just the side-effect free testing of the index for both cl--loop-body and cl--loop-conditions. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays): Extend test to cover this case. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index fef8786b59..3317c58002 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1320,8 +1320,9 @@ For more details, see Info node `(cl)Loop Facility'. (temp-idx (make-symbol "--cl-idx--"))) (push (list temp-vec (pop cl--loop-args)) loop-for-bindings) (push (list temp-idx -1) loop-for-bindings) + (push `(setq ,temp-idx (1+ ,temp-idx)) cl--loop-body) (cl--push-clause-loop-body - `(< (setq ,temp-idx (1+ ,temp-idx)) (length ,temp-vec))) + `(< ,temp-idx (length ,temp-vec))) (if (eq word 'across-ref) (push (list var `(aref ,temp-vec ,temp-idx)) cl--loop-symbol-macs) diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 77609a42a9..983e79ac57 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -43,6 +43,9 @@ "Bug#40727" (should (equal (cl-loop for y = (- (or x 0)) and x across [1 2] collect (cons x y)) + '((1 . 0) (2 . -1)))) + (should (equal (cl-loop for x across [1 2] and y = (- (or x 0)) + collect (cons x y)) '((1 . 0) (2 . -1))))) (ert-deftest cl-macs-loop-destructure () commit de7158598fcd5440c0180ff6f83052c29e490bcd Author: Noam Postavsky Date: Thu Apr 30 07:54:49 2020 -0400 Revert "cl-loop: Calculate the array length just once" It fails when using 'and' (parallel bindings) for arrays (Bug#40727). * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Revert to recomputing array length. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays): New test. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4408bb5846..fef8786b59 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1317,13 +1317,11 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word '(across across-ref)) (let ((temp-vec (make-symbol "--cl-vec--")) - (temp-len (make-symbol "--cl-len--")) (temp-idx (make-symbol "--cl-idx--"))) (push (list temp-vec (pop cl--loop-args)) loop-for-bindings) - (push (list temp-len `(length ,temp-vec)) loop-for-bindings) (push (list temp-idx -1) loop-for-bindings) (cl--push-clause-loop-body - `(< (setq ,temp-idx (1+ ,temp-idx)) ,temp-len)) + `(< (setq ,temp-idx (1+ ,temp-idx)) (length ,temp-vec))) (if (eq word 'across-ref) (push (list var `(aref ,temp-vec ,temp-idx)) cl--loop-symbol-macs) @@ -1337,7 +1335,6 @@ For more details, see Info node `(cl)Loop Facility'. (error "Expected `of'")))) (seq (cl--pop2 cl--loop-args)) (temp-seq (make-symbol "--cl-seq--")) - (temp-len (make-symbol "--cl-len--")) (temp-idx (if (eq (car cl--loop-args) 'using) (if (and (= (length (cadr cl--loop-args)) 2) @@ -1348,19 +1345,16 @@ For more details, see Info node `(cl)Loop Facility'. (push (list temp-seq seq) loop-for-bindings) (push (list temp-idx 0) loop-for-bindings) (if ref - (progn + (let ((temp-len (make-symbol "--cl-len--"))) (push (list temp-len `(length ,temp-seq)) loop-for-bindings) (push (list var `(elt ,temp-seq ,temp-idx)) cl--loop-symbol-macs) - (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) - ;; Evaluate seq length just if needed, that is, when seq is not a cons. - (push (list temp-len (or (consp seq) `(length ,temp-seq))) - loop-for-bindings) + (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) (push (list var nil) loop-for-bindings) (cl--push-clause-loop-body `(and ,temp-seq (or (consp ,temp-seq) - (< ,temp-idx ,temp-len)))) + (< ,temp-idx (length ,temp-seq))))) (push (list var `(if (consp ,temp-seq) (pop ,temp-seq) (aref ,temp-seq ,temp-idx))) diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 9ca84f156a..77609a42a9 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -39,6 +39,12 @@ collect (list c b a)) '((4.0 2 1) (8.3 6 5) (10.4 9 8))))) +(ert-deftest cl-macs-loop-and-arrays () + "Bug#40727" + (should (equal (cl-loop for y = (- (or x 0)) and x across [1 2] + collect (cons x y)) + '((1 . 0) (2 . -1))))) + (ert-deftest cl-macs-loop-destructure () (should (equal (cl-loop for (a b c) in '((1 2 4.0) (5 6 8.3) (8 9 10.4)) collect (list c b a)) commit 2c905fb8a1d95a72e4b8a9b138458c86b099ced1 Author: Tassilo Horn Date: Thu May 7 13:10:44 2020 +0200 Fix browse-url (remove debugging leftover). * lisp/net/browse-url.el (browse-url): Fix "No suitable browser for URL" always popping up. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index b34665358c..3d55ee554f 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -864,7 +864,7 @@ If ARGS are omitted, the default is to pass ;; which may not even exist any more. (if (stringp (frame-parameter nil 'display)) (setenv "DISPLAY" (frame-parameter nil 'display))) - (if (functionp nil) + (if (functionp function) (apply function url args) (error "No suitable browser for URL %s" url))))