🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189443

Re: help with include file...

#189443
From: Kyle Jones
Date: Sat, 02 Feb 1991 00:40
20 lines
1223 bytes
speelmo@bronze.ucs.indiana.edu (Lance Speelmon - UCS) writes:
 > Is there any way to get emacs to look in the current working
 > directory, instead of /tmp, when including a file????

If we assume you're using a mail or news-posting program that
calls Emacs to compose a message file in /tmp, this question
suddenly makes much more sense.

Put this in your .emacs file:

(setq find-file-hooks (cons 'if-/tmp-goto-cwd find-file-hooks))
(setq find-file-not-found-hooks
      (cons 'if-/tmp-goto-cwd find-file-not-found-hooks))

(defun if-/tmp-goto-cwd ()
  (if (string-match "^/tmp" buffer-file-name)
      (setq default-directory
	    (save-excursion (set-buffer "*scratch*")
			    default-directory )))
  nil )
Technical Details
Message-ID: <120857@uunet.UU.NET>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wendy-fate.uu.net
References: <1991Feb1.215200.18936@bronze.ucs.indiana.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,8fc22aa4342a408
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-02-01 21:19:35 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wendy-fate.uu.net
From: kyle@wendy-fate.uu.net (Kyle Jones)
Newsgroups: gnu.emacs.help
Subject: Re: help with include file...
Message-ID: <120857@uunet.UU.NET>
Date: 2 Feb 91 00:40:00 GMT
References: <1991Feb1.215200.18936@bronze.ucs.indiana.edu>
Sender: kyle@uunet.UU.NET
Lines: 20