emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: buffer-charset


From: Kenichi Handa
Subject: Re: buffer-charset
Date: Fri, 11 Oct 2002 09:18:06 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Francesco Potorti` <address@hidden> writes:
> I take the file in 
>  <ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-21.2.91.announce>

> and save it into `ann'.  Then 
> emacs -q
> C-x m
> C-c TAB ann RET
> C-c C-c

> I get a pop-up window proposing a bunch of "safe" coding systems.
> Obviously I have no idea why ever I should change my coding system,
> given that the file I included is apparently text only.  So I do:

In HEAD trunk, select-safe-coding-system is improved.  It
shows problematic characters in *Warning* buffer, and you
can click on them to move point to that character.

This works well on saving a buffer, but on sending a mail
(by sendmail-send-it), select-safe-coding-system (via
select-message-coding-system) is run on "sendmail temp"
buffer, thus that buffer disappears when you type C-g.

The attached patch is to run select-message-coding-system on
the current buffer (i.e. *mail*) in advance.  Could you
please try it with HEAD?

To the maintainer of sendmail.el:
  Do you think it breaks something?  If no, can I install that patch?

---
Ken'ichi HANDA
address@hidden

*** sendmail.el.~1.258.~        Mon Sep 23 09:17:51 2002
--- sendmail.el Fri Oct 11 09:17:14 2002
***************
*** 808,816 ****
        (tembuf (generate-new-buffer " sendmail temp"))
        (multibyte enable-multibyte-characters)
        (case-fold-search nil)
!       (coding (and (local-variable-p 'buffer-file-coding-system)
!                    buffer-file-coding-system))
!       selected-coding
  ;;;   resend-to-addresses
        delimline
        fcc-was-found
--- 808,814 ----
        (tembuf (generate-new-buffer " sendmail temp"))
        (multibyte enable-multibyte-characters)
        (case-fold-search nil)
!       (selected-coding (select-message-coding-system))
  ;;;   resend-to-addresses
        delimline
        fcc-was-found
***************
*** 830,836 ****
          (unless multibyte
            (set-buffer-multibyte nil))
          (insert-buffer-substring mailbuf)
-         (set-buffer-file-coding-system coding)
          (goto-char (point-max))
          ;; require one newline at the end.
          (or (= (preceding-char) ?\n)
--- 828,833 ----
***************
*** 954,960 ****
                   (not (re-search-forward "^MIME-version:" delimline t))
                   (progn (skip-chars-forward "\0-\177")
                          (/= (point) (point-max)))
!                  (setq selected-coding (select-message-coding-system))
                   (setq charset
                         (coding-system-get selected-coding 'mime-charset))
                   (goto-char delimline)
--- 951,957 ----
                   (not (re-search-forward "^MIME-version:" delimline t))
                   (progn (skip-chars-forward "\0-\177")
                          (/= (point) (point-max)))
!                  selected-coding
                   (setq charset
                         (coding-system-get selected-coding 'mime-charset))
                   (goto-char delimline)
***************
*** 983,991 ****
  \\|^resent-cc:\\|^resent-bcc:"
                                   delimline t))
              (let* ((default-directory "/")
!                    (coding-system-for-write
!                     (or selected-coding
!                         (select-message-coding-system)))
                     (args 
                      (append (list (point-min) (point-max)
                                    program
--- 980,986 ----
  \\|^resent-cc:\\|^resent-bcc:"
                                   delimline t))
              (let* ((default-directory "/")
!                    (coding-system-for-write selected-coding)
                     (args 
                      (append (list (point-min) (point-max)
                                    program




reply via email to

[Prev in Thread] Current Thread [Next in Thread]