;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:51:06 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/progmodes/executable.el ;;; in Emacs version 21.3 ;;; with bytecomp version 2.85.4.1 ;;; with all optimizations. ;;; Function definitions are lazy-loaded. ;;; 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 't '(#$ . -788) :type 'boolean :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 "\301B\302\301!\204\f\303\303\207" [current-load-list executable-command boundp nil] 2) #@143 *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" '(#$ . -2446) :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 "\302B\303\302!\204 \304>\203\305\202\306\302\207" [current-load-list system-type executable-binary-suffixes 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) #@311 ("\306\211\203P0\307 \n@\"\211\205C0\f\306\n\n\203?0 \n@P\310 !\20350\311 !\20450\306\211\n\2020\nA\n\306\2020 \211*?\205K0\306\nA\211\2040 *\207" . [exec-path file list command executable-binary-suffixes candidate nil expand-file-name file-executable-p file-directory-p suffixes])(#$ . 3810) nil 4 (#$ . 3637)]) #@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 #@175 ("\205\"0 \205\"0\302 !\206\"0\303 \304W\2030[\202!0\305\306 !\"\"\207" . [executable-chmod buffer-file-name file-executable-p set-file-modes 0 logior file-modes])(#$ . 4368) nil 6 (#$ . 4158)]) #@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) #@269 ("\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])(#$ . 4796) nil 6 (#$ . 4580) (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) #@1095 ("\306!\203\n0\2020\307!\2060\310\311\"\312\313\"\203%0\314\315\316\211$\202&0 \20510\315 \231\20510\317 Q\n\204\2710 \203C0\312\f \"\204\2710 \204L0_\203\2710e\320V\204\2710\212\321 \322  eb\210\323\324!\210\325\324\326\316\327$\210\330\331!\203\2510\320\224b\203\2700\320\225Sf\332U\204\2700 `\320\225{\230\204\2700!\203\2260\"\204\2260\333\213\203\2700\314 \327\211\316\320%\210\334\335# P\"\210\202\2700# \336\261\210\334\335# 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 "\\`/:" replace-match "" nil " " 1 point-marker buffer-modified-p make-local-hook after-save-hook add-hook executable-chmod 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)) message "Magic number changed to `%s'" 10 executable-insert point executable-query no-query-flag executable-prefix])(#$ . 5572) nil 6 (#$ . 5179) (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 #@106 ("\301=\2030\302\302 \303\"\207" . [this-command executable-self-display executable-set-magic "+2"])(#$ . 7043) nil 3 (#$ . 6875) nil]) #@152 Make file executable according to umask if not already executable. If file already has any execute bits set at all, do not change existing file modes. (defalias 'executable-make-buffer-file-executable-if-script-p #[nil #@281 ("\302 \303Y\20570\214~\210\304\305{\306\230)\20570\307\310 !\311\312 \313\"\311\313\"\314U?\20660\315 !\20660\316\310 \317 \"\"*\207" . [current-mode add-mode buffer-size 2 1 3 "#!" file-modes buffer-file-name logand default-file-modes 73 0 zerop set-file-modes logior])(#$ . 7416) nil 5 (#$ . 7190)]) (provide 'executable)