Function: speedbar-buffers-line-directory

speedbar-buffers-line-directory is a byte-compiled function defined in speedbar.el.gz.

Signature

(speedbar-buffers-line-directory &optional DEPTH)

Documentation

Fetch the directory of the file (buffer) specified on the current line.

Optional argument DEPTH specifies the current depth of the back search.

Source Code

;; Defined in /usr/src/emacs/lisp/speedbar.el.gz
(defun speedbar-buffers-line-directory (&optional _depth)
  "Fetch the directory of the file (buffer) specified on the current line.
Optional argument DEPTH specifies the current depth of the back search."
  (save-excursion
    (end-of-line)
    (let ((start (point)))
      ;; Buffers are always at level 0
      (if (not (re-search-backward "^0:" nil t))
	  nil
	(let* ((bn (speedbar-line-text))
	       (buffer (if bn (get-buffer bn))))
	  (if buffer
	      (if (eq start (line-end-position))
		  (or (with-current-buffer buffer default-directory)
		      "")
		(buffer-file-name buffer))))))))