emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/engine-mode 3d4870c337 50/71: Fall back to the browse-url-


From: ELPA Syncer
Subject: [nongnu] elpa/engine-mode 3d4870c337 50/71: Fall back to the browse-url-browser-function
Date: Wed, 21 Dec 2022 09:59:15 -0500 (EST)

branch: elpa/engine-mode
commit 3d4870c3375ec9a5d82c3e159400602c4d64ff26
Author: Gábor Vida <vidagabor@gmail.com>
Commit: Harry Schwartz <hello@harryrschwartz.com>

    Fall back to the browse-url-browser-function
    
    ...when no browser is set.
    
    This tiny commit changes the following issues:
    
    - Default value of engine/browser-function is not necessarily a
      symbol (browse-url-browser-function can be an alist).
    - Value of browse-url-browser-function is duplicated as the default value of
      engine/browser-function unnecessarily. If one initialize
      browse-url-browser-function later then engine-mode, then the default
      engine/browser-function will not honor this.
---
 engine-mode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/engine-mode.el b/engine-mode.el
index 007fc5cf39..b06756272b 100644
--- a/engine-mode.el
+++ b/engine-mode.el
@@ -81,9 +81,9 @@ For example, to use \"C-c s\" instead of the default \"C-x 
/\":
   (define-key engine-mode-map (kbd engine/keybinding-prefix) nil)
   (define-key engine-mode-map prefix-key engine-mode-prefixed-map))
 
-(defcustom engine/browser-function browse-url-browser-function
+(defcustom engine/browser-function nil
   "The default browser function used when opening a URL in an engine.
-Defaults to `browse-url-browser-function'."
+Defaults to `nil' which means to go with `browse-url-browser-function'."
   :group 'engine-mode
   :type 'symbol)
 
@@ -106,7 +106,8 @@ Defaults to `browse-url-browser-function'."
 (defun engine/execute-search (search-engine-url browser-function search-term)
   "Display the results of the query."
   (interactive)
-  (let ((browse-url-browser-function browser-function))
+  (let ((browse-url-browser-function (or browser-function
+                                         browse-url-browser-function)))
     (browse-url
      (format search-engine-url
              (url-hexify-string search-term)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]