;;
;;; Customizing and Developing for speedbar
;;
-;; Please see the speedbar manual for informaion.
+;; Please see the speedbar manual for information.
;;
;;; Notes:
;;
'trim - trim large directories to only show the last few.
nil - no trimming."
:group 'speedbar
- :type '(radio (const :tag "Span large directories over mutiple lines."
+ :type '(radio (const :tag "Span large directories over multiple lines."
span)
(const :tag "Trim large directories to only show the last few."
trim)
(substring (car extlist) 1)))
(setq regex2 (concat regex2 (if regex2 "\\|" "") (car extlist))))
(setq extlist (cdr extlist)))
- ;; concat all the sub-exressions together, making sure all types
- ;; of parts exist during concatination.
+ ;; Concatenate all the subexpressions together, making sure all types
+ ;; of parts exist during concatenation.
(concat "\\("
(if regex1 (concat "\\(\\.\\(" regex1 "\\)\\)") "")
(if (and regex1 regex2) "\\|" "")
before speedbar has been loaded."
:group 'speedbar
:type '(repeat (regexp :tag "Directory Regexp"))
- :set (lambda (sym val)
+ :set (lambda (_sym val)
(setq speedbar-ignored-directory-expressions val
speedbar-ignored-directory-regexp
(speedbar-extension-list-to-regex val))))
file completion."
:group 'speedbar
:type '(repeat (regexp :tag "Extension Regexp"))
- :set (lambda (sym val)
+ :set (lambda (_sym val)
(set 'speedbar-supported-extension-expressions val)
(set 'speedbar-file-regexp (speedbar-extension-list-to-regex val))))
#'speedbar-frame-mode
(if (featurep 'xemacs)
(append speedbar-frame-plist
- ;; This is a hack to get speedbar to iconfiy
+ ;; This is a hack to get speedbar to iconify
;; with the selected frame.
(list 'parent (selected-frame)))
speedbar-frame-parameters)
(if (not v)
(setq speedbar-special-mode-expansion-list t)
;; If it is autoloaded, we need to load it now so that
- ;; we have access to the varialbe -speedbar-menu-items.
+ ;; we have access to the variable -speedbar-menu-items.
;; Is this XEmacs safe?
(let ((sf (symbol-function v)))
(if (and (listp sf) (eq (car sf) 'autoload))
nl))
))
-(defun speedbar-directory-buttons (directory index)
+(defun speedbar-directory-buttons (directory _index)
"Insert a single button group at point for DIRECTORY.
Each directory part is a different button. If part of the directory
matches the user directory ~, then it is replaced with a ~.
(if (= index 0)
;; If the shown files variable has extra directories, then
;; it is our responsibility to redraw them all
- ;; Luckilly, the nature of inserting items into this list means
- ;; that by reversing it, we can easilly go in the right order
+ ;; Luckily, the nature of inserting items into this list means
+ ;; that by reversing it, we can easily go in the right order
(let ((sf (cdr (reverse speedbar-shown-directories))))
(setq speedbar-shown-directories
(list (expand-file-name default-directory)))
- ;; exand them all as we find them
+ ;; Expand them all as we find them.
(while sf
(if (speedbar-goto-this-file (car sf))
(progn
;; Go through all our bins Stick singles into our
;; junk-list, everything else as sublsts in work-list.
;; If two neighboring lists are both small, make a grouped
- ;; group combinding those two sub-lists.
+ ;; group combining those two sub-lists.
(setq diff-idx 0)
(while (> 256 diff-idx)
;; The bins contents are currently in forward order.
Optional argument ARG indicates that any cache should be flushed."
(interactive "P")
(speedbar-expand-line arg)
- ;; Now, inside the area expaded here, expand all subnodes of
+ ;; Now, inside the area expanded here, expand all subnodes of
;; the same descendant type.
(save-excursion
(speedbar-next 1) ;; Move into the list.
;; hidden by default anyway. Yay! It's easy.
)
-(defun speedbar-find-file (text token indent)
+(defun speedbar-find-file (text _token indent)
"Speedbar click handler for filenames.
TEXT, the file will be displayed in the attached frame.
TOKEN is unused, but required by the click handler. INDENT is the
(speedbar-find-file-in-frame (concat cdd text))
(speedbar-stealthy-updates)
(run-hooks 'speedbar-visiting-file-hook)
- ;; Reset the timer with a new timeout when cliking a file
+ ;; Reset the timer with a new timeout when clicking a file
;; in case the user was navigating directories, we can cancel
;; that other timer.
(speedbar-set-timer dframe-update-speed))
(dframe-maybee-jump-to-attached-frame))
-(defun speedbar-dir-follow (text token indent)
+(defun speedbar-dir-follow (text _token indent)
"Speedbar click handler for directory names.
Clicking a directory will cause the speedbar to list files in
the subdirectory TEXT. TOKEN is an unused requirement. The
(speedbar-center-buffer-smartly)
(save-excursion (speedbar-stealthy-updates)))
-(defun speedbar-directory-buttons-follow (text token indent)
+(defun speedbar-directory-buttons-follow (_text token _indent)
"Speedbar click handler for default directory buttons.
TEXT is the button clicked on. TOKEN is the directory to follow.
INDENT is the current indentation level and is unused."
(cond ((string-match "+" text) ;we have to expand this file
(let* ((fn (expand-file-name (concat (speedbar-line-directory indent)
token)))
- (mode nil)
(lst (speedbar-fetch-dynamic-tags fn)))
;; if no list, then remove expando button
(if (not lst)
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))
-(defun speedbar-tag-find (text token indent)
+(defun speedbar-tag-find (_text token indent)
"For the tag TEXT in a file TOKEN, go to that position.
INDENT is the current indentation level."
(let ((file (speedbar-line-directory indent)))
(select-frame f))
(speedbar-find-file-in-frame file)
(save-excursion (speedbar-stealthy-updates))
- ;; Reset the timer with a new timeout when cliking a file
+ ;; Reset the timer with a new timeout when clicking a file
;; in case the user was navigating directories, we can cancel
;; that other timer.
(speedbar-set-timer dframe-update-speed)
)
"Menu item elements shown when displaying a buffer list.")
-(defun speedbar-buffer-buttons (directory zero)
+(defun speedbar-buffer-buttons (_directory _zero)
"Create speedbar buttons based on the buffers currently loaded.
DIRECTORY is the directory of the currently active buffer, and ZERO is 0."
(speedbar-buffer-buttons-engine nil))
-(defun speedbar-buffer-buttons-temp (directory zero)
+(defun speedbar-buffer-buttons-temp (_directory _zero)
"Create speedbar buttons based on the buffers currently loaded.
DIRECTORY is the directory of the currently active buffer, and ZERO is 0."
(speedbar-buffer-buttons-engine t))
(defun speedbar-buffers-tail-notes (buffer)
"Add a note to the end of the last tag line.
Argument BUFFER is the buffer being tested."
- (let (mod ro)
- (with-current-buffer buffer
- (setq mod (buffer-modified-p)
- ro buffer-read-only))
- (if ro (speedbar-insert-button "%" nil nil nil nil t))))
+ (when (with-current-buffer buffer buffer-read-only)
+ (speedbar-insert-button "%" nil nil nil nil t)))
(defun speedbar-buffers-item-info ()
"Display information about the current buffer on the current line."
(with-current-buffer buffer (buffer-size))
(or (buffer-file-name buffer) "<No file>"))))))
-(defun speedbar-buffers-line-directory (&optional depth)
+(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
"")
(buffer-file-name buffer))))))))
-(defun speedbar-buffer-click (text token indent)
+(defun speedbar-buffer-click (text token _indent)
"When the users clicks on a buffer-button in speedbar.
TEXT is the buffer's name, TOKEN and INDENT are unused."
(if dframe-power-click