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
8a592131
Commit
8a592131
authored
Apr 08, 1999
by
Richard M. Stallman
Browse files
(auto-coding-alist-lookup): New function.
(set-auto-coding): Use auto-coding-alist-lookup.
parent
c352d959
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
lisp/international/mule.el
lisp/international/mule.el
+12
-7
No files found.
lisp/international/mule.el
View file @
8a592131
...
...
@@ -903,6 +903,17 @@ and the contents of `file-coding-system-alist'.")
"
Non-nil
means
look
for
`
load-coding
'
property
instead
of
`
coding
'.
This
is
used
for
loading
and
byte-compiling
Emacs
Lisp
files.
")
(defun auto-coding-alist-lookup (filename)
"
Return
the
coding
system
specified
by
`
auto-coding-alist
'
for
FILENAME.
"
(let ((alist auto-coding-alist)
(case-fold-search (memq system-type '(vax-vms windows-nt)))
coding-system)
(while (and alist (not coding-system))
(if (string-match (car (car alist)) filename)
(setq coding-system (cdr (car alist)))
(setq alist (cdr alist))))
coding-system))
(defun set-auto-coding (filename size)
"
Return
coding
system
for
a
file
FILENAME
of
which
SIZE
bytes
follow
point.
These
bytes
should
include
at
least
the
first
1k
of
the
file
...
...
@@ -919,13 +930,7 @@ or nil if nothing specified.
The
variable
`
set-auto-coding-function
'
(
which
see
)
is
set
to
this
function
by
default.
"
(let ((alist auto-coding-alist)
(case-fold-search (memq system-type '(vax-vms windows-nt)))
coding-system)
(while (and alist (not coding-system))
(if (string-match (car (car alist)) filename)
(setq coding-system (cdr (car alist)))
(setq alist (cdr alist))))
(let ((coding-system (auto-coding-alist-lookup filename)))
(or coding-system
(let* ((case-fold-search t)
...
...
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