Commit 6b3eac8d authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

Initial revision

parent a55d9b3b
;;; speedbar --- quick access to files and tags
;;; Copyright (C) 1996, 97, 98 Free Software Foundation
;;
;; Author: Eric M. Ludlam <zappo@gnu.ai.mit.edu>
;; Version: 0.6.2
;; Keywords: file, tags, tools
;;
;; This file is part of GNU Emacs.
;;
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;
;; The speedbar provides a frame in which files, and locations in
;; files are displayed. These items can be clicked on with mouse-2
;; in order to make the last active frame display that file location.
;;
;; Starting Speedbar:
;;
;; If speedbar came to you as a part of Emacs, simply type
;; `M-x speedbar', and it will be autoloaded for you. A "Speedbar"
;; submenu will be added under "Tools".
;;
;; If speedbar is not a part of your distribution, then add
;; this to your .emacs file:
;;
;; (autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
;; (autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
;;
;; If you want to choose it from a menu, you can do this:
;;
;; Emacs:
;; (define-key-after (lookup-key global-map [menu-bar tools])
;; [speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
;;
;; XEmacs:
;; (add-menu-button '("Tools")
;; ["Speedbar" speedbar-frame-mode
;; :style toggle
;; :selected (and (boundp 'speedbar-frame)
;; (frame-live-p speedbar-frame)
;; (frame-visible-p speedbar-frame))]
;; "--")
;;
;; If you want to access speedbar using only the keyboard, do this:
;;
;; (global-set-key [(f4)] 'speedbar-get-focus)
;;
;; This will let you hit f4 (or whatever key you choose) to jump
;; focus to the speedbar frame. Pressing it again will bring you back
;; to the attached frame. Pressing RET or e to jump to a file
;; or tag will move you back to the attached frame. The command
;; `speedbar-get-focus' will also create a speedbar frame if it does
;; not exist.
;;
;; Customizing Speedbar:
;;
;; Once a speedbar frame is active, it takes advantage of idle time
;; to keep its contents updated. The contents is usually a list of
;; files in the directory of the currently active buffer. When
;; applicable, tags in the active file can be expanded.
;;
;; To add new supported files types into speedbar, use the function
;; `speedbar-add-supported-extension' If speedbar complains that the
;; file type is not supported, that means there is no built in
;; support from imenu, and the etags part wasn't set up correctly. You
;; may add elements to `speedbar-supported-extension-expressions' as long
;; as it is done before speedbar is loaded.
;;
;; To prevent speedbar from following you into certain directories
;; use the function `speedbar-add-ignored-path-regexp' too add a new
;; regular expression matching a type of path. You may add list
;; elements to `speedbar-ignored-path-expressions' as long as it is
;; done before speedbar is loaded.
;;
;; To add new file types to imenu, see the documentation in the
;; file imenu.el that comes with emacs. To add new file types which
;; etags supports, you need to modify the variable
;; `speedbar-fetch-etags-parse-list'.
;;
;; If the updates are going too slow for you, modify the variable
;; `speedbar-update-speed' to a longer idle time before updates.
;;
;; If you navigate directories, you will probably notice that you
;; will navigate to a directory which is eventually replaced after
;; you go back to editing a file (unless you pull up a new file.)
;; The delay time before this happens is in
;; `speedbar-navigating-speed', and defaults to 10 seconds.
;;
;; Users XEmacs previous to 20 may want to change the default
;; timeouts for `speedbar-update-speed' to something longer as XEmacs
;; doesn't have idle timers, the speedbar timer keeps going off
;; arbitrarily while you're typing. It's quite pesky.
;;
;; Users of really old emacsen without the needed timers will not
;; have speedbar updating automatically. Use "r" to refresh the
;; display after changing directories. Remember, do not interrupt the
;; stealthy updates or your display may not be completely refreshed.
;;
;; See optional file `speedbspec.el' for additional configurations
;; which allow speedbar to create specialized lists for special modes
;; that are not file-related.
;;
;; 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)
;; and the package custom (for easy configuration of speedbar)
;; http://www.dina.kvl.dk/~abraham/custom/
;;
;; If you do not have custom installed, you can still get face colors
;; by modifying the faces directly in your .emacs file, or setting
;; them in your .Xdefaults file.
;; Here is an example .Xdefaults for a dark background:
;;
;; emacs*speedbar-button-face.attributeForeground: Aquamarine
;; emacs*speedbar-selected-face.attributeForeground: red
;; emacs*speedbar-selected-face.attributeUnderline: true
;; emacs*speedbar-directory-face.attributeForeground: magenta
;; emacs*speedbar-file-face.attributeForeground: green3
;; emacs*speedbar-highlight-face.attributeBackground: sea green
;; emacs*speedbar-tag-face.attributeForeground: yellow
;;; Speedbar updates can be found at:
;; ftp://ftp.ultranet.com/pub/zappo/speedbar*.tar.gz
;;
;;; Change log:
;; 0.1 Initial Revision
;; 0.2 Fixed problem with x-pointer-shape causing future frames not
;; to be created.
;; Fixed annoying habit of `speedbar-update-contents' to make
;; it possible to accidentally kill the speedbar buffer.
;; Clicking directory names now only changes the contents of
;; the speedbar, and does not cause a dired mode to appear.
;; Clicking the <+> next to the directory does cause dired to
;; be run.
;; Added XEmacs support, which means timer support moved to a
;; platform independant call.
;; Added imenu support. Now modes are supported by imenu
;; first, and etags only if the imenu call doesn't work.
;; Imenu is a little faster than etags, and is more emacs
;; friendly.
;; Added more user control variables described in the commentary.
;; Added smart recentering when nodes are opened and closed.
;; 0.3 x-pointer-shape fixed for emacs 19.35, so I put that check in.
;; Added invisible codes to the beginning of each line.
;; Added list aproach to node expansion for easier addition of new
;; types of things to expand by
;; Added multi-level path name support
;; Added multi-level tag name support.
;; Only mouse-2 is now used for node expansion
;; Added keys e + - to edit expand, and contract node lines
;; Added longer legal file regexp for all those modes which support
;; imenu. (pascal, fortran90, ada, pearl)
;; Added pascal support to etags from Dave Penkler <dave_penkler@grenoble.hp.com>
;; Fixed centering algorithm
;; Tried to choose background independent colors. Made more robust.
;; Rearranged code into a more logical order
;; 0.3.1 Fixed doc & broken keybindings
;; Added mode hooks.
;; Improved color selection to be background mode smart
;; `nil' passed to `speedbar-frame-mode' now toggles the frame as
;; advertised in the doc string
;; 0.4a Added modified patch from Dan Schmidt <dfan@lglass.com> allowing a
;; directory cache to be maintained speeding up revisiting of files.
;; Default raise-lower behavior is now off by default.
;; Added some menu items for edit expand and contract.
;; Pre 19.31 emacsen can run without idle timers.
;; Added some patch information from Farzin Guilak <farzin@protocol.com>
;; adding xemacs specifics, and some etags upgrades.
;; Added ability to set a faces symbol-value to a string
;; representing the desired foreground color. (idea from
;; Farzin Guilak, but implemented differently)
;; Fixed problem with 1 character buttons.
;; Added support for new Imenu marker technique.
;; Added `speedbar-load-hooks' for things to run only once on
;; load such as updating one of the many lists.
;; Added `speedbar-supported-extension-expressions' which is a
;; list of extensions that speedbar will tag. This variable
;; should only be updated with `speedbar-add-supported-extension'
;; Moved configure dialog support to a separate file so
;; speedbar is not dependant on eieio to run
;; Fixed list-contraction problem when the item was at the end
;; of a sublist.
;; Fixed XEmacs multi-frame timer selecting bug problem.
;; Added `speedbar-ignored-modes' which is a list of major modes
;; speedbar will not follow when it is displayed in the selected frame
;; 0.4 When the file being edited is not in the list, and is a file
;; that should be in the list, the speedbar cache is replaced.
;; Temp buffers are now shown in the attached frame not the
;; speedbar frame
;; New variables `speedbar-vc-*' and `speedbar-stealthy-function-list'
;; added. `speedbar-update-current-file' is now a member of
;; the stealthy list. New function `speedbar-check-vc' will
;; examine each file and mark it if it is checked out. To
;; add new version control types, override the function
;; `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'.
;; The stealth list is interruptible so that long operations
;; do not interrupt someones editing flow. Other long
;; speedbar updates will be added to the stealthy list in the
;; future should interesting ones be needed.
;; Added many new functions including:
;; `speedbar-item-byte-compile' `speedbar-item-load'
;; `speedbar-item-copy' `speedbar-item-rename' `speedbar-item-delete'
;; and `speedbar-item-info'
;; If the user kills the speedbar buffer in some way, the frame will
;; be removed.
;; 0.4.1 Bug fixes
;; <mark.jeffries@nomura.co.uk> added `speedbar-update-flag',
;; XEmacs fixes for menus, and tag sorting, and quit key.
;; Modeline now updates itself based on window-width.
;; Frame is cached when closed to make pulling it up again faster.
;; Speedbars window is now marked as dedicated.
;; Added bindings: <grossjoh@charly.informatik.uni-dortmund.de>
;; Long directories are now span multiple lines autmoatically
;; Added `speedbar-directory-button-trim-method' to specify how to
;; sorten the directory button to fit on the screen.
;; 0.4.2 Add one level of full-text cache.
;; Add `speedbar-get-focus' to switchto/raise the speedbar frame.
;; Editing thing-on-line will auto-raise the attached frame.
;; Bound `U' to `speedbar-up-directory' command.
;; Refresh will now maintain all subdirectories that were open
;; when the refresh was requested. (This does not include the
;; tags, only the directories)
;; 0.4.3 Bug fixes
;; 0.4.4 Added `speedbar-ignored-path-expressions' and friends.
;; Configuration menu items not displayed if dialog-mode not present
;; Speedbar buffer now starts with a space, and is not deleted
;; ewhen the speedbar frame is closed. This prevents the invisible
;; frame from preventing buffer switches with other buffers.
;; Fixed very bad bug in the -add-[extension|path] functions.
;; Added `speedbar-find-file-in-frame' which will always pop up a frame
;; that is already display a buffer selected in the speedbar buffer.
;; Added S-mouse2 as "power click" for always poping up a new frame.
;; and always rescanning with imenu (ditching the imenu cache), and
;; always rescanning directories.
;; 0.4.5 XEmacs bugfixes and enhancements.
;; Window Title simplified.
;; 0.4.6 Fixed problems w/ dedicated minibuffer frame.
;; Fixed errors reported by checkdoc.
;; 0.5 Mode-specific contents added. Controlled w/ the variable
;; `speedbar-mode-specific-contents-flag'. See speedbspec
;; for info on enabling this feature.
;; `speedbar-load-hook' name change and pointer check against
;; major-mode. Suggested by Sam Steingold <sds@ptc.com>
;; Quit auto-selects the attached frame.
;; Ranamed `speedbar-do-updates' to `speedbar-update-flag'
;; Passes checkdoc.
;; 0.5.1 Advice from ptype@dra.hmg.gb:
;; Use `post-command-idle-hook' in older emacsen
;; `speedbar-sort-tags' now works with imenu.
;; Unknown files (marked w/ ?) can now be operated on w/
;; file commands.
;; `speedbar-vc-*-hook's for easilly adding new version control systems.
;; Checkin/out w/ vc will reset the scanners and update the * marker.
;; Fixed ange-ftp require compile time problem.
;; Fixed XEmacs menu bar bug.
;; Added `speedbar-activity-change-focus-flag' to control if the
;; focus changes w/ mouse events.
;; Added `speedbar-sort-tags' toggle to the menubar.
;; Added `speedbar-smart-directory-expand-flag' to toggle how
;; new directories might be inserted into the speedbar hierarchy.
;; Added `speedbar-visiting-[tag|file]hook' which is called whenever
;; speedbar pulls up a file or tag in the attached frame. Setting
;; this to `reposition-window' will do nice things to function tags.
;; Fixed text-cache default-directory bug.
;; Emacs 20 char= support.
;; 0.5.2 Customization
;; For older emacsen, you will need to download the new defcustom
;; package to get nice faces for speedbar
;; mouse1 Double-click is now the same as middle click.
;; No mouse pointer shape stuff for XEmacs (is there any?)
;; 0.5.3 Regressive support for non-custom enabled emacsen.
;; Fixed serious problem w/ 0.5.2 and ignored paths.
;; `condition-case' no longer used in timer fcn.
;; `speedbar-edit-line' is now smarter w/ special modes.
;; 0.5.4 Fixed more problems for Emacs 20 so speedbar loads correctly.
;; Updated some documentation strings.
;; Added customization menu item, and customized some more variables.
;; 0.5.5 Fixed so that there can be no ignored paths
;; Added .l & .lsp as lisp, suggested by: sshteingold@cctrading.com
;; You can now adjust height in `speedbar-frame-parameters'
;; XEmacs fix for use of `local-variable-p'
;; 0.5.6 Folded in XEmacs suggestions from Hrvoje Niksic <hniksic@srce.hr>
;; Several custom changes (group definitions, trim-method & others)
;; Keymap changes, and ways to add menu items.
;; Timer use changes for XEmacs 20.4
;; Regular expression enhancements.
;; 0.6 Fixed up some frame definition stuff, use more convenience fns.
;; Rehashed frame creation code for better compatibility.
;; Fixed setting of kill-buffer hook.
;; Default speedbar has no menubar, mouse-3 is popup menu,
;; XEmacs double-click capability (Hrvoje Niksic <hniksic@srce.hr>)
;; General documentation fixup.
;; 0.6.1 Fixed button-3 menu for Emacs 20.
;; 0.6.2 Added autoload tag to `speedbar-get-focus'
;;; TODO:
;; - More functions to create buttons and options
;; - filtering algorithms to reduce the number of tags/files displayed.
;; - Timeout directories we haven't visited in a while.
;; - Remeber tags when refreshing the display. (Refresh tags too?)
;; - More 'special mode support.
;; - C- Mouse 3 menu too much indirection
(require 'assoc)
(require 'easymenu)
;; From custom web page for compatibility between versions of custom:
(eval-and-compile
(condition-case ()
(require 'custom)
(error nil))
(if (and (featurep 'custom) (fboundp 'custom-declare-variable))
nil ;; We've got what we needed
;; We have the old custom-library, hack around it!
(defmacro defgroup (&rest args)
nil)
(defmacro defface (var values doc &rest args)
(` (progn
(defvar (, var) (quote (, var)))
;; To make colors for your faces you need to set your .Xdefaults
;; or set them up ahead of time in your .emacs file.
(make-face (, var))
)))
(defmacro defcustom (var value doc &rest args)
(` (defvar (, var) (, value) (, doc))))))
;; customization stuff
(defgroup speedbar nil
"File and tag browser frame."
:group 'tags
:group 'tools)
(defgroup speedbar-faces nil
"Faces used in speedbar."
:prefix "speedbar-"
:group 'speedbar
:group 'faces)
(defgroup speedbar-vc nil
"Version control display in speedbar."
:prefix "speedbar-"
:group 'speedbar)
;;; Code:
(defvar speedbar-xemacsp (string-match "XEmacs" emacs-version)
"Non-nil if we are running in the XEmacs environment.")
(defvar speedbar-xemacs20p (and speedbar-xemacsp (= emacs-major-version 20)))
(defvar speedbar-initial-expansion-list
'(speedbar-directory-buttons speedbar-default-directory-list)
"List of functions to call to fill in the speedbar buffer.
Whenever a top level update is issued all functions in this list are
run. These functions will always get the default directory to use
passed in as the first parameter, and a 0 as the second parameter.
The 0 indicates the uppermost indentation level. They must assume
that the cursor is at the position where they start inserting
buttons.")
(defvar speedbar-stealthy-function-list
'(speedbar-update-current-file speedbar-check-vc)
"List of functions to periodically call stealthily.
Each function must return nil if interrupted, or t if completed.
Stealthy functions which have a single operation should always return
t. Functions which take a long time should maintain a state (where
they are in their speedbar related calculations) and permit
interruption. See `speedbar-check-vc' as a good example.")
(defcustom speedbar-mode-specific-contents-flag t
"*Non-nil means speedbar will show special mode contents.
This permits some modes to create customized contents for the speedbar
frame."
:group 'speedbar
:type 'boolean)
(defvar speedbar-special-mode-expansion-list nil
"Mode specific list of functions to call to fill in speedbar.
Some modes, such as Info or RMAIL, do not relate quite as easily into
a simple list of files. When this variable is non-nil and buffer-local,
then these functions are used, creating specialized contents. These
functions are called each time the speedbar timer is called. This
allows a mode to update its contents regularly.
Each function is called with the default and frame belonging to
speedbar, and with one parameter; the buffer requesting
the speedbar display.")
(defcustom speedbar-visiting-file-hook nil
"Hooks run when speedbar visits a file in the selected frame."
:group 'speedbar
:type 'hook)
(defcustom speedbar-visiting-tag-hook nil
"Hooks run when speedbar visits a tag in the selected frame."
:group 'speedbar
:type 'hook)
(defcustom speedbar-load-hook nil
"Hooks run when speedbar is loaded."
:group 'speedbar
:type 'hook)
(defcustom speedbar-show-unknown-files nil
"*Non-nil show files we can't expand with a ? in the expand button.
nil means don't show the file in the list."
:group 'speedbar
:type 'boolean)
(defcustom speedbar-update-speed
(if speedbar-xemacsp
(if speedbar-xemacs20p
2 ; 1 is too obrusive in XEmacs
5) ; when no idleness, need long delay
1)
"*Idle time in seconds needed before speedbar will update itself.
Updates occur to allow speedbar to display directory information
relevant to the buffer you are currently editing."
:group 'speedbar
:type 'integer)
(defcustom speedbar-navigating-speed 10
"*Idle time to wait after navigation commands in speedbar are executed.
Navigation commands included expanding/contracting nodes, and moving
between different directories."
:group 'speedbar
:type 'integer)
(defcustom speedbar-frame-parameters '((minibuffer . nil)
(width . 20)
(scroll-bar-width . 10)
(border-width . 0)
(menu-bar-lines . 0)
(unsplittable . t))
"*Parameters to use when creating the speedbar frame in Emacs.
Parameters not listed here which will be added automatically are
`height' which will be initialized to the height of the frame speedbar
is attached to."
:group 'speedbar
:type '(repeat (sexp :tag "Parameter:")))
;; These values by Hrvoje Niksic <hniksic@srce.hr>
(defcustom speedbar-frame-plist
'(minibuffer nil width 20 border-width 0
internal-border-width 0 unsplittable t
default-toolbar-visible-p nil has-modeline-p nil
menubar-visible-p nil
;; I don't see the particular value of these three, but...
text-pointer-glyph [cursor-font :data "top_left_arrow"]
nontext-pointer-glyph [cursor-font :data "top_left_arrow"]
selection-pointer-glyph [cursor-font :data "hand2"])
"*Parameters to use when creating the speedbar frame in XEmacs.
Parameters not listed here which will be added automatically are
`height' which will be initialized to the height of the frame speedbar
is attached to."
:group 'speedbar
:type '(repeat (group :inline t
(symbol :tag "Property")
(sexp :tag "Value"))))
(defcustom speedbar-use-imenu-flag (stringp (locate-library "imenu"))
"*Non-nil means use imenu for file parsing. nil to use etags.
XEmacs prior to 20.4 doesn't support imenu, therefore the default is to
use etags instead. Etags support is not as robust as imenu support."
:tag "User Imenu"
:group 'speedbar
:type 'boolean)
(defcustom speedbar-sort-tags nil
"*If Non-nil, sort tags in the speedbar display."
:group 'speedbar
:type 'boolean)
(defcustom speedbar-activity-change-focus-flag nil
"*Non-nil means the selected frame will change based on activity.
Thus, if a file is selected for edit, the buffer will appear in the
selected frame and the focus will change to that frame."
:group 'speedbar
:type 'boolean)
(defcustom speedbar-directory-button-trim-method 'span
"*Indicates how the directory button will be displayed.
Possible values are:
'span - span large directories over multiple lines.
'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."
span)
(const :tag "Trim large directories to only show the last few."
trim)
(const :tag "No trimming." nil)))
(defcustom speedbar-smart-directory-expand-flag t
"*Non-nil means speedbar should use smart expansion.
Smart expansion only affects when speedbar wants to display a
directory for a file in the attached frame. When smart expansion is
enabled, new directories which are children of a displayed directory
are expanded in the current framework. If nil, then the current
hierarchy would be replaced with the new directory."
:group 'speedbar
:type 'boolean)
(defcustom speedbar-before-popup-hook nil
"*Hooks called before popping up the speedbar frame."
:group 'speedbar
:type 'hook)
(defcustom speedbar-before-delete-hook nil
"*Hooks called before deleting the speedbar frame."
:group 'speedbar
:type 'hook)
(defcustom speedbar-mode-hook nil
"*Hooks called after creating a speedbar buffer."
:group 'speedbar
:type 'hook)
(defcustom speedbar-timer-hook nil
"*Hooks called after running the speedbar timer function."
:group 'speedbar
:type 'hook)
(defcustom speedbar-verbosity-level 1
"*Verbosity level of the speedbar. 0 means say nothing.
1 means medium level verbosity. 2 and higher are higher levels of
verbosity."
:group 'speedbar
:type 'integer)
(defcustom speedbar-vc-do-check t
"*Non-nil check all files in speedbar to see if they have been checked out.
Any file checked out is marked with `speedbar-vc-indicator'"
:group 'speedbar-vc
:type 'boolean)
(defvar speedbar-vc-indicator " *"
"Text used to mark files which are currently checked out.
Currently only RCS is supported. Other version control systems can be
added by examining the function `speedbar-this-file-in-vc' and
`speedbar-vc-check-dir-p'")
(defcustom speedbar-scanner-reset-hook nil
"*Hook called whenever generic scanners are reset.
Set this to implement your own scanning / rescan safe functions with
state data."
:group 'speedbar
:type 'hook)
(defcustom speedbar-vc-path-enable-hook nil
"*Return non-nil if the current path should be checked for Version Control.
Functions in this hook must accept one parameter which is the path
being checked."
:group 'speedbar-vc
:type 'hook)
(defcustom speedbar-vc-in-control-hook nil
"*Return non-nil if the specified file is under Version Control.
Functions in this hook must accept two parameters. The PATH of the
current file, and the FILENAME of the file being checked."
:group 'speedbar-vc
:type 'hook)
(defvar speedbar-vc-to-do-point nil
"Local variable maintaining the current version control check position.")
(defvar speedbar-ignored-modes nil
"*List of major modes which speedbar will not switch directories for.")
(defun speedbar-extension-list-to-regex (extlist)
"Takes EXTLIST, a list of extensions and transforms it into regexp.
All the preceding . are stripped for an optimized expression starting
with . followed by extensions, followed by full-filenames."
(let ((regex1 nil) (regex2 nil))
(while extlist
(if (= (string-to-char (car extlist)) ?.)
(setq regex1 (concat regex1 (if regex1 "\\|" "")
(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.
(concat "\\("
(if regex1 (concat "\\(\\.\\(" regex1 "\\)\\)") "")
(if (and regex1 regex2) "\\|" "")
(if regex2 (concat "\\(" regex2 "\\)") "")
"\\)$")))
(defvar speedbar-ignored-path-regexp nil
"Regular expression matching paths speedbar will not switch to.
Created from `speedbar-ignored-path-expressions' with the function
`speedbar-extension-list-to-regex' (A misnamed function in this case.)
Use the function `speedbar-add-ignored-path-regexp', or customize the
variable `speedbar-ignored-path-expressions' to modify this variable.")
(defcustom speedbar-ignored-path-expressions
'("/logs?/\\'")
"*List of regular expressions matching directories speedbar will ignore.
They should included paths to directories which are notoriously very
large and take a long time to load in. Use the function
`speedbar-add-ignored-path-regexp' to add new items to this list after
speedbar is loaded. You may place anything you like in this list
before speedbar has been loaded."
:group 'speedbar
:type '(repeat (regexp :tag "Path Regexp"))
:set (lambda (sym val)
(setq speedbar-ignored-path-expressions val
speedbar-ignored-path-regexp
(speedbar-extension-list-to-regex val))))
(defvar speedbar-file-unshown-regexp
(let ((nstr "") (noext completion-ignored-extensions))
(while noext
(setq nstr (concat nstr (regexp-quote (car noext)) "\\'"
(if (cdr noext) "\\|" ""))
noext (cdr noext)))
(concat nstr "\\|#[^#]+#$\\|\\.\\.?\\'"))
"*Regexp matching files we don't want displayed in a speedbar buffer.
It is generated from the variable `completion-ignored-extensions'")
;; this is dangerous to customize, because the defaults will probably
;; change in the future.
(defcustom speedbar-supported-extension-expressions
(append '(".[CcHh]\\(\\+\\+\\|pp\\|c\\|h\\)?" ".tex\\(i\\(nfo\\)?\\)?"
".el" ".emacs" ".l" ".lsp" ".p" ".java")
(if speedbar-use-imenu-flag
'(".f90" ".ada" ".pl" ".tcl" ".m"
"Makefile\\(\\.in\\)?")))
"*List of regular expressions which will match files supported by tagging.
Do not prefix the `.' char with a double \\ to quote it, as the period
will be stripped by a simplified optimizer when compiled into a
singular expression. This variable will be turned into
`speedbar-file-regexp' for use with speedbar. You should use the
function `speedbar-add-supported-extension' to add a new extension at
runtime, or use the configuration dialog to set it in your .emacs
file."
:group 'speedbar
:type '(repeat (regexp :tag "Extension Regexp"))
:set (lambda (sym val)
(setq speedbar-supported-extension-expressions val
speedbar-file-regexp (speedbar-extension-list-to-regex val)))
)
(defvar speedbar-file-regexp
(speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
"Regular expression matching files we know how to expand.
Created from `speedbar-supported-extension-expression' with the
function `speedbar-extension-list-to-regex'")
(defun speedbar-add-supported-extension (extension)