Re: Subject that ends with UTF-8, 85 or A0 e.g.:

2022-08-02 Thread Kenichi Asai
> Darn, that was my best guess.  After I sent the email, I even found some old
> bug reports that 0xa0 was considered "space" on MacOS (e.g.
> https://bugs.python.org/issue7072)
> 
> Still, perhaps there is something different about the way Mutt was built
> versus the quick compile.
> 
> Have you ever built Mutt yourself?  Would you be able to try, and try
> applying the attached patch to a recent release tarball?

Yes, and it solved the problem!!!  Thank you very much!

I haven't compiled mutt by myself for long, so I rewrote the homebrew
formula to use the patch and let homebrew recompile (mutt 2.2.3).

It's really great that I don't have to check Subject every time any
more to see if the last character is truncated.  Thank you Kevin and
all the others for considering and solving this problem.

Sincerely,

-- 
Kenichi Asai


Re: Subject that ends with UTF-8, 85 or A0 e.g.:

2022-08-02 Thread Kenichi Asai
> Would you mind creating a script to use for $editor.  Something like:
> 
> - - - - myeditor.sh - - - -
>   #!/bin/bash
> 
>   cp $1 ~/before.txt
>   vim $1
>   cp $1 ~/after.txt
> - - - - end myeditor.sh - - -
> 
> set editor = "~/myeditor.sh"
> 
> Then, if you put 加 at the end of the subject while in Mutt.  I'd like to
> see what before.txt and after.txt look like after vim runs.  Please attach
> them so I can look at the raw bytes.

Attached.  They were identical, both containing 加.

> Also, if you have access to a compiler, would you mind compiling and running
> this quick program:

Here you go:

asai@bigsur % cat test.c
#include 
#include 

int main ()
{
  printf("%d\n", isspace(0xa0));
  printf("%d\n", isspace(0x85));
  printf("%d\n", isspace(0x0a));

  return 0;
}
asai@bigsur % gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
asai@bigsur % gcc -o test test.c
asai@bigsur % ./test
0
0
1
asai@bigsur %

-- 
Kenichi Asai
From: Kenichi Asai 
To: a...@is.ocha.ac.jp
Cc: 
Bcc: 
Subject: 加
Reply-To: 


-- 
お茶大・理・情報   浅井 健一   a...@is.ocha.ac.jp
From: Kenichi Asai 
To: a...@is.ocha.ac.jp
Cc: 
Bcc: 
Subject: 加
Reply-To: 


-- 
お茶大・理・情報   浅井 健一   a...@is.ocha.ac.jp


Re: Subject that ends with UTF-8, 85 or A0 e.g.:

2022-08-02 Thread Kenichi Asai
> > I try to send this e-mail out in 7bit mode (with υ at the end of
> > Subject).
> 
> Why would you do that when the discussion seems to be about UTF-8
> glyphs ?  I'm curious.

I just thought that quoted printable did some work on the Subject
line, but I was wrong.

-- 
Kenichi Asai


Re: Subject that ends with UTF-8, 85 or A0 : �

2022-08-02 Thread Kenichi Asai
> > This e-mail has υ at the end of Subject.  I will send it out.
> 
> Somehow, the previous e-mail did not contain the replacement character
> at the end of Subject.  I don't know why.  Because the e-mail was
> quoted perhaps?
> 
> [text/plain, quoted, utf-8, 1.3K]
> 
> Bastian's e-mail is 7bit (as is my original e-mail):
> 
> [text/plain, 7bit, us-ascii, 0.7K]
> 
> I try to send this e-mail out in 7bit mode (with υ at the end of
> Subject).

The replacement characters in my previous e-mails do not show up in
mutt's pager (while the one in Bastian's e-mail does; I don't know
why), but if I see those e-mails in gmail, the replacement characters
do appear to exist.

-- 
Kenichi Asai


Re: Subject that ends with UTF-8, 85 or A0 e.g.: �

2022-08-02 Thread Kenichi Asai
> This e-mail has υ at the end of Subject.  I will send it out.

Somehow, the previous e-mail did not contain the replacement character
at the end of Subject.  I don't know why.  Because the e-mail was
quoted perhaps?

[text/plain, quoted, utf-8, 1.3K]

Bastian's e-mail is 7bit (as is my original e-mail):

[text/plain, 7bit, us-ascii, 0.7K]

I try to send this e-mail out in 7bit mode (with υ at the end of
Subject).

> * Does the problem occur if you use a different editor?

Yes.  The same thing happens with:

set editor="emacs %s"

-- 
Kenichi Asai


Re: Subject that ends with UTF-8, 85 or A0 e.g.: �

2022-08-02 Thread Kenichi Asai
Thank you all for considering this issue.

> * After you finish the above steps, what happens if you edit the email again
> in vim?  Does the 加 show up at the end of the subject in vim the second time?

No.  In vim, the character becomes ?? (two question marks).

> * With your original steps, what does the email look like if you send directly
> after returning from vim?

The replacement character is sent as seen in Bastian's e-mail:

Date: Tue, 2 Aug 2022 12:39:06 +0200
From: Bastian 
To: mutt-users@mutt.org
Subject: Re: Subject that ends with UTF-8, 85 or A0 ��

(I am not quite sure why there are two replacement characters here
instead of one.)

> Would you mind sending me an email so I can take a look?

This e-mail has υ at the end of Subject.  I will send it out.

> * Does the problem occur if you use a different editor?

Let me come back to this later.  I need to send this e-mail out to try
a different editor.

> * In the step:
>   "- enter some e-mail address and a subject."
> if instead, you put a 加 at the end of the subject here, before running vim,
> does 加 show up in vim?

Yes.

> If you then don't modify the subject while still in
> vim, does it show up in Mutt?

No.  It becomes the replacement character.

-- 
Kenichi Asai


Subject that ends with UTF-8, 85 or A0

2022-08-02 Thread Kenichi Asai
When the subject ends with a character whose last byte in
UTF-8 is either 85 or A0, it appears the character collapses.
To reproduce:

- prepare .mutt/muttrc containing only the following line:
  set edit_headers=yes
- launch mutt and type m to create a new mail.
- enter some e-mail address and a subject.
- vim launches.
- edit Subject line so that it ends with a character such as:
  υ or % or e (whose last byte of their UTF-8 code is 85) or
  ム or 加 (whose last byte of their UTF-8 code is A0).
- type :wq to quit vim.
- the last character is converted to something else.

Would it be possible to somehow avoid this problem?  I cannot avoid
creating e-mails with Japanese characters in Subject and this problem
bugs me quite much.

I am using Mutt 2.2.3 (2022-04-12) installed from homebrew on MacOS
Big Sur 11.6.7 on iMac (2019).

Sincerely,

-- 
Kenichi Asai


Re: is it possible to have two options for viewing html mail?

2020-10-24 Thread Kenichi Asai
> text/html;  mutt_bgrun /usr/bin/firefox %s >/dev/null 2>&1; needsterminal
> text/html; elinks -dump ; copiousoutput

This is almost what I am doing.  However, it works for text/html but
not for docx file, apparently.  For text/html, I have:

text/html; open -a safari -n -W %s; nametemplate=%s.html
text/html; w3m -dump -T %t %s; copiousoutput

in .mailcap and it goes beautifully: when I press Enter in the list of
attachments, w3m is used, and when I press m, safari is used.  (As a
related question, why do I obtain this behavior by the above two
lines?  What happens when I press Enter and what happens when I press
m?  I don't quite understand the fine details of mailcap.)

For docx file, I think I have exactly the same thing:

application/vnd.openxmlformats-officedocument.wordprocessingml.document;open -a 
preview -n -W %s; nametemplate=%s.docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document;textutil
 -stdout -cat txt %s; copiousoutput

but the file is always opened using preview, no matter I press Enter
or m.  Why?  How can I configure so that when I press Enter, textutil
is used but when I enter m, preview is used?

# I am using Mutt 1.13.3 (2020-01-12) from homebrew on MacOS 10.12.6.

Sincerely,

-- 
Kenichi Asai


Re: use mutt with mh

2019-05-22 Thread Kenichi Asai
> I got nmh set up and running on my system and in my
> /home/jude/.mutt/muttrc file have set mbox-format=mh.

I think you mean "set mbox_type=MH".

> When I start mutt I get /home/jude/Mail/inbox not found and if I
> create an inbox directory under ~/Mail/ and move all received
> messages into that inbox directory mutt claims
> /home/jude/Mail/inbox/ is not an inbox.

Try:

touch /home/jude/Mail/inbox/.mh_sequences

-- 
Kenichi Asai


Re: slow startup

2018-12-21 Thread Kenichi Asai
Thank you all for all the information.  By adding "host.local" to
/etc/hosts as follows:

127.0.0.1   localhost host.local

the problem disappears.  (I added host.local where host is the name of
the machine.)  Thank you again.  It helped me very very much!

Sincerely,

-- 
Kenichi Asai


slow startup

2018-12-20 Thread Kenichi Asai
Dear Mutt experts,

I am using mutt in the following configuration without any problems.

Mutt 1.9.0 (2017-09-02), installed via homebrew
macOS Sierra 10.12.6 on Mac mini (Late 2014)

However, when I cloned the entire hard drive (using DiskUtility) to
MacBookPro (Mid 2012), mutt takes about 5 seconds before it displays
the initial list of e-mails.  (On Mac mini, mutt shows the initial
list of e-mails instantly after I launch mutt from the terminal.)
Even if I remove my muttrc file and hide all my e-mails, it takes the
same 5 seconds before mutt shows a blank screen.

Why does it take so long time to start up?  Have anybody had the same
experience?  What should I check?

My guess is that mutt automatically checks some machine or network
configuration and wait 5 seconds for time out before starting.  Does
mutt do such things?  How can I learn about them?

I have been using mutt for decades, but this is the first time to
experience such slow startup.

Any help welcome.  Thank you in advance.

Sincerely,

-- 
Kenichi Asai