;;; speedbar --- quick access to files and tags in a frame
-;; Copyright (C) 1996-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2014 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: file, tags, tools
;;
;;; Notes:
;;
-;; Users of really old emacsen without the need timer functions
-;; will not have speedbar updating automatically. Use "g" to refresh
-;; the display after changing directories. Remember, do not interrupt
-;; the stealthy updates or your display may not be completely
-;; refreshed.
-;;
;; AUC-TEX users: The imenu tags for AUC-TEX mode don't work very
;; well. Use the imenu keywords from tex-mode.el for better results.
;;
-;; This file requires the library package assoc (association lists)
-;; assoc should be available in all modern versions of Emacs.
-;; The custom package is optional (for easy configuration of speedbar)
-;; http://www.dina.kvl.dk/~abraham/custom/
-;; custom is available in all versions of Emacs version 20 or better.
-;;
;;; Developing for speedbar
;;
;; Adding a speedbar specialized display mode:
:group 'etags
:group 'tools
:group 'convenience
+ :link '(custom-manual "(speedbar) Top")
+ :link '(info-link "(speedbar) Customizing")
; :version "20.3"
)
(defgroup speedbar-faces nil
"Faces used in speedbar."
:prefix "speedbar-"
+ :link '(info-link "(speedbar) Frames and Faces")
:group 'speedbar
:group 'faces)
(defgroup speedbar-vc nil
"Version control display in speedbar."
+ :link '(info-link "(speedbar) Version Control")
:prefix "speedbar-"
:group 'speedbar)
(defcustom speedbar-query-confirmation-method 'all
"Query control for file operations.
-The 'always flag means to always query before file operations.
+The 'all flag means to always query before file operations.
The 'none-but-delete flag means to not query before any file
operations, except before a file deletion."
:group 'speedbar
;; with the selected frame.
(list 'parent (selected-frame)))
speedbar-frame-parameters)
- speedbar-before-delete-hook
- speedbar-before-popup-hook
- speedbar-after-create-hook)
+ 'speedbar-before-delete-hook
+ 'speedbar-before-popup-hook
+ 'speedbar-after-create-hook)
;; Start up the timer
(if (not speedbar-frame)
(speedbar-set-timer nil)
selected. If the speedbar frame is active, then select the attached frame."
(interactive)
(speedbar-reset-scanners)
- (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode
- (lambda () (let ((speedbar-update-flag t))
- (speedbar-timer-fn)))))
+ (dframe-get-focus 'speedbar-frame 'speedbar-frame-mode)
+ (let ((speedbar-update-flag t))
+ (speedbar-timer-fn)))
(defsubst speedbar-frame-width ()
"Return the width of the speedbar frame in characters.
(dframe-select-attached-frame speedbar-frame)
;; make sure we at least choose a window to
;; get a good directory from
- (if (window-minibuffer-p (selected-window))
+ (if (window-minibuffer-p)
nil
;; Check for special modes
(speedbar-maybe-add-localized-support (current-buffer))
(run-hook-with-args 'speedbar-vc-in-control-hook directory name)
))
-;; Objet File scanning
+;; Object File scanning
(defun speedbar-check-objects ()
"Scan all files in a directory, and for each see if there is an object.
See `speedbar-check-obj-this-line' and `speedbar-obj-alist' for how
(set-buffer speedbar-buffer)
(if (<= (count-lines (point-min) (point-max))
- (1- (window-height (selected-window))))
+ (1- (window-height)))
;; whole buffer fits
(let ((cp (point)))
(setq end (point-max)))))
;; Now work out the details of centering
(let ((nl (count-lines start end))
- (wl (1- (window-height (selected-window))))
+ (wl (1- (window-height)))
(cp (point)))
(if (> nl wl)
;; We can't fit it all, so just center on cursor
nil
;; we need to do something...
(goto-char start)
- (let ((newcent (/ (- (window-height (selected-window)) nl) 2))
+ (let ((newcent (/ (- (window-height) nl) 2))
(lte (count-lines start (point-max))))
- (if (and (< (+ newcent lte) (window-height (selected-window)))
- (> (- (window-height (selected-window)) lte 1)
+ (if (and (< (+ newcent lte) (window-height))
+ (> (- (window-height) lte 1)
newcent))
- (setq newcent (- (window-height (selected-window))
+ (setq newcent (- (window-height)
lte 1)))
(recenter newcent))))
(goto-char cp))))))
(defun speedbar-recenter ()
"Recenter the current buffer so point is in the center of the window."
- (recenter (/ (window-height (selected-window)) 2)))
+ (recenter (/ (window-height) 2)))
\f
;;; Color loading section.