summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric M. Ludlam <zappo@gnu.org>2001-02-12 16:33:03 +0000
committerEric M. Ludlam <zappo@gnu.org>2001-02-12 16:33:03 +0000
commit68514d48aa7a9b75b0cde8072379845669c5bb02 (patch)
tree4be4caba7f8df2e29aa670e51823d8a09a441eee
parent60222d69c6d0c46532c9f1f7824f2c7c992da39e (diff)
downloademacs-68514d48aa7a9b75b0cde8072379845669c5bb02.tar.gz
(speedbar-frame-parameters): No toolbar lines.
(speedbar-line-file): Return nil if not a file. (speedbar-buffers-line-path): Return file for tags, and dir for files.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/speedbar.el30
2 files changed, 26 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 87eb632dbdc..bcfa6aaa26c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-12 Eric M. Ludlam <zappo@choochoo.ultranet.com>
+
+ * speedbar.el (speedbar-frame-parameters): No toolbar lines.
+ (speedbar-line-file): Return nil if not a file.
+ (speedbar-buffers-line-path): Return file for tags, and dir for files.
+
2001-02-12 Michael Kifer <kifer@cs.sunysb.edu>
* ediff-diff.el (ediff-make-diff2-buffer): Removed bogus checks
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index f60f7030ebc..97e2a582f48 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1,9 +1,9 @@
;;; speedbar --- quick access to files and tags in a frame
-;;; Copyright (C) 1996, 97, 98, 99, 00 Free Software Foundation
+;;; Copyright (C) 1996, 97, 98, 99, 2000, 01 Free Software Foundation
;; Author: Eric M. Ludlam <zappo@gnu.org>
-;; Version: 0.11
+;; Version: 0.11a
;; Keywords: file, tags, tools
;; This file is part of GNU Emacs.
@@ -347,6 +347,7 @@ between different directories."
(width . 20)
(border-width . 0)
(menu-bar-lines . 0)
+ (tool-bar-lines . 0)
(unsplittable . t))
"*Parameters to use when creating the speedbar frame in Emacs.
Any parameter supported by a frame may be added. The parameter `height'
@@ -3294,7 +3295,9 @@ directory, then it is the directory name."
(if f
(let* ((depth (string-to-int (match-string 1)))
(path (speedbar-line-path depth)))
- (concat path f))
+ (if (file-exists-p (concat path f))
+ (concat path f)
+ nil))
nil))))
(defun speedbar-goto-this-file (file)
@@ -4030,13 +4033,20 @@ If TEMP is non-nil, then clicking on a buffer restores the previous display."
(defun speedbar-buffers-line-path (&optional depth)
"Fetch the full path to the file (buffer) specified on the current line.
Optional argument DEPTH specifies the current depth of the back search."
- (end-of-line)
- ;; 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 (file-name-directory (buffer-file-name buffer))))))
+ (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 (save-excursion
+ (end-of-line)
+ (eq start (point)))
+ (file-name-directory (buffer-file-name buffer))
+ (buffer-file-name buffer))))))))
(defun speedbar-buffer-click (text token indent)
"When the users clicks on a buffer-button in speedbar.