[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnus should accept UTF8 even if UTF-8 is standard
From: |
Stefan Monnier |
Subject: |
Re: gnus should accept UTF8 even if UTF-8 is standard |
Date: |
Mon, 10 Nov 2008 10:01:29 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
>> === modified file 'lisp/international/mule.el'
>> --- lisp/international/mule.el 2008-07-24 03:10:36 +0000
>> +++ lisp/international/mule.el 2008-10-31 21:08:00 +0000
>> @@ -1192,6 +1192,10 @@
>> (widen)
>> (goto-char (point-min))
>> (set-auto-coding buffer-file-name (buffer-size))))))
>> + (completion-ignore-case t)
>> + (completion-pcm--delim-wild-regex
>> + (concat completion-pcm--delim-wild-regex
>> + "\\|\\([[:alpha:]]\\)[[:digit:]]"))
>> (cs (completing-read (format "Coding system for saving file (default %s): "
>> auto-cs)
>> (completion-table-in-turn
>> bcss-table combined-table)
> This hunk can't be applied to the current mule.el. In which function
> should this change be applied?
The above is from my own code, it's not in Emacs. If you want the
complete code, it's the interactive spec I use for
set-buffer-file-coding-system, so that completion is first done only on
the applicable coding systems. But the intent of the patch was just to
show what the code would look like: it would be placed inside a new
`read-coding-system' function.
Stefan
;; FIXME: provide a useful default (e.g. the one that
;; select-safe-coding-system would have chosen, or the next best one if
;; it's already the current coding system).
(interactive
(let* ((bcss (find-coding-systems-region (point-min) (point-max)))
(bcss-table (append '("dos" "unix" "mac")
(unless (equal bcss '(undecided))
(mapcar 'symbol-name
(sanitize-coding-system-list bcss)))))
(css-table
(unless (equal bcss '(undecided))
(delq nil (mapcar (lambda (cs)
(if (memq (coding-system-base cs) bcss)
(symbol-name cs)))
coding-system-list))))
(combined-table
(completion-table-in-turn css-table coding-system-alist))
(auto-cs
(unless find-file-literally
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(set-auto-coding buffer-file-name (buffer-size))))))
(cs (completing-read (format "Coding system for saving file (default
%s): " auto-cs)
(completion-table-in-turn
bcss-table combined-table)
nil t nil 'coding-system-history
(if auto-cs (symbol-name auto-cs)))))
(list (unless (zerop (length cs)) (intern cs))
current-prefix-arg)))