[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/ebrowse.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/ebrowse.el |
Date: |
Thu, 17 Oct 2002 12:58:03 -0400 |
Index: emacs/lisp/progmodes/ebrowse.el
diff -c emacs/lisp/progmodes/ebrowse.el:1.18
emacs/lisp/progmodes/ebrowse.el:1.19
*** emacs/lisp/progmodes/ebrowse.el:1.18 Sat Jul 13 16:17:00 2002
--- emacs/lisp/progmodes/ebrowse.el Thu Oct 17 12:57:37 2002
***************
*** 31,37 ****
;; - A complete set of tags-like functions working on class trees
;; - An electric buffer list showing class browser buffers only
! ;; Documentation is found in a separate Info file.
;;; Code:
--- 31,37 ----
;; - A complete set of tags-like functions working on class trees
;; - An electric buffer list showing class browser buffers only
! ;; Documentation is found in a separate Info file.
;;; Code:
***************
*** 375,384 ****
;; they are defined.
member-table)
!
(defstruct (ebrowse-ts (:type vector) :named)
"Tree structure.
! Following the header structure, an BROWSE file contains a number
of `ebrowse-ts' structures, each one describing one root class of
the class hierarchy with all its subclasses."
;; A `ebrowse-cs' structure describing the root class.
--- 375,384 ----
;; they are defined.
member-table)
!
(defstruct (ebrowse-ts (:type vector) :named)
"Tree structure.
! Following the header structure, a BROWSE file contains a number
of `ebrowse-ts' structures, each one describing one root class of
the class hierarchy with all its subclasses."
;; A `ebrowse-cs' structure describing the root class.
***************
*** 551,557 ****
(defvar ebrowse--frozen-flag nil
"Non-nil means an Ebrowse buffer won't be reused.
Buffer-local in Ebrowse buffers.")
!
(defvar ebrowse--show-file-names-flag nil
"Non-nil means show file names in a tree buffer.
--- 551,557 ----
(defvar ebrowse--frozen-flag nil
"Non-nil means an Ebrowse buffer won't be reused.
Buffer-local in Ebrowse buffers.")
!
(defvar ebrowse--show-file-names-flag nil
"Non-nil means show file names in a tree buffer.
***************
*** 572,578 ****
"Width of a columns to display for short member display form.
Buffer-local in Ebrowse member buffers.")
!
(defvar ebrowse--virtual-display-flag nil
"Non-nil means display virtual members in a member buffer.
Buffer-local in Ebrowse member buffers.")
--- 572,578 ----
"Width of a columns to display for short member display form.
Buffer-local in Ebrowse member buffers.")
!
(defvar ebrowse--virtual-display-flag nil
"Non-nil means display virtual members in a member buffer.
Buffer-local in Ebrowse member buffers.")
***************
*** 796,802 ****
(defun ebrowse-base-classes (tree)
"Return list of base-classes of TREE by searching subclass lists.
! This function must be used instead of the struct slot
`base-classes' to access the base-class list directly because it
computes this information lazily."
(or (ebrowse-ts-base-classes tree)
--- 796,802 ----
(defun ebrowse-base-classes (tree)
"Return list of base-classes of TREE by searching subclass lists.
! This function must be used instead of the struct slot
`base-classes' to access the base-class list directly because it
computes this information lazily."
(or (ebrowse-ts-base-classes tree)
***************
*** 885,891 ****
;;; Reading a tree from disk
(defun ebrowse-read ()
! "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.
Return a list (HEADER TREE) where HEADER is the file header read
and TREE is a list of `ebrowse-ts' structures forming the class tree."
(let ((header (condition-case nil
--- 885,891 ----
;;; Reading a tree from disk
(defun ebrowse-read ()
! "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.
Return a list (HEADER TREE) where HEADER is the file header read
and TREE is a list of `ebrowse-ts' structures forming the class tree."
(let ((header (condition-case nil
***************
*** 924,930 ****
(ebrowse-tree-mode)
(current-buffer)))
!
(defun ebrowse-create-tree-buffer (tree tags-file header obarray pop)
"Create a new tree buffer for tree TREE.
The tree was loaded from file TAGS-FILE.
--- 924,930 ----
(ebrowse-tree-mode)
(current-buffer)))
!
(defun ebrowse-create-tree-buffer (tree tags-file header obarray pop)
"Create a new tree buffer for tree TREE.
The tree was loaded from file TAGS-FILE.
***************
*** 1060,1066 ****
(define-key map [down-mouse-3] 'ebrowse-mouse-3-in-tree-buffer)
(define-key map [mouse-2] 'ebrowse-mouse-2-in-tree-buffer)
(define-key map [down-mouse-1] 'ebrowse-mouse-1-in-tree-buffer))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "L" map1)
--- 1060,1066 ----
(define-key map [down-mouse-3] 'ebrowse-mouse-3-in-tree-buffer)
(define-key map [mouse-2] 'ebrowse-mouse-2-in-tree-buffer)
(define-key map [down-mouse-1] 'ebrowse-mouse-1-in-tree-buffer))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "L" map1)
***************
*** 1115,1124 ****
(interactive)
(let* ((ident (propertized-buffer-identification "C++ Tree"))
header tree buffer-read-only)
!
(kill-all-local-variables)
(use-local-map ebrowse-tree-mode-map)
!
(unless (zerop (buffer-size))
(goto-char (point-min))
(multiple-value-setq (header tree) (ebrowse-read))
--- 1115,1124 ----
(interactive)
(let* ((ident (propertized-buffer-identification "C++ Tree"))
header tree buffer-read-only)
!
(kill-all-local-variables)
(use-local-map ebrowse-tree-mode-map)
!
(unless (zerop (buffer-size))
(goto-char (point-min))
(multiple-value-setq (header tree) (ebrowse-read))
***************
*** 1126,1132 ****
(setq tree (ebrowse-sort-tree-list tree))
(erase-buffer)
(message nil))
!
(mapcar 'make-local-variable
'(ebrowse--tags-file-name
ebrowse--indentation
--- 1126,1132 ----
(setq tree (ebrowse-sort-tree-list tree))
(erase-buffer)
(message nil))
!
(mapcar 'make-local-variable
'(ebrowse--tags-file-name
ebrowse--indentation
***************
*** 1136,1142 ****
ebrowse--frozen-flag
ebrowse--tree-obarray
revert-buffer-function))
!
(setf ebrowse--show-file-names-flag nil
ebrowse--tree-obarray (make-vector 127 0)
ebrowse--frozen-flag nil
--- 1136,1142 ----
ebrowse--frozen-flag
ebrowse--tree-obarray
revert-buffer-function))
!
(setf ebrowse--show-file-names-flag nil
ebrowse--tree-obarray (make-vector 127 0)
ebrowse--frozen-flag nil
***************
*** 1159,1165 ****
(ebrowse-redraw-tree)
(set-buffer-modified-p nil))
(run-hooks 'ebrowse-tree-mode-hook)))
!
(defun ebrowse-update-tree-buffer-mode-line ()
--- 1159,1165 ----
(ebrowse-redraw-tree)
(set-buffer-modified-p nil))
(run-hooks 'ebrowse-tree-mode-hook)))
!
(defun ebrowse-update-tree-buffer-mode-line ()
***************
*** 1222,1228 ****
(condition-case error
(loop repeat (or n-times 1)
as tree = (ebrowse-tree-at-point)
! do (progn
(setf (ebrowse-ts-mark tree) (not (ebrowse-ts-mark tree)))
(forward-line 1)
(push tree to-change)))
--- 1222,1228 ----
(condition-case error
(loop repeat (or n-times 1)
as tree = (ebrowse-tree-at-point)
! do (progn
(setf (ebrowse-ts-mark tree) (not (ebrowse-ts-mark tree)))
(forward-line 1)
(push tree to-change)))
***************
*** 1426,1436 ****
"Pop to a browser buffer from any other buffer.
Pop to member buffer if no prefix ARG, to tree buffer otherwise."
(interactive "P")
! (let ((buffer (get-buffer (if arg
ebrowse-tree-buffer-name
ebrowse-member-buffer-name))))
(unless buffer
! (setq buffer
(get-buffer (if arg
ebrowse-member-buffer-name
ebrowse-tree-buffer-name))))
--- 1426,1436 ----
"Pop to a browser buffer from any other buffer.
Pop to member buffer if no prefix ARG, to tree buffer otherwise."
(interactive "P")
! (let ((buffer (get-buffer (if arg
ebrowse-tree-buffer-name
ebrowse-member-buffer-name))))
(unless buffer
! (setq buffer
(get-buffer (if arg
ebrowse-member-buffer-name
ebrowse-tree-buffer-name))))
***************
*** 1536,1542 ****
:file (ebrowse-cs-file class)
:point (ebrowse-cs-point class))))
(ebrowse-view/find-file-and-search-pattern
! browse-struct
(list ebrowse--header class nil)
file
ebrowse--tags-file-name
--- 1536,1542 ----
:file (ebrowse-cs-file class)
:point (ebrowse-cs-point class))))
(ebrowse-view/find-file-and-search-pattern
! browse-struct
(list ebrowse--header class nil)
file
ebrowse--tags-file-name
***************
*** 1638,1644 ****
(make-local-variable 'ebrowse--frame-configuration)
(setq ebrowse--frame-configuration old-frame-configuration)
(make-local-variable 'ebrowse--view-exit-action)
! (setq ebrowse--view-exit-action
(and (not had-a-buf)
(not (buffer-modified-p buf-to-view))
'kill-buffer))
--- 1638,1644 ----
(make-local-variable 'ebrowse--frame-configuration)
(setq ebrowse--frame-configuration old-frame-configuration)
(make-local-variable 'ebrowse--view-exit-action)
! (setq ebrowse--view-exit-action
(and (not had-a-buf)
(not (buffer-modified-p buf-to-view))
'kill-buffer))
***************
*** 1653,1659 ****
INFO is a list (HEADER MEMBER-OR-CLASS ACCESSOR). HEADER is the
header structure of a class tree. MEMBER-OR-CLASS is either an
`ebrowse-ms' or `ebrowse-cs' structure depending on what is searched.
! ACCESSOR is an accessor function for the member list of an member
if MEMBER-OR-CLASS is an `ebrowse-ms'.
FILE is the file to search the member in.
FILE is not taken out of STRUC here because the filename in STRUC
--- 1653,1659 ----
INFO is a list (HEADER MEMBER-OR-CLASS ACCESSOR). HEADER is the
header structure of a class tree. MEMBER-OR-CLASS is either an
`ebrowse-ms' or `ebrowse-cs' structure depending on what is searched.
! ACCESSOR is an accessor function for the member list of a member
if MEMBER-OR-CLASS is an `ebrowse-ms'.
FILE is the file to search the member in.
FILE is not taken out of STRUC here because the filename in STRUC
***************
*** 1706,1712 ****
(defun ebrowse-class-declaration-regexp (name)
! "Construct a regexp for a declaration of class NAME."
(concat "^[ \t]*\\(template[ \t\n]*<.*>\\)?"
"[ \t\n]*\\(class\\|struct\\|union\\).*\\S_"
(ebrowse-symbol-regexp name)
--- 1706,1712 ----
(defun ebrowse-class-declaration-regexp (name)
! "Construct a regexp for a declaration of class NAME."
(concat "^[ \t]*\\(template[ \t\n]*<.*>\\)?"
"[ \t\n]*\\(class\\|struct\\|union\\).*\\S_"
(ebrowse-symbol-regexp name)
***************
*** 1841,1853 ****
start-of-class-name end-of-class-name)
;; Insert mark
(insert (if (ebrowse-ts-mark tree) ">" " "))
!
;; Indent and insert class name
(indent-to (+ (* level ebrowse--indentation)
ebrowse-tree-left-margin))
(setq start (point))
(insert (ebrowse-qualified-class-name class))
!
;; If template class, add <>
(when (ebrowse-template-p class)
(insert "<>"))
--- 1841,1853 ----
start-of-class-name end-of-class-name)
;; Insert mark
(insert (if (ebrowse-ts-mark tree) ">" " "))
!
;; Indent and insert class name
(indent-to (+ (* level ebrowse--indentation)
ebrowse-tree-left-margin))
(setq start (point))
(insert (ebrowse-qualified-class-name class))
!
;; If template class, add <>
(when (ebrowse-template-p class)
(insert "<>"))
***************
*** 2168,2174 ****
(define-key map1 "d" 'ebrowse-switch-member-buffer-to-derived-class)
(define-key map1 "n" 'ebrowse-switch-member-buffer-to-next-sibling-class)
(define-key map1 "p"
'ebrowse-switch-member-buffer-to-previous-sibling-class))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "D" map1)
--- 2168,2174 ----
(define-key map1 "d" 'ebrowse-switch-member-buffer-to-derived-class)
(define-key map1 "n" 'ebrowse-switch-member-buffer-to-next-sibling-class)
(define-key map1 "p"
'ebrowse-switch-member-buffer-to-previous-sibling-class))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "D" map1)
***************
*** 2178,2184 ****
(define-key map1 "l" 'ebrowse-toggle-long-short-display)
(define-key map1 "r" 'ebrowse-toggle-regexp-display)
(define-key map1 "w" 'ebrowse-set-member-buffer-column-width))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "F" map1)
--- 2178,2184 ----
(define-key map1 "l" 'ebrowse-toggle-long-short-display)
(define-key map1 "r" 'ebrowse-toggle-regexp-display)
(define-key map1 "w" 'ebrowse-set-member-buffer-column-width))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "F" map1)
***************
*** 2193,2199 ****
(define-key map1 "p" 'ebrowse-toggle-pure-member-filter)
(define-key map1 "r" 'ebrowse-remove-all-member-filters)
(define-key map1 "v" 'ebrowse-toggle-virtual-member-filter))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "L" map1)
--- 2193,2199 ----
(define-key map1 "p" 'ebrowse-toggle-pure-member-filter)
(define-key map1 "r" 'ebrowse-remove-all-member-filters)
(define-key map1 "v" 'ebrowse-toggle-virtual-member-filter))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "L" map1)
***************
*** 2205,2218 ****
(define-key map1 "t" 'ebrowse-display-types-member-list)
(define-key map1 "v" 'ebrowse-display-variables-member-list)
(define-key map1 "V" 'ebrowse-display-static-variables-member-list))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "G" map1)
(define-key map1 "m" 'ebrowse-goto-visible-member/all-member-lists)
(define-key map1 "n" 'ebrowse-repeat-member-search)
(define-key map1 "v" 'ebrowse-goto-visible-member))
!
(define-key map "f" 'ebrowse-find-member-declaration)
(define-key map "m" 'ebrowse-switch-to-next-member-buffer)
(define-key map "q" 'bury-buffer)
--- 2205,2218 ----
(define-key map1 "t" 'ebrowse-display-types-member-list)
(define-key map1 "v" 'ebrowse-display-variables-member-list)
(define-key map1 "V" 'ebrowse-display-static-variables-member-list))
!
(let ((map1 (make-sparse-keymap)))
(suppress-keymap map1 t)
(define-key map "G" map1)
(define-key map1 "m" 'ebrowse-goto-visible-member/all-member-lists)
(define-key map1 "n" 'ebrowse-repeat-member-search)
(define-key map1 "v" 'ebrowse-goto-visible-member))
!
(define-key map "f" 'ebrowse-find-member-declaration)
(define-key map "m" 'ebrowse-switch-to-next-member-buffer)
(define-key map "q" 'bury-buffer)
***************
*** 2682,2688 ****
the class cursor is on."
(let ((start (point))
(tree (or class ebrowse--displayed-class))
! class-name-start
class-name-end)
(insert "class ")
(setq class-name-start (point))
--- 2682,2688 ----
the class cursor is on."
(let ((start (point))
(tree (or class ebrowse--displayed-class))
! class-name-start
class-name-end)
(insert "class ")
(setq class-name-start (point))
***************
*** 2832,2838 ****
(indent-to (* i column-width))
(put-text-property start-of-column (point) 'mouse-face nil)
(setq start-of-entry (point))
! ;; Show various attributes
(when ebrowse--attributes-flag
(insert "<")
(ebrowse-draw-member-attributes member)
--- 2832,2838 ----
(indent-to (* i column-width))
(put-text-property start-of-column (point) 'mouse-face nil)
(setq start-of-entry (point))
! ;; Show various attributes
(when ebrowse--attributes-flag
(insert "<")
(ebrowse-draw-member-attributes member)
***************
*** 3035,3041 ****
Prefix arg ARG says which class should be displayed. Default is
the first derived class."
(interactive "P")
! (flet ((ebrowse-tree-obarray-as-alist ()
(loop for s in (ebrowse-ts-subclasses
ebrowse--displayed-class)
collect (cons (ebrowse-cs-name
--- 3035,3041 ----
Prefix arg ARG says which class should be displayed. Default is
the first derived class."
(interactive "P")
! (flet ((ebrowse-tree-obarray-as-alist ()
(loop for s in (ebrowse-ts-subclasses
ebrowse--displayed-class)
collect (cons (ebrowse-cs-name
***************
*** 3125,3131 ****
["Find in Tree" ebrowse-goto-visible-member/all-member-lists
:help "Search for a member in any class"
:active t])
! ("Display"
["Inherited" ebrowse-toggle-base-class-display
:help "Toggle display of inherited members"
:style toggle
--- 3125,3131 ----
["Find in Tree" ebrowse-goto-visible-member/all-member-lists
:help "Search for a member in any class"
:active t])
! ("Display"
["Inherited" ebrowse-toggle-base-class-display
:help "Toggle display of inherited members"
:style toggle
***************
*** 3218,3224 ****
:active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]))
! (easy-menu-define
ebrowse-member-name-object-menu ebrowse-member-mode-map
"Object menu for member names"
'("Ebrowse"
--- 3218,3224 ----
:active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]))
! (easy-menu-define
ebrowse-member-name-object-menu ebrowse-member-mode-map
"Object menu for member names"
'("Ebrowse"
***************
*** 3275,3281 ****
NAME is the name of the member.
Value is an alist of elements (CLASS-NAME . (CLASS LIST NAME)),
where each element describes one occurrence of member NAME in the tree.
! CLASS-NAME is the qualified name of the class in which the
member was found. The CDR of the acons is described in function
`ebrowse-class/index/member-for-member'."
(let ((table (ebrowse-member-table tree-header))
--- 3275,3281 ----
NAME is the name of the member.
Value is an alist of elements (CLASS-NAME . (CLASS LIST NAME)),
where each element describes one occurrence of member NAME in the tree.
! CLASS-NAME is the qualified name of the class in which the
member was found. The CDR of the acons is described in function
`ebrowse-class/index/member-for-member'."
(let ((table (ebrowse-member-table tree-header))
***************
*** 3321,3328 ****
;; matches! It returns the name as a string.
(unless (setq member-info (gethash name members))
(if (y-or-n-p "No exact match found. Try substrings? ")
! (setq name
! (or (first (ebrowse-list-of-matching-members
members (regexp-quote name) name))
(error "Sorry, nothing found")))
(error "Canceled")))
--- 3321,3328 ----
;; matches! It returns the name as a string.
(unless (setq member-info (gethash name members))
(if (y-or-n-p "No exact match found. Try substrings? ")
! (setq name
! (or (first (ebrowse-list-of-matching-members
members (regexp-quote name) name))
(error "Sorry, nothing found")))
(error "Canceled")))
***************
*** 3583,3589 ****
TREE is the class of the member to display.
ACCESSOR is the accessor symbol of its member list.
MEMBER is the member structure.
! KIND is a an additional string printed in the buffer."
(let* ((tree (first info))
(globals-p (ebrowse-globals-tree-p tree)))
(unless globals-p
--- 3583,3589 ----
TREE is the class of the member to display.
ACCESSOR is the accessor symbol of its member list.
MEMBER is the member structure.
! KIND is an additional string printed in the buffer."
(let* ((tree (first info))
(globals-p (ebrowse-globals-tree-p tree)))
(unless globals-p
***************
*** 3650,3656 ****
;;;###autoload
(defun* ebrowse-tags-complete-symbol (prefix)
"Perform completion on the C++ symbol preceding point.
! A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion."
(interactive "P")
--- 3650,3656 ----
;;;###autoload
(defun* ebrowse-tags-complete-symbol (prefix)
"Perform completion on the C++ symbol preceding point.
! A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion."
(interactive "P")
***************
*** 3695,3701 ****
(t
(delete-region begin end)
(insert completion)
!
(setf ebrowse-last-completion-location (point)
ebrowse-last-completion-start pattern
ebrowse-last-completion completion
--- 3695,3701 ----
(t
(delete-region begin end)
(insert completion)
!
(setf ebrowse-last-completion-location (point)
ebrowse-last-completion-start pattern
ebrowse-last-completion completion
***************
*** 3797,3803 ****
(defun ebrowse-tags-query-replace (from to)
"Query replace FROM with TO in all files of a class tree.
With prefix arg, process files of marked classes only."
! (interactive
"sTree query replace (regexp): \nsTree query replace %s by: ")
(setq ebrowse-tags-loop-form
(list 'and (list 'save-excursion
--- 3797,3803 ----
(defun ebrowse-tags-query-replace (from to)
"Query replace FROM with TO in all files of a class tree.
With prefix arg, process files of marked classes only."
! (interactive
"sTree query replace (regexp): \nsTree query replace %s by: ")
(setq ebrowse-tags-loop-form
(list 'and (list 'save-excursion
***************
*** 3868,3874 ****
(t
(unwind-protect
(progn
! (push (function
(lambda ()
(goto-char (ebrowse-position-point position))))
view-mode-hook)
--- 3868,3874 ----
(t
(unwind-protect
(progn
! (push (function
(lambda ()
(goto-char (ebrowse-position-point position))))
view-mode-hook)
***************
*** 3894,3900 ****
:file-name (buffer-file-name (marker-buffer marker))
:point (marker-position marker)
:target target
! :info info)
ebrowse-position-stack))))
--- 3894,3900 ----
:file-name (buffer-file-name (marker-buffer marker))
:point (marker-position marker)
:target target
! :info info)
ebrowse-position-stack))))
***************
*** 4367,4373 ****
(easy-menu-define
! ebrowse-tree-buffer-class-object-menu ebrowse-tree-mode-map
"Object menu for classes in the tree buffer"
'("Class"
["Functions" ebrowse-tree-command:show-member-functions
--- 4367,4373 ----
(easy-menu-define
! ebrowse-tree-buffer-class-object-menu ebrowse-tree-mode-map
"Object menu for classes in the tree buffer"
'("Class"
["Functions" ebrowse-tree-command:show-member-functions
***************
*** 4409,4415 ****
(easy-menu-define
! ebrowse-tree-buffer-object-menu ebrowse-tree-mode-map
"Object menu for tree buffers"
'("Ebrowse"
["Filename Display" ebrowse-toggle-file-name-display
--- 4409,4415 ----
(easy-menu-define
! ebrowse-tree-buffer-object-menu ebrowse-tree-mode-map
"Object menu for tree buffers"
'("Ebrowse"
["Filename Display" ebrowse-toggle-file-name-display
- [Emacs-diffs] Changes to emacs/lisp/progmodes/ebrowse.el,
Juanma Barranquero <=