unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: default mode for email drafts
       [not found] <87r78wx3jd.fsf@escher.local.home>
@ 2005-12-04 21:19 ` Richard M. Stallman
  2005-12-05 14:36   ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Richard M. Stallman @ 2005-12-04 21:19 UTC (permalink / raw)
  Cc: ding, emacs-devel

    I visited with C-x C-f a file whose file-name is an integer and whose
    immediate directory is named "drafts", and to my surprise I found
    myself in mh-letter-mode.  I was surprised because I not only don't
    use mh-e but I don't even have MH installed on my system.  I use Gnus
    to read and send email messages, and Gnus has a special group for
    drafts, and of course visiting a draft within Gnus DTRT. The problem
    is that Gnus uses a file structure for drafts that matches the regexp
    which auto-mode-alist associates exclusively with mh-letter-mode,
    which takes effect when visiting drafts outside of Gnus.

I think that Gnus should change the file name so that mh-e won't
be triggered.  Is there any obstacle to this?

							      I would
    guess that mh-e also a mechanism for visiting drafts in the
    appropriate mode.  So does this association really have to forced for
    C-x C-f?

It ought to be.  Why should we choose to make one mode work well or
the other?  We can make both work well.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-04 21:19 ` default mode for email drafts Richard M. Stallman
@ 2005-12-05 14:36   ` Reiner Steib
  2005-12-06  1:43     ` Richard M. Stallman
  2005-12-07  0:59     ` Juri Linkov
  0 siblings, 2 replies; 9+ messages in thread
From: Reiner Steib @ 2005-12-05 14:36 UTC (permalink / raw)
  Cc: Stephen Berman, ding, emacs-devel, mh-e-devel

On Sun, Dec 04 2005, Richard M. Stallman wrote:

>     I visited with C-x C-f a file whose file-name is an integer and whose
>     immediate directory is named "drafts", and to my surprise I found
>     myself in mh-letter-mode.  I was surprised because I not only don't
>     use mh-e but I don't even have MH installed on my system.  I use Gnus
>     to read and send email messages, and Gnus has a special group for
>     drafts, and of course visiting a draft within Gnus DTRT. The problem
>     is that Gnus uses a file structure for drafts that matches the regexp
>     which auto-mode-alist associates exclusively with mh-letter-mode,
>     which takes effect when visiting drafts outside of Gnus.
>
> I think that Gnus should change the file name so that mh-e won't
> be triggered.  Is there any obstacle to this?

Gnus uses "/drafts/[0-9]+" filenames at least since 1997.  We can't
change then [0-9]+ part in Gnus because the filenames need to be
integers.  Changing "/drafts/" might be possible but it break
compatibility with previous versions.  I'm quite sure it's not worth
the trouble.

Couldn't the regexp be made more specific to match only the MH files?
[ Cc-ing mh-e-devel. ]

False positives in `auto-mode-alist' cannot be avoided completely.
IIRC the policy is to make it work correctly in the common cases.

BTW, when I do `C-x C-f .../drafts/drafts/1240 RET' with `emacs
-Q', I get:

Debugger entered--Lisp error: (file-error "Searching for program" "no such file or directory" ".../drafts/drafts/install-mh")
  call-process(".../drafts/drafts/install-mh" nil t nil "-auto")
  apply(call-process ".../drafts/drafts/install-mh" nil t nil "-auto")
  mh-exec-cmd(".../drafts/drafts/install-mh" "-auto")
  mh-install("/home/dept/ste/.mh_profile" (file-error "Opening input
  file" "no such file or directory" "/home/dept/ste/.mh_profile"))
  mh-find-path()
  mh-letter-mode()
  set-auto-mode-0(mh-letter-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer 1240> ".../drafts/drafts/1240" nil nil
  ".../drafts/drafts/1240" (935129 64775))
  find-file-noselect(".../drafts/drafts/1240" nil nil t)
  find-file(".../drafts/drafts/1240" t)
  call-interactively(find-file)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-05 14:36   ` Reiner Steib
@ 2005-12-06  1:43     ` Richard M. Stallman
  2005-12-06 21:55       ` Richard M. Stallman
  2005-12-07  0:59     ` Juri Linkov
  1 sibling, 1 reply; 9+ messages in thread
From: Richard M. Stallman @ 2005-12-06  1:43 UTC (permalink / raw)
  Cc: Stephen.Berman, mh-e-devel, ding, emacs-devel

    Gnus uses "/drafts/[0-9]+" filenames at least since 1997.  We can't
    change then [0-9]+ part in Gnus because the filenames need to be
    integers.  Changing "/drafts/" might be possible but it break
    compatibility with previous versions.

Could gnus use /drafts if that exists, and otherwise use /gnus-drafts?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-06  1:43     ` Richard M. Stallman
@ 2005-12-06 21:55       ` Richard M. Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard M. Stallman @ 2005-12-06 21:55 UTC (permalink / raw)
  Cc: Reiner.Steib, Stephen.Berman, mh-e-devel, ding, emacs-devel

I wrote:

    Could gnus use /drafts if that exists, and otherwise use /gnus-drafts?

Even better: Use /drafts if that exists and /gnus-drafts does not exist.
Otherwise, use /gnus-drafts.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-05 14:36   ` Reiner Steib
  2005-12-06  1:43     ` Richard M. Stallman
@ 2005-12-07  0:59     ` Juri Linkov
  2005-12-07  3:11       ` Stefan Monnier
                         ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Juri Linkov @ 2005-12-07  0:59 UTC (permalink / raw)
  Cc: stephen.berman, mh-e-devel, ding, emacs-devel

> False positives in `auto-mode-alist' cannot be avoided completely.
> IIRC the policy is to make it work correctly in the common cases.
>
> BTW, when I do `C-x C-f .../drafts/drafts/1240 RET' with `emacs -Q',
> I get:
>
> Debugger entered--Lisp error: (file-error "Searching for program" "no such file or directory" ".../drafts/drafts/install-mh")
> [...]

Perhaps `auto-mode-alist' shouldn't contain

  ("/drafts/[0-9]+\\'" . mh-letter-mode)

in its default value.  mh-e.el could add it after loading, e.g. by using
a top-level form in mh-e.el:

(setq auto-mode-alist (cons '("/drafts/[0-9]+\\'" . mh-letter-mode) auto-mode-alist))

I suppose the users who want to visit draft files in mh-letter mode
already have (require 'mh-e) in .emacs or load it by other means.

It seems it is the right thing to do because MH-E's ChangeLog has the
following entry:

	* mh-comp.el (autoload): Don't set auto-mode-alist. This could
	screw things up for users that don't use MH-E (closes SF #1032353).

This means that mh-letter-mode was removed from auto-mode-alist only in the
autoloaded form in mh-comp.el, but not from files.el.  So what about removing
it from files.el too?

Please see also for more information SF #1032353 and
http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-04/msg00023.html.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-07  0:59     ` Juri Linkov
@ 2005-12-07  3:11       ` Stefan Monnier
  2005-12-07 19:03         ` Xavier Maillard
  2005-12-07 22:58       ` Richard M. Stallman
  2005-12-08  1:14       ` Bill Wohler
  2 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2005-12-07  3:11 UTC (permalink / raw)
  Cc: stephen.berman, emacs-devel, rms, mh-e-devel, ding

> Perhaps `auto-mode-alist' shouldn't contain
>   ("/drafts/[0-9]+\\'" . mh-letter-mode)
> in its default value.

Agreed.
I think if MH-E wants to add such an entry it should be more specific,
e.g. contain a more complete filename that includes the MH mail directory
(typically ~/Mail) and should only be added after extracting the value from
~/.mh_profile, thus making sure the user indeed uses MH.


        Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-07  3:11       ` Stefan Monnier
@ 2005-12-07 19:03         ` Xavier Maillard
  0 siblings, 0 replies; 9+ messages in thread
From: Xavier Maillard @ 2005-12-07 19:03 UTC (permalink / raw)
  Cc: juri, rms, stephen.berman, mh-e-devel, ding, emacs-devel

   I think if MH-E wants to add such an entry it should be more specific,
   e.g. contain a more complete filename that includes the MH mail directory
   (typically ~/Mail) and should only be added after extracting the value from
   ~/.mh_profile, thus making sure the user indeed uses MH.

Agreed with that.

Xavier



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-07  0:59     ` Juri Linkov
  2005-12-07  3:11       ` Stefan Monnier
@ 2005-12-07 22:58       ` Richard M. Stallman
  2005-12-08  1:14       ` Bill Wohler
  2 siblings, 0 replies; 9+ messages in thread
From: Richard M. Stallman @ 2005-12-07 22:58 UTC (permalink / raw)
  Cc: stephen.berman, mh-e-devel, ding, emacs-devel

    This means that mh-letter-mode was removed from auto-mode-alist only in the
    autoloaded form in mh-comp.el, but not from files.el.  So what about removing
    it from files.el too?

If this solution makes people happy, I don't object.

Another idea is to have a user option to specify the mode to
use for these files.  Running either MH-E or Gnus could set that option
if it is still nil, but users could also set it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: default mode for email drafts
  2005-12-07  0:59     ` Juri Linkov
  2005-12-07  3:11       ` Stefan Monnier
  2005-12-07 22:58       ` Richard M. Stallman
@ 2005-12-08  1:14       ` Bill Wohler
  2 siblings, 0 replies; 9+ messages in thread
From: Bill Wohler @ 2005-12-08  1:14 UTC (permalink / raw)
  Cc: rms, stephen.berman, ding, emacs-devel, mh-e-devel

Juri Linkov <juri@jurta.org> wrote:

> 	* mh-comp.el (autoload): Don't set auto-mode-alist. This could
> 	screw things up for users that don't use MH-E (closes SF #1032353).
> 
> This means that mh-letter-mode was removed from auto-mode-alist only in the
> autoloaded form in mh-comp.el, but not from files.el.  So what about removing
> it from files.el too?

Spot on, Juri.

I've removed the mh-letter-mode entry from auto-mode-alist in files.el.

p.s. Sorry I didn't respond sooner, but my laptop was in the shop the
past couple of days.

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-12-08  1:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87r78wx3jd.fsf@escher.local.home>
2005-12-04 21:19 ` default mode for email drafts Richard M. Stallman
2005-12-05 14:36   ` Reiner Steib
2005-12-06  1:43     ` Richard M. Stallman
2005-12-06 21:55       ` Richard M. Stallman
2005-12-07  0:59     ` Juri Linkov
2005-12-07  3:11       ` Stefan Monnier
2005-12-07 19:03         ` Xavier Maillard
2005-12-07 22:58       ` Richard M. Stallman
2005-12-08  1:14       ` Bill Wohler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).