[comp.emacs] Mail drop path for mode line

trost@reed.UUCP (Bill Trost) (02/25/88)

OK, I give up.  I've wandered around in both the C and Lisp sources,
and have yet to find what I'm looking for.  What I want to do is tell
emacs that my maildrop is in a different location other than the
default "/usr/spool/mail/$USER", but I can't see to get a hold on the
variable that controls this.  Anyone out there know where I can find
it?  This has gotten really bizarre; it's gotta be in the sources
*somewhere*!
-- 
...!(ogcvax|tektronix)!reed!trost (UUCP)

This text is in the public domain; no rights have been reserved, nor is
there any sort of warranty or guarantee of merchantability or fitness.

Ram-Ashwin@cs.yale.edu (Ashwin Ram) (02/26/88)

In article <8340@reed.UUCP>, trost@reed (Bill Trost) writes:
>                                             What I want to do is tell
> emacs that my maildrop is in a different location other than the
> default "/usr/spool/mail/$USER", but I can't see to get a hold on the
> variable that controls this.

Try one of the following:

- set the rmail-primary-inbox-list variable to your list of inbox files
- set the Mail: babyl option in your rmail-file-name file
- pass an explicit argument to rmail-get-new-mail
- set the rmail-spool-directory variable to your mailer's spooling directory


-- Ashwin Ram --

ARPA:    Ram-Ashwin@cs.yale.edu
UUCP:    {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET:  Ram@yalecs

karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) (02/26/88)

The variable you are looking for is the rmail-primary-inbox-list.  See
paths.el:

(defconst rmail-primary-inbox-list 
  (if (memq system-type '(hpux usg-unix-v))
      '("~/mbox" "/usr/mail/$LOGNAME")
    '("~/mbox" "/usr/spool/mail/$USER"))
 "List of files which are inboxes for user's primary mail file ~/RMAIL.")

But note the comment at the top of paths.el, and modify this variable
as it says:

;; If these settings are not right, override them with `setq'
;; in site-init.el.  Do not change this file.

Karl

bob@allosaur.cis.ohio-state.edu (Bob Sutterfield) (02/26/88)

In article <8340@reed.UUCP> trost@reed.UUCP (Bill Trost) writes:
>...I want to tell emacs that my maildrop is in a different location
>other than the default "/usr/spool/mail/$USER"...

Paragraph 4 of INSTALL suggests that you look at $BUILD/lisp/paths.el
and customize things in $BUILD/lisp/site-init.el if the defaults
aren't appropriate for your system.  You probably want to change the
value of rmail-spool-directory.
-=-
 Bob Sutterfield, Department of Computer and Information Science
 The Ohio State University; 2036 Neil Ave. Columbus OH USA 43210-1277
 bob@cis.ohio-state.edu or ...!cbosgd!osu-cis!bob

bob@allosaur.cis.ohio-state.edu (Bob Sutterfield) (02/26/88)

In article <8340@reed.UUCP> trost@reed.UUCP (Bill Trost) writes:
>...I want to tell emacs that my maildrop is in a different location
>other than the default "/usr/spool/mail/$USER"...

In article <7285@tut.cis.ohio-state.edu> karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes:
>The variable you are looking for is the rmail-primary-inbox-list.

In article <7288@tut.cis.ohio-state.edu> bob@allosaur.cis.ohio-state.edu (Bob Sutterfield) writes:
>You probably want to change the value of rmail-spool-directory.

Hmmm... Karl and I have been friends since 9th grade, have had close
professional contact for several years, and have worked across a
cubicle wall from each other for six months.  Neither of us noticed
that the other was simultaneously following up to this question until
both responses were posted.

I wonder when we'll be able to agree on something :-)
-=-
 Bob Sutterfield, Department of Computer and Information Science
 The Ohio State University; 2036 Neil Ave. Columbus OH USA 43210-1277
 bob@cis.ohio-state.edu or ...!cbosgd!osu-cis!bob

mike@pyrdc.UUCP (Mike Whitman) (02/27/88)

In article <8340@reed.UUCP>, trost@reed.UUCP (Bill Trost) writes:
> OK, I give up.  I've wandered around in both the C and Lisp sources,
> and have yet to find what I'm looking for.  What I want to do is tell
> emacs that my maildrop is in a different location other than the
> default "/usr/spool/mail/$USER", but I can't see to get a hold on the
> variable that controls this.  Anyone out there know where I can find
> it?  This has gotten really bizarre; it's gotta be in the sources
> *somewhere*!

Bill,

	Look in the etc directory in the loadst.c file for the paths
that mail is looked for. Have fun!

-- mike --

-- 
      -m-------  Mike Whitman		Phone : (703)848-2050
    ---mmm-----  Pyramid Technology     Fax   : (703)848-4995
  -----mmmmm---  8320 Old Courthouse Rd ARPA  : mike@gmu90x.gmu.edu
-------mmmmmmm-  Vienna, VA 22170	UUCP  : ...uunet!pyrdc!mike

jr@LF-SERVER-2.BBN.COM (John Robinson) (02/27/88)

I didn't see all the notes leading up to this message, but...

If you are trying to get the display due to (display-time) to be
correct, you have to set the environment variable MAIL right so that
emacs/etc/loadst will look in the right location.  This has to be done
before invoking emacs, since emacs by default (sites can change this)
can't modify envariables for its children or itself.  For MH/MMDF
mail, I have in my .cshrc:

  setenv MAIL ~/mailbox

/jr
jr@bbn.com or jr@bbn.uucp

nate@cpocd2.UUCP (Nathan Hess) (02/27/88)

In article <8340@reed.UUCP> trost@reed.UUCP (Bill Trost) writes:
>[...] What I want to do is tell emacs that my maildrop is in a
>different location other than the default "/usr/spool/mail/$USER", but
>I can't see to get a hold on the variable that controls this.  Anyone
>out there know where I can find it?


Well, as you pointed out, it's a variable, so I just ran through all the
mail-related variables and came up with:

rmail-file-name		      
  Variable: Name of user's primary mail file.

rmail-primary-inbox-list      
  Variable: List of files which are inboxes for user's primary mail file ~/RMAIL.

A (setq rmail-primary-inbox-list "<new maildrop file>") should do the
trick rather nicely.

--woodstock
-- 
	   "How did you get your mind to tilt like your hat?"

...!{decwrl|hplabs!oliveb|pur-ee|qantel|amd}!intelca!mipos3!cpocd2!nate
<domainish> :   nate@cpocd2.intel.com		ATT :    (602) 961-2037

wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (02/29/88)

You can change an emacs-childs environment variables via redefining
the emacs variable process-environment. Here is some code for changing 
(sub)shell variables from GnuEmacs. (Note current emacs variable that 
(getenv "FOO") returns will not be updated.)

-wolfgang

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;									     ;;
;;	File:     env.el						     ;;
;;	Author:   Wolfgang Rupprecht					     ;;
;;	Contents: modify and print the unix environment variables	     ;;
;; 		  for subprocesses     					     ;;
;;									     ;;
;;	$Log$								     ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Copyright (C) 1987 Wolfgang S. Rupprecht
;; This file is for GNU Emacs.

;; Env.el is distributed in the hope that it will be useful in conjuction with
;; GNU Emacs, but WITHOUT ANY WARRANTY.  No author or distributor
;; accepts responsibility to anyone for the consequences of using it
;; or for whether it serves any particular purpose or works at all,
;; unless he says so in writing.  This program is distributed for use with
;; and under the same terms as GNU Emacs. Refer to the GNU Emacs General Public
;; License for full details.

;; Everyone is granted permission to copy, modify and redistribute
;; env.el, but only under the conditions described in the
;; GNU Emacs General Public License.   A copy of this license is
;; supposed to have been given to you along with GNU Emacs so you
;; can know your rights and responsibilities.  It should be in a
;; file named COPYING.  Among other things, the copyright notice
;; and this notice must be preserved on all copies.


;; Code for hacking environment variables.
;; The most notable use is to clean up the environment of
;; the subprocesses. (setting TERM=dumb, unsetting TERMCAP, etc.) 
;; Requires GnuEmacs version 18.36 or later

(provide 'env)

(defvar old-env process-environment
  "A safe haven for the initial enviromment variables. Useful if you
ever want to look at or reset back to the initial environment.")

(defun modify-environment (name value)
  "Sets environment VARIABLE to have VALUE. Variable must be a string,
value may be either a string or nil.  Tries to preserve order of
variables and number of occurances of variable.  Appends new variable
to end of enironment variable list if it doesn't already occur.  If
value is nil, then all occurances of that variable are removed.  To
set a blank value, but have the variable name defined use the empty
string \"\"."
  (interactive "sVariable: \nxValue (as lisp string, or nil): ")
  (let ((env process-environment) new-env seen)
    (while env
      (if (null (string-match (concat "^" name "=") (car env)))
	  (setq new-env (cons (car env) new-env))
	  (if value
	      (setq new-env (cons (concat name "=" value) new-env)
		    seen t)))
      (setq env (cdr env)))
    (if (and value (null seen))
	(setq new-env (cons (concat name "=" value) new-env)))
    (setq process-environment (nreverse new-env))))

(defun print-environment-variable (name)
  "Print the value of an environment variable in the minibuffer.
Returns the variable as a string (or nil if variable is not set)"
  (interactive "sEnvironment Variable: ")
  (let ((env process-environment) value)
    (while (and env (null (string-match (concat "^" name "=\\(.*\\)$") (car env))))
      (setq env (cdr env)))
    (if env
	(setq value (substring (car env) (match-beginning 1) (match-end 1))))
    (if (interactive-p)
	(if env
	    (message "Variable '%s's value is '%s'" name value)
	    (message "Variable '%s' is NOT set" name)))
    value))

Wolfgang Rupprecht	ARPA:  wolfgang@mgm.mit.edu (IP 18.82.0.114)
326 Commonwealth Ave.	UUCP:  mit-eddie!mgm.mit.edu!wolfgang
Boston, Ma. 02115	TEL:   (617) 267-4365