branch: elpa/rpm-spec-mode
commit 73f4abb50bf0f9b19106f394afcdfeb1a41d4d5a
Author: Björn Bidar <bjorn.bi...@thaodan.de>
Commit: Björn Bidar <bjorn.bi...@thaodan.de>

    Tell shell-script-mode that the shell is always rpm
    
    Only have to take into account when '%_buildshell' isn't  '/bin/sh'.
    
    Signed-off-by: Björn Bidar <bjorn.bi...@thaodan.de>
---
 rpm-spec-mode.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/rpm-spec-mode.el b/rpm-spec-mode.el
index fff5d62bca..26217e2aaf 100644
--- a/rpm-spec-mode.el
+++ b/rpm-spec-mode.el
@@ -71,10 +71,8 @@
 
 (defconst rpm-spec-mode-version "0.16" "Version of `rpm-spec-mode'.")
 
-(eval-and-compile (defvar running-xemacs nil))
-
 (defgroup rpm-spec nil
-  "RPM spec mode with Emacs/XEmacs enhancements."
+  "RPM spec mode with Emacs enhancements."
   :prefix "rpm-spec-"
   :group 'languages)
 
@@ -714,8 +712,14 @@ with no args, if that value is non-nil."
   ;;Initialize font lock for GNU emacs.
   (make-local-variable 'font-lock-defaults)
   (font-lock-add-keywords nil rpm-spec-font-lock-keywords)
-  (rpm-spec-mode-imenu-setup)
-  (run-hooks 'rpm-spec-mode-hook))
+  ;; shell-script-mode would try to detect the shell type to accommodate
+  ;; to the target shell. The shell type should always be RPM in this
+  ;; instance
+  ;; FIXME: set `sh-ancestors' list based on '%_buildshell'.
+  ;; call a custom version of `sh--guess-shell' which compares against
+  ;; the macro.
+  (sh-set-shell "rpm" nil nil)
+  (rpm-spec-mode-imenu-setup))
 
 (defun rpm-command-filter (process string)
   "Filter to PROCESS normal output.  Add STRING as starting boundary."

Reply via email to