;ELC   
;;; compiled by rms@psilocin.gnu.ai.mit.edu on Thu Aug  1 18:19:38 1996
;;; from file /home/fsf/rms/e19/lisp/sh-script.el
;;; emacs version 19.31.97.4.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`sh-script.el' was compiled for Emacs 19.29 or later"))


(require (quote executable))
#@656 *Alist showing the direct ancestor of various shells.
This is the basis for `sh-feature'.  See also `sh-alias-alist'.
By default we have the following three hierarchies:

csh		C Shell
  jcsh		C Shell with Job Control
  tcsh		Toronto C Shell
    itcsh	? Toronto C Shell
rc		Plan 9 Shell
  es		Extensible Shell
sh		Bourne Shell
  ash		? Shell
  jsh		Bourne Shell with Job Control
    bash	GNU Bourne Again Shell
    ksh88	Korn Shell '88
      ksh	Korn Shell '93
	dtksh	CDE Desktop Korn Shell
      pdksh	Public Domain Korn Shell
      wksh	Window Korn Shell
      zsh	Z Shell
  oash		SCO OA (curses) Shell
  posix		IEEE 1003.2 Shell Standard
  wsh		? Shell
(defvar sh-ancestor-alist (quote ((ash . sh) (bash . jsh) (dtksh . ksh) (es . rc) (itcsh . tcsh) (jcsh . csh) (jsh . sh) (ksh . ksh88) (ksh88 . jsh) (oash . sh) (pdksh . ksh88) (posix . sh) (tcsh . csh) (wksh . ksh88) (wsh . sh) (zsh . ksh88))) (#$ . -510))
#@158 *Alist for transforming shell names to what they really are.
Use this where the name of the executable doesn't correspond to the type of
shell it really is.
(defvar sh-alias-alist (byte-code "= ä" [system-type lignux ((csh . tcsh) (ksh . pdksh)) ((ksh . ksh88) (sh5 . sh))] 2) (#$ . -1430))
#@59 *The executable file name for the shell being programmed.
(defvar sh-shell-file (byte-code "! " [getenv "SHELL" "/bin/sh"] 2) (#$ . -1734))
#@66 *Single argument string for the magic number.  See `sh-feature'.
(defvar sh-shell-arg (quote ((bash) (csh . "-f") (pdksh) (ksh88) (rc . "-p") (wksh) (zsh . "-f"))) (#$ . -1886))
#@246 Alist of shell variable names that should be included in completion.
These are used for completion in addition to all the variables named
in `process-environment'.  Each element looks like (VAR . VAR), where
the car and cdr are the same symbol.
(defvar sh-shell-variables nil (#$ . 2071))
#@49 Non-nil if `sh-shell-variables' is initialized.
(defvar sh-shell-variables-initialized nil (#$ . 2366))
#@63 Convert a shell name SHELL to the one we should handle it as.
(defalias 'sh-canonicalize-shell #[(shell) "9	 !\nA " [shell intern sh-alias-alist] 2 (#$ . 2476)])
#@62 The shell being programmed.  This is set by \[sh-set-shell].
(defvar sh-shell (byte-code "\n!!" [sh-canonicalize-shell file-name-nondirectory sh-shell-file] 3) (#$ . 2655))
#@60 Syntax-table used in Shell-Script mode.  See `sh-feature'.
(defvar sh-mode-syntax-table (quote ((csh eval identity sh) (sh eval sh-mode-syntax-table nil 34 "\"\"" 39 "\"'" 96 ".`" 36 "_" 33 "_" 37 "_" 58 "_" 46 "_" 94 "_" 126 "_") (rc eval sh-mode-syntax-table sh 34 "_" 96 "."))) (#$ . 2837))
#@35 Keymap used in Shell-Script mode.
(defvar sh-mode-map (byte-code " !####################### $ $ $# $ $ $\nB#\n@ #\nA B #\nC D #\nE F #\nG H #\nI J #\nK L #\nM N #\nO P #\nQ R #*" [make-sparse-keymap "Insert" menu-map map define-key "(" sh-function "" sh-while "" sh-until "" sh-tmp-file "" sh-select "" sh-repeat "" sh-while-getopts "\f" sh-indexed-loop "	" sh-if "" sh-for "" sh-case "=" sh-assignment "+" sh-add "" sh-execute-region "" executable-interpret "<" sh-maybe-here-document "(" skeleton-pair-insert-maybe "{" "[" "'" "`" "\"" "	" sh-indent-line substitute-key-definition complete-tag comint-dynamic-complete current-global-map newline-and-indent sh-newline-and-indent delete-backward-char backward-delete-char-untabify ":" sh-set-shell beginning-of-defun sh-beginning-of-compound-command backward-sentence sh-beginning-of-command forward-sentence sh-end-of-command [menu-bar insert] [sh-while] ("While Loop" . sh-while) [sh-until] ("Until Loop" . sh-until) [sh-tmp-file] ("Temporary File" . sh-tmp-file) [sh-select] ("Select Statement" . sh-select) [sh-repeat] ("Repeat Loop" . sh-repeat) [sh-while-getopts] ("Options Loop" . sh-while-getopts) [sh-indexed-loop] ("Indexed Loop" . sh-indexed-loop) [sh-if] ("If Statement" . sh-if) [sh-for] ("For Loop" . sh-for) [sh-case] ("Case Statement" . sh-case)] 5) (#$ . 3137))
#@46 *Functions for doing TAB dynamic completion.
(defvar sh-dynamic-complete-functions (quote (shell-dynamic-complete-environment-variable shell-dynamic-complete-command comint-dynamic-complete-filename)) (#$ . -4704))
#@83 *Value of `require-final-newline' in Shell-Script mode buffers.
See `sh-feature'.
(defvar sh-require-final-newline (quote ((csh . t) (pdksh . t) (rc eval . require-final-newline) (sh eval . require-final-newline))) (#$ . -4925))
#@190 *Regexp matching what may come before a comment `#'.
This must contain one \(grouping\) since it is the basis for fontifying
comments as well as for `comment-start-skip'.
See `sh-feature'.
(defvar sh-comment-prefix (quote ((csh . "\\(^\\|[^$]\\|\\$[^{]\\)") (rc eval identity csh) (sh . "\\(^\\|[ 	|&;()]\\)"))) (#$ . -5161))
#@172 *Regexp for the variable name and what may follow in an assignment.
First grouping matches the variable name.  This is upto and including the `='
sign.  See `sh-feature'.
(defvar sh-assignment-regexp (quote ((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ 	]*[-+*/%^]?=") (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ 	]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=") (rc . "\\<\\([a-zA-Z0-9_*]+\\)[ 	]*=") (sh . "\\<\\([a-zA-Z0-9_]+\\)="))) (#$ . -5494))
#@57 The width for further indentation in Shell-Script mode.
(defvar sh-indentation 4 (#$ . 5943))
#@71 *Don't remember variables less than this length for completing reads.
(defvar sh-remember-variable-min 3 (#$ . -6043))
#@130 When non-`nil' is the end of header for prepending by \[sh-execute-region].
That command is also used for setting this variable.
(defvar sh-header-marker nil (#$ . 6169))
#@127 *Regexp to determine the beginning of a shell command.
The actual command starts at the beginning of the second \(grouping\).
(defvar sh-beginning-of-command "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ 	]*\\([/~a-zA-Z0-9:]\\)" (#$ . -6347))
#@112 *Regexp to determine the end of a shell command.
The actual command ends at the end of the first \(grouping\).
(defvar sh-end-of-command "\\([/~a-zA-Z0-9:]\\)[ 	]*\\([;#)}`|&]\\|$\\)" (#$ . -6584))
#@33 Word to delimit here documents.
(defvar sh-here-document-word "EOF" (#$ . 6788))
#@75 Initial input in Bourne if, while and until skeletons.  See `sh-feature'.
(defvar sh-test (quote ((sh "[  ]" . 3) (ksh88 "[[  ]]" . 4))) (#$ . 6875))
#@180 *List of all shell builtins for completing read and fontification.
Note that on some systems not all builtins are available or some are
implemented as aliases.  See `sh-feature'.
(defvar sh-builtins (quote ((bash eval sh-append posix "alias" "bg" "bind" "builtin" "declare" "dirs" "enable" "fc" "fg" "help" "history" "jobs" "kill" "let" "local" "popd" "pushd" "source" "suspend" "typeset" "unalias") (bourne eval sh-append shell "eval" "export" "getopts" "newgrp" "pwd" "read" "readonly" "times" "ulimit") (csh eval sh-append shell "alias" "chdir" "glob" "history" "limit" "nice" "nohup" "rehash" "setenv" "source" "time" "unalias" "unhash") (dtksh eval identity wksh) (es "access" "apids" "cd" "echo" "eval" "false" "let" "limit" "local" "newpgrp" "result" "time" "umask" "var" "vars" "wait" "whatis") (jsh eval sh-append sh "bg" "fg" "jobs" "kill" "stop" "suspend") (jcsh eval sh-append csh "bg" "fg" "jobs" "kill" "notify" "stop" "suspend") (ksh88 eval sh-append bourne "alias" "bg" "false" "fc" "fg" "jobs" "kill" "let" "print" "time" "typeset" "unalias" "whence") (oash eval sh-append sh "checkwin" "dateline" "error" "form" "menu" "newwin" "oadeinit" "oaed" "oahelp" "oainit" "pp" "ppfile" "scan" "scrollok" "wattr" "wclear" "werase" "win" "wmclose" "wmmessage" "wmopen" "wmove" "wmtitle" "wrefresh") (pdksh eval sh-append ksh88 "bind") (posix eval sh-append sh "command") (rc "builtin" "cd" "echo" "eval" "limit" "newpgrp" "shift" "umask" "wait" "whatis") (sh eval sh-append bourne "hash" "test" "type") (shell "cd" "echo" "eval" "set" "shift" "umask" "unset" "wait") (wksh eval sh-append ksh88 "Xt[A-Z][A-Za-z]*") (zsh eval sh-append ksh88 "autoload" "bindkey" "builtin" "chdir" "compctl" "declare" "dirs" "disable" "disown" "echotc" "enable" "functions" "getln" "hash" "history" "integer" "limit" "local" "log" "popd" "pushd" "r" "readonly" "rehash" "sched" "setopt" "source" "suspend" "true" "ttyctl" "type" "unfunction" "unhash" "unlimit" "unsetopt" "vared" "which"))) (#$ . -7032))
#@271 *List of keywords that may be immediately followed by a builtin or keyword.
Given some confusion between keywords and builtins depending on shell and
system, the distinction here has been based on whether they influence the
flow of control or syntax.  See `sh-feature'.
(defvar sh-leading-keywords (quote ((csh "else") (es "true" "unwind-protect" "whatis") (rc "else") (sh "do" "elif" "else" "if" "then" "trap" "type" "until" "while"))) (#$ . -9033))
#@67 *List of keywords not in `sh-leading-keywords'.
See `sh-feature'.
(defvar sh-other-keywords (quote ((bash eval sh-append bourne "bye" "logout") (bourne eval sh-append shell "done" "esac" "fi" "for" "function" "in" "return") (csh eval sh-append shell "breaksw" "default" "end" "endif" "endsw" "foreach" "goto" "if" "logout" "onintr" "repeat" "switch" "then" "while") (es "break" "catch" "exec" "exit" "fn" "for" "forever" "fork" "if" "return" "throw" "while") (ksh88 eval sh-append bourne "select") (rc "break" "case" "exec" "exit" "fn" "for" "if" "in" "return" "switch" "while") (shell "break" "case" "continue" "exec" "exit") (zsh eval sh-append bash "select"))) (#$ . -9490))
#@78 List of all shell variables available for completing read.
See `sh-feature'.
(defvar sh-variables (quote ((bash eval sh-append sh "allow_null_glob_expansion" "auto_resume" "BASH" "BASH_VERSION" "cdable_vars" "ENV" "EUID" "FCEDIT" "FIGNORE" "glob_dot_filenames" "histchars" "HISTFILE" "HISTFILESIZE" "history_control" "HISTSIZE" "hostname_completion_file" "HOSTTYPE" "IGNOREEOF" "ignoreeof" "LINENO" "MAIL_WARNING" "noclobber" "nolinks" "notify" "no_exit_on_failed_exec" "NO_PROMPT_VARS" "OLDPWD" "OPTERR" "PPID" "PROMPT_COMMAND" "PS4" "pushd_silent" "PWD" "RANDOM" "REPLY" "SECONDS" "SHLVL" "TMOUT" "UID") (csh eval sh-append shell "argv" "cdpath" "child" "echo" "histchars" "history" "home" "ignoreeof" "mail" "noclobber" "noglob" "nonomatch" "path" "prompt" "shell" "status" "time" "verbose") (es eval sh-append shell "apid" "cdpath" "CDPATH" "history" "home" "ifs" "noexport" "path" "pid" "prompt" "signals") (jcsh eval sh-append csh "notify") (ksh88 eval sh-append sh "ENV" "ERRNO" "FCEDIT" "FPATH" "HISTFILE" "HISTSIZE" "LINENO" "OLDPWD" "PPID" "PS3" "PS4" "PWD" "RANDOM" "REPLY" "SECONDS" "TMOUT") (oash eval sh-append sh "FIELD" "FIELD_MAX" "LAST_KEY" "OALIB" "PP_ITEM" "PP_NUM") (rc eval sh-append shell "apid" "apids" "cdpath" "CDPATH" "history" "home" "ifs" "path" "pid" "prompt" "status") (sh eval sh-append shell "CDPATH" "IFS" "OPTARG" "OPTIND" "PS1" "PS2") (shell "COLUMNS" "EDITOR" "HOME" "HUSHLOGIN" "LANG" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LINES" "LOGNAME" "MAIL" "MAILCHECK" "MAILPATH" "PAGER" "PATH" "SHELL" "TERM" "TERMCAP" "TERMINFO" "VISUAL") (tcsh eval sh-append csh "addsuffix" "ampm" "autocorrect" "autoexpand" "autolist" "autologout" "chase_symlinks" "correct" "dextract" "edit" "el" "fignore" "gid" "histlit" "HOST" "HOSTTYPE" "HPATH" "ignore_symlinks" "listjobs" "listlinks" "listmax" "matchbeep" "nobeep" "NOREBIND" "oid" "printexitvalue" "prompt2" "prompt3" "pushdsilent" "pushdtohome" "recexact" "recognize_only_executables" "rmstar" "savehist" "SHLVL" "showdots" "sl" "SYSTYPE" "tcsh" "term" "tperiod" "tty" "uid" "version" "visiblebell" "watch" "who" "wordchars") (zsh eval sh-append ksh88 "BAUD" "bindcmds" "cdpath" "DIRSTACKSIZE" "fignore" "FIGNORE" "fpath" "HISTCHARS" "hostcmds" "hosts" "HOSTS" "LISTMAX" "LITHISTSIZE" "LOGCHECK" "mailpath" "manpath" "NULLCMD" "optcmds" "path" "POSTEDIT" "prompt" "PROMPT" "PROMPT2" "PROMPT3" "PROMPT4" "psvar" "PSVAR" "READNULLCMD" "REPORTTIME" "RPROMPT" "RPS1" "SAVEHIST" "SPROMPT" "STTY" "TIMEFMT" "TMOUT" "TMPPREFIX" "varcmds" "watch" "WATCH" "WATCHFMT" "WORDCHARS" "ZDOTDIR"))) (#$ . 10174))
#@59 *Rules for highlighting shell scripts.  See `sh-feature'.
(defvar sh-font-lock-keywords (quote ((csh eval sh-append shell (quote ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 font-lock-variable-name-face))) (es eval sh-append executable-font-lock-keywords (quote ("\\$#?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\)" 1 font-lock-variable-name-face))) (rc eval identity es) (sh eval sh-append shell (quote ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 font-lock-variable-name-face))) (shell eval sh-append executable-font-lock-keywords (quote ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)) (quote ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 font-lock-variable-name-face))))) (#$ . -12790))
#@70 *Additional rules for highlighting shell scripts.  See `sh-feature'.
(defvar sh-font-lock-keywords-1 (quote ((sh "[ 	]in\\>"))) (#$ . -13501))
#@68 *Yet more rules for highlighting shell scripts.  See `sh-feature'.
(defvar sh-font-lock-keywords-2 nil (#$ . -13650))
#@337 *Value of `font-lock-keywords-only' for highlighting shell scripts.
Default value is `t' because Emacs' syntax is not expressive enough to
detect that $# does not start a comment.  Thus comments are fontified by
regexp which means that a single apostrophe in a comment turns everything
upto the next one or end of buffer into a string.
(defvar sh-font-lock-keywords-only t (#$ . -13775))
(put (quote sh-mode) (quote mode-class) (quote special))
#@2071 Major mode for editing shell scripts.
This mode works for many shells, since they all have roughly the same syntax,
as far as commands, arguments, variables, pipes, comments etc. are concerned.
Unless the file's magic number indicates the shell, your usual shell is
assumed.  Since filenames rarely give a clue, they are not further analyzed.

This mode adapts to the variations between shells (see `sh-set-shell') by
means of an inheritance based feature lookup (see `sh-feature').  This
mechanism applies to all variables (including skeletons) that pertain to
shell-specific features.

The default style of this mode is that of Rosenblatt's Korn shell book.
The syntax of the statements varies with the shell being used.  The
following commands are available, based on the current shell's syntax:

\[sh-case]	 case statement
\[sh-for]	 for loop
\[sh-function]	 function definition
\[sh-if]	 if statement
\[sh-indexed-loop]	 indexed loop from 1 to n
\[sh-while-getopts]	 while getopts loop
\[sh-repeat]	 repeat loop
\[sh-select]	 select loop
\[sh-until]	 until loop
\[sh-while]	 while loop

\[backward-delete-char-untabify]	 Delete backward one position, even if it was a tab.
\[sh-newline-and-indent]	 Delete unquoted space and indent new line same as this one.
\[sh-end-of-command]	 Go to end of successive commands.
\[sh-beginning-of-command]	 Go to beginning of successive commands.
\[sh-set-shell]	 Set this buffer's shell, and maybe its magic number.
\[sh-execute-region]	 Have optional header and region be executed in a subshell.

\[sh-maybe-here-document]	 Without prefix, following an unquoted < inserts here document.
{, (, [, ', ", `
	Unless quoted with \, insert the pairs {}, (), [], or '', "", ``.

If you generally program a shell different from your login shell you can
set `sh-shell-file' accordingly.  If your shell's file name doesn't correctly
indicate what shell it is use `sh-alias-alist' to translate.

If your shell gives error messages with line numbers, you can use \[executable-interpret]
with your script for an edit-interpret-debug cycle.
(defalias 'sh-mode #[nil " \n!!!!!!!!!!!!!!!!!!!!!! P	#&BB+eb ! 0 !)!" [kill-all-local-variables use-local-map sh-mode-map make-local-variable indent-line-function indent-region-function skeleton-end-hook paragraph-start paragraph-separate comment-start comment-start-skip require-final-newline sh-header-marker sh-shell-file sh-shell skeleton-pair-alist skeleton-pair-filter comint-dynamic-complete-functions comint-prompt-regexp font-lock-keywords font-lock-defaults skeleton-filter skeleton-newline-indent-rigidly sh-shell-variables sh-shell-variables-initialized sh-mode major-mode "Shell-script" mode-name sh-indent-line #[(b e) "b!`b!`#)" [b skip-syntax-backward "-" e indent-rigidly sh-indentation] 4] #[nil "l    " [newline indent-relative] 1] page-delimiter "\\|$" "# " sh-dynamic-complete-functions "^[ 	]*" (sh-font-lock-keywords sh-font-lock-keywords-1 sh-font-lock-keywords-2) sh-font-lock-keywords-only (nil ((47 . "w") (126 . "w") (46 . "w") (45 . "w") (95 . "w"))) ((96 _ 96)) sh-quoted-p ((< (quote (- (min sh-indentation (current-column)))))) skeleton-further-elements sh-feature t zerop buffer-size buffer-read-only sh-set-shell run-hooks sh-mode-hook] 4 (#$ . 14228) nil])
(defalias (quote shell-script-mode) (quote sh-mode))
#@118 Function to get simple fontification based on `sh-font-lock-keywords'.
This adds rules for comments and assignments.
(defalias 'sh-font-lock-keywords #[(&optional keywords) "	\"" [sh-feature sh-font-lock-keywords #[(list) "	!PB\f!B\"BB" [sh-feature sh-comment-prefix "\\(#.*\\)" (2 font-lock-comment-face t) sh-assignment-regexp (1 font-lock-variable-name-face) append keywords list] 5]] 3 (#$ . 17704)])
#@58 Function to get better fontification including keywords.
(defalias 'sh-font-lock-keywords-1 #[(&optional builtins) "\f!#\f!!\"#ɰ\n\f6 \n!#RB!B\nPBC!#!)" ["\\([;(){}`|&]\\|^\\)[ 	]*\\(\\(\\(" mapconcat identity sh-feature sh-leading-keywords "\\|" "\\)[ 	]+\\)?\\(" append sh-other-keywords "\\)" keywords sh-font-lock-keywords builtins "[ 	]+\\)?\\(" sh-builtins "\\)\\>" ((2 font-lock-keyword-face nil t) (6 font-lock-function-name-face)) sh-font-lock-keywords-2 (2 font-lock-keyword-face) sh-font-lock-keywords-1] 9 (#$ . 18129)])
#@71 Function to get better fontification including keywords and builtins.
(defalias 'sh-font-lock-keywords-2 #[nil "!" [sh-font-lock-keywords-1 t] 2 (#$ . 18709)])
#@150 Set this buffer's shell to SHELL (a string).
Makes this script executable via `executable-set-magic'.
Calls the value of `sh-set-shell-hook' if set.
(defalias 'sh-set-shell #[(shell &optional no-query-flag insert-flag) "\n!!\fA \n!\"	!\n\f!P\"!!!\nT \n@!\nAH !e e ۉ!!!" [intern file-name-nondirectory shell sh-shell sh-alias-alist executable-set-magic sh-feature sh-shell-arg sh-shell-file sh-require-final-newline require-final-newline nil font-lock-keywords font-lock-syntax-table sh-comment-prefix "#+[	 ]*" comment-start-skip format "[%s]" mode-line-process sh-shell-variables sh-shell-variables-initialized sh-variables set-syntax-table sh-mode-syntax-table sh-remember-variable boundp font-lock-mode 0 run-hooks sh-set-shell-hook] 5 (#$ . 18879) (list (completing-read "Name or path of shell: " interpreter-mode-alist (lambda (x) (eq (cdr x) (quote sh-mode)))) (eq executable-query (quote function)) t)])
#@892 Index ALIST by the current shell.
If ALIST isn't a list where every element is a cons, it is returned as is.
Else indexing follows an inheritance logic which works in two ways:

  - Fall back on successive ancestors (see `sh-ancestor-alist') as long as
    the alist contains no value for the current shell.

  - If the value thus looked up is a list starting with `eval' its `cdr' is
    first evaluated.  If that is also a list and the first argument is a
    symbol in ALIST it is not evaluated, but rather recursively looked up in
    ALIST to allow the function called to define the value for one shell to be
    derived from another shell.  While calling the function, is the car of the
    alist element is the current shell.
    The value thus determined is physically replaced into the alist.

Optional FUNCTION is applied to the determined value and the result is cached
in ALIST.
(defalias 'sh-feature #[(list &optional function) ":!  	@: 	A 	 ) \n1 \f\nB\"A \fŉP \fP \fA= A: @= A: A@ A!D* !\n \n@\nA!BC+" [list l function assoc sh-shell nil val elt sh-ancestor-alist eval quote sh-feature] 7 (#$ . 19864)])
#@72 Copy TABLE and set syntax for successive CHARs according to strings S.
(defalias 'sh-mode-syntax-table #[(table &rest list) "	!\n \n@\nA@	#\nAA 	" [copy-syntax-table table list modify-syntax-entry] 5 (#$ . 21099)])
#@78 Return list composed of first argument (a list) physically appended to rest.
(defalias 'sh-append #[(ancestor &rest list) "	" [list ancestor] 2 (#$ . 21331)])
#@73 Modify a copy of SKELETON by replacing I1 with REPL1, I2 with REPL2 ...
(defalias 'sh-modify #[(skeleton &rest list) "	!\n! \n@	 \n@\"\nA@\nAA 	" [copy-sequence skeleton list error "Index %d out of bounds"] 4 (#$ . 21499)])
#@132 Indent as far as preceding non-empty line, then by steps of `sh-indentation'.
Lines containing only comments are considered empty.
(defalias 'sh-indent-line #[nil "o y l g= i)=& ] i iW= l9 ] Ȃ] `y`|lU \f	T	_]] \f	T	_j)i Wj w*" [-1 back-to-indentation 35 nil current previous this-command newline-and-indent 0 sh-indentation current-indentation " 	"] 3 (#$ . 21745) nil])
#@398 Pass optional header and region to a subshell for noninteractive execution.
The working directory is that of the buffer, and only environment variables
are already set which is why you can mark a header within the script.

With a positive prefix ARG, instead of sending region, define header from
beginning of buffer to point.  With a negative prefix ARG, instead of sending
region, clear header.
(defalias 'sh-execute-region #[(start end &optional flag) " !V  \f: \fbp	#e\f	Z\\	#\f	|*	P#" [flag prefix-numeric-value 0 point-marker sh-header-marker nil buffer-undo-list append-to-buffer start end shell-command-on-region sh-shell-file " -"] 5 (#$ . 22172) "r\nP"])
#@69 Make VARIABLE available for future completing reads in this buffer.
(defalias 'sh-remember-variable #[(var) "G	W ! \f\" B\fB" [var sh-remember-variable-min getenv assoc sh-shell-variables] 3 (#$ . 22885)])
#@52 Is point preceded by an odd number of backslashes?
(defalias 'sh-quoted-p #[nil "x)¦=" ["\\\\" nil 2 -1] 2 (#$ . 23113)])
#@477 Insert a case/switch statement.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-case #[(&optional str arg) "\n#" [skeleton-proxy-new ((csh "expression: " "switch( " str " )" n > "case " (read-string "pattern: ") 58 n > _ n "breaksw" n ("other pattern, %s: " < "case " str 58 n > _ n "breaksw" n) < "default:" n > _ n resume: < < "endsw") (es) (rc "expression: " "switch( " str " ) {" n > "case " (read-string "pattern: ") n > _ n ("other pattern, %s: " < "case " str n > _ n) < "case *" n > _ n resume: < < 125) (sh "expression: " "case " str " in" n > (read-string "pattern: ") 41 n > _ n ";;" n ("other pattern, %s: " < str 41 n > _ n ";;" n) < "*)" n > _ n resume: < < "esac")) str arg] 4 (#$ . 23248) "*P\nP"])
(put (quote sh-case) (quote menu-enable) (quote (sh-feature sh-case)))
#@464 Insert a for loop.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-for #[(&optional str arg) "\n#" [skeleton-proxy-new ((csh eval sh-modify sh 1 "foreach " 3 " ( " 5 " )" 15 "end") (es eval sh-modify rc 3 " = ") (rc eval sh-modify sh 1 "for( " 5 " ) {" 15 125) (sh "Index variable: " "for " str " in " _ "; do" n > _ | 36 & (sh-remember-variable str) n < "done")) str arg] 4 (#$ . 24455) "*P\nP"])
#@481 Insert an indexed loop from 1 to n.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-indexed-loop #[(&optional str arg) "\n#" [skeleton-proxy-new ((bash eval identity posix) (csh "Index variable: " "@ " str " = 1" n "while( $" str " <= " (read-string "upper limit: ") " )" n > _ 36 str n "@ " str "++" n < "end") (es eval sh-modify rc 3 " =") (ksh88 "Index variable: " "integer " str "=0" n "while (( ( " str " += 1 ) <= " (read-string "upper limit: ") " )); do" n > _ 36 (sh-remember-variable str) n < "done") (posix "Index variable: " str "=1" n "while [ $" str " -le " (read-string "upper limit: ") " ]; do" n > _ 36 str n str 61 (sh-add (sh-remember-variable str) 1) n < "done") (rc "Index variable: " "for( " str " in" " `{awk 'BEGIN { for( i=1; i<=" (read-string "upper limit: ") "; i++ ) print i }'}) {" n > _ 36 (sh-remember-variable str) n < 125) (sh "Index variable: " "for " str " in `awk 'BEGIN { for( i=1; i<=" (read-string "upper limit: ") "; i++ ) print i }'`; do" n > _ 36 (sh-remember-variable str) n < "done")) str arg] 4 (#$ . 25274) "*P\nP"])
#@88 Scan the buffer for variable assignments.
Add these variables to `sh-shell-variables'.
(defalias 'sh-shell-initialize-variables #[nil " \"eb# !\f ) \"" [message "Scanning buffer `%s' for variable assignments..." buffer-name t sh-shell-variables-initialized search-forward "=" nil sh-assignment 0 "Scanning buffer `%s' for variable assignments...done"] 4 (#$ . 26756)])
(byte-code "	B" [sh-add-buffer current-load-list] 2)
#@547 Do completion using `sh-shell-variables', but initialize it first.
This function is designed for use as the "completion table",
so it takes three arguments:
  STRING, the current buffer contents;
  PREDICATE, the predicate for filtering possible matches;
  CODE, which says what kind of things to do.
CODE can be nil, t or `lambda'.
nil means to return the best completion of STRING, or nil if there is none.
t means to return a list of all possible completions of STRING.
`lambda' means to return t if STRING is a valid completion as it stands.
(defalias 'sh-add-completer #[(string predicate code) "q	  \")% 	\n#D =7 	\n#D =D 	\")" [sh-add-buffer sh-shell-variables-initialized sh-shell-initialize-variables mapcar #[(var) "\"OB" [var 0 string-match "="] 6] process-environment sh-shell-variables code try-completion string predicate t all-completions lambda assoc] 4 (#$ . 27211)])
#@69 Insert an addition of VAR and prefix DELTA for Bourne (type) shell.
(defalias 'sh-add #[(var delta) "!!\fW Ƃ \f!!!" [sh-feature ((bash . "$[ ") (ksh88 . "$(( ") (posix . "$(( ") (rc . "`{expr $") (sh . "`expr $") (zsh . "$[ ")) sh-remember-variable var delta 0 " - " " + " number-to-string abs ((bash . " ]") (ksh88 . " ))") (posix . " ))") (rc . "}") (sh . "`") (zsh . " ]"))] 6 (#$ . 28152) (let ((sh-add-buffer (current-buffer))) (list (completing-read "Variable: " (quote sh-add-completer)) (prefix-numeric-value current-prefix-arg)))])
#@475 Insert a function definition.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-function #[(&optional str arg) "\n#" [skeleton-proxy-new ((bash eval sh-modify ksh88 3 "() {") (ksh88 "name: " "function " str " {" n > _ n < "}") (rc eval sh-modify ksh88 1 "fn ") (sh nil "() {" n > _ n < "}")) str arg] 4 (#$ . 28717) "*P\nP"])
#@469 Insert an if statement.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-if #[(&optional str arg) "\n#" [skeleton-proxy-new ((csh "condition: " "if( " str " ) then" n > _ n ("other condition, %s: " < "else if( " str " ) then" n > _ n) < "else" n > _ n resume: < "endif") (es "condition: " "if { " str " } {" n > _ n ("other condition, %s: " < "} { " str " } {" n > _ n) < "} {" n > _ n resume: < 125) (rc eval sh-modify csh 3 " ) {" 8 (quote ("other condition, %s: " < "} else if( " str " ) {" n > _ n)) 10 "} else {" 17 125) (sh "condition: " (quote (setq input (sh-feature sh-test))) "if " str "; then" n > _ n ("other condition, %s: " < "elif " str "; then" n > _ n) < "else" n > _ n resume: < "fi")) str arg] 4 (#$ . 29462) "*P\nP"])
#@478 Insert a repeat loop definition.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-repeat #[(&optional str arg) "\n#" [skeleton-proxy-new ((es nil "forever {" n > _ n < 125) (zsh "factor: " "repeat " str "; do" n > _ n < "done")) str arg] 4 (#$ . 30620) "*P\nP"])
(put (quote sh-repeat) (quote menu-enable) (quote (sh-feature sh-repeat)))
#@472 Insert a select statement.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-select #[(&optional str arg) "\n#" [skeleton-proxy-new ((ksh88 "Index variable: " "select " str " in " _ "; do" n > 36 str n < "done")) str arg] 4 (#$ . 31378) "*P\nP"])
(put (quote sh-select) (quote menu-enable) (quote (sh-feature sh-select)))
#@491 Insert code to setup temporary file handling.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-tmp-file #[(&optional str arg) "\n#" [skeleton-proxy-new ((bash eval identity ksh88) (csh (file-name-nondirectory (buffer-file-name)) "set tmp = /tmp/" str ".$$" n "onintr exit" n _ (and (goto-char (point-max)) (not (bolp)) 10) "exit:\n" "rm $tmp* >&/dev/null" >) (es (file-name-nondirectory (buffer-file-name)) "local( signals = $signals sighup sigint; tmp = /tmp/" str ".$pid ) {" n > "catch @ e {" n > "rm $tmp^* >[2]/dev/null" n "throw $e" n < "} {" n > _ n < 125 n < 125) (ksh88 eval sh-modify sh 6 "EXIT") (rc (file-name-nondirectory (buffer-file-name)) "tmp = /tmp/" str ".$pid" n "fn sigexit { rm $tmp^* >[2]/dev/null }") (sh (file-name-nondirectory (buffer-file-name)) "TMP=/tmp/" str ".$$" n "trap \"rm $TMP* 2>/dev/null\" " 48)) str arg] 4 (#$ . 32119) "*P\nP"])
#@467 Insert an until loop.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-until #[(&optional str arg) "\n#" [skeleton-proxy-new ((sh "condition: " (quote (setq input (sh-feature sh-test))) "until " str "; do" n > _ n < "done")) str arg] 4 (#$ . 33408) "*P\nP"])
(put (quote sh-until) (quote menu-enable) (quote (sh-feature sh-until)))
#@466 Insert a while loop.  See `sh-feature'.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-while #[(&optional str arg) "\n#" [skeleton-proxy-new ((csh eval sh-modify sh 2 "while( " 4 " )" 10 "end") (es eval sh-modify rc 2 "while { " 4 " } {") (rc eval sh-modify csh 4 " ) {" 10 125) (sh "condition: " (quote (setq input (sh-feature sh-test))) "while " str "; do" n > _ n < "done")) str arg] 4 (#$ . 34160) "*P\nP"])
#@616 Insert a while getopts loop.  See `sh-feature'.
Prompts for an options string which consists of letters for each recognized
option followed by a colon `:' if the option accepts an argument.

This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing "inside".
If there is a highlighted region, the skeleton text is wrapped
around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overiding the use of a highlighted region.
(defalias 'sh-while-getopts #[(&optional str arg) "\n#" [skeleton-proxy-new ((bash eval sh-modify sh 18 "${0##*/}") (csh nil "while( 1 )" n > "switch( \"$1\" )" n (quote (setq input (quote ("- x" . 2)))) > > ("option, %s: " < "case " (quote (eval str)) (quote (if (string-match " +" str) (setq v1 (substring str (match-end 0)) str (substring str 0 (match-beginning 0))) (setq v1 nil))) str 58 n > "set " v1 & " = $2" | -4 & _ n (if v1 "shift") & n "breaksw" n) < "case --:" n > "shift" n < "default:" n > "break" n resume: < < "endsw" n "shift" n < "end") (ksh88 eval sh-modify sh 16 "print" 18 "${0##*/}" 36 "OPTIND-1") (posix eval sh-modify sh 18 "$(basename $0)") (sh "optstring: " "while getopts :" str " OPT; do" n > "case $OPT in" n > > (quote (setq v1 (append (vconcat str) nil))) ((prog1 (if v1 (char-to-string (car v1))) (if (eq (nth 1 v1) 58) (setq v1 (nthcdr 2 v1) v2 "\"$OPTARG\"") (setq v1 (cdr v1) v2 nil))) < str "|+" str 41 n > _ v2 n ";;" n) < "*)" n > "echo" " \"usage: " "`basename $0`" " [+-" (quote (setq v1 (point))) str (quote (save-excursion (while (search-backward ":" v1 t) (replace-match " ARG] [+-" t t)))) (if (eq (preceding-char) 45) -5) "] [--] ARGS...\"" n "exit 2" n < < "esac" n < "done" n "shift " (sh-add "OPTIND" -1))) str arg] 4 (#$ . 34975) "*P\nP"])
(put (quote sh-while-getopts) (quote menu-enable) (quote (sh-feature sh-while-getopts)))
#@73 Remember preceding identifier for future completion and do self-insert.
(defalias 'sh-assignment #[(arg) "	!	X Ê!`y# !)!" [self-insert-command arg 1 sh-remember-variable re-search-forward sh-feature sh-assignment-regexp 0 t match-string] 5 (#$ . 36979) "p"])
#@130 Inserts self.  Without prefix, following unquoted `<' inserts here document.
The document is bounded by `sh-here-document-word'.
(defalias 'sh-maybe-here-document #[(arg) "\n!!\nH `Zf\f=?H ! )H cl0 !0 c > 3  )" [self-insert-command prefix-numeric-value arg 2 last-command-char backward-char sh-quoted-p sh-here-document-word looking-at "[ 	]" 32 1 newline 10] 3 (#$ . 37263) "*P"])
#@42 Dynamically perform completion at point.
(autoload (quote comint-dynamic-complete) "comint" '(#$ . 37690) t)
#@44 Dynamically complete the command at point.
(autoload (quote shell-dynamic-complete-command) "shell" '(#$ . 37805) t)
#@45 Dynamically complete the filename at point.
(autoload (quote comint-dynamic-complete-filename) "comint" '(#$ . 37928) t)
#@57 Dynamically complete the environment variable at point.
(autoload (quote shell-dynamic-complete-environment-variable) "shell" '(#$ . 38055) t)
#@74 Strip unquoted whitespace, insert newline, and indent like current line.
(defalias 'sh-newline-and-indent #[nil " `x!   u`| j" [current-indentation zerop " 	" nil sh-quoted-p newline] 5 (#$ . 38204) "*"])
#@50 Move point to successive beginnings of commands.
(defalias 'sh-beginning-of-command #[nil "	# Ĕb" [re-search-backward sh-beginning-of-command nil t 2] 4 (#$ . 38430) nil])
#@44 Move point to successive ends of commands.
(defalias 'sh-end-of-command #[nil "	# ĕb" [re-search-forward sh-end-of-command nil t 1] 4 (#$ . 38615) nil])
(provide (quote sh-script))
