636 |
(setcar l mime-charset)) |
(setcar l mime-charset)) |
637 |
(setq l (cdr l)))) |
(setq l (cdr l)))) |
638 |
|
|
639 |
|
;; Don't offer variations with locking shift, which you |
640 |
|
;; basically never want. |
641 |
|
(let (l) |
642 |
|
(dolist (elt codings (setq codings (nreverse l))) |
643 |
|
(unless (or (eq 'coding-category-iso-7-else |
644 |
|
(coding-system-category elt)) |
645 |
|
(eq 'coding-category-iso-8-else |
646 |
|
(coding-system-category elt))) |
647 |
|
(push elt l)))) |
648 |
|
|
649 |
;; Make sure the offending buffer is displayed. |
;; Make sure the offending buffer is displayed. |
650 |
(or (stringp from) |
(or (stringp from) |
651 |
(pop-to-buffer bufname)) |
(pop-to-buffer bufname)) |
715 |
|
|
716 |
(if (eq coding-system t) |
(if (eq coding-system t) |
717 |
(setq coding-system buffer-file-coding-system)) |
(setq coding-system buffer-file-coding-system)) |
718 |
coding-system)) |
;; Check we're not inconsistent with what `coding:' spec &c would |
719 |
|
;; give when file is re-read. |
720 |
|
(unless (stringp from) |
721 |
|
(let ((auto-cs (save-restriction |
722 |
|
(widen) |
723 |
|
(save-excursion |
724 |
|
(goto-char (point-min)) |
725 |
|
(set-auto-coding (or buffer-file-name "") |
726 |
|
(buffer-size)))))) |
727 |
|
(if (and auto-cs |
728 |
|
(not (coding-system-equal (coding-system-base coding-system) |
729 |
|
(coding-system-base auto-cs)))) |
730 |
|
(unless (yes-or-no-p |
731 |
|
(format "Selected encoding %s disagrees with \ |
732 |
|
%s specified by file contents. Really save (else edit coding cookies \ |
733 |
|
and try again)? " coding-system auto-cs)) |
734 |
|
(error "Save aborted"))))) coding-system)) |
735 |
|
|
736 |
(setq select-safe-coding-system-function 'select-safe-coding-system) |
(setq select-safe-coding-system-function 'select-safe-coding-system) |
737 |
|
|