HOME


sh-3ll 1.0
DIR:/usr/share/emacs/26.1/lisp/progmodes/
Upload File :
Current File : //usr/share/emacs/26.1/lisp/progmodes/executable.elc
;ELC
;;; Compiled
;;; in Emacs version 26.1
;;; with all optimizations.
;;; Function definitions are lazy-loaded.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

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


(byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312\313\304\301&\210\306\314\315\316\312\317\304\301&\210\306\320\321\322\312\323\304\301&\210\306\324\325\326\327\330\312\331\304\301&	\210\306\332\302\333\327\330\312\313\304\301&	\210\306\334\335\336\312\337\304\301&\207" [custom-declare-group executable nil "Base functionality for executable interpreter scripts." :group processes custom-declare-variable executable-insert t "Non-nil means offer to add a magic number to a file.\nThis takes effect when you switch to certain major modes,\nincluding Shell-script mode (`sh-mode').\nWhen you type \\[executable-set-magic], it always offers to add or\nupdate the magic number." :type boolean executable-query 'function "If non-nil, ask user before changing an existing magic number.\nWhen this is `function', only ask when called non-interactively." (choice (const :tag "Don't Ask" nil) (const :tag "Ask when non-interactive" function) (other :tag "Ask" t)) executable-magicless-file-regexp "/[Mm]akefile$\\|/\\.\\(z?profile\\|bash_profile\\|z?login\\|bash_login\\|z?logout\\|bash_logout\\|.+shrc\\|esrc\\|rcrc\\|[kz]shenv\\)$" "On files with this kind of name no magic is inserted or changed." regexp executable-prefix "#!" "Interpreter magic number prefix inserted when there was no magic number.\nUse of `executable-prefix-env' is preferable to this option." :version "26.1" string executable-prefix-env "If non-nil, use \"/usr/bin/env\" in interpreter magic number.\nIf this variable is non-nil, the interpreter magic number inserted\nby `executable-set-magic' will be \"#!/usr/bin/env INTERPRETER\",\notherwise it will be \"#!/path/to/INTERPRETER\"." executable-chmod 73 "After saving, if the file is not executable, set this mode.\nThis mode passed to `set-file-modes' is taken absolutely when negative, or\nrelative to the files existing modes.  Do nothing if this is nil.\nTypical values are 73 (+x) or -493 (rwxr-xr-x)." (choice integer (const nil))] 10)
(defvar executable-command nil)
(byte-code "\300\301\302\303\304\305\306\307&\210\310\301\311\312\313$\207" [custom-declare-variable executable-self-display "tail" "Command you use with argument `-n+2' to make text files self-display.\nNote that the like of `more' doesn't work too well under Emacs \\[shell]." :type string :group executable make-obsolete-variable nil "25.1" set] 8)
#@136 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)) (#$ . 2814))
#@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)) (#$ . 3063))
(defvaralias 'executable-binary-suffixes 'exec-suffixes)
#@100 Check if PROGRAM handles arguments Posix-style.
If PROGRAM is non-nil, use that instead of "find".
(defalias 'executable-command-find-posix-p #[(&optional program) #@389 ("\305!\306	\307\310#@\311\312!rq\210\313\216\314\f\2060\315\307p\307	\316\n\317\320&	\210eb\210\321\n\307\322#\20520\322-\207" . [data-directory dir file #1=#:temp-buffer program file-truename directory-files nil "^[^.]" generate-new-buffer " *temp*" #[nil "\301!\205	0\302!\207" [#1# buffer-name kill-buffer] 2] call-process "find" "-name" "-maxdepth" "1" search-forward t])(#$ . 3771) nil 10 (#$ . 3600)])
#@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])(#$ . 4408) nil 6 (#$ . 4198)])
#@275 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.  The buffer is also in `comint-mode' and
`compilation-shell-minor-mode', so that you can answer any prompts.
(defalias 'executable-interpret #[(command) #@308 ("\305\306!\210\307?!\210\310\302!\210	\311	\312\313#)\207" . [compilation-ask-about-save command executable-command executable-error-regexp-alist compilation-error-regexp-alist require compile save-some-buffers make-local-variable compilation-start t #[(_x) "\300\207" [#1="*interpretation*"] 1 #1#]])(#$ . 4945) nil 4 (#$ . 4620) (list (read-string "Run script: " (or executable-command buffer-file-name)))])
#@297 Set this buffer's interpreter to INTERPRETER with optional ARGUMENT.
The variables `executable-magicless-file-regexp', `executable-prefix-env',
`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) #@1242 ("\306!\203\n0\2020\307!\2060\310\311\"\312\313\"\203%0\314\315\316\211$\202&0	\20510\315	\231\20510\317	Q\312\320\n\"\203H0\203O0\321\322	!P\202O0\n\323\316O	P\f\204\3220
\203_0\312&
\"\204\3220'\204i0(\203\3220e\324V\204\3220\212eb\210\325\326\327\316\330$\210\331\332!\203\3060\324\224b\203\3210\324\225Sf\333U\204\3210	`\324\225{\230\204\3210)\203\2660*\204\2660\334 +\335\216\336p!\210\337\340\341	\"!*\203\3210\314	\330\211\316\324%\210\342\343	\"\210\202\3210\344	\345\261\210\342\343	\"\210)\207" . [interpreter argument executable-prefix executable-prefix-env buffer-read-only buffer-file-name file-name-absolute-p executable-find error "Interpreter %s not recognized" string-match "\\`/:" replace-match "" nil " " "#!\\([ 	]*/usr/bin/env[ 	]*\\)?$" "/usr/bin/env " file-name-nondirectory 2 1 add-hook after-save-hook executable-chmod t looking-at "#![ 	]*\\(.*\\)$" 32 current-window-configuration #[nil "\301!\207" [#1=#:wconfig set-window-configuration] 2] switch-to-buffer y-or-n-p format-message "Replace magic number by `#!%s'? " message "Magic number changed to `#!%s'" "#!" 10 executable-magicless-file-regexp insert-flag executable-insert executable-query no-query-flag #1#])(#$ . 5764) nil 6 (#$ . 5367) (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 #@108 ("\301=\2030\302\302	\303\"\207" . [this-command executable-self-display executable-set-magic "-n+2"])(#$ . 7382) nil 3 (#$ . 7214) nil])
(make-obsolete 'executable-self-display nil "25.1")
#@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 #@378 ("\303 \304Y\205G0\214~\210e\304e\\{\305\230)\205G0\3061?0\307\310 !\311\312 \313\"\311\313\"\314U?\206<0	\314U\206<0\315\310 \316	\"\"*0\207\317\320\n\"\210)\321\207" . [current-mode add-mode #1=#:err buffer-size 2 "#!" (debug error) file-modes buffer-file-name logand default-file-modes 73 0 set-file-modes logior message "Unable to make file executable: %s" nil])(#$ . 7809) nil 5 (#$ . 7583)])
(provide 'executable)