Hi
I'd like to know if there exists a simple elisp function that I can
call and just get the present working directory.
I tried (pwd) but it gives a prefix. For example:
(pwd)
"Directory C:\\emacs-22.2\\bin/"
Which prefixes "Directory" to the result. I could just strip that bit
out but I'd like to know if there's an easier way.
Another hack I tried is:
(defun get-pwd-hack ()
(let* ((buffer-name (buffer-name))
(buffer-file-name (buffer-file-name))
(bnl (length buffer-name))
(bfnl (length buffer-file-name)))
(substring buffer-file-name 0 (- bfnl (1+ bnl)))))
Which will fail if I'm in, say, the *scratch* buffer.
Thanks
Vijay