;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; 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)) (#$ . 2772)) #@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)) (#$ . 3021)) (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) "\305!\306 \307\310#@\311\312!r q\210\313\216\314\f\206\315\307p\307 \316\n\317\320& \210eb\210\321\n\307\322#\2052\322-\207" [data-directory dir file #1=#:temp-buffer program file-truename directory-files nil "\\`[^.]" generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process "find" "-name" "-maxdepth" "1" search-forward t] 10 (#$ . 3558)]) #@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 (#$ . 4129)]) #@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) "\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#]] 4 (#$ . 4520) (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) "\306!\203\n\202\307!\206\310\311\"\312\313\"\203%\314\315\316\211$\202& \2051\315 \231\2051\317 Q\312\320\n\"\203H \203O\321\322 !P\202O\323\n\324\" P\f\204\322 \203_\312' \"\204\322(\204i)\203\322e\325V\204\322\212eb\210\326\327\330\316\331$\210\332\333!\203\306\325\224b\203\321\325\225Sf\334U\204\321 `\325\225{\230\204\321*\203\266+\204\266\335 ,\336\216\337p!\210\340\341\342 \"!*\203\321\314 \331\211\316\325%\210\343\344 \"\210\202\321\345 \346\261\210\343\344 \"\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 substring 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#] 6 (#$ . 5241) (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 "-n+2"] 3 (#$ . 7048) 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 "\303 \304Y\205G\214~\210e\304e\\{\305\230)\205G\3061?\307\310 !\311\312\313 \"\311\312\"\314U?\206< \314U\206<\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 73 default-file-modes 0 set-file-modes logior message "Unable to make file executable: %s" nil] 5 (#$ . 7390)]) (provide 'executable)