mailing-list for TeXmacs Users

Text archives Help


Re: Finding style file in same directory as document


Chronological Thread 
  • From: David Allouche <address@hidden>
  • To: address@hidden
  • Subject: Re: Finding style file in same directory as document
  • Date: Wed, 26 Dec 2001 21:02:47 +0100

On Wednesday 26 December 2001 09:06, Andrey G. Grozin wrote:
> On Wed, 26 Dec 2001, David Allouche wrote:
> > In most modern desktop setups, "." will always be $HOME since TeXmacs
> > will be started from a laucher bar or an application menu. So TeXmacs
> > will NOT find the custom stylesheet.
>
> Are modern desktop setups really THAT bad? I always thought that starting
> applications from some predefined directory is the most annoying "feature"
> of Windows.

Of course, you can always start a program from the terminal emulator in any
directory you want. You can also set your lauchers so that they cd to some
directory before starting a specific application. But 99% of the time, people
(including myself) just do not bother, and anyway that would not fix this
specific problem.

Anyway, as I will explain in further, a well designed graphical application
ought not be affected by the directory from which it was started.

> > -- Change the working directory to the directory where the current
> > document is located. For consistency, this should be done every time a
> > TeXmacs window gets the focus and every time the buffer associated with
> > the currently focused window is changed. Unamed documents could be
> > associated with the directory where TeXmacs was started. This behavior is
> > inspired by Emacs.
>
> I am definitely against this approach. I don't want an application to cd
> behind my back. I know from which directory I started it, and I prefer it
> to be the working directory until I explicitely do something.

Please, can you explain what you mean by "the working directory"? Not "the
value returned by the getcwd() POSIX call", but in which ways it affects
TeXmacs' behavior, and, indirectly, you as a user. I'm not purposefully
stupid, I want to know what the working directory means to you as a user
interface feature.

> > -- Define an new environment variable that holds name of the directory
> > where the current document is located, one could name it
> > TEXMACS_DOCUMENT_PATH. The value of this variable should be updated in
> > the same way as the working directory in the previous solution. This
> > would allow the best control from the TEXMACS_*_PATH environment
> > variables.
>
> This may be reasonable. But it seems to me that it's easier just to start
> texmacs from the right directory.

Thank you for your input. Even if I do not agree with the reasons you gave,
this is definitely an interesting point of view.

Now, I'd like to discuss the semantics of the working directory in WIMP
(window icon menu pointer) user interface. It seems to me that you have a
very strong command line interface background and you could find my
perspective interesting.

First I want to say that I started in computing with the Apple Macintosh.
When I started programming, I remember I found the concept of working
directory completely incomprehensible, far more than pointer arithmetic and
casting of numbers in C. The reason is that, in WIMP user interfaces, there
is NO concept of a single current directory associated with an application.

In the WIMP desktops, the only things that have a location on disk are files
and directories. Running applications have no apparent intrinsic location.
Once you work with a document or a directory, you have a window open, and
only then you can think of a current location, and this location can only be
the location of the document displayed in the currently active window. So, a
running application is conceptually associated with as many "working
directories" as open documents.

The fact that the working directory defaults to the $HOME directory in Un*x
and Win32 desktops is a logical consequence of the graphical desktop not
being associated with any given directory. Actually, your terminal emulator
is associated with a working directory, and so is your file manager window
(btw, if you attach a terminal to a file manager, à la Midnight Commander or
Konqueror, the PWD of the attached terminal will be continuously updated to
match that of the file manager). But which directory ought to be associated
with the screen background you click to get your application menu
(WindowMaker), or with the panel window that is used to lauch applications
(GNOME, KDE or Windows)?

None... But since applications running on top of the desktop will not exist
without a working directory, you just have to give them one, but it is NOT a
user interface feature, just a piece of legacy API. That is why the phrase
"start the application from the right directory" simply does not make sense
from a WIMP perspective. One DO NOT start an application FROM a directory,
one starts an application by clicking a (conceptually) location-less
launcher, or by opening a document. Actually, the working directory is not
relevant to the WIMP savyy application.

So, when you are using TeXmacs, in which ways can you be affected by the
working directory?

Maybe the default location of the file selection dialogs? But it is also
perfectly legitimate for this default to be the last directory used in a file
selection dialog, because the user will be more likely to open its next file
in the same directory as the previous one.

Maybe the directory from which linked files (like external images) are found?
But the policy in TeXmacs, and more generally in the definition of relative
URL is to use the location of the document containing the link as the base
location.

Maybe the location you are in when you start a subshell? Ah, that ought to be
an interesting problem, since that is a question that do not arise in pure
WIMP environments. The solution that has been adopted by Emacs programmers is
to use the location of the buffer active at the time the sub-shell was
created, and I do not think one can name Emacs programmers WIMP bigots...

So, the interpretation of the "." in some environement variable used in a
WIMP application is not obvious. Since the environment variable is used to
locate stuff useful to process a document's data, it MAKES sense to
interprete it as the location of the document.

One place where the actual working directory is significant is when starting
a "Session". The CLI application running the session will be most visibly
affected by the working directory. But why this directory should not default
to the location of the document containing the session? If the session
depends on some external data files, I think the best default place for such
files would be in the same directory as the TeXmacs document...

Overall, the notion of working directory in WIMP is not only
document-specific, it is also feature-specific.

If I have overlooked something, or if you think I am plain wrong, please tell
me. I do not intend to start a troll, I just want to have a constructive
discussion in order to find the best solution to improve the usability of
TeXmacs.


Best regards.



Archive powered by MHonArc 2.6.19.

Top of page