Commit c410bd65 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(sh-case): Make this a simple define-skeleton

as it was originally.  Don't add a menu-enable property.
(sh-assignment-regexp): Renamed from sh-assignment-prefix
undoing a renaming made by mistake.
parent c60e7b0d
......@@ -322,7 +322,7 @@ See `sh-feature'."
:group 'sh-script)
(defcustom sh-assignment-prefix
(defcustom sh-assignment-regexp
'((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
;; actually spaces are only supported in let/(( ... ))
(ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=")
......@@ -1001,16 +1001,9 @@ region, clear header."
;; You are welcome to add the syntax or even completely new statements as
;; appropriate for your favorite shell.
;; This defun is the same as what define-skeleton does,
;; but by putting the data in a variable named sh-case,
;; we make it possible to use that variable in the menu-enable property.
(defun sh-case (&optional str arg)
(interactive "*P\nP")
(skeleton-proxy-new sh-case str arg))
(put 'sh-case 'menu-enable '(sh-feature sh-case))
(defvar sh-case
'((csh "expression: "
(define-skeleton sh-case
"Insert a case/switch statement. See `sh-feature'."
((csh "expression: "
"switch( " str " )" \n
> "case " (read-string "pattern: ") ?: \n
> _ \n
......@@ -1047,10 +1040,7 @@ region, clear header."
< "*)" \n
> _ \n
resume:
< < "esac"))
"Insert a case/switch statement. See `sh-feature'.")
< < "esac")))
(define-skeleton sh-for
"Insert a for loop. See `sh-feature'."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment