[comp.windows.x] HELP**EMACS ON X***

manoj@acsu.buffalo.edu (Manoj Mehta) (02/15/91)

This is my second posting  asking for help on the same subject.
Will sombody know what could be the problem with my
x windows , as when i run emacs on x windows it does
ont pick files which are present in that dir.
It will pick files only from the home dir.
I LL REALLY APPRECIATE THE HELP ON THIS MATTER....
THANX
manoj

khera@thneed.cs.duke.edu (Vick Khera) (02/16/91)

In article <59846@eerie.acsu.Buffalo.EDU> manoj@acsu.buffalo.edu (Manoj Mehta) writes:

   This is my second posting asking for help on the same subject.
   Will sombody know what could be the problem with my x windows , as
   when i run emacs on x windows it does ont pick files which are
   present in that dir.  It will pick files only from the home dir.
   I'LL REALLY APPRECIATE THE HELP ON THIS MATTER....  THANX manoj

i tried to reply to your first message via e-mail, but it bonced back
from your machine, acsu.buffalo.edu, claiming that it had no idea who
you, manoj@acsu.buffalo.edu, were.  if you want help, at least let
people have a way of getting in touch with you.  here's my original
response:


first off, this has *nothing* to do with X.  assuming you are running
GNU emacs, which it looks like, it has everything to do with the shell
you are running in.  some shells will keep and update an environment
variable PWD.  if you switch shells, and the other shell doesn't
update PWD, then you will have problems.  emacs believes the value of
PWD to be your working directory.  the thing to do is to unset the
variable PWD: in csh, unsetenv PWD will do the trick.  i'm not sure
about other shells.  then emacs will work as you expect.

send questions related to GNU emacs to gnu.emacs.help or comp.emacs,
not here.

								v.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vick Khera, Gradual Student/Systems Guy   Department of Computer Science
ARPA:   khera@cs.duke.edu                 Duke University
UUCP:   ...!mcnc!duke!khera               Durham, NC 27706     (919) 660-6528

dob@inel.GOV (Dave Brooks) (02/16/91)

I tried mailing to this person twice, but it just bounces.  sorry for the
waste of bandwidth.

 > 
 >    From: manoj@acsu.buffalo.edu (Manoj Mehta)
 >    Newsgroups: comp.windows.x
 >    Date: 14 Feb 91 19:44:27 GMT
 >    Distribution: usa
 >    Organization: SUNY Buffalo
 >    Nntp-Posting-Host: kofke.eng.buffalo.edu
 > 
 >    This is my second posting  asking for help on the same subject.
 >    Will sombody know what could be the problem with my
 >    x windows , as when i run emacs on x windows it does
 >    ont pick files which are present in that dir.
 >    It will pick files only from the home dir.
 >    I LL REALLY APPRECIATE THE HELP ON THIS MATTER....
 >    THANX
 >    manoj
 > 
 > since i use emacs within X, and it behaves quite normally, i would imagine
 > that your problem is not necessarily related to X.  first off, let's assume
 > that when you run emacs you are getting the binary, not some script which
 > cd's to your home directory.  next, let's assume that there's nothing in
 > your .emacs file which would cd to home, as well.
 > 
 > usually, if i bring up emacs and want to pick files from a directory, i'll
 > specify the directory as an argument to emacs.  let's say i was in ~/foo,
 > then i would do this:
 > 
 > emacs . &
 > 
 > that works for me.  alternatively, you could go 'emacs ~/foo &'.  i haven't
 > tried just 'emacs &' in the context you described, but since the example i
 > gave you works, i wouldn't worry about it.
 > 
 > you might try posting to gnu.emacs.help for future emacs questions.
 > 
 > dlb

danw@tbird9.prime.com (Dan Westerberg) (02/16/91)

I too have replied via e-mail, it hasn't bounced yet.  Since one solution has
been posted here, I'll post another.

Instead of doing an 'unsetenv PWD' as Vick Khera suggests, you could also
comment out the lines in emacs/lisp/startup.el.  The offending line are:

;;    (if (and (not (eq system-type 'vax-vms))
;;           (getenv "PWD"))
;;      (setq default-directory (file-name-as-directory (getenv "PWD"))))

Note that we have them commented out because we run both csh and tcsh around
here.  If you do make the lisp change, be sure to re-compile the file using
byte-compile-file.

dan

-- 
===============================================================================
|                                                                             |
| Daniel I. Westerberg                 email:  danw@tbird9.prime.com (or)     |
| Prime Computer Inc.                          danw@s49.prime.com             |
| MS 10-9                                                                     |
| 500 Old Connecticut Path             phone:  508-620-2800  x3644            |
| Framingham,  MA  10701                 fax:  508-879-9098                   |
|                                                                             |
===============================================================================