Path: utzoo!news-server.csri.toronto.edu!rpi!usc!apple!agate!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.mail.mh Subject: Re: Default editor switches in .mh_profile Message-ID: <1991Mar17.190959.12763@NCoast.ORG> Date: 17 Mar 91 19:09:59 GMT References: <9103111635.AA03682%caligula@ansa.co.uk> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.mail.mh Organization: North Coast Public Access Un*x (ncoast) Lines: 45 As quoted from <9103111635.AA03682%caligula@ansa.co.uk> by eo@ansa.co.UK (Ed Oskiewicz): +--------------- | Does anyone know of a way to provide startup arguments to the Editor: | specified in your .mh_profile? +--------------- You can't. You can sometimes play other tricks, however: run a shell script for your editor, which passes arguments (emacs) or sets $EXINIT (vi). +--------------- | Then I get the following error msg from csh | unable to exec emacs -f text-mode: No such file or directory +--------------- MH doesn't use csh, it uses the exec?p system call. ("?" because I haven't checked to see if it uses execl or execv.) Since the exec() doesn't do argument splitting, the whole string is taken as the editor name. +--------------- | I guess that its trying to start an editor called "emacs -f text-mode". The | same sort of error happens if I sprinkle quotes around any of these 3 tokens. +--------------- Correct. The man page mh-profile(5) says this. You can use the trick I mentioned above to do this. But if you're just trying to force text mode on a buffer, what you're doing may not work anyway, most likely. (I don't remember if -f executes in the previous file's buffer or not.) Better is to put this in your .emacs: (setq auto-mode-alist (append auto-mode-alist '(("/Mail/draft$" . text-mode)))) (Approximate; I rarely get the (append) vs. (list) right. I've got the actual code at work, but the modems are screwed up so I can't grab it....) If you use a draft folder, you can hardcode that into the regexp or you can write code to extract it from .mh_profile. Hope this helps a little, ++Brandon -- Me: Brandon S. Allbery Ham: KB8JRR on 2m, 220, 440, 1200 Internet: allbery@NCoast.ORG (QRT on HF until local problems fixed) America OnLine: KB8JRR // Delphi: ALLBERY AMPR: kb8jrr.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery KB8JRR @ WA8BXN.OH