emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/speedbar.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/speedbar.el
Date: Wed, 10 Jul 2002 04:21:31 -0400

Index: emacs/lisp/speedbar.el
diff -c emacs/lisp/speedbar.el:1.42 emacs/lisp/speedbar.el:1.43
*** emacs/lisp/speedbar.el:1.42 Sun Apr 14 12:21:40 2002
--- emacs/lisp/speedbar.el      Wed Jul 10 04:21:31 2002
***************
*** 287,293 ****
  (defvar speedbar-special-mode-key-map nil
    "Default keymap used when identifying a specialized display mode.
  This keymap is local to each buffer that wants to define special keybindings
! effective when it's display is shown.")
  
  (defcustom speedbar-visiting-file-hook nil
    "Hooks run when speedbar visits a file in the selected frame."
--- 287,293 ----
  (defvar speedbar-special-mode-key-map nil
    "Default keymap used when identifying a specialized display mode.
  This keymap is local to each buffer that wants to define special keybindings
! effective when its display is shown.")
  
  (defcustom speedbar-visiting-file-hook nil
    "Hooks run when speedbar visits a file in the selected frame."
***************
*** 382,393 ****
  (defvar speedbar-dynamic-tags-function-list
    '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list)
      (speedbar-fetch-dynamic-etags . speedbar-insert-etags-list))
!   "Set to a functions which will return and insert a list of tags.
  Each element is of the form ( FETCH .  INSERT ) where FETCH
! is a funciotn which takes one parameter (the file to tag) and returns a
  list of tags.  The tag list can be of any form as long as the
  corresponding insert method can handle it.  If it returns t, then an
! error occured, and the next fetch routine is tried.
  INSERT is a function which takes an INDENTation level, and a LIST of
  tags to insert.  It will then create the speedbar buttons.")
  
--- 382,393 ----
  (defvar speedbar-dynamic-tags-function-list
    '((speedbar-fetch-dynamic-imenu . speedbar-insert-imenu-list)
      (speedbar-fetch-dynamic-etags . speedbar-insert-etags-list))
!   "Set to a list of functions which will return and insert a list of tags.
  Each element is of the form ( FETCH .  INSERT ) where FETCH
! is a function which takes one parameter (the file to tag) and returns a
  list of tags.  The tag list can be of any form as long as the
  corresponding insert method can handle it.  If it returns t, then an
! error occurred, and the next fetch routine is tried.
  INSERT is a function which takes an INDENTation level, and a LIST of
  tags to insert.  It will then create the speedbar buttons.")
  
***************
*** 497,503 ****
                                    (if (fboundp 'display-graphic-p)
                                        (display-graphic-p)
                                      window-system))
!   "*Non nil if speedbar should display icons."
    :group 'speedbar
    :version "21.1"
    :type 'boolean)
--- 497,503 ----
                                    (if (fboundp 'display-graphic-p)
                                        (display-graphic-p)
                                      window-system))
!   "*Non-nil if speedbar should display icons."
    :group 'speedbar
    :version "21.1"
    :type 'boolean)
***************
*** 847,853 ****
     ))
  
  (defun speedbar-make-specialized-keymap ()
!   "Create a keymap for use w/ a speedbar major or minor display mode.
  This basically creates a sparse keymap, and makes it's parent be
  `speedbar-key-map'."
    (let ((k (make-sparse-keymap)))
--- 847,853 ----
     ))
  
  (defun speedbar-make-specialized-keymap ()
!   "Create a keymap for use with a speedbar major or minor display mode.
  This basically creates a sparse keymap, and makes it's parent be
  `speedbar-key-map'."
    (let ((k (make-sparse-keymap)))
***************
*** 943,949 ****
    "Menu items appearing at the end of the speedbar menu.")
  
  (defvar speedbar-desired-buffer nil
!   "Non-nil when speedbar is showing buttons specific a special mode.
  In this case it is the originating buffer.")
  (defvar speedbar-buffer nil
    "The buffer displaying the speedbar.")
--- 943,949 ----
    "Menu items appearing at the end of the speedbar menu.")
  
  (defvar speedbar-desired-buffer nil
!   "Non-nil when speedbar is showing buttons specific to a special mode.
  In this case it is the originating buffer.")
  (defvar speedbar-buffer nil
    "The buffer displaying the speedbar.")
***************
*** 1665,1671 ****
  
  (defun speedbar-up-directory ()
    "Keyboard accelerator for moving the default directory up one.
! Assumes that the current buffer is the speedbar buffer"
    (interactive)
    (setq default-directory (expand-file-name (concat default-directory "../")))
    (speedbar-update-contents))
--- 1665,1671 ----
  
  (defun speedbar-up-directory ()
    "Keyboard accelerator for moving the default directory up one.
! Assumes that the current buffer is the speedbar buffer."
    (interactive)
    (setq default-directory (expand-file-name (concat default-directory "../")))
    (speedbar-update-contents))
***************
*** 1738,1744 ****
  (defun speedbar-item-info ()
    "Display info in the mini-buffer about the button the mouse is over.
  This function can be replaced in `speedbar-mode-functions-list' as
! `speedbar-item-info'"
    (interactive)
    (let (message-log-max)
      (funcall (or (speedbar-fetch-replacement-function 'speedbar-item-info)
--- 1738,1744 ----
  (defun speedbar-item-info ()
    "Display info in the mini-buffer about the button the mouse is over.
  This function can be replaced in `speedbar-mode-functions-list' as
! `speedbar-item-info'."
    (interactive)
    (let (message-log-max)
      (funcall (or (speedbar-fetch-replacement-function 'speedbar-item-info)
***************
*** 1943,1949 ****
  ;;; Utility functions
  ;;
  (defun speedbar-set-timer (timeout)
!   "Apply a timer with TIMEOUT, or remove a timer if TIMOUT is nil.
  TIMEOUT is the number of seconds until the speedbar timer is called
  again.  When TIMEOUT is nil, turn off all timeouts.
  This function will also enable or disable the `vc-checkin-hook' used
--- 1943,1949 ----
  ;;; Utility functions
  ;;
  (defun speedbar-set-timer (timeout)
!   "Apply a timer with TIMEOUT, or remove a timer if TIMEOUT is nil.
  TIMEOUT is the number of seconds until the speedbar timer is called
  again.  When TIMEOUT is nil, turn off all timeouts.
  This function will also enable or disable the `vc-checkin-hook' used
***************
*** 2017,2023 ****
  This function assumes that the current buffer is the speedbar buffer.
  If PREVLINE, then put this button on the previous line.
  
! This is a convenience function for special mode that create their own
  specialized speedbar displays."
    (goto-char (point-max))
    (let ((start (point)))
--- 2017,2023 ----
  This function assumes that the current buffer is the speedbar buffer.
  If PREVLINE, then put this button on the previous line.
  
! This is a convenience function for special modes that create their own
  specialized speedbar displays."
    (goto-char (point-max))
    (let ((start (point)))
***************
*** 2038,2044 ****
  (defun speedbar-make-button (start end face mouse function &optional token)
    "Create a button from START to END, with FACE as the display face.
  MOUSE is the mouse face.  When this button is clicked on FUNCTION
! will be run with the TOKEN parameter (any Lisp object)"
    (put-text-property start end 'face face)
    (put-text-property start end 'mouse-face mouse)
    (put-text-property start end 'invisible nil)
--- 2038,2044 ----
  (defun speedbar-make-button (start end face mouse function &optional token)
    "Create a button from START to END, with FACE as the display face.
  MOUSE is the mouse face.  When this button is clicked on FUNCTION
! will be run with the TOKEN parameter (any Lisp object)."
    (put-text-property start end 'face face)
    (put-text-property start end 'mouse-face mouse)
    (put-text-property start end 'invisible nil)
***************
*** 2291,2297 ****
  Lastly, DEPTH shows the depth of expansion.
  
  This function assumes that the cursor is in the speedbar window at the
! position to insert a new item, and that the new item will end with a CR"
    (let ((start (point))
        (end (progn
               (insert (int-to-string depth) ":")
--- 2291,2297 ----
  Lastly, DEPTH shows the depth of expansion.
  
  This function assumes that the cursor is in the speedbar window at the
! position to insert a new item, and that the new item will end with a CR."
    (let ((start (point))
        (end (progn
               (insert (int-to-string depth) ":")
***************
*** 2348,2354 ****
    "Insert list of FILES starting at point, and indenting all files to LEVEL.
  Tag expandable items with a +, otherwise a ?.  Don't highlight ? as we
  don't know how to manage them.  The input parameter FILES is a cons
! cell of the form ( 'DIRLIST .  'FILELIST )"
    ;; Start inserting all the directories
    (let ((dirs (car files)))
      (while dirs
--- 2348,2354 ----
    "Insert list of FILES starting at point, and indenting all files to LEVEL.
  Tag expandable items with a +, otherwise a ?.  Don't highlight ? as we
  don't know how to manage them.  The input parameter FILES is a cons
! cell of the form ( 'DIRLIST .  'FILELIST )."
    ;; Start inserting all the directories
    (let ((dirs (car files)))
      (while dirs
***************
*** 2745,2751 ****
    (speedbar-reconfigure-keymaps))
  
  (defun speedbar-update-special-contents ()
!   "Used the mode-specific variable to fill in the speedbar buffer.
  This should only be used by modes classified as special."
    (let ((funclst speedbar-special-mode-expansion-list)
        (specialbuff (current-buffer)))
--- 2745,2751 ----
    (speedbar-reconfigure-keymaps))
  
  (defun speedbar-update-special-contents ()
!   "Use the mode-specific variable to fill in the speedbar buffer.
  This should only be used by modes classified as special."
    (let ((funclst speedbar-special-mode-expansion-list)
        (specialbuff (current-buffer)))
***************
*** 2869,2875 ****
    )
  
  (defun speedbar-find-selected-file (file)
!   "Goto the line where FILE is."
    (goto-char (point-min))
    (let ((m nil))
      (while (and (setq m (re-search-forward
--- 2869,2875 ----
    )
  
  (defun speedbar-find-selected-file (file)
!   "Go to the line where FILE is."
    (goto-char (point-min))
    (let ((m nil))
      (while (and (setq m (re-search-forward
***************
*** 2971,2977 ****
  (defun speedbar-add-indicator (indicator-string &optional replace-this)
    "Add INDICATOR-STRING to the end of this speedbar line.
  If INDICATOR-STRING is space, and REPLACE-THIS is a character, then
! an the existing indicator is removed.  If there is already an
  indicator, then do not add a space."
    (beginning-of-line)
    ;; The nature of the beast: Assume we are in "the right place"
--- 2971,2977 ----
  (defun speedbar-add-indicator (indicator-string &optional replace-this)
    "Add INDICATOR-STRING to the end of this speedbar line.
  If INDICATOR-STRING is space, and REPLACE-THIS is a character, then
! the existing indicator is removed.  If there is already an
  indicator, then do not add a space."
    (beginning-of-line)
    ;; The nature of the beast: Assume we are in "the right place"
***************
*** 3235,3241 ****
  (defun speedbar-do-function-pointer ()
    "Look under the cursor and examine the text properties.
  From this extract the file/tag name, token, indentation level and call
! a function if appropriate"
    (let* ((fn (get-text-property (point) 'speedbar-function))
         (tok (get-text-property (point) 'speedbar-token))
         ;; The 1-,+ is safe because scaning starts AFTER the point
--- 3235,3241 ----
  (defun speedbar-do-function-pointer ()
    "Look under the cursor and examine the text properties.
  From this extract the file/tag name, token, indentation level and call
! a function if appropriate."
    (let* ((fn (get-text-property (point) 'speedbar-function))
         (tok (get-text-property (point) 'speedbar-token))
         ;; The 1-,+ is safe because scaning starts AFTER the point
***************
*** 3286,3292 ****
        nil)))
  
  (defun speedbar-line-file (&optional p)
!   "Retrieve the file or whatever from the line at P point.
  The return value is a string representing the file.  If it is a
  directory, then it is the directory name."
    (save-match-data
--- 3286,3292 ----
        nil)))
  
  (defun speedbar-line-file (&optional p)
!   "Retrieve the file or whatever from the line at point P.
  The return value is a string representing the file.  If it is a
  directory, then it is the directory name."
    (save-match-data
***************
*** 3300,3306 ****
        nil))))
  
  (defun speedbar-goto-this-file (file)
!   "If FILE is displayed, goto this line and return t.
  Otherwise do not move and return nil."
    (let ((path (substring (file-name-directory (expand-file-name file))
                         (length (expand-file-name default-directory))))
--- 3300,3306 ----
        nil))))
  
  (defun speedbar-goto-this-file (file)
!   "If FILE is displayed, go to this line and return t.
  Otherwise do not move and return nil."
    (let ((path (substring (file-name-directory (expand-file-name file))
                         (length (expand-file-name default-directory))))
***************
*** 3341,3347 ****
    "Retrieve the pathname associated with the current line.
  This may require traversing backwards from DEPTH and combining the default
  directory with these items.  This function is replaceable in
! `speedbar-mode-functions-list' as `speedbar-line-path'"
    (let ((rf (speedbar-fetch-replacement-function 'speedbar-line-path)))
      (if rf (funcall rf depth) default-directory)))
        
--- 3341,3347 ----
    "Retrieve the pathname associated with the current line.
  This may require traversing backwards from DEPTH and combining the default
  directory with these items.  This function is replaceable in
! `speedbar-mode-functions-list' as `speedbar-line-path'."
    (let ((rf (speedbar-fetch-replacement-function 'speedbar-line-path)))
      (if rf (funcall rf depth) default-directory)))
        
***************
*** 3449,3455 ****
  (if speedbar-xemacsp
      (defalias 'speedbar-mouse-event-p 'button-press-event-p)
    (defun speedbar-mouse-event-p (event)
!     "Return t if the event is a mouse related event"
      ;; And Emacs does it this way
      (if (and (listp event)
             (member (event-basic-type event)
--- 3449,3455 ----
  (if speedbar-xemacsp
      (defalias 'speedbar-mouse-event-p 'button-press-event-p)
    (defun speedbar-mouse-event-p (event)
!     "Return t if the event is a mouse related event."
      ;; And Emacs does it this way
      (if (and (listp event)
             (member (event-basic-type event)
***************
*** 3482,3488 ****
  
  (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
  the subdirectory TEXT.  TOKEN is an unused requirement.  The
  subdirectory chosen will be at INDENT level."
    (setq default-directory
--- 3482,3488 ----
  
  (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
  subdirectory chosen will be at INDENT level."
    (setq default-directory
***************
*** 3587,3593 ****
    (speedbar-center-buffer-smartly))
  
  (defun speedbar-tag-find (text token indent)
!   "For the tag TEXT in a file TOKEN, goto that position.
  INDENT is the current indentation level."
    (let ((file (speedbar-line-path indent)))
      (speedbar-find-file-in-frame file)
--- 3587,3593 ----
    (speedbar-center-buffer-smartly))
  
  (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-path indent)))
      (speedbar-find-file-in-frame file)
***************
*** 3776,3789 ****
  (defvar speedbar-fetch-etags-command "etags"
    "*Command used to create an etags file.
  
! This variable is ignored if `speedbar-use-imenu-flag' is t")
  
  (defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
    "*List of arguments to use with `speedbar-fetch-etags-command'.
  This creates an etags output buffer.  Use `speedbar-toggle-etags' to
  modify this list conveniently.
  
! This variable is ignored if `speedbar-use-imenu-flag' is t")
  
  (defun speedbar-toggle-etags (flag)
    "Toggle FLAG in `speedbar-fetch-etags-arguments'.
--- 3776,3789 ----
  (defvar speedbar-fetch-etags-command "etags"
    "*Command used to create an etags file.
  
! This variable is ignored if `speedbar-use-imenu-flag' is t.")
  
  (defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
    "*List of arguments to use with `speedbar-fetch-etags-command'.
  This creates an etags output buffer.  Use `speedbar-toggle-etags' to
  modify this list conveniently.
  
! This variable is ignored if `speedbar-use-imenu-flag' is t.")
  
  (defun speedbar-toggle-etags (flag)
    "Toggle FLAG in `speedbar-fetch-etags-arguments'.
***************
*** 3793,3799 ****
  `speedbar-show-unknown-files'.
  
    This function is a convenience function for XEmacs menu created by
! Farzin Guilak <address@hidden>"
    (interactive)
    (cond
     ((equal flag "sort")
--- 3793,3799 ----
  `speedbar-show-unknown-files'.
  
    This function is a convenience function for XEmacs menu created by
! Farzin Guilak <address@hidden>."
    (interactive)
    (cond
     ((equal flag "sort")
***************
*** 3869,3875 ****
  (defun speedbar-extract-one-symbol (expr)
    "At point, return nil, or one alist in the form: (SYMBOL .  POSITION)
  The line should contain output from etags.  Parse the output using the
! regular expression EXPR"
    (let* ((sym (if (stringp expr)
                  (if (save-excursion
                        (re-search-forward expr (save-excursion
--- 3869,3875 ----
  (defun speedbar-extract-one-symbol (expr)
    "At point, return nil, or one alist in the form: (SYMBOL .  POSITION)
  The line should contain output from etags.  Parse the output using the
! regular expression EXPR."
    (let* ((sym (if (stringp expr)
                  (if (save-excursion
                        (re-search-forward expr (save-excursion
***************
*** 3893,3899 ****
        nil)))
  
  (defun speedbar-parse-c-or-c++tag ()
!   "Parse a c or c++ tag, which tends to be a little complex."
    (save-excursion
      (let ((bound (save-excursion (end-of-line) (point))))
        (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t)
--- 3893,3899 ----
        nil)))
  
  (defun speedbar-parse-c-or-c++tag ()
!   "Parse a C or C++ tag, which tends to be a little complex."
    (save-excursion
      (let ((bound (save-excursion (end-of-line) (point))))
        (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t)
***************
*** 4117,4123 ****
    )
  
  (defun speedbar-unhighlight-one-tag-line ()
!   "Unhighlight the currently highlight line."
    (if speedbar-highlight-one-tag-line
        (progn
        (speedbar-delete-overlay speedbar-highlight-one-tag-line)
--- 4117,4123 ----
    )
  
  (defun speedbar-unhighlight-one-tag-line ()
!   "Unhighlight the currently highlighted line."
    (if speedbar-highlight-one-tag-line
        (progn
        (speedbar-delete-overlay speedbar-highlight-one-tag-line)
***************
*** 4154,4160 ****
                                    (:foreground "blue4"))
                                   (((class color) (background dark))
                                    (:foreground "light blue")))
!   "Faced used for directory names."
    :group 'speedbar-faces)
  (defface speedbar-tag-face '((((class color) (background light))
                              (:foreground "brown"))
--- 4154,4160 ----
                                    (:foreground "blue4"))
                                   (((class color) (background dark))
                                    (:foreground "light blue")))
!   "Face used for directory names."
    :group 'speedbar-faces)
  (defface speedbar-tag-face '((((class color) (background light))
                              (:foreground "brown"))
***************
*** 4198,4204 ****
        
  (defmacro defimage-speedbar (variable imagespec docstring)
    "Don't bother loading up an image...
! Argument VARIABLE is the varible to define.
  Argument IMAGESPEC is the list defining the image to create.
  Argument DOCSTRING is the documentation for VARIABLE."
    `(defvar ,variable nil ,docstring))
--- 4198,4204 ----
        
  (defmacro defimage-speedbar (variable imagespec docstring)
    "Don't bother loading up an image...
! Argument VARIABLE is the variable to define.
  Argument IMAGESPEC is the list defining the image to create.
  Argument DOCSTRING is the documentation for VARIABLE."
    `(defvar ,variable nil ,docstring))
***************
*** 4215,4228 ****
      r))
  
  (defun speedbar-convert-emacs21-imagespec-to-xemacs (spec)
!   "Convert the Emacs21 Image SPEC into an XEmacs image spec."
    (let* ((sl (car spec))
         (itype (nth 1 sl))
         (ifile (nth 3 sl)))
      (vector itype ':file (speedbar-find-image-on-load-path ifile))))
  
  (defmacro defimage-speedbar (variable imagespec docstring)
!   "Devine VARIABLE as an image if `defimage' is not available..
  IMAGESPEC is the image data, and DOCSTRING is documentation for the image."
    `(defvar ,variable
       ;; The Emacs21 version of defimage looks just like the XEmacs image
--- 4215,4228 ----
      r))
  
  (defun speedbar-convert-emacs21-imagespec-to-xemacs (spec)
!   "Convert the Emacs21 image SPEC into an XEmacs image spec."
    (let* ((sl (car spec))
         (itype (nth 1 sl))
         (ifile (nth 3 sl)))
      (vector itype ':file (speedbar-find-image-on-load-path ifile))))
  
  (defmacro defimage-speedbar (variable imagespec docstring)
!   "Define VARIABLE as an image if `defimage' is not available.
  IMAGESPEC is the image data, and DOCSTRING is documentation for the image."
    `(defvar ,variable
       ;; The Emacs21 version of defimage looks just like the XEmacs image



reply via email to

[Prev in Thread] Current Thread [Next in Thread]