comparison lisp/modes/executable.el @ 120:cca96a509cfe r20-1b12

Import from CVS: tag r20-1b12
author cvs
date Mon, 13 Aug 2007 09:25:29 +0200
parents 0d2f883870bc
children
comparison
equal deleted inserted replaced
119:d101af7320b8 120:cca96a509cfe
52 ;; lock keywords. Their mode-setting commands should call 52 ;; lock keywords. Their mode-setting commands should call
53 ;; `executable-set-magic'. 53 ;; `executable-set-magic'.
54 54
55 ;;; Code: 55 ;;; Code:
56 56
57 (defvar executable-insert 'not-modified 57
58 (defgroup executable nil
59 "Base functionality for executable interpreter scripts"
60 :group 'processes)
61
62
63 (defcustom executable-insert 'other
58 "*What to do when newly found file has no or wrong magic number: 64 "*What to do when newly found file has no or wrong magic number:
59 nil do nothing 65 nil do nothing
60 t insert or update magic number 66 t insert or update magic number
61 other insert or update magic number, but mark as unmodified. 67 other insert or update magic number, but mark as unmodified.
62 When the insertion is marked as unmodified, you can save it with \\[write-file] RET. 68 When the insertion is marked as unmodified, you can save it with \\[write-file] RET.
63 This variable is used when `executable-set-magic' is called as a function, 69 This variable is used when `executable-set-magic' is called as a function,
64 e.g. when Emacs sets some Un*x interpreter script mode. 70 e.g. when Emacs sets some Un*x interpreter script mode.
65 With \\[executable-set-magic], this is always treated as if it were `t'.") 71 With \\[executable-set-magic], this is always treated as if it were `t'."
66 72 :type '(choice (const :tag "off" nil)
67 73 (const :tag "on" t)
68 (defvar executable-query 'function 74 symbol)
75 :group 'executable)
76
77
78 (defcustom executable-query 'function
69 "*If non-`nil', ask user before inserting or changing magic number. 79 "*If non-`nil', ask user before inserting or changing magic number.
70 When this is `function', only ask when called non-interactively.") 80 When this is `function', only ask when called non-interactively."
71 81 :type '(choice (const :tag "Don't Ask" nil)
72 82 (const :tag "Ask" t)
73 (defvar executable-magicless-file-regexp "/[Mm]akefile$\\|/\\.\\(z?profile\\|bash_profile\\|z?login\\|bash_login\\|z?logout\\|bash_logout\\|.+shrc\\|esrc\\|rcrc\\|[kz]shenv\\)$" 83 (const :tag "Ask when non-interactive" function))
74 "*On files with this kind of name no magic is inserted or changed.") 84 :group 'executable)
75 85
76 86
77 (defvar executable-prefix "#! " 87 (defcustom executable-magicless-file-regexp "/[Mm]akefile$\\|/\\.\\(z?profile\\|bash_profile\\|z?login\\|bash_login\\|z?logout\\|bash_logout\\|.+shrc\\|esrc\\|rcrc\\|[kz]shenv\\)$"
78 "*Interpreter magic number prefix inserted when there was no magic number.") 88 "*On files with this kind of name no magic is inserted or changed."
79 89 :type 'regexp
80 90 :group 'executable)
81 91
82 (defvar executable-chmod 73 92
93 (defcustom executable-prefix "#! "
94 "*Interpreter magic number prefix inserted when there was no magic number."
95 :type 'string
96 :group 'executable)
97
98
99
100 (defcustom executable-chmod 73
83 "*After saving, if the file is not executable, set this mode. 101 "*After saving, if the file is not executable, set this mode.
84 This mode passed to `set-file-modes' is taken absolutely when negative, or 102 This mode passed to `set-file-modes' is taken absolutely when negative, or
85 relative to the files existing modes. Do nothing if this is nil. 103 relative to the files existing modes. Do nothing if this is nil.
86 Typical values are 73 (+x) or -493 (rwxr-xr-x).") 104 Typical values are 73 (+x) or -493 (rwxr-xr-x)."
105 :type 'integer
106 :group 'executable)
87 107
88 108
89 (defvar executable-command nil) 109 (defvar executable-command nil)
90 110
91 (defvar executable-self-display "tail" 111 (defcustom executable-self-display "tail"
92 "*Command you use with argument `+2' to make text files self-display. 112 "*Command you use with argument `+2' to make text files self-display.
93 Note that the like of `more' doesn't work too well under Emacs \\[shell].") 113 Note that the like of `more' doesn't work too well under Emacs \\[shell]."
114 :type 'string
115 :group 'executable)
94 116
95 117
96 (defvar executable-font-lock-keywords 118 (defvar executable-font-lock-keywords
97 '(("\\`#!.*/\\([^ \t\n]+\\)" 1 font-lock-keyword-face t)) 119 '(("\\`#!.*/\\([^ \t\n]+\\)" 1 font-lock-keyword-face t))
98 "*Rules for highlighting executable scripts' magic number. 120 "*Rules for highlighting executable scripts' magic number.