🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #312

Re: Epoch uses home directory instead of current directory

#312
From: Jerry
Date: Thu, 01 Oct 1992 19:26
54 lines
2591 bytes
The normal response is to say "Your shell does not properly set and/or
maintain the PWD environment variable."  I think, however, that it is
a mistake to assume that all shells do this.  Here is a drop in
replacement for the function of the same name in the
epoch-lisp/startup.el file.  You will need to make a similar change to
lisp/startup.el as well (at bottom of this message).  This solves the
problem here on our Suns (typically "sh" followed by "cd" followed by
"epoch").

The original fix was posted to the net by Andy (ange-ftp) Norman, I
believe.

-Jerry

---------------- put this in epoch-lisp/startup.el ----------------

(defun normal-top-level ()
  (if command-line-processed
      (message "Back to top level.")
    (setq command-line-processed t)
    ;; In presence of symlinks, switch to cleaner form of default directory.
    (if (and (not (eq system-type 'vax-vms))
	     (getenv "PWD")
	     (equal (nthcdr 10 (file-attributes default-directory))
		    (nthcdr 10 (file-attributes (getenv "PWD")))))
	(setq default-directory (file-name-as-directory (getenv "PWD"))))
    (unwind-protect
      (progn
	(if (boundp 'epoch::version)
	  (run-hooks 'epoch-setup-hook))
	(command-line))
      (and term-setup-hook
	   (funcall term-setup-hook))
      (and window-setup-hook
	   (funcall window-setup-hook)))))     

---------------- put this in lisp/startup.el ----------------

(defun normal-top-level ()
  (if command-line-processed
      (message "Back to top level.")
    (setq command-line-processed t)
    ;; In presence of symlinks, switch to cleaner form of default directory.
    (if (and (not (eq system-type 'vax-vms))
	     (getenv "PWD")
	     (equal (nthcdr 10 (file-attributes default-directory))
		    (nthcdr 10 (file-attributes (getenv "PWD")))))
	(setq default-directory (file-name-as-directory (getenv "PWD"))))
    (unwind-protect
	(command-line)
      (and term-setup-hook
	   (funcall term-setup-hook))
      (and window-setup-hook
	   (funcall window-setup-hook)))))
Technical Details
Message-ID: <9210011926.AA12579@banach>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!math.ep.utexas.EDU!jerry
References: <1992Oct1.155612.12369@fcom.cc.utah.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!math.ep.utexas.EDU!jerry
From: jerry@math.ep.utexas.EDU (Jerry)
Subject: Re: Epoch uses home directory instead of current directory
Message-ID: <9210011926.AA12579@banach>
Sender: daemon@cis.ohio-state.edu
Organization: Department of Mathematical Sciences--University of Texas at El Paso
References: <1992Oct1.155612.12369@fcom.cc.utah.edu>
Distribution: gnu
Date: Thu, 1 Oct 1992 19:26:55 GMT
Lines: 54