Directory function is called for in Emacs/elisp -
how can find directory function being called from?
for example, if call line
(defconst dir default-directory)
the value of dir directory fine containing above line is, not directory calling from.
thanks in advance
the default behaviour in emacs use directory associated file being "visited" in current buffer. so,
(file-name-directory (buffer-file-name))
should give directory name of file of current buffer (i.e., 1 working @ time, custom lisp function called).
if not sure, whether custom function called in context of buffer, has file name associated it, should test this:
(let ((file (buffer-file-name))) (if (not file) (progn ... no file name here ...) ... ok, file name available ...))
Comments
Post a Comment