Discussion:
[VM] VM change in Emacs 24 - leaving mail mode
Daniel Barrett
2015-12-15 05:03:46 UTC
Permalink
I've noticed a change in VM's behavior since upgrading to Emacs 24.
When I'm composing an email and I run "save-buffer" to a file, the
buffer enters text-mode instead of staying in mail-mode. In previous
versions of Emacs, the buffer remained in mail-mode even after saving.
Is there an easy way to prevent this change of mode?

Thanks,
Dan

--
Dan Barrett
***@blazemonger.com
r***@knighten.org
2015-12-15 05:47:04 UTC
Permalink
Post by Daniel Barrett
I've noticed a change in VM's behavior since upgrading to Emacs 24.
When I'm composing an email and I run "save-buffer" to a file, the
buffer enters text-mode instead of staying in mail-mode. In previous
versions of Emacs, the buffer remained in mail-mode even after saving.
Is there an easy way to prevent this change of mode?
Thanks,
Dan
--
Dan Barrett
Just checked on my system with emacs-version 24.2.1 and vm-version 8.1.0 and
saw no such change.
--
Robert L. Knighten
***@knighten.org
Uday Reddy
2015-12-15 11:33:44 UTC
Permalink
Post by Daniel Barrett
I've noticed a change in VM's behavior since upgrading to Emacs 24.
When I'm composing an email and I run "save-buffer" to a file, the
buffer enters text-mode instead of staying in mail-mode. In previous
versions of Emacs, the buffer remained in mail-mode even after saving.
Is there an easy way to prevent this change of mode?
That might depend on what file name you use for the file, and what your
auto-mode setting is for that file name.

Cheers,
Uday
Daniel Barrett
2015-12-16 01:25:23 UTC
Permalink
Post by Uday Reddy
Post by Daniel Barrett
I've noticed a change in VM's behavior since upgrading to Emacs 24.
When I'm composing an email and I run "save-buffer" to a file, the
buffer enters text-mode instead of staying in mail-mode.
That might depend on what file name you use for the file, and what your
auto-mode setting is for that file name.
Thanks Uday. The filename for saving has no extension (for example, "foo").

I removed this line from my .emacs file:

(setq default-major-mode 'text-mode)

and the bad behavior stopped. However, this line was present for
earlier versions of Emacs and didn't cause the mode-switching on
saves.

Any suggestions to stop the mode-switching, and still have my default
major mode be text-mode? Thanks.

--
Dan Barrett
***@blazemonger.com
Uday Reddy
2015-12-16 11:14:42 UTC
Permalink
Post by Daniel Barrett
Post by Uday Reddy
Post by Daniel Barrett
I've noticed a change in VM's behavior since upgrading to Emacs 24.
When I'm composing an email and I run "save-buffer" to a file, the
buffer enters text-mode instead of staying in mail-mode.
That might depend on what file name you use for the file, and what your
auto-mode setting is for that file name.
Thanks Uday. The filename for saving has no extension (for example, "foo").
(setq default-major-mode 'text-mode)
and the bad behavior stopped. However, this line was present for
earlier versions of Emacs and didn't cause the mode-switching on
saves.
I can't speak for Emacs.

The sensible thing to do is to use a file extension for mail messages, e.g.,
"eml" or "ml", and then define the auto-mode for it to be mail-mode.

Cheers,
Uday
Daniel Barrett
2016-01-17 16:50:45 UTC
Permalink
Sorting a folder doesn't seem to count as a change to the folder in VM
8.2.0b.

1. Visit a VM folder.

2. Type "G" to sort the messages, and choose a sort that's different
from the current one.

3. The buffer's status bar doesn't get marked as changed: no "**" appears
in the lower left. Typing "S" to run vm-save-and-expunge-folder has no
effect. Closing and reopening the folder shows that the sort didn't
get saved.

I think the behavior was different when I ran Emacs 23 rather than 24.
Is this behavior configurable?

Thanks,
Dan

--
Dan Barrett
***@blazemonger.com
Manuel Hermenegildo
2016-01-17 17:51:55 UTC
Permalink
I think this is because it is not a physical change, i.e., a change
that will be reflected in the file if the buffer is saved. To perform
a physical change on the file you need to add C-u before the sorting
command. In this case, *if there is an actual rearrangement of
messages*, the buffer modified marker (*) will appear and when saving
the file will be modified. I also got a bit confused by this the first
time I ran into it, but it makes a lot if sense. Cheers, --Manuel

--
Daniel Barrett
2016-01-17 21:16:44 UTC
Permalink
To perform a physical change on the file you need to add C-u before
the sorting command.
Thanks, that works!

--
Dan Barrett
***@blazemonger.com

Loading...