[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enhanced select-safe-coding-system
From: |
Richard Stallman |
Subject: |
Re: enhanced select-safe-coding-system |
Date: |
Wed, 1 May 2002 01:14:52 -0600 (MDT) |
Your code was based on an older version did not have some other
changes that are in the sources now. I merged it, and the changes
you made seem to be these.
Does anyone see a problem with these changes?
Handa, do they look correct to you?
*** mule-cmds.el.~1.190.~ Sat Apr 27 23:22:23 2002
--- mule-cmds.el Wed May 1 01:33:40 2002
***************
*** 636,641 ****
--- 636,651 ----
(setcar l mime-charset))
(setq l (cdr l))))
+ ;; Don't offer variations with locking shift, which you
+ ;; basically never want.
+ (let (l)
+ (dolist (elt codings (setq codings (nreverse l)))
+ (unless (or (eq 'coding-category-iso-7-else
+ (coding-system-category elt))
+ (eq 'coding-category-iso-8-else
+ (coding-system-category elt)))
+ (push elt l))))
+
;; Make sure the offending buffer is displayed.
(or (stringp from)
(pop-to-buffer bufname))
***************
*** 705,711 ****
(if (eq coding-system t)
(setq coding-system buffer-file-coding-system))
! coding-system))
(setq select-safe-coding-system-function 'select-safe-coding-system)
--- 715,737 ----
(if (eq coding-system t)
(setq coding-system buffer-file-coding-system))
! ;; Check we're not inconsistent with what coding cookies &c would
! ;; give when file is re-read.
! (unless (stringp from)
! (let ((auto-cs (save-restriction
! (widen)
! (save-excursion
! (goto-char (point-min))
! (set-auto-coding (or buffer-file-name "")
! (buffer-size))))))
! (if (and auto-cs
! (not (coding-system-equal (coding-system-base coding-system)
! (coding-system-base auto-cs))))
! (unless (yes-or-no-p
! (format "Selected encoding %s disagrees with \
! %s specified by file contents. Really save (else edit coding cookies \
! and try again)? " coding-system auto-cs))
! (error "Save aborted"))))) coding-system))
(setq select-safe-coding-system-function 'select-safe-coding-system)