;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Wed Jun 24 14:20:17 1998
;;; from file /gd/gnu/emacs/lisp/progmodes/executable.el
;;; in Emacs version 20.2.95.4
;;; with bytecomp version 2.46
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`executable.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'executable nil "Base functionality for executable interpreter scripts" :group 'processes)
#@245 *Non-nil means offer to add a magic number to a file.
This takes effect when you switch to certain major modes,
including Shell-script mode (`sh-mode').
When you type \[executable-set-magic], it always offers to add or
update the magic number.
(custom-declare-variable 'executable-insert ''other '(#$ . -732) :type '(choice (const :tag "off" nil) (const :tag "on" t) symbol) :group 'executable)
#@130 *If non-nil, ask user before changing an existing magic number.
When this is `function', only ask when called non-interactively.
(custom-declare-variable 'executable-query ''function '(#$ . -1134) :type '(choice (const :tag "Don't Ask" nil) (const :tag "Ask when non-interactive" function) (other :tag "Ask" t)) :group 'executable)
#@67 *On files with this kind of name no magic is inserted or changed.
(custom-declare-variable 'executable-magicless-file-regexp '"/[Mm]akefile$\\|/\\.\\(z?profile\\|bash_profile\\|z?login\\|bash_login\\|z?logout\\|bash_logout\\|.+shrc\\|esrc\\|rcrc\\|[kz]shenv\\)$" '(#$ . -1472) :type 'regexp :group 'executable)
#@75 *Interpreter magic number prefix inserted when there was no magic number.
(custom-declare-variable 'executable-prefix '"#! " '(#$ . -1789) :type 'string :group 'executable)
#@251 *After saving, if the file is not executable, set this mode.
This mode passed to `set-file-modes' is taken absolutely when negative, or
relative to the files existing modes.  Do nothing if this is nil.
Typical values are 73 (+x) or -493 (rwxr-xr-x).
(custom-declare-variable 'executable-chmod '73 '(#$ . -1969) :type '(choice integer (const nil)) :group 'executable)
(byte-code "\302\300!\204 \303\300	B\303\207" [executable-command current-load-list boundp nil] 2)
#@144 *Command you use with argument `+2' to make text files self-display.
Note that the like of `more' doesn't work too well under Emacs  \[shell].
(custom-declare-variable 'executable-self-display '"tail" '(#$ . -2445) :type 'string :group 'executable)
#@137 *Rules for highlighting executable scripts' magic number.
This can be included in `font-lock-keywords' by modes that call `executable'.
(defvar executable-font-lock-keywords '(("\\`#!.*/\\([^ 	\n]+\\)" 1 font-lock-keyword-face t)) (#$ . -2701))
#@85 Alist of regexps used to match script errors.
See `compilation-error-regexp-alist'.
(defvar executable-error-regexp-alist '(("^\\(.*[^[/]\\)\\(\\[[0-9]+\\]\\)?: .* error .* line \\([0-9]+\\)" 1 3) ("^\\(.*[^/]\\)\\[\\([0-9]+\\)\\]: .*: " 1 2) ("^\\(.*[^/]\\): [^0-9\n]+\n\\1: \\1: line \\([0-9]+\\):" 1 2) (" error .* line \\([0-9]+\\) of file \\(.+\\)$" 2 1) ("^[^ ].+\n\\( .+\n\\)* line \\([0-9]+\\) of file \\(.+\\)$" 3 2) ("^\\(.+\\):\\([0-9]+\\): " 1 2)) (#$ . 2952))
(byte-code "\303\301!\204 \304>\203 \305\202 \306\301\nB\303\207" [system-type executable-binary-suffixes current-load-list boundp (ms-dos windows-nt) (".exe" ".com" ".bat" ".cmd" ".btm" "") ("")] 2)
#@128 Search for COMMAND in exec-path and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'.
(defalias 'executable-find #[(command) "\306\211\203P \307\n@\"\211\205C \f\306\n\n\203? 	\n@P\310!\2035 \311!\2045 \306\211\n\202 \nA\n\306\202 \211*?\205K \306\nA\211\204 	*\207" [exec-path file list command executable-binary-suffixes candidate nil expand-file-name file-executable-p file-directory-p suffixes] 4 (#$ . 3638)])
#@170 This gets called after saving a file to assure that it be executable.
You can set the absolute or relative mode in variable `executable-chmod' for
non-executable files.
(defalias 'executable-chmod #[nil "\205\" 	\205\" \302	!\206\" \303	\304W\203 [\202! \305\306	!\"\"\207" [executable-chmod buffer-file-name file-executable-p set-file-modes 0 logior file-modes] 6 (#$ . 4124)])
#@166 Run script with user-specified args, and collect output in a buffer.
While script runs asynchronously, you can use the \[next-error] command
to find the next error.
(defalias 'executable-interpret #[(command) "\304\305!\210\306?!\210\307\302!\210\310	\211\311\312\313%\207" [compilation-ask-about-save command executable-command executable-error-regexp-alist require compile save-some-buffers make-local-variable compile-internal "No more errors." "Interpretation" nil] 6 (#$ . 4515) (list (read-string "Run script: " (or executable-command buffer-file-name)))])
#@293 Set this buffer's interpreter to INTERPRETER with optional ARGUMENT.
The variables `executable-magicless-file-regexp', `executable-prefix',
`executable-insert', `executable-query' and `executable-chmod' control
when and how magic numbers are inserted or replaced and scripts made
executable.
(defalias 'executable-set-magic #[(interpreter &optional argument no-query-flag insert-flag) "\306!\203\n \202 \307!\206 \310\311\"\211	\205! \312	\231\205! \313	Q\n\204\251 \2033 \314\f\"\204\251 \204< \203\251 e\315V\204\251 \212\316 \317 eb\210\320\321!\210\322\321\323\324\325$\210\326\327!\203\231 \315\224b\203\250 \315\225Sf\330U\204\250 	`\315\225{\230\204\250  \203\206 !\204\206 \331\213\203\250 \332	\325\211\324\315%\210\333\334\"	P\"\210\202\250 \"	\335\261\210\333\334\"	P\"\210+\207" [interpreter argument buffer-read-only buffer-file-name executable-magicless-file-regexp insert-flag file-name-absolute-p executable-find error "Interpreter %s not recognized" "" " " string-match 1 point-marker buffer-modified-p make-local-hook after-save-hook add-hook executable-chmod nil t looking-at "#![ 	]*\\(.*\\)$" 32 ((byte-code "\302p!\210\303\304	\305R!\207" [executable-prefix argument switch-to-buffer y-or-n-p "Replace magic number by `" "'? "] 5)) replace-match message "Magic number changed to `%s'" 10 executable-insert point executable-query no-query-flag executable-prefix] 7 (#$ . 5088) (let* ((name (read-string "Name or file name of interpreter: ")) (arg (read-string (format "Argument for %s: " name)))) (list name arg (eq executable-query 'function) t))])
#@121 Turn a text file into a self-displaying Un*x command.
The magic number of such a command displays all lines but itself.
(defalias 'executable-self-display #[nil "\301=\203 \302\302	\303\"\207" [this-command executable-self-display executable-set-magic "+2"] 3 (#$ . 6691) nil])
(provide 'executable)
