Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
cc7e1d18
Commit
cc7e1d18
authored
Jun 09, 2000
by
Dave Love
Browse files
(executable-make-buffer-file-executable-if-script-p): Renamed and
simplified.
parent
d18f678b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
lisp/ChangeLog
lisp/ChangeLog
+3
-3
lisp/progmodes/executable.el
lisp/progmodes/executable.el
+4
-7
No files found.
lisp/ChangeLog
View file @
cc7e1d18
...
...
@@ -3,11 +3,11 @@
* executable.el: Byte compile dynamic.
(executable-insert): Change custom type.
(executable-find): Add autoload cookie.
(make-buffer-file-executable-if-script-p): New
function. From
Noah Friedman.
(
executable-
make-buffer-file-executable-if-script-p): New
function. After
Noah Friedman.
* files.el (after-save-hook): Customize, with
make-buffer-file-executable-if-script-p as an option.
executable-
make-buffer-file-executable-if-script-p as an option.
2000-06-09 Kenichi Handa <handa@etl.go.jp>
...
...
lisp/progmodes/executable.el
View file @
cc7e1d18
...
...
@@ -267,16 +267,13 @@ The magic number of such a command displays all lines but itself."
(
executable-set-magic
executable-self-display
"+2"
))
;;;###autoload
(
defun
make-buffer-file-executable-if-script-p
()
(
defun
executable-
make-buffer-file-executable-if-script-p
()
"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."
(
and
(
save-excursion
(
save-restriction
(
widen
)
(
goto-char
(
point-min
))
(
save-match-data
(
looking-at
"^#!"
))))
(
and
(
save-restriction
(
widen
)
(
string=
"#!"
(
buffer-substring
1
3
)))
(
let*
((
current-mode
(
file-modes
(
buffer-file-name
)))
(
add-mode
(
logand
?\111
(
default-file-modes
))))
(
or
(
/=
(
logand
?\111
current-mode
)
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment