From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hikaru Ichijyo Newsgroups: gmane.emacs.help Subject: using movemail directly in .emacs Date: 04 May 2014 03:10:13 GMT Organization: UN Spacy Message-ID: <5365af95$0$17080$c3e8da3$dd9697d2@news.astraweb.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1399173506 2745 80.91.229.3 (4 May 2014 03:18:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 03:18:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 04 05:18:19 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wgmtg-0003ER-Pf for geh-help-gnu-emacs@m.gmane.org; Sun, 04 May 2014 05:15:24 +0200 Original-Received: from localhost ([::1]:51946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wgmtg-0002AB-2h for geh-help-gnu-emacs@m.gmane.org; Sat, 03 May 2014 23:15:24 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!border3.nntp.dca.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.14.2 (x86_64)) Original-Lines: 47 Original-NNTP-Posting-Host: cbdea486.news.astraweb.com Original-X-Trace: DXC=o>7e[d:M6AII]J2Y9=AF]JL?0kYOcDh@JTE6nc^O4LMOi List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97554 Archived-At: This is a newbie Emacs question. If the answers are obvious or the intent misguided, let me know. I'd like to start handling my email in Emacs, probably in VM. But I have seen that all Emacs mailreaders like to move the spool file into the home directory before operating, because none of them can do locking on a mailbox in place while the system mailer daemon is trying to append new messages. (This is not as outrageous of an expectation as it sounds. Mutt, Pine/Alpine, and KMail can all do this, and they all provide code examples for ways it could be done.) I'd like to keep my inbox in the system spool where other email programs expect it, so I can freely go back and forth between various email programs while I'm in the process of getting myself moved over to an Emacs way of thinking. I realize it is possible to setup Alpine and Mutt to work the other way -- to read their inbox from the home directory, in effect, making them work with Emacs way of doing things. I'd rather do the opposite: The Lisp program movemail, bundled with Emacs, seems to have the ability to do mailbox locking so that RMAIL can safely move mailboxes into the home directory. (I think VM uses it also.) Would it be possible to directly call movemail from the .emacs file and make it do the following? This is what I want to do: - When Emacs launches, I want my .emacs file to run movemail, and put my system spool inbox into my home directory in a place that VM expects it. - It can be safely assumed that so long as Emacs is running, I'm not going to run Alpine or Mutt or anything similar -- if Emacs is available, I'll use Emacs for mail, and it won't matter that my inbox is in my home directory at that time. - When Emacs shuts down, I'd like to use its shutdown hooks to append any newly received messages in the system spool to the inbox in my home directory, and then use movemail to put the whole home directory inbox back into /var/spool/mail before Emacs quits itself. Is any of this impossible or misguided? I'd just strongly prefer my mailbox in the system spool area where most UNIX tools expect it to be. -- He that would make his own liberty secure must guard even his enemy from oppression; for if he violates this duty, he establishes a precedent that will reach to himself. --Thomas Paine