#462 Create separate context for MH-E

mh-e-8.0
open
nobody
None
6
2013-02-23
2011-12-26
Bill Wohler
No

To: mh-e-devel@lists.sourceforge.net
Subject: Re: Own context (was: src mh-e.el,1.395,1.396 ChangeLog,1.1210,1.1211)
From: "Mark D. Baushke" <mdb@gnu.org>
X-Mailer: MH-E 7.82+cvs; nmh 1.0.4; GNU Emacs 21.1.1
Date: Mon, 06 Sep 2004 19:58:15 -0700
Message-ID: <76895.1094525895@juniper.net>

Bill Wohler <wohler@newt.com> writes:

> Satyaki Das <satyaki@theforce.stanford.edu> wrote:
>
> > Mark D. Baushke <mdb@gnu.org> writes:
> >
> > > I also have my own context.
> > >
> > > I think we would do well to have a configuration option for our users to
> > > set their own.
> > >
> > > Note that my own context is created under my home directory because /tmp
> > > is sometimes swept for old files on some of my systems and I would
> > > rather not have it removed out from under me.
> >
> > Yes, mine too (~/Mail/mhe-context). Should be easy enough to add
> > a defcustom to do this.
>
> Oddly enough, I'm probably the only one around here who hasn't set my
> own context, but then I'm always paranoid about what procmail or I might
> do to screw things up. I think adding our own context is a marvelous
> idea. With this change, I'll be able to sleep at night again ;-).
>
> I like your filename a lot (~/Mail/mhe-context) as it is consistent with
> mhe-index and context, so let's go with that. Since context is
> customizable in .mh_profile, I agree that we should have a customization
> variable for it as well; mh-context is a clear choice.
>
> Can everyone who has done this please post your code please? Then we can
> vote on or merge the implementations.

Here is mine. It is probably similar to what other folks have... I used
to have (make-temp-file "~/tmp/mh-e.context.") instead of the odd dance
with ~/tmp and ~ until I ran into a box which replicated some, but not
all of my home directory stuff... Note that `mhpath +` will give you whatever
.mh_profile sets for Path instead of assuming that the default "Path: Mail"
is being used... for example, my .mh_profile uses "Path: .Mail" to avoid
walking into assumptions about what is in Mail by various browsers...

\-- Mark

(if (fboundp 'setenv)
(let ((tmpdir (expand-file-name "~/tmp")))
(if (not (and tmpdir
(file-exists-p tmpdir)
(car (file-attributes tmpdir)))) ; a directory
(setq tmpdir (expand-file-name "~")))
(progn
(setenv "MHCONTEXT" (make-temp-file (concat tmpdir "/mh-e.context.")))
(add-hook 'kill-emacs-hook 'mdb-private-mh-kill-context))))
(defun mdb-private-mh-kill-context ()
(let ((filename (getenv "MHCONTEXT")))
(if (and filename
(file-exists-p filename))
(delete-file (getenv "MHCONTEXT")))))

Discussion

  • Bill Wohler
    Bill Wohler
    2011-12-26

    • priority: 5 --> 6
     
  • Bill Wohler
    Bill Wohler
    2011-12-26

    Bumping priority since this is generally useful and valuable.

     
  • Bill Wohler
    Bill Wohler
    2011-12-27

    • status: open --> open-accepted
     
  • Bill Wohler
    Bill Wohler
    2013-02-23

    • labels: General -->
     
  • Bill Wohler
    Bill Wohler
    2013-02-23

    Ticket moved from /p/mh-e/feature-requests/152/

     
  • Bill Wohler
    Bill Wohler
    2013-02-23

    • Status: open-accepted --> open