;ELC   
;;; compiled by erik@naggum.no on Sat Nov 11 09:35:53 1995
;;; from file /gd/gnu/emacs/19.0/lisp/sh-script.el
;;; emacs version 19.29.90.5.
;;; 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"))


(byte-code "!\f\" B\f" [require executable assoc "sh" interpreter-mode-alist ("\\.c?sh\\'\\|\\.shar\\'\\|/\\.\\(z?profile\\|bash_profile\\|z?login\\|bash_login\\|z?logout\\|bash_logout\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\|rcrc\\|[kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) auto-mode-alist (("ash" . sh-mode) ("bash" . sh-mode) ("csh" . sh-mode) ("dtksh" . sh-mode) ("es" . sh-mode) ("itcsh" . sh-mode) ("jsh" . sh-mode) ("ksh" . sh-mode) ("oash" . sh-mode) ("pdksh" . sh-mode) ("rc" . sh-mode) ("sh" . sh-mode) ("sh5" . sh-mode) ("tcsh" . sh-mode) ("wksh" . sh-mode) ("wsh" . sh-mode) ("zsh" . sh-mode))] 3)
#@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))) (#$ . -1112))
#@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 linux ((csh . tcsh) (ksh . pdksh) (sh . bash)) ((ksh . ksh88) (sh5 . sh))] 2) (#$ . -2033))
#@48 *The executable of the shell being programmed.
(defvar sh-shell-path (byte-code "! " [getenv "SHELL" "/bin/sh"] 2) (#$ . -2348))
#@66 *Single argument string for the magic number.  See `sh-feature'.
(defvar sh-shell-arg (quote ((bash . "-norc") (csh . "-f") (ksh88 eval progn nil (if (file-exists-p "/etc/suid_profile") nil "-p")) (pdksh) (rc . "-p") (wksh . "-motif") (zsh . "-f"))) (#$ . -2489))
#@62 The shell being programmed.  This is set by \[sh-set-shell].
(defvar sh-shell (byte-code "\n!!A \n!!" [intern file-name-nondirectory sh-shell-path sh-alias-alist] 3) (#$ . 2759))
#@195 Abbrev-table used in Shell-Script mode.  See `sh-feature'.
Due to the internal workings of abbrev tables, the shell name symbol is
actually defined as the table for the like of \[edit-abbrevs].
(defvar sh-abbrevs (quote ((csh eval sh-abbrevs shell "switch" (quote sh-case) "getopts" (quote sh-while-getopts)) (es eval sh-abbrevs shell "function" (quote sh-function)) (ksh88 eval sh-abbrevs sh "select" (quote sh-select)) (rc eval sh-abbrevs shell "case" (quote sh-case) "function" (quote sh-function)) (sh eval sh-abbrevs shell "case" (quote sh-case) "function" (quote sh-function) "until" (quote sh-until) "getopts" (quote sh-while-getopts)) (shell "for" sh-for "loop" sh-indexed-loop "if" sh-if "tmpfile" sh-tmp-file "while" sh-while) (zsh eval sh-abbrevs ksh88 "repeat" (quote sh-repeat)))) (#$ . 2954))
#@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 "."))) (#$ . 3767))
#@35 Keymap used in Shell-Script mode.
(defvar sh-mode-map (byte-code " 	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	 $	 $	 $	#	 $	 $	 $	!B#	#	@ A #	B C #	D E #	F G #	H I #	J K #	L M #	N O #	P Q #	)" [make-sparse-keymap 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] "Insert" [menu-bar insert sh-while] ("While loop" . sh-while) [menu-bar insert sh-until] ("Until loop" . sh-until) [menu-bar insert sh-tmp-file] ("Temporary file" . sh-tmp-file) [menu-bar insert sh-select] ("Select statement" . sh-select) [menu-bar insert sh-repeat] ("Repeat loop" . sh-repeat) [menu-bar insert sh-while-getopts] ("Options loop" . sh-while-getopts) [menu-bar insert sh-indexed-loop] ("Indexed loop" . sh-indexed-loop) [menu-bar insert sh-if] ("If statement" . sh-if) [menu-bar insert sh-for] ("For loop" . sh-for) [menu-bar insert sh-case] ("Case statement" . sh-case)] 6) (#$ . 4067))
#@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)) (#$ . -5770))
#@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))) (#$ . -5991))
#@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 . "\\(^\\|[ 	|&;()]\\)"))) (#$ . -6227))
#@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_]+\\)="))) (#$ . -6560))
#@57 The width for further indentation in Shell-Script mode.
(defvar sh-indentation 4 (#$ . 7009))
#@71 *Don't remember variables less than this length for completing reads.
(defvar sh-remember-variable-min 3 (#$ . -7109))
#@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 (#$ . 7235))
#@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:]\\)" (#$ . -7413))
#@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:]\\)[ 	]*\\([;#)}`|&]\\|$\\)" (#$ . -7650))
#@33 Word to delimit here documents.
(defvar sh-here-document-word "EOF" (#$ . 7854))
#@75 Initial input in Bourne if, while and until skeletons.  See `sh-feature'.
(defvar sh-test (quote ((sh "[  ]" . 3) (ksh88 "[[  ]]" . 4))) (#$ . 7941))
#@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"))) (#$ . -8098))
#@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"))) (#$ . -10099))
#@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"))) (#$ . -10557))
#@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"))) (#$ . 11242))
#@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 ("\\\\." 0 font-lock-string-face)) (quote ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 font-lock-variable-name-face))))) (#$ . -13858))
#@70 *Additional rules for highlighting shell scripts.  See `sh-feature'.
(defvar sh-font-lock-keywords-1 (quote ((sh "[ 	]in[ 	]"))) (#$ . -14558))
#@68 *Yet more rules for highlighting shell scripts.  See `sh-feature'.
(defvar sh-font-lock-keywords-2 nil (#$ . -14708))
#@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-path' 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	\"(eb! ! !!" [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-path 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 process-environment 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) nil 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 sh-set-shell looking-at "#![	 ]*\\([^	\n ]+\\)" match-string 1 run-hooks sh-mode-hook] 4 (#$ . 14834) 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 (#$ . 18262)])
#@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 (#$ . 18687)])
#@71 Function to get better fontification including keywords and builtins.
(defalias 'sh-font-lock-keywords-2 #[nil "!" [sh-font-lock-keywords-1 t] 2 (#$ . 19267)])
#@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) "= !!A 	!\"\n!\f!!P\"!!!!#f !W )w @!Ak ! $ !!!" [this-command sh-set-shell executable-set-magic intern file-name-nondirectory shell sh-shell sh-alias-alist sh-feature sh-shell-arg sh-shell-path sh-abbrevs local-abbrev-table sh-require-final-newline require-final-newline nil font-lock-keywords sh-comment-prefix "#+[	 ]*" comment-start-skip format "[%s]" mode-line-process default-value process-environment sh-variables set-syntax-table sh-mode-syntax-table font-lock-syntax-table search-forward "=" t sh-assignment 0 sh-remember-variable boundp font-lock-mode run-hooks sh-set-shell-hook] 5 (#$ . 19437) (list (completing-read "Name or path of shell: " interpreter-mode-alist (lambda (x) (eq (cdr x) (quote sh-mode)))))])
#@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 (#$ . 20449)])
#@343 Iff it isn't, define the current shell as abbrev table and fill that.
Abbrev table will inherit all abbrevs from ANCESTOR, which is either an abbrev
table or a list of (NAME1 EXPANSION1 ...).  In addition it will define abbrevs
according to the remaining arguments NAMEi EXPANSIONi ...
EXPANSION may be either a string or a skeleton command.
(defalias 'sh-abbrevs #[(ancestor &rest list) "	! 	JQ \n< \n	\"\n!$ \n\"O 	J@A@;: A@; A@9E A@$AA( 	J" [boundp sh-shell ancestor list define-abbrev-table nil vectorp mapatoms #[(atom) "= J!JK$" [atom 0 define-abbrev sh-shell symbol-name] 5] define-abbrev ""] 6 (#$ . 21685)])
#@71 Copy TABLE and set syntax for succesive 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 (#$ . 22354)])
#@78 Return list composed of first argument (a list) physically appended to rest.
(defalias 'sh-append #[(ancestor &rest list) "	" [list ancestor] 2 (#$ . 22585)])
#@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 (#$ . 22753)])
#@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 "! l g= i)=% ^ i iW= l9 ^ ɂ^ `y`|lV \nT\n_]^ \nT\n_j)i Wk w*" [line-move -1 back-to-indentation 35 nil current previous this-command newline-and-indent 0 sh-indentation current-indentation " 	"] 3 (#$ . 22999) 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-path " -"] 5 (#$ . 23439) "r\nP"])
#@69 Make VARIABLE available for future completing reads in this buffer.
(defalias 'sh-remember-variable #[(var) "G	W ! P\fB" [var sh-remember-variable-min getenv "=" process-environment] 2 (#$ . 24152)])
#@52 Is point preceded by an odd number of backslashes?
(defalias 'sh-quoted-p #[nil "x)¦=" ["\\\\" nil 2 -1] 2 (#$ . 24370)])
#@52 Insert a case/switch statement.  See `sh-feature'.
(defvar sh-case (quote ((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"))) (#$ . 24504))
(byte-code "\"#" [defalias sh-case skeleton-proxy put menu-enable (sh-feature sh-case)] 4)
#@39 Insert a for loop.  See `sh-feature'.
(defvar sh-for (quote ((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"))) (#$ . 25247))
(defalias (quote sh-for) (quote skeleton-proxy))
#@56 Insert an indexed loop from 1 to n.  See `sh-feature'.
(defvar sh-indexed-loop (quote ((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"))) (#$ . 25622))
(defalias (quote sh-indexed-loop) (quote skeleton-proxy))
#@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 (#$ . 26670) (list (completing-read "Variable: " (mapcar (lambda (var) (substring var 0 (string-match "=" var))) process-environment)) (prefix-numeric-value current-prefix-arg))])
#@50 Insert a function definition.  See `sh-feature'.
(defvar sh-function (quote ((bash eval sh-modify ksh88 3 "() {") (ksh88 "name: " "function " str " {" n > _ n < "}") (rc eval sh-modify ksh88 1 "fn ") (sh nil "() {" n > _ n < "}"))) (#$ . 27253))
(defalias (quote sh-function) (quote skeleton-proxy))
#@44 Insert an if statement.  See `sh-feature'.
(defvar sh-if (quote ((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"))) (#$ . 27559))
(defalias (quote sh-if) (quote skeleton-proxy))
#@53 Insert a repeat loop definition.  See `sh-feature'.
(defvar sh-repeat (quote ((es nil "forever {" n > _ n < 125) (zsh "factor: " "repeat " str "; do" n > _ n < "done"))) (#$ . 28272))
(byte-code "\"#" [defalias sh-repeat skeleton-proxy put menu-enable (sh-feature sh-repeat)] 4)
#@47 Insert a select statement.  See `sh-feature'.
(defvar sh-select (quote ((ksh88 "Index variable: " "select " str " in " _ "; do" n > 36 str n < "done"))) (#$ . 28566))
(byte-code "\"#" [defalias sh-select skeleton-proxy put menu-enable (sh-feature sh-select)] 4)
#@66 Insert code to setup temporary file handling.  See `sh-feature'.
(defvar sh-tmp-file (quote ((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))) (#$ . 28843))
(defalias (quote sh-tmp-file) (quote skeleton-proxy))
#@42 Insert an until loop.  See `sh-feature'.
(defvar sh-until (quote ((sh "condition: " (quote (setq input (sh-feature sh-test))) "until " str "; do" n > _ n < "done"))) (#$ . 29693))
(byte-code "\"#" [defalias sh-until skeleton-proxy put menu-enable (sh-feature sh-until)] 4)
#@41 Insert a while loop.  See `sh-feature'.
(defvar sh-while (quote ((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"))) (#$ . 29981))
(defalias (quote sh-while) (quote skeleton-proxy))
#@191 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.
(defvar sh-while-getopts (quote ((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)))) (#$ . 30355))
(byte-code "\"#" [defalias sh-while-getopts skeleton-proxy put menu-enable (sh-feature sh-while-getopts)] 4)
#@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 (#$ . 31893) "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 (#$ . 32177) "*P"])
#@42 Dynamically perform completion at point.
(autoload (quote comint-dynamic-complete) "comint" '(#$ . 32604) t)
#@44 Dynamically complete the command at point.
(autoload (quote shell-dynamic-complete-command) "shell" '(#$ . 32719) t)
#@45 Dynamically complete the filename at point.
(autoload (quote comint-dynamic-complete-filename) "comint" '(#$ . 32842) t)
#@57 Dynamically complete the environment variable at point.
(autoload (quote shell-dynamic-complete-environment-variable) "shell" '(#$ . 32969) 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 (#$ . 33118) "*"])
#@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 (#$ . 33344) 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 (#$ . 33529) nil])
