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
05134257
Commit
05134257
authored
Oct 14, 1998
by
Kenichi Handa
Browse files
(make-coding-system): Create -with-esc variant coding system.
parent
3019692c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
lisp/international/mule.el
lisp/international/mule.el
+26
-9
No files found.
lisp/international/mule.el
View file @
05134257
...
...
@@ -548,9 +548,10 @@ a value of `safe-charsets' in PLIST."
((= type 2) ; ISO2022
(let ((i 0)
(vec (make-vector 32 nil))
(g1-designation nil))
(g1-designation nil)
(fl flags))
(while (< i 4)
(let ((charset (car fl
ags
)))
(let ((charset (car fl)))
(if (and no-initial-designation
(> i 0)
(or (charsetp charset)
...
...
@@ -575,10 +576,10 @@ a value of `safe-charsets' in PLIST."
(setq no-alternative-designation nil)
(error "
Invalid
charset:
%s
" charset)))))
(aset vec i charset))
(setq fl
ags
(cdr fl
ags
) i (1+ i)))
(while (and (< i 32) fl
ags
)
(aset vec i (car fl
ags
))
(setq fl
ags
(cdr fl
ags
) i (1+ i)))
(setq fl (cdr fl) i (1+ i)))
(while (and (< i 32) fl)
(aset vec i (car fl))
(setq fl (cdr fl) i (1+ i)))
(aset coding-spec 4 vec)
(setq coding-category
(if (aref vec 8) ; Use locking-shift.
...
...
@@ -625,9 +626,10 @@ a value of `safe-charsets' in PLIST."
;; In the old version, the arg PROPERTIES is a list to be
;; set in PLIST as a value of property `safe-charsets'.
(plist-put plist 'safe-charsets properties)
(while properties
(plist-put plist (car (car properties)) (cdr (car properties)))
(setq properties (cdr properties))))
(let ((l properties))
(while l
(plist-put plist (car (car l)) (cdr (car l)))
(setq l (cdr l)))))
(aset coding-spec coding-spec-plist-idx plist))
(put coding-system 'coding-system coding-spec)
(put coding-category 'coding-systems
...
...
@@ -646,6 +648,21 @@ a value of `safe-charsets' in PLIST."
(setq coding-system-list (cons coding-system coding-system-list))
(setq coding-system-alist (cons (list (symbol-name coding-system))
coding-system-alist))
;; For a coding system of cateogory iso-8-1 and iso-8-2, create
;; XXX-with-esc variants.
(let ((coding-category (coding-system-category coding-system)))
(if (or (eq coding-category 'coding-category-iso-8-1)
(eq coding-category 'coding-category-iso-8-2))
(let ((esc (intern (concat (symbol-name coding-system) "
-with-esc
")))
(doc (format "
Same
as
%s
but
can
handle
any
charsets
by
ISO
's
escape
sequences.
" coding-system)))
(make-coding-system esc type mnemonic doc
(if (listp (car flags))
(cons (append (car flags) '(t)) (cdr flags))
(cons (list (car flags) t) (cdr flags)))
properties)
(coding-system-put esc 'safe-charsets t))))
coding-system)
(defun define-coding-system-alias (alias coding-system)
...
...
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