aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-22 04:37:22 +0000
committerRichard M. Stallman1997-04-22 04:37:22 +0000
commitc410bd65f5cb14d844f6894206c408c4011d48ed (patch)
tree25c4cb2d5c1628eb682e8025a83b6036cdcf122e
parentc60e7b0d7c505f1d60b514918a60508aebd55ae6 (diff)
downloademacs-c410bd65f5cb14d844f6894206c408c4011d48ed.tar.gz
emacs-c410bd65f5cb14d844f6894206c408c4011d48ed.zip
(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.
-rw-r--r--lisp/progmodes/sh-script.el82
1 files changed, 36 insertions, 46 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 78fbb0a9599..3124d59bffb 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -322,7 +322,7 @@ See `sh-feature'."
322 :group 'sh-script) 322 :group 'sh-script)
323 323
324 324
325(defcustom sh-assignment-prefix 325(defcustom sh-assignment-regexp
326 '((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=") 326 '((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
327 ;; actually spaces are only supported in let/(( ... )) 327 ;; actually spaces are only supported in let/(( ... ))
328 (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=") 328 (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=")
@@ -1001,56 +1001,46 @@ region, clear header."
1001;; You are welcome to add the syntax or even completely new statements as 1001;; You are welcome to add the syntax or even completely new statements as
1002;; appropriate for your favorite shell. 1002;; appropriate for your favorite shell.
1003 1003
1004;; This defun is the same as what define-skeleton does, 1004(define-skeleton sh-case
1005;; but by putting the data in a variable named sh-case, 1005 "Insert a case/switch statement. See `sh-feature'."
1006;; we make it possible to use that variable in the menu-enable property. 1006 ((csh "expression: "
1007(defun sh-case (&optional str arg) 1007 "switch( " str " )" \n
1008 (interactive "*P\nP") 1008 > "case " (read-string "pattern: ") ?: \n
1009 (skeleton-proxy-new sh-case str arg))
1010(put 'sh-case 'menu-enable '(sh-feature sh-case))
1011
1012(defvar sh-case
1013 '((csh "expression: "
1014 "switch( " str " )" \n
1015 > "case " (read-string "pattern: ") ?: \n
1016 > _ \n
1017 "breaksw" \n
1018 ( "other pattern, %s: "
1019 < "case " str ?: \n
1020 > _ \n
1021 "breaksw" \n)
1022 < "default:" \n
1023 > _ \n
1024 resume:
1025 < < "endsw")
1026 (es)
1027 (rc "expression: "
1028 "switch( " str " ) {" \n
1029 > "case " (read-string "pattern: ") \n
1030 > _ \n
1031 ( "other pattern, %s: "
1032 < "case " str \n
1033 > _ \n)
1034 < "case *" \n
1035 > _ \n 1009 > _ \n
1036 resume: 1010 "breaksw" \n
1037 < < ?})
1038 (sh "expression: "
1039 "case " str " in" \n
1040 > (read-string "pattern: ") ?\) \n
1041 > _ \n
1042 ";;" \n
1043 ( "other pattern, %s: " 1011 ( "other pattern, %s: "
1044 < str ?\) \n 1012 < "case " str ?: \n
1045 > _ \n 1013 > _ \n
1046 ";;" \n) 1014 "breaksw" \n)
1047 < "*)" \n 1015 < "default:" \n
1048 > _ \n 1016 > _ \n
1049 resume: 1017 resume:
1050 < < "esac")) 1018 < < "endsw")
1051 "Insert a case/switch statement. See `sh-feature'.") 1019 (es)
1052 1020 (rc "expression: "
1053 1021 "switch( " str " ) {" \n
1022 > "case " (read-string "pattern: ") \n
1023 > _ \n
1024 ( "other pattern, %s: "
1025 < "case " str \n
1026 > _ \n)
1027 < "case *" \n
1028 > _ \n
1029 resume:
1030 < < ?})
1031 (sh "expression: "
1032 "case " str " in" \n
1033 > (read-string "pattern: ") ?\) \n
1034 > _ \n
1035 ";;" \n
1036 ( "other pattern, %s: "
1037 < str ?\) \n
1038 > _ \n
1039 ";;" \n)
1040 < "*)" \n
1041 > _ \n
1042 resume:
1043 < < "esac")))
1054 1044
1055(define-skeleton sh-for 1045(define-skeleton sh-for
1056 "Insert a for loop. See `sh-feature'." 1046 "Insert a for loop. See `sh-feature'."