/[emacs]/emacs/lisp/speedbar.el
ViewVC logotype

Diff of /emacs/lisp/speedbar.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by pj, Sun Apr 14 16:21:40 2002 UTC revision 1.42.2.1 by miles, Fri Apr 4 06:20:11 2003 UTC
# Line 185  Line 185 
185  ;; customization stuff  ;; customization stuff
186  (defgroup speedbar nil  (defgroup speedbar nil
187    "File and tag browser frame."    "File and tag browser frame."
188    :group 'tags    :group 'etags
189    :group 'tools    :group 'tools
190    :group 'convenience    :group 'convenience
191    :version "20.3")    :version "20.3")
# Line 287  speedbar buffer.") Line 287  speedbar buffer.")
287  (defvar speedbar-special-mode-key-map nil  (defvar speedbar-special-mode-key-map nil
288    "Default keymap used when identifying a specialized display mode.    "Default keymap used when identifying a specialized display mode.
289  This keymap is local to each buffer that wants to define special keybindings  This keymap is local to each buffer that wants to define special keybindings
290  effective when it's display is shown.")  effective when its display is shown.")
291    
292  (defcustom speedbar-visiting-file-hook nil  (defcustom speedbar-visiting-file-hook nil
293    "Hooks run when speedbar visits a file in the selected frame."    "Hooks run when speedbar visits a file in the selected frame."
# Line 382  use etags instead.  Etags support is not Line 382  use etags instead.  Etags support is not
382  (defvar speedbar-dynamic-tags-function-list  (defvar speedbar-dynamic-tags-function-list
383    '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list)    '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list)
384      (speedbar-fetch-dynamic-etags . speedbar-insert-etags-list))      (speedbar-fetch-dynamic-etags . speedbar-insert-etags-list))
385    "Set to a functions which will return and insert a list of tags.    "Set to a list of functions which will return and insert a list of tags.
386  Each element is of the form ( FETCH .  INSERT ) where FETCH  Each element is of the form ( FETCH .  INSERT ) where FETCH
387  is a funciotn which takes one parameter (the file to tag) and returns a  is a function which takes one parameter (the file to tag) and returns a
388  list of tags.  The tag list can be of any form as long as the  list of tags.  The tag list can be of any form as long as the
389  corresponding insert method can handle it.  If it returns t, then an  corresponding insert method can handle it.  If it returns t, then an
390  error occured, and the next fetch routine is tried.  error occurred, and the next fetch routine is tried.
391  INSERT is a function which takes an INDENTation level, and a LIST of  INSERT is a function which takes an INDENTation level, and a LIST of
392  tags to insert.  It will then create the speedbar buttons.")  tags to insert.  It will then create the speedbar buttons.")
393    
# Line 407  tags to insert.  It will then create the Line 407  tags to insert.  It will then create the
407    "*List of hooks which speedbar will use to organize tags into groups.    "*List of hooks which speedbar will use to organize tags into groups.
408  Groups are defined as expandable meta-tags.  Imenu supports  Groups are defined as expandable meta-tags.  Imenu supports
409  such things in some languages, such as separating variables from  such things in some languages, such as separating variables from
410  functions.  Each hook takes one argument LST, and may destructivly  functions.  Each hook takes one argument LST, and may destructively
411  create a new list of the same form.  LST is a list of elements of the  create a new list of the same form.  LST is a list of elements of the
412  form:  form:
413    (ELT1 ELT2 ... ELTn)    (ELT1 ELT2 ... ELTn)
414  where each ELT is of the form  where each ELT is of the form
415    (TAG-NAME-STRING . NUMBER-OR-MARKER)    (TAG-NAME-STRING . NUMBER-OR-MARKER)
416  or  or
417    (GROUP-NAME-STRING ELT1 ELR2... ELTn)"    (GROUP-NAME-STRING ELT1 ELT2... ELTn)"
418    :group 'speedbar    :group 'speedbar
419    :type 'hook    :type 'hook
420    :options '(speedbar-sort-tag-hierarchy    :options '(speedbar-sort-tag-hierarchy
# Line 497  hierarchy would be replaced with the new Line 497  hierarchy would be replaced with the new
497                                      (if (fboundp 'display-graphic-p)                                      (if (fboundp 'display-graphic-p)
498                                          (display-graphic-p)                                          (display-graphic-p)
499                                        window-system))                                        window-system))
500    "*Non nil if speedbar should display icons."    "*Non-nil if speedbar should display icons."
501    :group 'speedbar    :group 'speedbar
502    :version "21.1"    :version "21.1"
503    :type 'boolean)    :type 'boolean)
# Line 534  verbosity." Line 534  verbosity."
534    
535  (defcustom speedbar-vc-do-check t  (defcustom speedbar-vc-do-check t
536    "*Non-nil check all files in speedbar to see if they have been checked out.    "*Non-nil check all files in speedbar to see if they have been checked out.
537  Any file checked out is marked with `speedbar-vc-indicator'"  Any file checked out is marked with `speedbar-vc-indicator'."
538    :group 'speedbar-vc    :group 'speedbar-vc
539    :type 'boolean)    :type 'boolean)
540    
# Line 563  current file, and the FILENAME of the fi Line 563  current file, and the FILENAME of the fi
563  (defcustom speedbar-obj-do-check t  (defcustom speedbar-obj-do-check t
564    "*Non-nil check all files in speedbar to see if they have an object file.    "*Non-nil check all files in speedbar to see if they have an object file.
565  Any file checked out is marked with `speedbar-obj-indicator', and the  Any file checked out is marked with `speedbar-obj-indicator', and the
566  marking is based on  `speedbar-obj-alist'"  marking is based on `speedbar-obj-alist'."
567    :group 'speedbar-vc    :group 'speedbar-vc
568    :type 'boolean)    :type 'boolean)
569    
# Line 847  to toggle this value.") Line 847  to toggle this value.")
847     ))     ))
848    
849  (defun speedbar-make-specialized-keymap ()  (defun speedbar-make-specialized-keymap ()
850    "Create a keymap for use w/ a speedbar major or minor display mode.    "Create a keymap for use with a speedbar major or minor display mode.
851  This basically creates a sparse keymap, and makes it's parent be  This basically creates a sparse keymap, and makes it's parent be
852  `speedbar-key-map'."  `speedbar-key-map'."
853    (let ((k (make-sparse-keymap)))    (let ((k (make-sparse-keymap)))
# Line 932  This basically creates a sparse keymap, Line 932  This basically creates a sparse keymap,
932                       (looking-at "[0-9]+: *\\[[+-]\\] [^ \n]+ \\*?[!#]$"))]                       (looking-at "[0-9]+: *\\[[+-]\\] [^ \n]+ \\*?[!#]$"))]
933      )      )
934    "Additional menu items while in file-mode.")    "Additional menu items while in file-mode.")
935    
936  (defvar speedbar-easymenu-definition-trailer  (defvar speedbar-easymenu-definition-trailer
937    (append    (append
938     (if (and (featurep 'custom) (fboundp 'custom-declare-variable))     (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
# Line 943  This basically creates a sparse keymap, Line 943  This basically creates a sparse keymap,
943    "Menu items appearing at the end of the speedbar menu.")    "Menu items appearing at the end of the speedbar menu.")
944    
945  (defvar speedbar-desired-buffer nil  (defvar speedbar-desired-buffer nil
946    "Non-nil when speedbar is showing buttons specific a special mode.    "Non-nil when speedbar is showing buttons specific to a special mode.
947  In this case it is the originating buffer.")  In this case it is the originating buffer.")
948  (defvar speedbar-buffer nil  (defvar speedbar-buffer nil
949    "The buffer displaying the speedbar.")    "The buffer displaying the speedbar.")
# Line 981  directories.") Line 981  directories.")
981  (if (fboundp 'frame-parameter)  (if (fboundp 'frame-parameter)
982    
983      (defalias 'speedbar-frame-parameter 'frame-parameter)      (defalias 'speedbar-frame-parameter 'frame-parameter)
984      
985    (defun speedbar-frame-parameter (frame parameter)    (defun speedbar-frame-parameter (frame parameter)
986      "Return FRAME's PARAMETER value."      "Return FRAME's PARAMETER value."
987      (cdr (assoc parameter (frame-parameters frame)))))      (cdr (assoc parameter (frame-parameters frame)))))
# Line 1215  Files are completely ignored if they mat Line 1215  Files are completely ignored if they mat
1215  which is generated from `completion-ignored-extensions'.  which is generated from `completion-ignored-extensions'.
1216    
1217  Files with a `*' character after their name are files checked out of a  Files with a `*' character after their name are files checked out of a
1218  version control system.  (currently only RCS is supported.)  New  version control system.  (Currently only RCS is supported.)  New
1219  version control systems can be added by examining the documentation  version control systems can be added by examining the documentation
1220  for `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'  for `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'.
1221    
1222  Files with a `#' or `!' character after them are source files that  Files with a `#' or `!' character after them are source files that
1223  have an object file associated with them.  The `!' indicates that the  have an object file associated with them.  The `!' indicates that the
1224  files is out of date.   You can control what source/object associations  files is out of date.  You can control what source/object associations
1225  exist through the variable `speedbar-obj-alist'.  exist through the variable `speedbar-obj-alist'.
1226    
1227  Click on the [+] to display a list of tags from that file.  Click on  Click on the [+] to display a list of tags from that file.  Click on
# Line 1454  and the existence of packages." Line 1454  and the existence of packages."
1454  (defun speedbar-mouse-hscroll (e)  (defun speedbar-mouse-hscroll (e)
1455    "Read a mouse event E from the mode line, and horizontally scroll.    "Read a mouse event E from the mode line, and horizontally scroll.
1456  If the mouse is being clicked on the far left, or far right of the  If the mouse is being clicked on the far left, or far right of the
1457  mode-line.  This is only useful for non-XEmacs"  mode-line.  This is only useful for non-XEmacs."
1458    (interactive "e")    (interactive "e")
1459    (let* ((xp (car (nth 2 (car (cdr e)))))    (let* ((xp (car (nth 2 (car (cdr e)))))
1460           (cpw (/ (frame-pixel-width)           (cpw (/ (frame-pixel-width)
# Line 1665  files, or the directory button." Line 1665  files, or the directory button."
1665    
1666  (defun speedbar-up-directory ()  (defun speedbar-up-directory ()
1667    "Keyboard accelerator for moving the default directory up one.    "Keyboard accelerator for moving the default directory up one.
1668  Assumes that the current buffer is the speedbar buffer"  Assumes that the current buffer is the speedbar buffer."
1669    (interactive)    (interactive)
1670    (setq default-directory (expand-file-name (concat default-directory "../")))    (setq default-directory (expand-file-name (concat default-directory "../")))
1671    (speedbar-update-contents))    (speedbar-update-contents))
# Line 1676  Assumes that the current buffer is the s Line 1676  Assumes that the current buffer is the s
1676    "Refresh the current speedbar display, disposing of any cached data."    "Refresh the current speedbar display, disposing of any cached data."
1677    (interactive)    (interactive)
1678    (let ((dl speedbar-shown-directories)    (let ((dl speedbar-shown-directories)
1679          (dm (and (boundp 'deactivate-mark) deactivate-mark)))          deactivate-mark)
1680      (while dl      (while dl
1681        (adelete 'speedbar-directory-contents-alist (car dl))        (adelete 'speedbar-directory-contents-alist (car dl))
1682        (setq dl (cdr dl)))        (setq dl (cdr dl)))
# Line 1687  Assumes that the current buffer is the s Line 1687  Assumes that the current buffer is the s
1687      ;; Reset the timer in case it got really hosed for some reason...      ;; Reset the timer in case it got really hosed for some reason...
1688      (speedbar-set-timer speedbar-update-speed)      (speedbar-set-timer speedbar-update-speed)
1689      (if (<= 1 speedbar-verbosity-level)      (if (<= 1 speedbar-verbosity-level)
1690          (speedbar-message "Refreshing speedbar...done"))          (speedbar-message "Refreshing speedbar...done"))))
     (if (boundp 'deactivate-mark) (setq deactivate-mark dm))))  
1691    
1692  (defun speedbar-item-load ()  (defun speedbar-item-load ()
1693    "Load the item under the cursor or mouse if it is a Lisp file."    "Load the item under the cursor or mouse if it is a Lisp file."
# Line 1738  File style information is displayed with Line 1737  File style information is displayed with
1737  (defun speedbar-item-info ()  (defun speedbar-item-info ()
1738    "Display info in the mini-buffer about the button the mouse is over.    "Display info in the mini-buffer about the button the mouse is over.
1739  This function can be replaced in `speedbar-mode-functions-list' as  This function can be replaced in `speedbar-mode-functions-list' as
1740  `speedbar-item-info'"  `speedbar-item-info'."
1741    (interactive)    (interactive)
1742    (let (message-log-max)    (let (message-log-max)
1743      (funcall (or (speedbar-fetch-replacement-function 'speedbar-item-info)      (funcall (or (speedbar-fetch-replacement-function 'speedbar-item-info)
# Line 1943  variable `speedbar-obj-alist'." Line 1942  variable `speedbar-obj-alist'."
1942  ;;; Utility functions  ;;; Utility functions
1943  ;;  ;;
1944  (defun speedbar-set-timer (timeout)  (defun speedbar-set-timer (timeout)
1945    "Apply a timer with TIMEOUT, or remove a timer if TIMOUT is nil.    "Apply a timer with TIMEOUT, or remove a timer if TIMEOUT is nil.
1946  TIMEOUT is the number of seconds until the speedbar timer is called  TIMEOUT is the number of seconds until the speedbar timer is called
1947  again.  When TIMEOUT is nil, turn off all timeouts.  again.  When TIMEOUT is nil, turn off all timeouts.
1948  This function will also enable or disable the `vc-checkin-hook' used  This function will also enable or disable the `vc-checkin-hook' used
# Line 2017  When the user clicks on TEXT, FUNCTION i Line 2016  When the user clicks on TEXT, FUNCTION i
2016  This function assumes that the current buffer is the speedbar buffer.  This function assumes that the current buffer is the speedbar buffer.
2017  If PREVLINE, then put this button on the previous line.  If PREVLINE, then put this button on the previous line.
2018    
2019  This is a convenience function for special mode that create their own  This is a convenience function for special modes that create their own
2020  specialized speedbar displays."  specialized speedbar displays."
2021    (goto-char (point-max))    (goto-char (point-max))
2022    (let ((start (point)))    (let ((start (point)))
# Line 2038  specialized speedbar displays." Line 2037  specialized speedbar displays."
2037  (defun speedbar-make-button (start end face mouse function &optional token)  (defun speedbar-make-button (start end face mouse function &optional token)
2038    "Create a button from START to END, with FACE as the display face.    "Create a button from START to END, with FACE as the display face.
2039  MOUSE is the mouse face.  When this button is clicked on FUNCTION  MOUSE is the mouse face.  When this button is clicked on FUNCTION
2040  will be run with the TOKEN parameter (any Lisp object)"  will be run with the TOKEN parameter (any Lisp object)."
2041    (put-text-property start end 'face face)    (put-text-property start end 'face face)
2042    (put-text-property start end 'mouse-face mouse)    (put-text-property start end 'mouse-face mouse)
2043    (put-text-property start end 'invisible nil)    (put-text-property start end 'invisible nil)
# Line 2177  of the special mode functions." Line 2176  of the special mode functions."
2176  The car is the list of directories, the cdr is list of files not  The car is the list of directories, the cdr is list of files not
2177  matching ignored headers.  Cache any directory files found in  matching ignored headers.  Cache any directory files found in
2178  `speedbar-directory-contents-alist' and use that cache before scanning  `speedbar-directory-contents-alist' and use that cache before scanning
2179  the file-system"  the file-system."
2180    (setq directory (expand-file-name directory))    (setq directory (expand-file-name directory))
2181    ;; If in powerclick mode, then the directory we are getting    ;; If in powerclick mode, then the directory we are getting
2182    ;; should be rescanned.    ;; should be rescanned.
# Line 2291  TAG-BUTTON-FACE is a face used for this Line 2290  TAG-BUTTON-FACE is a face used for this
2290  Lastly, DEPTH shows the depth of expansion.  Lastly, DEPTH shows the depth of expansion.
2291    
2292  This function assumes that the cursor is in the speedbar window at the  This function assumes that the cursor is in the speedbar window at the
2293  position to insert a new item, and that the new item will end with a CR"  position to insert a new item, and that the new item will end with a CR."
2294    (let ((start (point))    (let ((start (point))
2295          (end (progn          (end (progn
2296                 (insert (int-to-string depth) ":")                 (insert (int-to-string depth) ":")
# Line 2326  position to insert a new item, and that Line 2325  position to insert a new item, and that
2325                              (if tag-button-function 'speedbar-highlight-face nil)                              (if tag-button-function 'speedbar-highlight-face nil)
2326                              tag-button-function tag-button-data))                              tag-button-function tag-button-data))
2327      ))      ))
2328      
2329  (defun speedbar-change-expand-button-char (char)  (defun speedbar-change-expand-button-char (char)
2330    "Change the expansion button character to CHAR for the current line."    "Change the expansion button character to CHAR for the current line."
2331    (save-excursion    (save-excursion
# Line 2348  position to insert a new item, and that Line 2347  position to insert a new item, and that
2347    "Insert list of FILES starting at point, and indenting all files to LEVEL.    "Insert list of FILES starting at point, and indenting all files to LEVEL.
2348  Tag expandable items with a +, otherwise a ?.  Don't highlight ? as we  Tag expandable items with a +, otherwise a ?.  Don't highlight ? as we
2349  don't know how to manage them.  The input parameter FILES is a cons  don't know how to manage them.  The input parameter FILES is a cons
2350  cell of the form ( 'DIRLIST .  'FILELIST )"  cell of the form ( 'DIRLIST .  'FILELIST )."
2351    ;; Start inserting all the directories    ;; Start inserting all the directories
2352    (let ((dirs (car files)))    (let ((dirs (car files)))
2353      (while dirs      (while dirs
# Line 2640  name will have the function FIND-FUN and Line 2639  name will have the function FIND-FUN and
2639    (speedbar-insert-generic-list indent lst    (speedbar-insert-generic-list indent lst
2640                                  'speedbar-tag-expand                                  'speedbar-tag-expand
2641                                  'speedbar-tag-find))                                  'speedbar-tag-find))
2642                                    
2643  (defun speedbar-insert-etags-list (indent lst)  (defun speedbar-insert-etags-list (indent lst)
2644    "At level INDENT, insert the etags generated LST."    "At level INDENT, insert the etags generated LST."
2645    (speedbar-insert-generic-list indent lst    (speedbar-insert-generic-list indent lst
# Line 2745  name will have the function FIND-FUN and Line 2744  name will have the function FIND-FUN and
2744    (speedbar-reconfigure-keymaps))    (speedbar-reconfigure-keymaps))
2745    
2746  (defun speedbar-update-special-contents ()  (defun speedbar-update-special-contents ()
2747    "Used the mode-specific variable to fill in the speedbar buffer.    "Use the mode-specific variable to fill in the speedbar buffer.
2748  This should only be used by modes classified as special."  This should only be used by modes classified as special."
2749    (let ((funclst speedbar-special-mode-expansion-list)    (let ((funclst speedbar-special-mode-expansion-list)
2750          (specialbuff (current-buffer)))          (specialbuff (current-buffer)))
# Line 2869  If new functions are added, their state Line 2868  If new functions are added, their state
2868    )    )
2869    
2870  (defun speedbar-find-selected-file (file)  (defun speedbar-find-selected-file (file)
2871    "Goto the line where FILE is."    "Go to the line where FILE is."
2872    (goto-char (point-min))    (goto-char (point-min))
2873    (let ((m nil))    (let ((m nil))
2874      (while (and (setq m (re-search-forward      (while (and (setq m (re-search-forward
# Line 2971  updated." Line 2970  updated."
2970  (defun speedbar-add-indicator (indicator-string &optional replace-this)  (defun speedbar-add-indicator (indicator-string &optional replace-this)
2971    "Add INDICATOR-STRING to the end of this speedbar line.    "Add INDICATOR-STRING to the end of this speedbar line.
2972  If INDICATOR-STRING is space, and REPLACE-THIS is a character, then  If INDICATOR-STRING is space, and REPLACE-THIS is a character, then
2973  an the existing indicator is removed.  If there is already an  the existing indicator is removed.  If there is already an
2974  indicator, then do not add a space."  indicator, then do not add a space."
2975    (beginning-of-line)    (beginning-of-line)
2976    ;; The nature of the beast: Assume we are in "the right place"    ;; The nature of the beast: Assume we are in "the right place"
# Line 3235  This should be bound to mouse event E." Line 3234  This should be bound to mouse event E."
3234  (defun speedbar-do-function-pointer ()  (defun speedbar-do-function-pointer ()
3235    "Look under the cursor and examine the text properties.    "Look under the cursor and examine the text properties.
3236  From this extract the file/tag name, token, indentation level and call  From this extract the file/tag name, token, indentation level and call
3237  a function if appropriate"  a function if appropriate."
3238    (let* ((fn (get-text-property (point) 'speedbar-function))    (let* ((fn (get-text-property (point) 'speedbar-function))
3239           (tok (get-text-property (point) 'speedbar-token))           (tok (get-text-property (point) 'speedbar-token))
3240           ;; The 1-,+ is safe because scaning starts AFTER the point           ;; The 1-,+ is safe because scaning starts AFTER the point
# Line 3286  Optional argument P is where to start th Line 3285  Optional argument P is where to start th
3285        nil)))        nil)))
3286    
3287  (defun speedbar-line-file (&optional p)  (defun speedbar-line-file (&optional p)
3288    "Retrieve the file or whatever from the line at P point.    "Retrieve the file or whatever from the line at point P.
3289  The return value is a string representing the file.  If it is a  The return value is a string representing the file.  If it is a
3290  directory, then it is the directory name."  directory, then it is the directory name."
3291    (save-match-data    (save-match-data
# Line 3300  directory, then it is the directory name Line 3299  directory, then it is the directory name
3299          nil))))          nil))))
3300    
3301  (defun speedbar-goto-this-file (file)  (defun speedbar-goto-this-file (file)
3302    "If FILE is displayed, goto this line and return t.    "If FILE is displayed, go to this line and return t.
3303  Otherwise do not move and return nil."  Otherwise do not move and return nil."
3304    (let ((path (substring (file-name-directory (expand-file-name file))    (let ((path (substring (file-name-directory (expand-file-name file))
3305                           (length (expand-file-name default-directory))))                           (length (expand-file-name default-directory))))
# Line 3341  Otherwise do not move and return nil." Line 3340  Otherwise do not move and return nil."
3340    "Retrieve the pathname associated with the current line.    "Retrieve the pathname associated with the current line.
3341  This may require traversing backwards from DEPTH and combining the default  This may require traversing backwards from DEPTH and combining the default
3342  directory with these items.  This function is replaceable in  directory with these items.  This function is replaceable in
3343  `speedbar-mode-functions-list' as `speedbar-line-path'"  `speedbar-mode-functions-list' as `speedbar-line-path'."
3344    (let ((rf (speedbar-fetch-replacement-function 'speedbar-line-path)))    (let ((rf (speedbar-fetch-replacement-function 'speedbar-line-path)))
3345      (if rf (funcall rf depth) default-directory)))      (if rf (funcall rf depth) default-directory)))
3346          
3347  (defun speedbar-files-line-path (&optional depth)  (defun speedbar-files-line-path (&optional depth)
3348    "Retrieve the pathname associated with the current line.    "Retrieve the pathname associated with the current line.
3349  This may require traversing backwards from DEPTH and combining the default  This may require traversing backwards from DEPTH and combining the default
# Line 3428  With universal argument ARG, flush cache Line 3427  With universal argument ARG, flush cache
3427            (forward-char -2)            (forward-char -2)
3428            (speedbar-do-function-pointer))            (speedbar-do-function-pointer))
3429        (error (speedbar-position-cursor-on-line)))))        (error (speedbar-position-cursor-on-line)))))
3430      
3431  (defun speedbar-flush-expand-line ()  (defun speedbar-flush-expand-line ()
3432    "Expand the line under the cursor and flush any cached information."    "Expand the line under the cursor and flush any cached information."
3433    (interactive)    (interactive)
3434    (speedbar-expand-line 1))    (speedbar-expand-line 1))
3435      
3436  (defun speedbar-contract-line ()  (defun speedbar-contract-line ()
3437    "Contract the line under the cursor."    "Contract the line under the cursor."
3438    (interactive)    (interactive)
# Line 3449  With universal argument ARG, flush cache Line 3448  With universal argument ARG, flush cache
3448  (if speedbar-xemacsp  (if speedbar-xemacsp
3449      (defalias 'speedbar-mouse-event-p 'button-press-event-p)      (defalias 'speedbar-mouse-event-p 'button-press-event-p)
3450    (defun speedbar-mouse-event-p (event)    (defun speedbar-mouse-event-p (event)
3451      "Return t if the event is a mouse related event"      "Return t if the event is a mouse related event."
3452      ;; And Emacs does it this way      ;; And Emacs does it this way
3453      (if (and (listp event)      (if (and (listp event)
3454               (member (event-basic-type event)               (member (event-basic-type event)
# Line 3482  current indentation level." Line 3481  current indentation level."
3481    
3482  (defun speedbar-dir-follow (text token indent)  (defun speedbar-dir-follow (text token indent)
3483    "Speedbar click handler for directory names.    "Speedbar click handler for directory names.
3484  Clicking a directory will cause the speedbar to list files in the  Clicking a directory will cause the speedbar to list files in
3485  the subdirectory TEXT.  TOKEN is an unused requirement.  The  the subdirectory TEXT.  TOKEN is an unused requirement.  The
3486  subdirectory chosen will be at INDENT level."  subdirectory chosen will be at INDENT level."
3487    (setq default-directory    (setq default-directory
# Line 3554  expanded.  INDENT is the current indenta Line 3553  expanded.  INDENT is the current indenta
3553  TEXT is the button clicked on.  TOKEN is the directory to follow.  TEXT is the button clicked on.  TOKEN is the directory to follow.
3554  INDENT is the current indentation level and is unused."  INDENT is the current indentation level and is unused."
3555    (if (string-match "^[A-z]:$" token)    (if (string-match "^[A-z]:$" token)
3556        (setq default-directory (concat token (char-to-string directory-sep-char)))        (setq default-directory (concat token "/"))
3557      (setq default-directory token))      (setq default-directory token))
3558    ;; Because we leave speedbar as the current buffer,    ;; Because we leave speedbar as the current buffer,
3559    ;; update contents will change directory without    ;; update contents will change directory without
# Line 3587  indentation level." Line 3586  indentation level."
3586    (speedbar-center-buffer-smartly))    (speedbar-center-buffer-smartly))
3587    
3588  (defun speedbar-tag-find (text token indent)  (defun speedbar-tag-find (text token indent)
3589    "For the tag TEXT in a file TOKEN, goto that position.    "For the tag TEXT in a file TOKEN, go to that position.
3590  INDENT is the current indentation level."  INDENT is the current indentation level."
3591    (let ((file (speedbar-line-path indent)))    (let ((file (speedbar-line-path indent)))
3592      (speedbar-find-file-in-frame file)      (speedbar-find-file-in-frame file)
# Line 3776  This variable is ignored if `speedbar-us Line 3775  This variable is ignored if `speedbar-us
3775  (defvar speedbar-fetch-etags-command "etags"  (defvar speedbar-fetch-etags-command "etags"
3776    "*Command used to create an etags file.    "*Command used to create an etags file.
3777    
3778  This variable is ignored if `speedbar-use-imenu-flag' is t")  This variable is ignored if `speedbar-use-imenu-flag' is t.")
3779    
3780  (defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")  (defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
3781    "*List of arguments to use with `speedbar-fetch-etags-command'.    "*List of arguments to use with `speedbar-fetch-etags-command'.
3782  This creates an etags output buffer.  Use `speedbar-toggle-etags' to  This creates an etags output buffer.  Use `speedbar-toggle-etags' to
3783  modify this list conveniently.  modify this list conveniently.
3784    
3785  This variable is ignored if `speedbar-use-imenu-flag' is t")  This variable is ignored if `speedbar-use-imenu-flag' is t.")
3786    
3787  (defun speedbar-toggle-etags (flag)  (defun speedbar-toggle-etags (flag)
3788    "Toggle FLAG in `speedbar-fetch-etags-arguments'.    "Toggle FLAG in `speedbar-fetch-etags-arguments'.
# Line 3793  value is \"show\" then toggle the value Line 3792  value is \"show\" then toggle the value
3792  `speedbar-show-unknown-files'.  `speedbar-show-unknown-files'.
3793    
3794    This function is a convenience function for XEmacs menu created by    This function is a convenience function for XEmacs menu created by
3795  Farzin Guilak <farzin@protocol.com>"  Farzin Guilak <farzin@protocol.com>."
3796    (interactive)    (interactive)
3797    (cond    (cond
3798     ((equal flag "sort")     ((equal flag "sort")
# Line 3869  Each symbol will be associated with its Line 3868  Each symbol will be associated with its
3868  (defun speedbar-extract-one-symbol (expr)  (defun speedbar-extract-one-symbol (expr)
3869    "At point, return nil, or one alist in the form: (SYMBOL .  POSITION)    "At point, return nil, or one alist in the form: (SYMBOL .  POSITION)
3870  The line should contain output from etags.  Parse the output using the  The line should contain output from etags.  Parse the output using the
3871  regular expression EXPR"  regular expression EXPR."
3872    (let* ((sym (if (stringp expr)    (let* ((sym (if (stringp expr)
3873                    (if (save-excursion                    (if (save-excursion
3874                          (re-search-forward expr (save-excursion                          (re-search-forward expr (save-excursion
# Line 3893  regular expression EXPR" Line 3892  regular expression EXPR"
3892        nil)))        nil)))
3893    
3894  (defun speedbar-parse-c-or-c++tag ()  (defun speedbar-parse-c-or-c++tag ()
3895    "Parse a c or c++ tag, which tends to be a little complex."    "Parse a C or C++ tag, which tends to be a little complex."
3896    (save-excursion    (save-excursion
3897      (let ((bound (save-excursion (end-of-line) (point))))      (let ((bound (save-excursion (end-of-line) (point))))
3898        (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t)        (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t)
# Line 4117  TEXT is the buffer's name, TOKEN and IND Line 4116  TEXT is the buffer's name, TOKEN and IND
4116    )    )
4117    
4118  (defun speedbar-unhighlight-one-tag-line ()  (defun speedbar-unhighlight-one-tag-line ()
4119    "Unhighlight the currently highlight line."    "Unhighlight the currently highlighted line."
4120    (if speedbar-highlight-one-tag-line    (if speedbar-highlight-one-tag-line
4121        (progn        (progn
4122          (speedbar-delete-overlay speedbar-highlight-one-tag-line)          (speedbar-delete-overlay speedbar-highlight-one-tag-line)
# Line 4154  TEXT is the buffer's name, TOKEN and IND Line 4153  TEXT is the buffer's name, TOKEN and IND
4153                                      (:foreground "blue4"))                                      (:foreground "blue4"))
4154                                     (((class color) (background dark))                                     (((class color) (background dark))
4155                                      (:foreground "light blue")))                                      (:foreground "light blue")))
4156    "Faced used for directory names."    "Face used for directory names."
4157    :group 'speedbar-faces)    :group 'speedbar-faces)
4158  (defface speedbar-tag-face '((((class color) (background light))  (defface speedbar-tag-face '((((class color) (background light))
4159                                (:foreground "brown"))                                (:foreground "brown"))
# Line 4175  TEXT is the buffer's name, TOKEN and IND Line 4174  TEXT is the buffer's name, TOKEN and IND
4174                                      (:background "green"))                                      (:background "green"))
4175                                     (((class color) (background dark))                                     (((class color) (background dark))
4176                                      (:background "sea green"))                                      (:background "sea green"))
4177                                     (((class grayscale monochrome)                                     (((class grayscale mono)
4178                                       (background light))                                       (background light))
4179                                      (:background "black"))                                      (:background "black"))
4180                                     (((class grayscale monochrome)                                     (((class grayscale mono)
4181                                       (background dark))                                       (background dark))
4182                                      (:background "white")))                                      (:background "white")))
4183    "Face used for highlighting buttons with the mouse."    "Face used for highlighting buttons with the mouse."
# Line 4195  TEXT is the buffer's name, TOKEN and IND Line 4194  TEXT is the buffer's name, TOKEN and IND
4194      (defalias 'defimage-speedbar 'defimage)      (defalias 'defimage-speedbar 'defimage)
4195    
4196    (if (not (fboundp 'make-glyph))    (if (not (fboundp 'make-glyph))
4197          
4198  (defmacro defimage-speedbar (variable imagespec docstring)  (defmacro defimage-speedbar (variable imagespec docstring)
4199    "Don't bother loading up an image...    "Don't bother loading up an image...
4200  Argument VARIABLE is the varible to define.  Argument VARIABLE is the variable to define.
4201  Argument IMAGESPEC is the list defining the image to create.  Argument IMAGESPEC is the list defining the image to create.
4202  Argument DOCSTRING is the documentation for VARIABLE."  Argument DOCSTRING is the documentation for VARIABLE."
4203    `(defvar ,variable nil ,docstring))    `(defvar ,variable nil ,docstring))
# Line 4215  Argument DOCSTRING is the documentation Line 4214  Argument DOCSTRING is the documentation
4214      r))      r))
4215    
4216  (defun speedbar-convert-emacs21-imagespec-to-xemacs (spec)  (defun speedbar-convert-emacs21-imagespec-to-xemacs (spec)
4217    "Convert the Emacs21 Image SPEC into an XEmacs image spec."    "Convert the Emacs21 image SPEC into an XEmacs image spec."
4218    (let* ((sl (car spec))    (let* ((sl (car spec))
4219           (itype (nth 1 sl))           (itype (nth 1 sl))
4220           (ifile (nth 3 sl)))           (ifile (nth 3 sl)))
4221      (vector itype ':file (speedbar-find-image-on-load-path ifile))))      (vector itype ':file (speedbar-find-image-on-load-path ifile))))
4222    
4223  (defmacro defimage-speedbar (variable imagespec docstring)  (defmacro defimage-speedbar (variable imagespec docstring)
4224    "Devine VARIABLE as an image if `defimage' is not available..    "Define VARIABLE as an image if `defimage' is not available.
4225  IMAGESPEC is the image data, and DOCSTRING is documentation for the image."  IMAGESPEC is the image data, and DOCSTRING is documentation for the image."
4226    `(defvar ,variable    `(defvar ,variable
4227       ;; The Emacs21 version of defimage looks just like the XEmacs image       ;; The Emacs21 version of defimage looks just like the XEmacs image

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.42.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26