Re: bug#35370: notmuch-emacs: avoiding deprecated message-default-charset

2019-05-10 Thread Noam Postavsky
close 35370
quit

Eli Zaretskii  writes:

>> From: Lars Ingebrigtsen 

>> I think the patch looks OK -- it'll change the behaviour if you have
>> set enable-multibyte-characters to nil, but...  does anybody do that?
>
> If they do, it's their funeral.
>
> Noam, please go ahead, and thanks.

Done.

510aa7505f 2019-05-10T06:41:59-04:00 "Stop using message-default-charset 
(Bug#35370)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=510aa7505fc14e0ebc6a0d220160397f068c5c04

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: bug#35370: notmuch-emacs: avoiding deprecated message-default-charset

2019-05-08 Thread Noam Postavsky
Eli Zaretskii  writes:

>> From: Daniel Kahn Gillmor 
>> Date: Sun, 21 Apr 2019 21:55:38 -0400
>> Cc: da...@tethera.net, notmuch@notmuchmail.org, 35...@debbugs.gnu.org
>> 
>> Do you have any recommendation for how an external emacs module (which
>> aims to work with at emacs 25 as well at least) should handle this?
>
> Just remove any uses of it.  Why are you using it now?

Should we remove the remaining uses of it from Emacs too?

>From a3dca9511e1639ccfdf06bced16af5babb5078de Mon Sep 17 00:00:00 2001
From: Noam Postavsky 
Date: Tue, 7 May 2019 08:18:49 -0400
Subject: [PATCH] Stop using message-default-charset (Bug#35370)

In 2016-02-14 "Remove compat code for older Emacsen",
message-default-charset was obsoleted, and a couple of uses were
removed, but others were left behind.
* lisp/gnus/message.el (message-send-mail)
(message-send-news, message-do-fcc)
(message-encode-message-body):
* lisp/gnus/mml.el (mml-to-mime): Stop using message-default-charset.
---
 lisp/gnus/message.el | 13 -
 lisp/gnus/mml.el |  4 +---
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index c8b6f0ee68..2c2122d89a 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4588,8 +4588,7 @@ (defun message-send-mail ( _)
  (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-mail-headers t)
-   (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
+(mail-encode-encoded-word-buffer))
  (goto-char (point-max))
  ;; require one newline at the end.
  (or (= (preceding-char) ?\n)
@@ -4962,8 +4961,7 @@ (defun message-send-news ( arg)
  (message-generate-headers '(Lines)))
;; Remove some headers.
(message-remove-header message-ignored-news-headers t)
-   (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
+(mail-encode-encoded-word-buffer))
  (goto-char (point-max))
  ;; require one newline at the end.
  (or (= (preceding-char) ?\n)
@@ -5441,8 +5439,7 @@ (defun message-do-fcc ()
  (while (setq file (message-fetch-field "fcc" t))
(push file list)
(message-remove-header "fcc" nil t))
- (let ((mail-parse-charset message-default-charset)
-   (rfc2047-header-encoding-alist
+  (let ((rfc2047-header-encoding-alist
 (cons '("Newsgroups" . default)
   rfc2047-header-encoding-alist)))
(mail-encode-encoded-word-buffer)))
@@ -8101,9 +8098,7 @@ (defun message-clone-locals (buffer  varstr)
 
 (defun message-encode-message-body ()
   (unless message-inhibit-body-encoding
-(let ((mail-parse-charset (or mail-parse-charset
- message-default-charset))
- (case-fold-search t)
+(let ((case-fold-search t)
  lines content-type-p)
   (message-goto-body)
   (save-restriction
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index f6d358dfc0..7a99a0dc46 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -48,7 +48,6 @@ (autoload 'message-mail-p "message")
 
 (defvar gnus-article-mime-handles)
 (defvar gnus-newsrc-hashtb)
-(defvar message-default-charset)
 (defvar message-deletable-headers)
 (defvar message-options)
 (defvar message-posting-charset)
@@ -1015,8 +1014,7 @@ (defun mml-to-mime ()
 ;; Skip past any From_ headers.
 (while (looking-at "From ")
   (forward-line 1))
-(let ((mail-parse-charset message-default-charset))
-  (mail-encode-encoded-word-buffer)))
+(mail-encode-encoded-word-buffer))
   (message-encode-message-body))
 
 (defun mml-insert-mime (handle  no-markup)
-- 
2.11.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: bug#35370: notmuch-emacs: avoiding deprecated message-default-charset

2019-04-22 Thread Noam Postavsky
Daniel Kahn Gillmor  writes:

>>> In notmuch-maildir-setup-message-for-saving:
>>> emacs/notmuch-maildir-fcc.el:172:31:Warning: ‘message-default-charset’ is an
>>> obsolete variable (as of 26.1); The default charset comes from the
>>> language environment
>>>
>>> I'm not enough of an emacs guru to know the right way to avoid this
>>> warning, but i'm hoping that someonen else can take a stab at it, since
>>> extraneous warnings make it easier to ignore real problems.
>>
>> Good question. I looked at message.el in emacs master and it
>>
>>  1) Obsoletes message-default-charset as in 26.1
>>  2) Still uses it in exactly the construction we do.
>
> interesting, thanks for digging that up.
>
>> I'm not sure if it's exactly a reportable bug in emacs, but it is a bit
>> annoying.
>
> seems reportable, if not exactly high-severity.  what does upstream
> expect downstream users of message-default-charset to do?  I'm
> (trying to) forward this to the emacs upstream bugtracker; maybe we can
> get guidance from them on what to do.

The commit which marks this variable as obsolete, has a couple hunks
that just remove uses of it.  Not clear why other uses were left in.
Oversight?

[1: 66d9ef95c0]: 2016-02-14 17:07:48 +1100
  Remove compat code for older Emacsen
  
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=66d9ef95c0f9407d2a6d26bcd7ed84a303294b53

--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -777,8 +777,7 @@ (defun gnus-request-accept-article (group  
gnus-command-method last
   (message-options-set-recipient)
   (save-restriction
(message-narrow-to-head)
-   (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
+   (mail-encode-encoded-word-buffer))
   (message-encode-message-body)))
   (let ((gnus-command-method (or gnus-command-method
 (gnus-find-method-for-group group)))
@@ -800,8 +799,7 @@ (defun gnus-request-replace-article (article group buffer 
 no-encode)
   (message-options-set-recipient)
   (save-restriction
(message-narrow-to-head)
-   (let ((mail-parse-charset message-default-charset))
- (mail-encode-encoded-word-buffer)))
+   (mail-encode-encoded-word-buffer))
   (message-encode-message-body)))
   (let* ((func (car (gnus-group-name-to-method group)))
  (result (funcall (intern (format "%s-request-replace-article" func))
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch