From 2b13451ea807ff5f82f66cb2ce75ec290d83b1e6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 21 Oct 2017 14:49:57 +0200 Subject: [PATCH] lang/sh: recognize functions w/ dashes in imenu --- modules/lang/sh/config.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index 2b3c677d4..fc379fd8c 100644 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -24,6 +24,11 @@ (setq sh-indent-after-continuation 'always) + ;; recognize function names with dashes in them + (push '((sh . ((nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1) + (nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))) + sh-imenu-generic-expression) + ;; 1. Fontifies variables in double quotes ;; 2. Fontify command substitution in double quotes ;; 3. Fontify built-in/common commands (see `+sh-builtin-keywords')