branch: elpa/powershell
commit 3744d8c2ab99ef9f6dc58cdffec7d3770201713b
Author: Mark A. Hershberger <[email protected]>
Commit: Mark A. Hershberger <[email protected]>

    Use fboundp instead of require
    
    imenu-add-menubar-index is autoloaded, for example, and 
speedbar-add-supported-extension should be.
    
    (See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72795)
---
 powershell.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/powershell.el b/powershell.el
index d4d59028ef2..66d9f2cecfc 100644
--- a/powershell.el
+++ b/powershell.el
@@ -734,7 +734,7 @@ Where <fcn-name> is the name of the function to which 
<helper string> applies.
 
 (defun powershell-setup-imenu ()
   "Install `powershell-imenu-expression'."
-  (when (require 'imenu nil t)
+  (when (fboundp 'imenu-add-menubar-index)
     ;; imenu doc says these are buffer-local by default
     (setq imenu-generic-expression powershell-imenu-expression)
     (setq imenu-case-fold-search nil)
@@ -742,7 +742,7 @@ Where <fcn-name> is the name of the function to which 
<helper string> applies.
 
 (defun powershell-setup-speedbar ()
   "Install `speedbar-add-supported-extension'."
-  (when (require 'speedbar nil t)
+  (when (fboundp 'speedbar-add-supported-extension)
     (speedbar-add-supported-extension ".ps1?")))
 
 ;; A better command would be something like "powershell.exe -NoLogo

Reply via email to