From 86633e6fbd0ffb750bf38261d3d20a97e3fde348 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 9 Mar 2014 15:03:38 +0100 Subject: [PATCH] Emacs: using sh-shell for compilation --- .emacs.d/functions.el | 1 - .emacs.d/mode-sh.el | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.emacs.d/functions.el b/.emacs.d/functions.el index 33e102ca..15f96f9c 100644 --- a/.emacs.d/functions.el +++ b/.emacs.d/functions.el @@ -210,7 +210,6 @@ fallback to the mode provided in symbol DEFAULT." (warn "Could not load %s, fallback to %s" (symbol-name ',feature) (symbol-name ',default)))))))))) -;; TODO: try defadvice. (defun mark-word-from-beginning (&optional arg allow-extend) "Set the point at the beginning of the word and call `mark-word'." (interactive "P\np") diff --git a/.emacs.d/mode-sh.el b/.emacs.d/mode-sh.el index 503859ef..9974e9ea 100644 --- a/.emacs.d/mode-sh.el +++ b/.emacs.d/mode-sh.el @@ -2,15 +2,15 @@ ;; Shell ;;============================================================================== -;; TODO: set sh-shell-file per buffer? - ;; Allow comment indentation. (setq sh-indent-comment t) (add-hook-and-eval 'sh-mode-hook (lambda () - (set (make-local-variable 'compile-command) (concat sh-shell-file " " buffer-file-name))) ) + (set (make-local-variable 'defun-prompt-regexp) + (concat "^\\(function[ \t]\\|[[:alnum:]_]+[ \t]+()[ \t]+\\)")) + (set (make-local-variable 'compile-command) (concat (symbol-name sh-shell) " " buffer-file-name))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;