🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Tom Crook Thu, 01 Oct 1992 15:56
Epoch uses home directory instead of current directory
#305
Author: Tom Crook
Date: Thu, 01 Oct 1992 15:56
16 lines
1097 bytes
An Epoch user I know has the following problem.  When he attempts to
start epoch with a filename argument, Epoch always uses his home
directory rather than the current working directory.  For example: he
is in the subdirectory ~/code and wants to edit an existing file foo.c
so he types:

	epoch foo.c

Epoch starts up and creates a new file ~/foo.c instead of editing the
existing file ~/code/foo.c

Can anyone tell us why Epoch does not grab the current working directory
and is defaulting to the home directory?

He is running on an HP/Apollo 425t with Domain 10.3.5.  Epoch was
compiled using Domain's BSD4.3 emulation.
Re: Epoch uses home directory instead of current directory
#312
Author: 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)))))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads