annotate lisp/progmodes/ebrowse.el @ 67916:26c863f15f72

(fill-single-word-nobreak-p): Use `sentence-end'.
author Juri Linkov <juri@jurta.org>
date Fri, 30 Dec 2005 05:59:16 +0000
parents 96187e7edd1b
children dc49655f57ae 4513d8dcdfd5 ee12d75eb214
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; ebrowse.el --- Emacs C++ class browser & tags facility
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
64699
629afbe74e61 Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents: 64092
diff changeset
3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
629afbe74e61 Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents: 64092
diff changeset
4 ;; 2002, 2003, 2004, 2005
629afbe74e61 Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents: 64092
diff changeset
5 ;; Free Software Foundation Inc.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Author: Gerd Moellmann <gerd@gnu.org>
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8 ;; Maintainer: FSF
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; Keywords: C++ tags tools
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; any later version.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21 ;; GNU General Public License for more details.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to
64092
e055d02d8b97 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63947
diff changeset
25 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
e055d02d8b97 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63947
diff changeset
26 ;; Boston, MA 02110-1301, USA.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 ;; This package implements
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 ;; - A class browser for C++
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 ;; - A complete set of tags-like functions working on class trees
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 ;; - An electric buffer list showing class browser buffers only
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
36 ;; Documentation is found in a separate Info file.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 ;;; Code:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40 (require 'easymenu)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 (require 'view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 (require 'ebuff-menu)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 (eval-when-compile
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 (require 'cl)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 (require 'helper))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 ;;; User-options
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 (defgroup ebrowse nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 "Settings for the C++ class browser."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 :group 'tools)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 (defcustom ebrowse-search-path nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 "*List of directories to search for source files in a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 Elements should be directory names; nil as an element means to try
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
59 to find source files relative to the location of the BROWSE file loaded."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 :group 'ebrowse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 :type '(repeat (choice (const :tag "Default" nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 (string :tag "Directory"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 (defcustom ebrowse-view/find-hook nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 "*Hooks run after finding or viewing a member or class."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 :group 'ebrowse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 :type 'hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 (defcustom ebrowse-not-found-hook nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 "*Hooks run when finding or viewing a member or class was not successful."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 :group 'ebrowse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 :type 'hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 (defcustom ebrowse-electric-list-mode-hook nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 "*Hook called by `ebrowse-electric-position-mode'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 :group 'ebrowse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 :type 'hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 (defcustom ebrowse-max-positions 50
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 "*Number of markers saved on electric position stack."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 :group 'ebrowse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 (defgroup ebrowse-tree nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 "Settings for class tree buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 :group 'ebrowse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 (defcustom ebrowse-tree-mode-hook nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96 "*Hook run in each new tree buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 :group 'ebrowse-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 :type 'hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 (defcustom ebrowse-tree-buffer-name "*Tree*"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 "*The default name of class tree buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 :group 'ebrowse-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 :type 'string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 (defcustom ebrowse--indentation 4
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 "*The amount by which subclasses are indented in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 :group 'ebrowse-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113 (defcustom ebrowse-source-file-column 40
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 "*The column in which source file names are displayed in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 :group 'ebrowse-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
117
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
118
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
119 (defcustom ebrowse-tree-left-margin 2
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
120 "*Amount of space left at the left side of the tree display.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 This space is used to display markers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 :group 'ebrowse-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 (defgroup ebrowse-member nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
128 "Settings for member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 :group 'ebrowse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 (defcustom ebrowse-default-declaration-column 25
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 "*The column in which member declarations are displayed in member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
134 :group 'ebrowse-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
135 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
137
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
138 (defcustom ebrowse-default-column-width 25
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 "*The width of the columns in member buffers (short display form)."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
140 :group 'ebrowse-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
141 :type 'integer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
142
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
143
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
144 (defcustom ebrowse-member-buffer-name "*Members*"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 "*The name of the buffer for member display."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 :group 'ebrowse-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 :type 'string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 (defcustom ebrowse-member-mode-hook nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 "*Run in each new member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 :group 'ebrowse-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 :type 'hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 (defgroup ebrowse-faces nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 "Faces used by Ebrowse."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 :group 'ebrowse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
161
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
162 (defface ebrowse-tree-mark
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
163 '((((min-colors 88)) (:foreground "red1"))
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
164 (t (:foreground "red")))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
165 "*The face used for the mark character in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
167 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
168 (put 'ebrowse-tree-mark-face 'face-alias 'ebrowse-tree-mark)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
169
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
170
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
171 (defface ebrowse-root-class
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
172 '((((min-colors 88)) (:weight bold :foreground "blue1"))
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
173 (t (:weight bold :foreground "blue")))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
174 "*The face used for root classes in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
175 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
176 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
177 (put 'ebrowse-root-class-face 'face-alias 'ebrowse-root-class)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
178
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
179
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
180 (defface ebrowse-file-name
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 '((t (:italic t)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 "*The face for filenames displayed in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
184 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
185 (put 'ebrowse-file-name-face 'face-alias 'ebrowse-file-name)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
186
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
187
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
188 (defface ebrowse-default
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189 '((t nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190 "*Face for everything else in the tree not having other faces."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
192 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
193 (put 'ebrowse-default-face 'face-alias 'ebrowse-default)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
194
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
195
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
196 (defface ebrowse-member-attribute
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
197 '((((min-colors 88)) (:foreground "red1"))
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
198 (t (:foreground "red")))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 "*Face used to display member attributes."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
201 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
202 (put 'ebrowse-member-attribute-face 'face-alias 'ebrowse-member-attribute)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
203
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
204
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
205 (defface ebrowse-member-class
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
206 '((t (:foreground "purple")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
207 "*Face used to display the class title in member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
208 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
209 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
210 (put 'ebrowse-member-class-face 'face-alias 'ebrowse-member-class)
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
211
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
212
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
213 (defface ebrowse-progress
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
214 '((((min-colors 88)) (:background "blue1"))
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 59550
diff changeset
215 (t (:background "blue")))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216 "*Face for progress indicator."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 :group 'ebrowse-faces)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
218 ;; backward-compatibility alias
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
219 (put 'ebrowse-progress-face 'face-alias 'ebrowse-progress)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
220
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
221
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
223 ;;; Utilities.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225 (defun ebrowse-some (predicate vector)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 "Return true if PREDICATE is true of some element of VECTOR.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 If so, return the value returned by PREDICATE."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
228 (let ((length (length vector))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
229 (i 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
230 result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
231 (while (and (< i length) (not result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
232 (setq result (funcall predicate (aref vector i))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 i (1+ i)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234 result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 (defun ebrowse-every (predicate vector)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
238 "Return true if PREDICATE is true of every element of VECTOR."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
239 (let ((length (length vector))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
240 (i 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
241 (result t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
242 (while (and (< i length) result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 (setq result (funcall predicate (aref vector i))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
244 i (1+ i)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
245 result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
246
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 (defun ebrowse-position (item list &optional test)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
249 "Return the position of ITEM in LIST or nil if not found.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
250 Compare items with `eq' or TEST if specified."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251 (let ((i 0) found)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
252 (cond (test
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
253 (while list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
254 (when (funcall test item (car list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
255 (setq found i list nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
256 (setq list (cdr list) i (1+ i))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
257 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
258 (while list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
259 (when (eq item (car list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260 (setq found i list nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
261 (setq list (cdr list) i (1+ i)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
262 found))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
263
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
264
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
265 (defun ebrowse-delete-if-not (predicate list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
266 "Remove elements not satisfying PREDICATE from LIST and return the result.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
267 This is a destructive operation."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
268 (let (result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
269 (while list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
270 (let ((next (cdr list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
271 (when (funcall predicate (car list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
272 (setq result (nconc result list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
273 (setf (cdr list) nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
274 (setq list next)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
275 result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
276
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
277
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
278 (defmacro ebrowse-output (&rest body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
279 "Eval BODY with a writable current buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
280 Preserve buffer's modified state."
49832
c62a92d62ebe (ebrowse-output): Don't use gensym.
Dave Love <fx@gnu.org>
parents: 49735
diff changeset
281 (let ((modified (make-symbol "--ebrowse-output--")))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
282 `(let (buffer-read-only (,modified (buffer-modified-p)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
283 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
284 (progn ,@body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
285 (set-buffer-modified-p ,modified)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
286
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
287
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
288 (defmacro ebrowse-ignoring-completion-case (&rest body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
289 "Eval BODY with `completion-ignore-case' bound to t."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
290 `(let ((completion-ignore-case t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
291 ,@body))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
292
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
293
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
294 (defmacro ebrowse-save-selective (&rest body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
295 "Eval BODY with `selective-display' restored at the end."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
296 (let ((var (make-symbol "var")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
297 `(let ((,var selective-display))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
298 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
299 (progn ,@body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
300 (setq selective-display ,var)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
301
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
302
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
303 (defmacro ebrowse-for-all-trees (spec &rest body)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
304 "For all trees in SPEC, eval BODY."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
305 (let ((var (make-symbol "var"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
306 (spec-var (car spec))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
307 (array (cadr spec)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
308 `(loop for ,var being the symbols of ,array
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
309 as ,spec-var = (get ,var 'ebrowse-root) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
310 (when (vectorp ,spec-var)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
311 ,@body))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
312
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
313 ;;; Set indentation for macros above.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
314
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
315 (put 'ebrowse-output 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
316 (put 'ebrowse-ignoring-completion-case 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
317 (put 'ebrowse-save-selective 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
318 (put 'ebrowse-for-all-trees 'lisp-indent-hook 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
319
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
320
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
321 (defsubst ebrowse-set-face (start end face)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
322 "Set face of a region START END to FACE."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
323 (overlay-put (make-overlay start end) 'face face))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
324
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
325
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
326 (defun ebrowse-completing-read-value (prompt table initial-input)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
327 "Read a string in the minibuffer, with completion.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
328 Case is ignored in completions.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
329
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
330 PROMPT is a string to prompt with; normally it ends in a colon and a space.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
331 TABLE is an alist whose elements' cars are strings, or an obarray.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
332 TABLE can also be a function to do the completion itself.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
333 If INITIAL-INPUT is non-nil, insert it in the minibuffer initially.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
334 If it is (STRING . POSITION), the initial input
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
335 is STRING, but point is placed POSITION characters into the string."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
336 (ebrowse-ignoring-completion-case
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
337 (completing-read prompt table nil t initial-input)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
338
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
339
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
340 (defun ebrowse-value-in-buffer (sym buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
341 "Return the value of SYM in BUFFER."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
342 (let ((old-buffer (current-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
343 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
344 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
345 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
346 (symbol-value sym))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
347 (set-buffer old-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
348
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
349
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
350 (defun ebrowse-rename-buffer (new-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
351 "Rename current buffer to NEW-NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
352 If a buffer with name NEW-NAME already exists, delete it first."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
353 (let ((old-buffer (get-buffer new-name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
354 (unless (eq old-buffer (current-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
355 (when old-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
356 (save-excursion (kill-buffer old-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
357 (rename-buffer new-name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
358
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
359
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
360 (defun ebrowse-trim-string (string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
361 "Return a copy of STRING with leading white space removed.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
362 Replace sequences of newlines with a single space."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
363 (when (string-match "^[ \t\n\r]+" string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
364 (setq string (substring string (match-end 0))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
365 (loop while (string-match "[\n]+" string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
366 finally return string do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
367 (setq string (replace-match " " nil t string))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
368
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
369
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
370 (defun ebrowse-width-of-drawable-area ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
371 "Return the width of the display area for the current buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
372 If buffer is displayed in a window, use that window's width,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
373 otherwise use the current frame's width."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
374 (let ((window (get-buffer-window (current-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
375 (if window
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
376 (window-width window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
377 (frame-width))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
378
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
379
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
380 ;;; Structure definitions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
381
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
382 (defstruct (ebrowse-hs (:type vector) :named)
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
383 "Header structure found at the head of BROWSE files."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
384 ;; A version string that is compared against the version number of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
385 ;; the Lisp package when the file is loaded. This is done to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
386 ;; detect file format changes.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
387 version
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
388 ;; Command line options used for producing the BROWSE file.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
389 command-line-options
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
390 ;; The following slot is currently not used. It's kept to keep
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
391 ;; the file format compatible.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
392 unused
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
393 ;; A slot that is filled out after the tree is loaded. This slot is
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
394 ;; set to a hash table mapping members to lists of classes in which
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
395 ;; they are defined.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
396 member-table)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
397
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
398
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
399 (defstruct (ebrowse-ts (:type vector) :named)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
400 "Tree structure.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
401 Following the header structure, a BROWSE file contains a number
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
402 of `ebrowse-ts' structures, each one describing one root class of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
403 the class hierarchy with all its subclasses."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
404 ;; A `ebrowse-cs' structure describing the root class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
405 class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
406 ;; A list of `ebrowse-ts' structures for all subclasses.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
407 subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
408 ;; Lists of `ebrowse-ms' structures for each member in a group of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
409 ;; members.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
410 member-variables member-functions static-variables static-functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
411 friends types
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
412 ;; List of `ebrowse-ts' structures for base classes. This slot is
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
413 ;; filled at load time.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
414 base-classes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
415 ;; A marker slot used in the tree buffer (can be saved back to disk.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
416 mark)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
417
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
418
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
419 (defstruct (ebrowse-bs (:type vector) :named)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
420 "Common sub-structure.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
421 A common structure defining an occurrence of some name in the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
422 source files."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
423 ;; The class or member name as a string constant
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
424 name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
425 ;; An optional string for the scope of nested classes or for
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
426 ;; namespaces.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
427 scope
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
428 ;; Various flags describing properties of classes/members, e.g. is
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
429 ;; template, is const etc.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
430 flags
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
431 ;; File in which the entity is found. If this is part of a
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
432 ;; `ebrowse-ms' member description structure, and FILE is nil, then
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
433 ;; search for the name in the SOURCE-FILE of the members class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
434 file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
435 ;; Regular expression to search for. This slot can be a number in
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
436 ;; which case the number is the file position at which the regular
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
437 ;; expression is found in a separate regexp file (see the header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
438 ;; structure). This slot can be nil in which case the regular
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
439 ;; expression will be generated from the class/member name.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
440 pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
441 ;; The buffer position at which the search for the class or member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
442 ;; will start.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
443 point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
444
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
445
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
446 (defstruct (ebrowse-cs (:include ebrowse-bs) (:type vector) :named)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
447 "Class structure.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
448 This is the structure stored in the CLASS slot of a `ebrowse-ts'
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
449 structure. It describes the location of the class declaration."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
450 source-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
451
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
452
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
453 (defstruct (ebrowse-ms (:include ebrowse-bs) (:type vector) :named)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
454 "Member structure.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
455 This is the structure describing a single member. The `ebrowse-ts'
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
456 structure contains various lists for the different types of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
457 members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
458 ;; Public, protected, private
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
459 visibility
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
460 ;; The file in which the member's definition can be found.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
461 definition-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
462 ;; Same as PATTERN above, but for the member definition.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
463 definition-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
464 ;; Same as POINT above but for member definition.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
465 definition-point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
466
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
467
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
468
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
469 ;;; Some macros to access the FLAGS slot of a MEMBER.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
470
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
471 (defsubst ebrowse-member-bit-set-p (member bit)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
472 "Value is non-nil if MEMBER's bit BIT is set."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
473 (/= 0 (logand (ebrowse-bs-flags member) bit)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
474
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
475
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
476 (defsubst ebrowse-virtual-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
477 "Value is non-nil if MEMBER is virtual."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
478 (ebrowse-member-bit-set-p member 1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
479
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
480
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
481 (defsubst ebrowse-inline-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
482 "Value is non-nil if MEMBER is inline."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
483 (ebrowse-member-bit-set-p member 2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
484
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
485
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
486 (defsubst ebrowse-const-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
487 "Value is non-nil if MEMBER is const."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
488 (ebrowse-member-bit-set-p member 4))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
489
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
490
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
491 (defsubst ebrowse-pure-virtual-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
492 "Value is non-nil if MEMBER is a pure virtual function."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
493 (ebrowse-member-bit-set-p member 8))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
494
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
495
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
496 (defsubst ebrowse-mutable-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
497 "Value is non-nil if MEMBER is mutable."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
498 (ebrowse-member-bit-set-p member 16))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
499
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
500
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
501 (defsubst ebrowse-template-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
502 "Value is non-nil if MEMBER is a template."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
503 (ebrowse-member-bit-set-p member 32))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
504
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
505
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
506 (defsubst ebrowse-explicit-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
507 "Value is non-nil if MEMBER is explicit."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
508 (ebrowse-member-bit-set-p member 64))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
509
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
510
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
511 (defsubst ebrowse-throw-list-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
512 "Value is non-nil if MEMBER has a throw specification."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
513 (ebrowse-member-bit-set-p member 128))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
514
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
515
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
516 (defsubst ebrowse-extern-c-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
517 "Value is non-nil if MEMBER.is `extern \"C\"'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
518 (ebrowse-member-bit-set-p member 256))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
519
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
520
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
521 (defsubst ebrowse-define-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
522 "Value is non-nil if MEMBER is a define."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
523 (ebrowse-member-bit-set-p member 512))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
524
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
525
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
526 (defconst ebrowse-version-string "ebrowse 5.0"
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
527 "Version string expected in BROWSE files.")
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
528
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
529
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
530 (defconst ebrowse-globals-name "*Globals*"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
531 "The name used for the surrogate class.containing global entities.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
532 This must be the same that `ebrowse' uses.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
533
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
534
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
535 (defvar ebrowse--last-regexp nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
536 "Last regular expression searched for in tree and member buffers.
41773
31e7749d1e1a Doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 40255
diff changeset
537 Each tree and member buffer maintains its own search history.")
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
538 (make-variable-buffer-local 'ebrowse--last-regexp)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
539
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
540
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
541 (defconst ebrowse-member-list-accessors
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
542 '(ebrowse-ts-member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
543 ebrowse-ts-member-functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
544 ebrowse-ts-static-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
545 ebrowse-ts-static-functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
546 ebrowse-ts-friends
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
547 ebrowse-ts-types)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
548 "List of accessors for member lists.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
549 Each element is the symbol of an accessor function.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
550 The nth element must be the accessor for the nth member list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
551 in an `ebrowse-ts' structure.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
552
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
553
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
554 ;;; FIXME: Add more doc strings for the buffer-local variables below.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
555
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
556 (defvar ebrowse--tree-obarray nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
557 "Obarray holding all `ebrowse-ts' structures of a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
558 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
559
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
560
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
561 (defvar ebrowse--tags-file-name nil
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
562 "File from which BROWSE file was loaded.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
563 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
564
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
565
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
566 (defvar ebrowse--header nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
567 "Header structure of type `ebrowse-hs' of a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
568 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
569
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
570
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
571 (defvar ebrowse--frozen-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
572 "Non-nil means an Ebrowse buffer won't be reused.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
573 Buffer-local in Ebrowse buffers.")
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
574
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
575
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
576 (defvar ebrowse--show-file-names-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
577 "Non-nil means show file names in a tree buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
578 Buffer-local in Ebrowse tree buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
579
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
580
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
581 (defvar ebrowse--long-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
582 "Non-nil means show members in long display form.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
583 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
584
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
585
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
586 (defvar ebrowse--n-columns nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
587 "Number of columns to display for short member display form.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
588 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
589
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
590
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
591 (defvar ebrowse--column-width nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
592 "Width of a columns to display for short member display form.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
593 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
594
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
595
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
596 (defvar ebrowse--virtual-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
597 "Non-nil means display virtual members in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
598 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
599
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
600
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
601 (defvar ebrowse--inline-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
602 "Non-nil means display inline members in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
603 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
604
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
605
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
606 (defvar ebrowse--const-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
607 "Non-nil means display const members in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
608 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
609
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
610
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
611 (defvar ebrowse--pure-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
612 "Non-nil means display pure virtual members in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
613 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
614
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
615
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
616 (defvar ebrowse--filters nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
617 "Filter for display of public, protected, and private members.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
618 This is a vector of three elements. An element nil means the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
619 corresponding members are not shown.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
620 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
621
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
622
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
623 (defvar ebrowse--show-inherited-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
624 "Non-nil means display inherited members in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
625 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
626
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
627
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
628 (defvar ebrowse--attributes-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
629 "Non-nil means display member attributes in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
630 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
631
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
632
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
633 (defvar ebrowse--source-regexp-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
634 "Non-nil means display member regexps in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
635 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
636
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
637
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
638 (defvar ebrowse--displayed-class nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
639 "Class displayed in a member buffer, a `ebrowse-ts' structure.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
640 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
641
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
642
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
643 (defvar ebrowse--accessor nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
644 "Member list displayed in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
645 This is a symbol whose function definition is an accessor for the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
646 member list in `ebrowse-cs' structures.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
647 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
648
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
649
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
650 (defvar ebrowse--member-list nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
651 "The list of `ebrowse-ms' structures displayed in a member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
652 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
653
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
654
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
655 (defvar ebrowse--decl-column nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
656 "Column in which declarations are displayed in member buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
657 Buffer-local in Ebrowse member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
658
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
659
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
660 (defvar ebrowse--frame-configuration nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
661 "Frame configuration saved when viewing a class/member in another frame.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
662 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
663
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
664
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
665 (defvar ebrowse--view-exit-action nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
666 "Action to perform after viewing a class/member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
667 Either `kill-buffer' or nil.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
668 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
669
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
670
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
671 (defvar ebrowse--tree nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
672 "Class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
673 Buffer-local in Ebrowse buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
674
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
675
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
676 ;;; Temporaries used to communicate with `ebrowse-find-pattern'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
677
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
678 (defvar ebrowse-temp-position-to-view nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
679 (defvar ebrowse-temp-info-to-view nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
680
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
681
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
682 (defvar ebrowse-tree-mode-map ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
683 "The keymap used in tree mode buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
684
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
685
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
686 (defvar ebrowse--member-mode-strings nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
687 "Strings displayed in the mode line of member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
688
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
689
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
690 (defvar ebrowse-member-mode-map ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
691 "The keymap used in the member buffers.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
692
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
693
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
694 ;;; Define mode line titles for each member list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
695
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
696 (put 'ebrowse-ts-member-variables 'ebrowse-title "Member Variables")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
697 (put 'ebrowse-ts-member-functions 'ebrowse-title "Member Functions")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
698 (put 'ebrowse-ts-static-variables 'ebrowse-title "Static Variables")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
699 (put 'ebrowse-ts-static-functions 'ebrowse-title "Static Functions")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
700 (put 'ebrowse-ts-friends 'ebrowse-title "Friends")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
701 (put 'ebrowse-ts-types 'ebrowse-title "Types")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
702
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
703 (put 'ebrowse-ts-member-variables 'ebrowse-global-title "Global Variables")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
704 (put 'ebrowse-ts-member-functions 'ebrowse-global-title "Global Functions")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
705 (put 'ebrowse-ts-static-variables 'ebrowse-global-title "Static Variables")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
706 (put 'ebrowse-ts-static-functions 'ebrowse-global-title "Static Functions")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
707 (put 'ebrowse-ts-friends 'ebrowse-global-title "Defines")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
708 (put 'ebrowse-ts-types 'ebrowse-global-title "Types")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
709
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
710
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
711
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
712 ;;; Operations on `ebrowse-ts' structures
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
713
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
714 (defun ebrowse-files-table (&optional marked-only)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
715 "Return an obarray containing all files mentioned in the current tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
716 The tree is expected in the buffer-local variable `ebrowse--tree-obarray'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
717 MARKED-ONLY non-nil means include marked classes only."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
718 (let ((files (make-hash-table :test 'equal))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
719 (i -1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
720 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
721 (when (or (not marked-only) (ebrowse-ts-mark tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
722 (let ((class (ebrowse-ts-class tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
723 (when (zerop (% (incf i) 20))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
724 (ebrowse-show-progress "Preparing file list" (zerop i)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
725 ;; Add files mentioned in class description
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
726 (let ((source-file (ebrowse-cs-source-file class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
727 (file (ebrowse-cs-file class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
728 (when source-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
729 (puthash source-file source-file files))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
730 (when file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
731 (puthash file file files))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
732 ;; For all member lists in this class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
733 (loop for accessor in ebrowse-member-list-accessors do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
734 (loop for m in (funcall accessor tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
735 for file = (ebrowse-ms-file m)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
736 for def-file = (ebrowse-ms-definition-file m) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
737 (when file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
738 (puthash file file files))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
739 (when def-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
740 (puthash def-file def-file files))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
741 files))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
742
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
743
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
744 (defun ebrowse-files-list (&optional marked-only)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
745 "Return a list containing all files mentioned in a tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
746 MARKED-ONLY non-nil means include marked classes only."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
747 (let (list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
748 (maphash #'(lambda (file dummy) (setq list (cons file list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
749 (ebrowse-files-table marked-only))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
750 list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
751
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
752
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
753 (defun* ebrowse-marked-classes-p ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
754 "Value is non-nil if any class in the current class tree is marked."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
755 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
756 (when (ebrowse-ts-mark tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
757 (return-from ebrowse-marked-classes-p tree))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
758
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
759
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
760 (defsubst ebrowse-globals-tree-p (tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
761 "Return t if TREE is the one for global entities."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
762 (string= (ebrowse-bs-name (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
763 ebrowse-globals-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
764
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
765
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
766 (defsubst ebrowse-qualified-class-name (class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
767 "Return the name of CLASS with scope prepended, if any."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
768 (if (ebrowse-cs-scope class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
769 (concat (ebrowse-cs-scope class) "::" (ebrowse-cs-name class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
770 (ebrowse-cs-name class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
771
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
772
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
773 (defun ebrowse-tree-obarray-as-alist (&optional qualified-names-p)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
774 "Return an alist describing all classes in a tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
775 Each elements in the list has the form (CLASS-NAME . TREE).
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
776 CLASS-NAME is the name of the class. TREE is the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
777 class tree whose root is QUALIFIED-CLASS-NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
778 QUALIFIED-NAMES-P non-nil means return qualified names as CLASS-NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
779 The class tree is found in the buffer-local variable `ebrowse--tree-obarray'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
780 (let (alist)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
781 (if qualified-names-p
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
782 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
783 (setq alist
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
784 (acons (ebrowse-qualified-class-name (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
785 tree alist)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
786 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
787 (setq alist
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
788 (acons (ebrowse-cs-name (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
789 tree alist))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
790 alist))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
791
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
792
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
793 (defun ebrowse-sort-tree-list (list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
794 "Sort a LIST of `ebrowse-ts' structures by qualified class names."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
795 (sort list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
796 #'(lambda (a b)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
797 (string< (ebrowse-qualified-class-name (ebrowse-ts-class a))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
798 (ebrowse-qualified-class-name (ebrowse-ts-class b))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
799
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
800
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
801 (defun ebrowse-class-in-tree (class tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
802 "Search for a class with name CLASS in TREE.
59550
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
803 If CLASS is found, return the tail of TREE starting at CLASS. This function
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
804 is used during the load phase where classes appended to a file replace older
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
805 class information."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
806 (let ((tclass (ebrowse-ts-class class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
807 found)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
808 (while (and tree (not found))
59550
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
809 (let ((root-ptr tree))
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
810 (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class (car root-ptr)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
811 (ebrowse-qualified-class-name tclass))
59550
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
812 (setq found root-ptr))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
813 (setq tree (cdr tree))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
814 found))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
815
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
816
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
817 (defun ebrowse-base-classes (tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
818 "Return list of base-classes of TREE by searching subclass lists.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
819 This function must be used instead of the struct slot
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
820 `base-classes' to access the base-class list directly because it
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
821 computes this information lazily."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
822 (or (ebrowse-ts-base-classes tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
823 (setf (ebrowse-ts-base-classes tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
824 (loop with to-search = (list tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
825 with result = nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
826 as search = (pop to-search)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
827 while search finally return result
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
828 do (ebrowse-for-all-trees (ti ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
829 (when (memq search (ebrowse-ts-subclasses ti))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
830 (unless (memq ti result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
831 (setq result (nconc result (list ti))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
832 (push ti to-search)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
833
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
834
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
835 (defun ebrowse-direct-base-classes (tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
836 "Return the list of direct super classes of TREE."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
837 (let (result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
838 (dolist (s (ebrowse-base-classes tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
839 (when (memq tree (ebrowse-ts-subclasses s))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
840 (setq result (cons s result))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
841 result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
842
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
843
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
844
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
845 ;;; Operations on MEMBER structures/lists
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
846
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
847 (defun ebrowse-name/accessor-alist (tree accessor)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
848 "Return an alist containing all members of TREE in group ACCESSOR.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
849 ACCESSOR is the accessor function for the member list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
850 Elements of the result have the form (NAME . ACCESSOR), where NAME
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
851 is the member name."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
852 (loop for member in (funcall accessor tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
853 collect (cons (ebrowse-ms-name member) accessor)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
854
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
855
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
856 (defun ebrowse-name/accessor-alist-for-visible-members ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
857 "Return an alist describing all members visible in the current buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
858 Each element of the list has the form (MEMBER-NAME . ACCESSOR),
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
859 where MEMBER-NAME is the member's name, and ACCESSOR is the struct
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
860 accessor with which the member's list can be accessed in an `ebrowse-ts'
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
861 structure. The list includes inherited members if these are visible."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
862 (let* ((list (ebrowse-name/accessor-alist ebrowse--displayed-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
863 ebrowse--accessor)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
864 (if ebrowse--show-inherited-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
865 (nconc list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
866 (loop for tree in (ebrowse-base-classes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
867 ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
868 nconc (ebrowse-name/accessor-alist
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
869 tree ebrowse--accessor)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
870 list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
871
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
872
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
873 (defun ebrowse-name/accessor-alist-for-class-members ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
874 "Like `ebrowse-name/accessor-alist-for-visible-members'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
875 This function includes members of base classes if base class members
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
876 are visible in the buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
877 (let (list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
878 (dolist (func ebrowse-member-list-accessors list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
879 (setq list (nconc list (ebrowse-name/accessor-alist
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
880 ebrowse--displayed-class func)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
881 (when ebrowse--show-inherited-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
882 (dolist (class (ebrowse-base-classes ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
883 (setq list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
884 (nconc list (ebrowse-name/accessor-alist class func))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
885
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
886
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
887 ;;; Progress indication
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
888
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
889 (defvar ebrowse-n-boxes 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
890 (defconst ebrowse-max-boxes 60)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
891
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
892 (defun ebrowse-show-progress (title &optional start)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
893 "Display a progress indicator.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
894 TITLE is the title of the progress message. START non-nil means
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
895 this is the first progress message displayed."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
896 (let (message-log-max)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
897 (when start (setq ebrowse-n-boxes 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
898 (setq ebrowse-n-boxes (mod (1+ ebrowse-n-boxes) ebrowse-max-boxes))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
899 (message (concat title ": "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
900 (propertize (make-string ebrowse-n-boxes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
901 (if (display-color-p) ?\ ?+))
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
902 'face 'ebrowse-progress)))))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
903
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
904
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
905 ;;; Reading a tree from disk
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
906
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
907 (defun ebrowse-read ()
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
908 "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
909 Return a list (HEADER TREE) where HEADER is the file header read
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
910 and TREE is a list of `ebrowse-ts' structures forming the class tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
911 (let ((header (condition-case nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
912 (read (current-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
913 (error (error "No Ebrowse file header found"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
914 tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
915 ;; Check file format.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
916 (unless (ebrowse-hs-p header)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
917 (error "No Ebrowse file header found"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
918 (unless (string= (ebrowse-hs-version header) ebrowse-version-string)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
919 (error "File has wrong version `%s' (`%s' expected)"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
920 (ebrowse-hs-version header) ebrowse-version-string))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
921 ;; Read Lisp objects. Temporarily increase `gc-cons-threshold' to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
922 ;; prevent a GC that would not free any memory.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
923 (let ((gc-cons-threshold 2000000))
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
924 (while (not (progn (skip-chars-forward " \t\n\r") (eobp)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
925 (let* ((root (read (current-buffer)))
59550
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
926 (old-root-ptr (ebrowse-class-in-tree root tree)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
927 (ebrowse-show-progress "Reading data" (null tree))
59550
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
928 (if old-root-ptr
ab8776511cbc (ebrowse-class-in-tree): Return the tail of the tree
Eli Zaretskii <eliz@gnu.org>
parents: 52529
diff changeset
929 (setcar old-root-ptr root)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
930 (push root tree)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
931 (garbage-collect)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
932 (list header tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
933
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
934
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
935 (defun ebrowse-revert-tree-buffer-from-file (ignore-auto-save noconfirm)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
936 "Function installed as `revert-buffer-function' in tree buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
937 See that variable's documentation for the meaning of IGNORE-AUTO-SAVE and
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
938 NOCONFIRM."
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
939 (when (or noconfirm (yes-or-no-p "Revert tree from disk? "))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
940 (loop for member-buffer in (ebrowse-same-tree-member-buffer-list)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
941 do (kill-buffer member-buffer))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
942 (erase-buffer)
63947
a13c7f436bfa (ebrowse-revert-tree-buffer-from-file): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents: 63448
diff changeset
943 (with-no-warnings
a13c7f436bfa (ebrowse-revert-tree-buffer-from-file): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents: 63448
diff changeset
944 (insert-file (or buffer-file-name ebrowse--tags-file-name)))
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
945 (ebrowse-tree-mode)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
946 (current-buffer)))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
947
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
948
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
949 (defun ebrowse-create-tree-buffer (tree tags-file header obarray pop)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
950 "Create a new tree buffer for tree TREE.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
951 The tree was loaded from file TAGS-FILE.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
952 HEADER is the header structure of the file.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
953 OBARRAY is an obarray with a symbol for each class in the tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
954 POP non-nil means popup the buffer up at the end.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
955 Return the buffer created."
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
956 (let ((name ebrowse-tree-buffer-name))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
957 (set-buffer (get-buffer-create name))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
958 (ebrowse-tree-mode)
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
959 (setq ebrowse--tree tree
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
960 ebrowse--tags-file-name tags-file
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
961 ebrowse--tree-obarray obarray
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
962 ebrowse--header header
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
963 ebrowse--frozen-flag nil)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
964 (ebrowse-redraw-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
965 (set-buffer-modified-p nil)
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
966 (case pop
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
967 (switch (switch-to-buffer name))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
968 (pop (pop-to-buffer name)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
969 (current-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
970
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
971
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
972
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
973 ;;; Operations for member obarrays
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
974
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
975 (defun ebrowse-fill-member-table ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
976 "Return an obarray holding all members of all classes in the current tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
977
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
978 For each member, a symbol is added to the obarray. Members are
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
979 extracted from the buffer-local tree `ebrowse--tree-obarray'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
980
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
981 Each symbol has its property `ebrowse-info' set to a list (TREE MEMBER-LIST
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
982 MEMBER) where TREE is the tree in which the member is defined,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
983 MEMBER-LIST is a symbol describing the member list in which the member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
984 is found, and MEMBER is a MEMBER structure describing the member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
985
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
986 The slot `member-table' of the buffer-local header structure of
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
987 type `ebrowse-hs' is set to the resulting obarray."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
988 (let ((members (make-hash-table :test 'equal))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
989 (i -1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
990 (setf (ebrowse-hs-member-table ebrowse--header) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
991 (garbage-collect)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
992 ;; For all classes...
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
993 (ebrowse-for-all-trees (c ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
994 (when (zerop (% (incf i) 10))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
995 (ebrowse-show-progress "Preparing member lookup" (zerop i)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
996 (loop for f in ebrowse-member-list-accessors do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
997 (loop for m in (funcall f c) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
998 (let* ((member-name (ebrowse-ms-name m))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
999 (value (gethash member-name members)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1000 (push (list c f m) value)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1001 (puthash member-name value members)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1002 (setf (ebrowse-hs-member-table ebrowse--header) members)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1003
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1004
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1005 (defun ebrowse-member-table (header)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1006 "Return the member obarray. Build it it hasn't been set up yet.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1007 HEADER is the tree header structure of the class tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1008 (when (null (ebrowse-hs-member-table header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1009 (loop for buffer in (ebrowse-browser-buffer-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1010 until (eq header (ebrowse-value-in-buffer 'ebrowse--header buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1011 finally do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1012 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1013 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1014 (ebrowse-fill-member-table))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1015 (ebrowse-hs-member-table header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1016
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1017
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1018
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1019 ;;; Operations on TREE obarrays
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1020
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1021 (defun ebrowse-build-tree-obarray (tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1022 "Make sure every class in TREE is represented by a unique object.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1023 Build obarray of all classes in TREE."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1024 (let ((classes (make-vector 127 0)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1025 ;; Add root classes...
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1026 (loop for root in tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1027 as sym =
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1028 (intern (ebrowse-qualified-class-name (ebrowse-ts-class root)) classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1029 do (unless (get sym 'ebrowse-root)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1030 (setf (get sym 'ebrowse-root) root)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1031 ;; Process subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1032 (ebrowse-insert-supers tree classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1033 classes))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1034
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1035
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1036 (defun ebrowse-insert-supers (tree classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1037 "Build base class lists in class tree TREE.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1038 CLASSES is an obarray used to collect classes.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1039
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1040 Helper function for `ebrowse-build-tree-obarray'. Base classes should
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1041 be ordered so that immediate base classes come first, then the base
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1042 class of the immediate base class and so on. This means that we must
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1043 construct the base-class list top down with adding each level at the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1044 beginning of the base-class list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1045
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1046 We have to be cautious here not to end up in an infinite recursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1047 if for some reason a circle is in the inheritance graph."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1048 (loop for class in tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1049 as subclasses = (ebrowse-ts-subclasses class) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1050 ;; Make sure every class is represented by a unique object
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1051 (loop for subclass on subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1052 as sym = (intern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1053 (ebrowse-qualified-class-name (ebrowse-ts-class (car subclass)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1054 classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1055 as next = nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1056 do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1057 ;; Replace the subclass tree with the one found in
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1058 ;; CLASSES if there is already an entry for that class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1059 ;; in it. Otherwise make a new entry.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1060 ;;
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1061 ;; CAVEAT: If by some means (e.g., use of the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1062 ;; preprocessor in class declarations, a name is marked
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1063 ;; as a subclass of itself on some path, we would end up
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1064 ;; in an endless loop. We have to omit subclasses from
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1065 ;; the recursion that already have been processed.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1066 (if (get sym 'ebrowse-root)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1067 (setf (car subclass) (get sym 'ebrowse-root))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1068 (setf (get sym 'ebrowse-root) (car subclass))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1069 ;; Process subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1070 (ebrowse-insert-supers subclasses classes)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1071
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1072
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1073 ;;; Tree buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1074
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1075 (unless ebrowse-tree-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1076 (let ((map (make-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1077 (setf ebrowse-tree-mode-map map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1078 (suppress-keymap map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1079
30554
e56649429a8b (ebrowse-tree-mode-map): Use display-mouse-p instead of window-system.
Eli Zaretskii <eliz@gnu.org>
parents: 28816
diff changeset
1080 (when (display-mouse-p)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1081 (define-key map [down-mouse-3] 'ebrowse-mouse-3-in-tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1082 (define-key map [mouse-2] 'ebrowse-mouse-2-in-tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1083 (define-key map [down-mouse-1] 'ebrowse-mouse-1-in-tree-buffer))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1084
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1085 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1086 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1087 (define-key map "L" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1088 (define-key map1 "d" 'ebrowse-tree-command:show-friends)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1089 (define-key map1 "f" 'ebrowse-tree-command:show-member-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1090 (define-key map1 "F" 'ebrowse-tree-command:show-static-member-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1091 (define-key map1 "t" 'ebrowse-tree-command:show-types)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1092 (define-key map1 "v" 'ebrowse-tree-command:show-member-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1093 (define-key map1 "V" 'ebrowse-tree-command:show-static-member-variables))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1094
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1095 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1096 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1097 (define-key map "M" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1098 (define-key map1 "a" 'ebrowse-mark-all-classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1099 (define-key map1 "t" 'ebrowse-toggle-mark-at-point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1100
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1101 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1102 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1103 (define-key map "T" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1104 (define-key map1 "f" 'ebrowse-toggle-file-name-display)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1105 (define-key map1 "s" 'ebrowse-show-file-name-at-point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1106 (define-key map1 "w" 'ebrowse-set-tree-indentation)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1107 (define-key map "x" 'ebrowse-statistics))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1108
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1109 (define-key map "n" 'ebrowse-repeat-member-search)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1110 (define-key map "q" 'bury-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1111 (define-key map "*" 'ebrowse-expand-all)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1112 (define-key map "+" 'ebrowse-expand-branch)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1113 (define-key map "-" 'ebrowse-collapse-branch)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1114 (define-key map "/" 'ebrowse-read-class-name-and-go)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1115 (define-key map " " 'ebrowse-view-class-declaration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1116 (define-key map "?" 'describe-mode)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1117 (define-key map "\C-i" 'ebrowse-pop/switch-to-member-buffer-for-same-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1118 (define-key map "\C-k" 'ebrowse-remove-class-at-point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1119 (define-key map "\C-l" 'ebrowse-redraw-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1120 (define-key map "\C-m" 'ebrowse-find-class-declaration)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1121
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1122
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1123
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1124 ;;; Tree-mode - mode for tree buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1125
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1126 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1127 (defun ebrowse-tree-mode ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1128 "Major mode for Ebrowse class tree buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1129 Each line corresponds to a class in a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1130 Letters do not insert themselves, they are commands.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1131 File operations in the tree buffer work on class tree data structures.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1132 E.g.\\[save-buffer] writes the tree to the file it was loaded from.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1133
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1134 Tree mode key bindings:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1135 \\{ebrowse-tree-mode-map}"
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1136 (interactive)
28548
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
1137 (let* ((ident (propertized-buffer-identification "C++ Tree"))
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1138 header tree buffer-read-only)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1139
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1140 (kill-all-local-variables)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1141 (use-local-map ebrowse-tree-mode-map)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1142
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1143 (unless (zerop (buffer-size))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1144 (goto-char (point-min))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1145 (multiple-value-setq (header tree) (ebrowse-read))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1146 (message "Sorting. Please be patient...")
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1147 (setq tree (ebrowse-sort-tree-list tree))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1148 (erase-buffer)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1149 (message nil))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1150
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1151 (mapcar 'make-local-variable
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1152 '(ebrowse--tags-file-name
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1153 ebrowse--indentation
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1154 ebrowse--tree
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1155 ebrowse--header
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1156 ebrowse--show-file-names-flag
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1157 ebrowse--frozen-flag
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1158 ebrowse--tree-obarray
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1159 revert-buffer-function))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1160
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1161 (setf ebrowse--show-file-names-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1162 ebrowse--tree-obarray (make-vector 127 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1163 ebrowse--frozen-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1164 major-mode 'ebrowse-tree-mode
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1165 mode-name "Ebrowse-Tree"
28548
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
1166 mode-line-buffer-identification ident
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1167 buffer-read-only t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1168 selective-display t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1169 selective-display-ellipses t
28541
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1170 revert-buffer-function 'ebrowse-revert-tree-buffer-from-file
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1171 ebrowse--header header
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1172 ebrowse--tree tree
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1173 ebrowse--tags-file-name (buffer-file-name)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1174 ebrowse--tree-obarray (and tree (ebrowse-build-tree-obarray tree))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1175 ebrowse--frozen-flag nil)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1176
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1177 (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1178 (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1179 (when tree
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1180 (ebrowse-redraw-tree)
f0c234df148e (ebrowse-read): Skip forward over white
Gerd Moellmann <gerd@gnu.org>
parents: 28527
diff changeset
1181 (set-buffer-modified-p nil))
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
1182 (run-mode-hooks 'ebrowse-tree-mode-hook)))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1183
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1184
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1185
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1186 (defun ebrowse-update-tree-buffer-mode-line ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1187 "Update the tree buffer mode line."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1188 (ebrowse-rename-buffer (if ebrowse--frozen-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1189 (ebrowse-frozen-tree-buffer-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1190 ebrowse--tags-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1191 ebrowse-tree-buffer-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1192 (force-mode-line-update))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1193
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1194
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1195
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1196 ;;; Removing classes from trees
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1197
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1198 (defun ebrowse-remove-class-and-kill-member-buffers (tree class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1199 "Remove from TREE class CLASS.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1200 Kill all member buffers still containing a reference to the class."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1201 (let ((sym (intern-soft (ebrowse-cs-name (ebrowse-ts-class class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1202 ebrowse--tree-obarray)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1203 (setf tree (delq class tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1204 (get sym 'ebrowse-root) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1205 (dolist (root tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1206 (setf (ebrowse-ts-subclasses root)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1207 (delq class (ebrowse-ts-subclasses root))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1208 (ebrowse-ts-base-classes root) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1209 (ebrowse-remove-class-and-kill-member-buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1210 (ebrowse-ts-subclasses root) class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1211 (ebrowse-kill-member-buffers-displaying class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1212 tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1213
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1214
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1215 (defun ebrowse-remove-class-at-point (forced)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1216 "Remove the class point is on from the class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1217 Do not ask for confirmation if FORCED is non-nil."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1218 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1219 (let* ((class (ebrowse-tree-at-point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1220 (class-name (ebrowse-cs-name (ebrowse-ts-class class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1221 (subclasses (ebrowse-ts-subclasses class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1222 (cond ((or forced
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1223 (y-or-n-p (concat "Delete class " class-name "? ")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1224 (setf ebrowse--tree (ebrowse-remove-class-and-kill-member-buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1225 ebrowse--tree class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1226 (set-buffer-modified-p t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1227 (message "%s %sdeleted." class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1228 (if subclasses "and derived classes " ""))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1229 (ebrowse-redraw-tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1230 (t (message "Aborted")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1231
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1232
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1233
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1234 ;;; Marking classes in the tree buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1235
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1236 (defun ebrowse-toggle-mark-at-point (&optional n-times)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1237 "Toggle mark for class cursor is on.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1238 If given a numeric N-TIMES argument, mark that many classes."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1239 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1240 (let (to-change pnt)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1241 ;; Get the classes whose mark must be toggled. Note that
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1242 ;; ebrowse-tree-at-point might issue an error.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1243 (condition-case error
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1244 (loop repeat (or n-times 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1245 as tree = (ebrowse-tree-at-point)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1246 do (progn
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1247 (setf (ebrowse-ts-mark tree) (not (ebrowse-ts-mark tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1248 (forward-line 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1249 (push tree to-change)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1250 (error nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1251 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1252 ;; For all these classes, reverse the mark char in the display
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1253 ;; by a regexp replace over the whole buffer. The reason for this
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1254 ;; is that classes might have multiple base classes. If this is
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1255 ;; the case, they are displayed more than once in the tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1256 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1257 (loop for tree in to-change
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1258 as regexp = (concat "^.*\\b"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1259 (regexp-quote
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1260 (ebrowse-cs-name (ebrowse-ts-class tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1261 "\\b")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1262 do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1263 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1264 (loop while (re-search-forward regexp nil t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1265 do (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1266 (goto-char (match-beginning 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1267 (delete-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1268 (insert-char (if (ebrowse-ts-mark tree) ?> ? ) 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1269 (ebrowse-set-mark-props (1- (point)) (point) tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1270 (goto-char (match-end 0)))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1271
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1272
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1273 (defun ebrowse-mark-all-classes (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1274 "Unmark, with PREFIX mark, all classes in the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1275 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1276 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1277 (setf (ebrowse-ts-mark tree) prefix))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1278 (ebrowse-redraw-marks (point-min) (point-max)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1279
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1280
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1281 (defun ebrowse-redraw-marks (start end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1282 "Display class marker signs in the tree between START and END."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1283 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1284 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1285 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1286 (catch 'end
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1287 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1288 (dolist (root ebrowse--tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1289 (ebrowse-draw-marks-fn root start end))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1290 (ebrowse-update-tree-buffer-mode-line)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1291
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1292
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1293 (defun ebrowse-draw-marks-fn (tree start end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1294 "Display class marker signs in TREE between START and END."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1295 (when (>= (point) start)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1296 (delete-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1297 (insert (if (ebrowse-ts-mark tree) ?> ? ))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1298 (ebrowse-set-mark-props (1- (point)) (point) tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1299 (forward-line 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1300 (when (> (point) end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1301 (throw 'end nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1302 (dolist (sub (ebrowse-ts-subclasses tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1303 (ebrowse-draw-marks-fn sub start end)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1304
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1305
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1306
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1307 ;;; File name display in tree buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1308
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1309 (defun ebrowse-show-file-name-at-point (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1310 "Show filename in the line point is in.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1311 With PREFIX, insert that many filenames."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1312 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1313 (unless ebrowse--show-file-names-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1314 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1315 (dotimes (i prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1316 (let ((tree (ebrowse-tree-at-point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1317 start
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1318 file-name-existing)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1319 (beginning-of-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1320 (skip-chars-forward " \t*a-zA-Z0-9_")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1321 (setq start (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1322 file-name-existing (looking-at "("))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1323 (delete-region start (save-excursion (end-of-line) (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1324 (unless file-name-existing
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1325 (indent-to ebrowse-source-file-column)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1326 (insert "(" (or (ebrowse-cs-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1327 (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1328 "unknown")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1329 ")"))
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
1330 (ebrowse-set-face start (point) 'ebrowse-file-name)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1331 (beginning-of-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1332 (forward-line 1))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1333
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1334
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1335 (defun ebrowse-toggle-file-name-display ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1336 "Toggle display of filenames in tree buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1337 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1338 (setf ebrowse--show-file-names-flag (not ebrowse--show-file-names-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1339 (let ((old-line (count-lines (point-min) (point))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1340 (ebrowse-redraw-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1341 (goto-line old-line)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1342
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1343
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1344
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1345 ;;; General member and tree buffer functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1346
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1347 (defun ebrowse-member-buffer-p (buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1348 "Value is non-nil if BUFFER is a member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1349 (eq (cdr (assoc 'major-mode (buffer-local-variables buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1350 'ebrowse-member-mode))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1351
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1352
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1353 (defun ebrowse-tree-buffer-p (buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1354 "Value is non-nil if BUFFER is a class tree buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1355 (eq (cdr (assoc 'major-mode (buffer-local-variables buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1356 'ebrowse-tree-mode))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1357
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1358
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1359 (defun ebrowse-buffer-p (buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1360 "Value is non-nil if BUFFER is a tree or member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1361 (memq (cdr (assoc 'major-mode (buffer-local-variables buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1362 '(ebrowse-tree-mode ebrowse-member-mode)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1363
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1364
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1365 (defun ebrowse-browser-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1366 "Return a list of all tree or member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1367 (ebrowse-delete-if-not 'ebrowse-buffer-p (buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1368
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1369
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1370 (defun ebrowse-member-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1371 "Return a list of all member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1372 (ebrowse-delete-if-not 'ebrowse-member-buffer-p (buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1373
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1374
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1375 (defun ebrowse-tree-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1376 "Return a list of all tree buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1377 (ebrowse-delete-if-not 'ebrowse-tree-buffer-p (buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1378
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1379
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1380 (defun ebrowse-known-class-trees-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1381 "Return a list of buffers containing class trees.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1382 The list will contain, for each class tree loaded,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1383 one buffer. Prefer tree buffers over member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1384 (let ((buffers (nconc (ebrowse-tree-buffer-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1385 (ebrowse-member-buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1386 (set (make-hash-table))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1387 result)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1388 (dolist (buffer buffers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1389 (let ((tree (ebrowse-value-in-buffer 'ebrowse--tree buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1390 (unless (gethash tree set)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1391 (push buffer result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1392 (puthash tree t set)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1393 result))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1394
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1395
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1396 (defun ebrowse-same-tree-member-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1397 "Return a list of members buffers with same tree as current buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1398 (ebrowse-delete-if-not
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1399 #'(lambda (buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1400 (eq (ebrowse-value-in-buffer 'ebrowse--tree buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1401 ebrowse--tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1402 (ebrowse-member-buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1403
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1404
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1405
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1406 (defun ebrowse-pop/switch-to-member-buffer-for-same-tree (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1407 "Pop to the buffer displaying members.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1408 Switch to buffer if prefix ARG.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1409 If no member buffer exists, make one."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1410 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1411 (let ((buf (or (first (ebrowse-same-tree-member-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1412 (get-buffer ebrowse-member-buffer-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1413 (ebrowse-tree-command:show-member-functions))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1414 (when buf
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1415 (if arg
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1416 (switch-to-buffer buf)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1417 (pop-to-buffer buf)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1418 buf))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1419
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1420
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1421 (defun ebrowse-switch-to-next-member-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1422 "Switch to next member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1423 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1424 (let* ((list (ebrowse-member-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1425 (next-list (cdr (memq (current-buffer) list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1426 (next-buffer (if next-list (car next-list) (car list))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1427 (if (eq next-buffer (current-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1428 (error "No next buffer")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1429 (bury-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1430 (switch-to-buffer next-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1431
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1432
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1433 (defun ebrowse-kill-member-buffers-displaying (tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1434 "Kill all member buffers displaying TREE."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1435 (loop for buffer in (ebrowse-member-buffer-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1436 as class = (ebrowse-value-in-buffer 'ebrowse--displayed-class buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1437 when (eq class tree) do (kill-buffer buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1438
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1439
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1440 (defun ebrowse-frozen-tree-buffer-name (tags-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1441 "Return the buffer name of a tree which is associated TAGS-FILE-NAME."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1442 (concat ebrowse-tree-buffer-name " (" tags-file-name ")"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1443
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1444
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1445 (defun ebrowse-pop-to-browser-buffer (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1446 "Pop to a browser buffer from any other buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1447 Pop to member buffer if no prefix ARG, to tree buffer otherwise."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1448 (interactive "P")
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1449 (let ((buffer (get-buffer (if arg
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1450 ebrowse-tree-buffer-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1451 ebrowse-member-buffer-name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1452 (unless buffer
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1453 (setq buffer
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1454 (get-buffer (if arg
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1455 ebrowse-member-buffer-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1456 ebrowse-tree-buffer-name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1457 (unless buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1458 (error "No browser buffer found"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1459 (pop-to-buffer buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1460
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1461
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1462
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1463 ;;; Misc tree buffer commands
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1464
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1465 (defun ebrowse-set-tree-indentation ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1466 "Set the indentation width of the tree display."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1467 (interactive)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
1468 (let ((width (string-to-number (read-from-minibuffer
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
1469 (concat "Indentation ("
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
1470 (int-to-string ebrowse--indentation)
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
1471 "): ")))))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1472 (when (plusp width)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1473 (setf ebrowse--indentation width)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1474 (ebrowse-redraw-tree))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1475
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1476
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1477 (defun ebrowse-read-class-name-and-go (&optional class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1478 "Position cursor on CLASS.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1479 Read a class name from the minibuffer if CLASS is nil."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1480 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1481 (ebrowse-ignoring-completion-case
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1482 ;; If no class specified, read the class name from mini-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1483 (unless class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1484 (setf class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1485 (completing-read "Goto class: "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1486 (ebrowse-tree-obarray-as-alist) nil t)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1487 (ebrowse-save-selective
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1488 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1489 (widen)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1490 (setf selective-display nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1491 (setq ebrowse--last-regexp (concat "\\b" class "\\b"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1492 (if (re-search-forward ebrowse--last-regexp nil t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1493 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1494 (goto-char (match-beginning 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1495 (ebrowse-unhide-base-classes))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1496 (error "Not found")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1497
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1498
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1499
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1500 ;;; Showing various kinds of member buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1501
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1502 (defun ebrowse-tree-command:show-member-variables (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1503 "Display member variables; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1504 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1505 (ebrowse-display-member-buffer 'ebrowse-ts-member-variables arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1506
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1507
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1508 (defun ebrowse-tree-command:show-member-functions (&optional arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1509 "Display member functions; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1510 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1511 (ebrowse-display-member-buffer 'ebrowse-ts-member-functions arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1512
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1513
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1514 (defun ebrowse-tree-command:show-static-member-variables (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1515 "Display static member variables; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1516 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1517 (ebrowse-display-member-buffer 'ebrowse-ts-static-variables arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1518
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1519
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1520 (defun ebrowse-tree-command:show-static-member-functions (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1521 "Display static member functions; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1522 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1523 (ebrowse-display-member-buffer 'ebrowse-ts-static-functions arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1524
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1525
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1526 (defun ebrowse-tree-command:show-friends (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1527 "Display friend functions; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1528 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1529 (ebrowse-display-member-buffer 'ebrowse-ts-friends arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1530
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1531
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1532 (defun ebrowse-tree-command:show-types (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1533 "Display types defined in a class; with prefix ARG in frozen member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1534 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1535 (ebrowse-display-member-buffer 'ebrowse-ts-types arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1536
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1537
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1538
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1539 ;;; Viewing or finding a class declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1540
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1541 (defun ebrowse-tree-at-point ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1542 "Return the class structure for the class point is on."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1543 (or (get-text-property (point) 'ebrowse-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1544 (error "Not on a class")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1545
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1546
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1547 (defun* ebrowse-view/find-class-declaration (&key view where)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1548 "View or find the declarator of the class point is on.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1549 VIEW non-nil means view it. WHERE is additional position info."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1550 (let* ((class (ebrowse-ts-class (ebrowse-tree-at-point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1551 (file (ebrowse-cs-file class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1552 (browse-struct (make-ebrowse-bs
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1553 :name (ebrowse-cs-name class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1554 :pattern (ebrowse-cs-pattern class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1555 :flags (ebrowse-cs-flags class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1556 :file (ebrowse-cs-file class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1557 :point (ebrowse-cs-point class))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1558 (ebrowse-view/find-file-and-search-pattern
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1559 browse-struct
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1560 (list ebrowse--header class nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1561 file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1562 ebrowse--tags-file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1563 view
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1564 where)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1565
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1566
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1567 (defun ebrowse-find-class-declaration (prefix-arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1568 "Find a class declaration and position cursor on it.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1569 PREFIX-ARG 4 means find it in another window.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1570 PREFIX-ARG 5 means find it in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1571 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1572 (ebrowse-view/find-class-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1573 :view nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1574 :where (cond ((= prefix-arg 4) 'other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1575 ((= prefix-arg 5) 'other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1576 (t 'this-window))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1577
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1578
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1579 (defun ebrowse-view-class-declaration (prefix-arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1580 "View class declaration and position cursor on it.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1581 PREFIX-ARG 4 means view it in another window.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1582 PREFIX-ARG 5 means view it in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1583 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1584 (ebrowse-view/find-class-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1585 :view 'view
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1586 :where (cond ((= prefix-arg 4) 'other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1587 ((= prefix-arg 5) 'other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1588 (t 'this-window))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1589
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1590
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1591
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1592 ;;; The FIND engine
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1593
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1594 (defun ebrowse-find-source-file (file tags-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1595 "Find source file FILE.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1596 Source files are searched for (a) relative to TAGS-FILE-NAME
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1597 which is the path of the BROWSE file from which the class tree was loaded,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1598 and (b) in the directories named in `ebrowse-search-path'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1599 (let (file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1600 (try-file (expand-file-name file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1601 (file-name-directory tags-file-name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1602 (if (file-readable-p try-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1603 (setq file-name try-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1604 (let ((search-in ebrowse-search-path))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1605 (while (and search-in
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1606 (null file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1607 (let ((try-file (expand-file-name file (car search-in))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1608 (if (file-readable-p try-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1609 (setq file-name try-file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1610 (setq search-in (cdr search-in))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1611 (unless file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1612 (error "File `%s' not found" file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1613 file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1614
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1615
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1616 (defun ebrowse-view-file-other-window (file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1617 "View a file FILE in another window.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1618 This is a replacement for `view-file-other-window' which does not
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1619 seem to work. It should be removed when `view.el' is fixed."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1620 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1621 (let ((old-arrangement (current-window-configuration))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1622 (had-a-buf (get-file-buffer file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1623 (buf-to-view (find-file-noselect file)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1624 (switch-to-buffer-other-window buf-to-view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1625 (view-mode-enter old-arrangement
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1626 (and (not had-a-buf)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1627 (not (buffer-modified-p buf-to-view))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1628 'kill-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1629
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1630
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1631 (defun ebrowse-view-exit-fn (buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1632 "Function called when exiting View mode in BUFFER.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1633 Restore frame configuration active before viewing the file,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1634 and possibly kill the viewed buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1635 (let (exit-action original-frame-configuration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1636 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1637 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1638 (setq original-frame-configuration ebrowse--frame-configuration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1639 exit-action ebrowse--view-exit-action))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1640 ;; Delete the frame in which we viewed.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1641 (mapcar 'delete-frame
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1642 (loop for frame in (frame-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1643 when (not (assq frame original-frame-configuration))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1644 collect frame))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1645 (when exit-action
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1646 (funcall exit-action buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1647
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1648
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1649 (defun ebrowse-view-file-other-frame (file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1650 "View a file FILE in another frame.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1651 The new frame is deleted when it is no longer used."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1652 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1653 (let ((old-frame-configuration (current-frame-configuration))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1654 (old-arrangement (current-window-configuration))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1655 (had-a-buf (get-file-buffer file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1656 (buf-to-view (find-file-noselect file)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1657 (switch-to-buffer-other-frame buf-to-view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1658 (make-local-variable 'ebrowse--frame-configuration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1659 (setq ebrowse--frame-configuration old-frame-configuration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1660 (make-local-variable 'ebrowse--view-exit-action)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1661 (setq ebrowse--view-exit-action
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1662 (and (not had-a-buf)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1663 (not (buffer-modified-p buf-to-view))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1664 'kill-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1665 (view-mode-enter old-arrangement 'ebrowse-view-exit-fn)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1666
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1667
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1668 (defun ebrowse-view/find-file-and-search-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1669 (struc info file tags-file-name &optional view where)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1670 "Find or view a member or class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1671 STRUC is an `ebrowse-bs' structure (or a structure including that)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1672 describing what to search.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1673 INFO is a list (HEADER MEMBER-OR-CLASS ACCESSOR). HEADER is the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1674 header structure of a class tree. MEMBER-OR-CLASS is either an
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1675 `ebrowse-ms' or `ebrowse-cs' structure depending on what is searched.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1676 ACCESSOR is an accessor function for the member list of a member
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1677 if MEMBER-OR-CLASS is an `ebrowse-ms'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1678 FILE is the file to search the member in.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1679 FILE is not taken out of STRUC here because the filename in STRUC
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1680 may be nil in which case the filename of the class description is used.
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
1681 TAGS-FILE-NAME is the name of the BROWSE file from which the
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1682 tree was loaded.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1683 If VIEW is non-nil, view file else find the file.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1684 WHERE is either `other-window', `other-frame' or `this-window' and
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1685 specifies where to find/view the result."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1686 (unless file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1687 (error "Sorry, no file information available for %s"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1688 (ebrowse-bs-name struc)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1689 ;; Get the source file to view or find.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1690 (setf file (ebrowse-find-source-file file tags-file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1691 ;; If current window is dedicated, use another frame.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1692 (when (window-dedicated-p (selected-window))
43763
29f787bccb84 (ebrowse-view/find-file-and-search-pattern):
Gerd Moellmann <gerd@gnu.org>
parents: 42706
diff changeset
1693 (setf where 'other-window))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1694 (cond (view
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1695 (setf ebrowse-temp-position-to-view struc
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1696 ebrowse-temp-info-to-view info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1697 (unless (boundp 'view-mode-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1698 (setq view-mode-hook nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1699 (push 'ebrowse-find-pattern view-mode-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1700 (case where
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1701 (other-window (ebrowse-view-file-other-window file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1702 (other-frame (ebrowse-view-file-other-frame file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1703 (t (view-file file))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1704 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1705 (case where
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1706 (other-window (find-file-other-window file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1707 (other-frame (find-file-other-frame file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1708 (t (find-file file)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1709 (ebrowse-find-pattern struc info))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1710
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1711
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1712 (defun ebrowse-symbol-regexp (name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1713 "Generate a suitable regular expression for a member or class NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1714 This is `regexp-quote' for most symbols, except for operator names
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1715 which may contain whitespace. For these symbols, replace white
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
1716 space in the symbol name (generated by BROWSE) with a regular
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1717 expression matching any number of whitespace characters."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1718 (loop with regexp = (regexp-quote name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1719 with start = 0
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1720 finally return regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1721 while (string-match "[ \t]+" regexp start)
46353
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
1722 do (setq regexp (concat (substring regexp 0 (match-beginning 0))
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
1723 "[ \t]*"
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
1724 (substring regexp (match-end 0)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1725 start (+ (match-beginning 0) 5))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1726
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1727
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1728 (defun ebrowse-class-declaration-regexp (name)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1729 "Construct a regexp for a declaration of class NAME."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1730 (concat "^[ \t]*\\(template[ \t\n]*<.*>\\)?"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1731 "[ \t\n]*\\(class\\|struct\\|union\\).*\\S_"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1732 (ebrowse-symbol-regexp name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1733 "\\S_"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1734
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1735
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1736 (defun ebrowse-variable-declaration-regexp (name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1737 "Construct a regexp for matching a variable NAME."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1738 (concat "\\S_" (ebrowse-symbol-regexp name) "\\S_"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1739
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1740
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1741 (defun ebrowse-function-declaration/definition-regexp (name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1742 "Construct a regexp for matching a function NAME."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1743 (concat "^[a-zA-Z0-9_:*&<>, \t]*\\S_"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1744 (ebrowse-symbol-regexp name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1745 "[ \t\n]*("))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1746
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1747
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1748 (defun ebrowse-pp-define-regexp (name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1749 "Construct a regexp matching a define of NAME."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1750 (concat "^[ \t]*#[ \t]*define[ \t]+" (regexp-quote name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1751
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1752
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1753 (defun* ebrowse-find-pattern (&optional position info &aux viewing)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1754 "Find a pattern.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1755
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1756 This is a kluge: Ebrowse allows you to find or view a file containing
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1757 a pattern. To be able to do a search in a viewed buffer,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1758 `view-mode-hook' is temporarily set to this function;
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1759 `ebrowse-temp-position-to-view' holds what to search for.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1760
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1761 INFO is a list (TREE-HEADER TREE-OR-MEMBER MEMBER-LIST)."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1762 (unless position
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1763 (pop view-mode-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1764 (setf viewing t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1765 position ebrowse-temp-position-to-view
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1766 info ebrowse-temp-info-to-view))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1767 (widen)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1768 (let* ((pattern (ebrowse-bs-pattern position))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1769 (start (ebrowse-bs-point position))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1770 (offset 100)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1771 found)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1772 (destructuring-bind (header class-or-member member-list) info
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1773 ;; If no pattern is specified, construct one from the member name.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1774 (when (stringp pattern)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1775 (setq pattern (concat "^.*" (regexp-quote pattern))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1776 ;; Construct a regular expression if none given.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1777 (unless pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1778 (typecase class-or-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1779 (ebrowse-ms
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1780 (case member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1781 ((ebrowse-ts-member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1782 ebrowse-ts-static-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1783 ebrowse-ts-types)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1784 (setf pattern (ebrowse-variable-declaration-regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1785 (ebrowse-bs-name position))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1786 (otherwise
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1787 (if (ebrowse-define-p class-or-member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1788 (setf pattern (ebrowse-pp-define-regexp (ebrowse-bs-name position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1789 (setf pattern (ebrowse-function-declaration/definition-regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1790 (ebrowse-bs-name position)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1791 (ebrowse-cs
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1792 (setf pattern (ebrowse-class-declaration-regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1793 (ebrowse-bs-name position))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1794 ;; Begin searching some OFFSET from the original point where the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1795 ;; regular expression was found by the parse, and step forward.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1796 ;; When there is no regular expression in the database and a
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1797 ;; member definition/declaration was not seen by the parser,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1798 ;; START will be 0.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1799 (when (and (boundp 'ebrowse-debug)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1800 (symbol-value 'ebrowse-debug))
65689
96187e7edd1b 2005-09-25 Romain Francoise <romain@orebokech.com>
Romain Francoise <romain@orebokech.com>
parents: 64699
diff changeset
1801 (y-or-n-p (format "start = %d? " start))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1802 (y-or-n-p pattern))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1803 (setf found
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1804 (loop do (goto-char (max (point-min) (- start offset)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1805 when (re-search-forward pattern (+ start offset) t) return t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1806 never (bobp)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1807 do (incf offset offset)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1808 (cond (found
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1809 (beginning-of-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1810 (run-hooks 'ebrowse-view/find-hook))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1811 ((numberp (ebrowse-bs-pattern position))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1812 (goto-char start)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1813 (if ebrowse-not-found-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1814 (run-hooks 'ebrowse-not-found-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1815 (message "Not found")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1816 (sit-for 2)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1817 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1818 (if ebrowse-not-found-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1819 (run-hooks 'ebrowse-not-found-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1820 (unless viewing
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1821 (error "Not found"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1822 (message "Not found")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1823 (sit-for 2)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1824
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1825
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1826 ;;; Drawing the tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1827
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1828 (defun ebrowse-redraw-tree (&optional quietly)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1829 "Redisplay the complete tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1830 QUIETLY non-nil means don't display progress messages."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1831 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1832 (or quietly (message "Displaying..."))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1833 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1834 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1835 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1836 (ebrowse-draw-tree-fn)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1837 (ebrowse-update-tree-buffer-mode-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1838 (or quietly (message nil)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1839
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1840
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1841 (defun ebrowse-set-mark-props (start end tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1842 "Set text properties for class marker signs between START and END.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1843 TREE denotes the class shown."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1844 (add-text-properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1845 start end
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1846 `(mouse-face highlight ebrowse-what mark ebrowse-tree ,tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1847 help-echo "double-mouse-1: mark/unmark"))
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
1848 (ebrowse-set-face start end 'ebrowse-tree-mark))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1849
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1850
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1851 (defun* ebrowse-draw-tree-fn (&aux stack1 stack2 start)
49480
891beaa9ee33 (ebrowse-draw-tree-fn): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 47929
diff changeset
1852 "Display a single class and recursively its subclasses.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1853 This function may look weird, but this is faster than recursion."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1854 (setq stack1 (make-list (length ebrowse--tree) 0)
45742
70b4c348d174 (ebrowse-draw-tree-fn): Use copy-sequence.
Richard M. Stallman <rms@gnu.org>
parents: 43764
diff changeset
1855 stack2 (copy-sequence ebrowse--tree))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1856 (loop while stack2
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1857 as level = (pop stack1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1858 as tree = (pop stack2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1859 as class = (ebrowse-ts-class tree) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1860 (let ((start-of-line (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1861 start-of-class-name end-of-class-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1862 ;; Insert mark
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1863 (insert (if (ebrowse-ts-mark tree) ">" " "))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1864
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1865 ;; Indent and insert class name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1866 (indent-to (+ (* level ebrowse--indentation)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1867 ebrowse-tree-left-margin))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1868 (setq start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1869 (insert (ebrowse-qualified-class-name class))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
1870
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1871 ;; If template class, add <>
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1872 (when (ebrowse-template-p class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1873 (insert "<>"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1874 (ebrowse-set-face start (point) (if (zerop level)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
1875 'ebrowse-root-class
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
1876 'ebrowse-default))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1877 (setf start-of-class-name start
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1878 end-of-class-name (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1879 ;; If filenames are to be displayed...
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1880 (when ebrowse--show-file-names-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1881 (indent-to ebrowse-source-file-column)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1882 (setq start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1883 (insert "("
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1884 (or (ebrowse-cs-file class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1885 "unknown")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1886 ")")
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
1887 (ebrowse-set-face start (point) 'ebrowse-file-name))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1888 (ebrowse-set-mark-props start-of-line (1+ start-of-line) tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1889 (add-text-properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1890 start-of-class-name end-of-class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1891 `(mouse-face highlight ebrowse-what class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1892 ebrowse-tree ,tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1893 help-echo "double-mouse-1: (un)expand tree; mouse-2: member functions, mouse-3: menu"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1894 (insert "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1895 ;; Push subclasses, if any.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1896 (when (ebrowse-ts-subclasses tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1897 (setq stack2
45742
70b4c348d174 (ebrowse-draw-tree-fn): Use copy-sequence.
Richard M. Stallman <rms@gnu.org>
parents: 43764
diff changeset
1898 (nconc (copy-sequence (ebrowse-ts-subclasses tree)) stack2)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1899 stack1
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1900 (nconc (make-list (length (ebrowse-ts-subclasses tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1901 (1+ level)) stack1)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1902
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1903
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1904
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1905 ;;; Expanding/ collapsing tree branches
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1906
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1907 (defun ebrowse-expand-branch (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1908 "Expand a sub-tree that has been previously collapsed.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1909 With prefix ARG, expand all sub-trees."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1910 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1911 (if arg
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1912 (ebrowse-expand-all arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1913 (ebrowse-collapse-fn nil)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1914
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1915
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1916 (defun ebrowse-collapse-branch (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1917 "Fold (do no longer display) the subclasses of the current class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1918 \(The class cursor is on.) With prefix ARG, fold all trees in the buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1919 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1920 (if arg
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1921 (ebrowse-expand-all (not arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1922 (ebrowse-collapse-fn t)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1923
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1924
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1925 (defun ebrowse-expand-all (collapse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1926 "Expand or fold all trees in the buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1927 COLLAPSE non-nil means fold them."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1928 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1929 (let ((line-end (if collapse "^\n" "^\r"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1930 (insertion (if collapse "\r" "\n")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1931 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1932 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1933 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1934 (while (not (progn (skip-chars-forward line-end) (eobp)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1935 (when (or (not collapse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1936 (looking-at "\n "))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1937 (delete-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1938 (insert insertion))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1939 (when collapse
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1940 (skip-chars-forward "\n ")))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1941
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1942
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1943 (defun ebrowse-unhide-base-classes ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1944 "Unhide the line the cursor is on and all base classes."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1945 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1946 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1947 (let (indent last-indent)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1948 (skip-chars-backward "^\r\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1949 (when (not (looking-at "[\r\n][^ \t]"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1950 (skip-chars-forward "\r\n \t")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1951 (while (and (or (null last-indent) ;first time
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1952 (> indent 1)) ;not root class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1953 (re-search-backward "[\r\n][ \t]*" nil t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1954 (setf indent (- (match-end 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1955 (match-beginning 0)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1956 (when (or (null last-indent)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1957 (< indent last-indent))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1958 (setf last-indent indent)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1959 (when (looking-at "\r")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1960 (delete-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1961 (insert 10)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1962 (backward-char 1)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1963
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1964
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1965 (defun ebrowse-hide-line (collapse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1966 "Hide/show a single line in the tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1967 COLLAPSE non-nil means hide."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1968 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1969 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1970 (skip-chars-forward "^\r\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1971 (delete-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1972 (insert (if collapse 13 10)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1973
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1974
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1975 (defun ebrowse-collapse-fn (collapse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1976 "Collapse or expand a branch of the tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1977 COLLAPSE non-nil means collapse the branch."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1978 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1979 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1980 (beginning-of-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1981 (skip-chars-forward "> \t")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1982 (let ((indentation (current-column)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1983 (while (and (not (eobp))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1984 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1985 (skip-chars-forward "^\r\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1986 (goto-char (1+ (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1987 (skip-chars-forward "> \t")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1988 (> (current-column) indentation)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1989 (ebrowse-hide-line collapse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1990 (skip-chars-forward "^\r\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1991 (goto-char (1+ (point))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1992
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1993
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1994 ;;; Electric tree selection
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1995
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1996 (defvar ebrowse-electric-list-mode-map ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1997 "Keymap used in electric Ebrowse buffer list window.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1998
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1999
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2000 (unless ebrowse-electric-list-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2001 (let ((map (make-keymap))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2002 (submap (make-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2003 (setq ebrowse-electric-list-mode-map map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2004 (fillarray (car (cdr map)) 'ebrowse-electric-list-undefined)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2005 (fillarray (car (cdr submap)) 'ebrowse-electric-list-undefined)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2006 (define-key map "\e" submap)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2007 (define-key map "\C-z" 'suspend-emacs)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2008 (define-key map "\C-h" 'Helper-help)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2009 (define-key map "?" 'Helper-describe-bindings)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2010 (define-key map "\C-c" nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2011 (define-key map "\C-c\C-c" 'ebrowse-electric-list-quit)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2012 (define-key map "q" 'ebrowse-electric-list-quit)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2013 (define-key map " " 'ebrowse-electric-list-select)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2014 (define-key map "\C-l" 'recenter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2015 (define-key map "\C-u" 'universal-argument)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2016 (define-key map "\C-p" 'previous-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2017 (define-key map "\C-n" 'next-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2018 (define-key map "p" 'previous-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2019 (define-key map "n" 'next-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2020 (define-key map "v" 'ebrowse-electric-view-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2021 (define-key map "\C-v" 'scroll-up)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2022 (define-key map "\ev" 'scroll-down)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2023 (define-key map "\e\C-v" 'scroll-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2024 (define-key map "\e>" 'end-of-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2025 (define-key map "\e<" 'beginning-of-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2026 (define-key map "\e>" 'end-of-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2027
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2028 (put 'ebrowse-electric-list-mode 'mode-class 'special)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2029 (put 'ebrowse-electric-list-undefined 'suppress-keymap t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2030
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2031
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2032 (defun ebrowse-electric-list-mode ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2033 "Mode for electric tree list mode."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2034 (kill-all-local-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2035 (use-local-map ebrowse-electric-list-mode-map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2036 (setq mode-name "Electric Position Menu"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2037 mode-line-buffer-identification "Electric Tree Menu")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2038 (when (memq 'mode-name mode-line-format)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2039 (setq mode-line-format (copy-sequence mode-line-format))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2040 (setcar (memq 'mode-name mode-line-format) "Tree Buffers"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2041 (make-local-variable 'Helper-return-blurb)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2042 (setq Helper-return-blurb "return to buffer editing"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2043 truncate-lines t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2044 buffer-read-only t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2045 major-mode 'ebrowse-electric-list-mode)
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
2046 (run-mode-hooks 'ebrowse-electric-list-mode-hook))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2047
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2048
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2049 (defun ebrowse-list-tree-buffers ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2050 "Display a list of all tree buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2051 (set-buffer (get-buffer-create "*Tree Buffers*"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2052 (setq buffer-read-only nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2053 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2054 (insert "Tree\n" "----\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2055 (dolist (buffer (ebrowse-known-class-trees-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2056 (insert (buffer-name buffer) "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2057 (setq buffer-read-only t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2058
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2059
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2060 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2061 (defun ebrowse-electric-choose-tree ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2062 "Return a buffer containing a tree or nil if no tree found or canceled."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2063 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2064 (unless (car (ebrowse-known-class-trees-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2065 (error "No tree buffers"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2066 (let (select buffer window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2067 (save-window-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2068 (save-window-excursion (ebrowse-list-tree-buffers))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2069 (setq window (Electric-pop-up-window "*Tree Buffers*")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2070 buffer (window-buffer window))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2071 (shrink-window-if-larger-than-buffer window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2072 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2073 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2074 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2075 (ebrowse-electric-list-mode)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2076 (setq select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2077 (catch 'ebrowse-electric-list-select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2078 (message "<<< Press Space to bury the list >>>")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2079 (let ((first (progn (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2080 (forward-line 2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2081 (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2082 (last (progn (goto-char (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2083 (forward-line -1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2084 (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2085 (goal-column 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2086 (goto-char first)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2087 (Electric-command-loop 'ebrowse-electric-list-select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2088 nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2089 t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2090 'ebrowse-electric-list-looper
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2091 (cons first last))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2092 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2093 (bury-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2094 (message nil)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2095 (when select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2096 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2097 (setq select (ebrowse-electric-get-buffer select)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2098 (kill-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2099 select))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2100
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2101
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2102 (defun ebrowse-electric-list-looper (state condition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2103 "Prevent cursor from moving beyond the buffer end.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2104 Don't let it move into the title lines.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2105 See 'Electric-command-loop' for a description of STATE and CONDITION."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2106 (cond ((and condition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2107 (not (memq (car condition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2108 '(buffer-read-only end-of-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2109 beginning-of-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2110 (signal (car condition) (cdr condition)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2111 ((< (point) (car state))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2112 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2113 (forward-line 2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2114 ((> (point) (cdr state))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2115 (goto-char (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2116 (forward-line -1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2117 (if (pos-visible-in-window-p (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2118 (recenter -1)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2119
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2120
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2121 (defun ebrowse-electric-list-undefined ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2122 "Function called for keys that are undefined."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2123 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2124 (message "Type C-h for help, ? for commands, q to quit, Space to select.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2125 (sit-for 4))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2126
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2127
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2128 (defun ebrowse-electric-list-quit ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2129 "Discard the buffer list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2130 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2131 (throw 'ebrowse-electric-list-select nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2132
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2133
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2134 (defun ebrowse-electric-list-select ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2135 "Select a buffer from the buffer list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2136 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2137 (throw 'ebrowse-electric-list-select (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2138
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2139
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2140 (defun ebrowse-electric-get-buffer (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2141 "Get a buffer corresponding to the line POINT is in."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2142 (let ((index (- (count-lines (point-min) point) 2)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2143 (nth index (ebrowse-known-class-trees-buffer-list))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2144
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2145
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2146 ;;; View a buffer for a tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2147
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2148 (defun ebrowse-electric-view-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2149 "View buffer point is on."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2150 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2151 (let ((buffer (ebrowse-electric-get-buffer (point))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2152 (cond (buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2153 (view-buffer buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2154 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2155 (error "Buffer no longer exists")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2156
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2157
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2158 (defun ebrowse-choose-from-browser-buffers ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2159 "Read a browser buffer name from the minibuffer and return that buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2160 (let* ((buffers (ebrowse-known-class-trees-buffer-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2161 (if buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2162 (if (not (second buffers))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2163 (first buffers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2164 (or (ebrowse-electric-choose-tree) (error "No tree buffer")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2165 (let* ((insert-default-directory t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2166 (file (read-file-name "Find tree: " nil nil t)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2167 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2168 (find-file file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2169 (find-buffer-visiting file)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2170
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2171
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2172 ;;; Member buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2173
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2174 (unless ebrowse-member-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2175 (let ((map (make-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2176 (setf ebrowse-member-mode-map map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2177 (suppress-keymap map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2178
30554
e56649429a8b (ebrowse-tree-mode-map): Use display-mouse-p instead of window-system.
Eli Zaretskii <eliz@gnu.org>
parents: 28816
diff changeset
2179 (when (display-mouse-p)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2180 (define-key map [down-mouse-3] 'ebrowse-member-mouse-3)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2181 (define-key map [mouse-2] 'ebrowse-member-mouse-2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2182
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2183 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2184 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2185 (define-key map "C" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2186 (define-key map1 "b" 'ebrowse-switch-member-buffer-to-base-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2187 (define-key map1 "c" 'ebrowse-switch-member-buffer-to-any-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2188 (define-key map1 "d" 'ebrowse-switch-member-buffer-to-derived-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2189 (define-key map1 "n" 'ebrowse-switch-member-buffer-to-next-sibling-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2190 (define-key map1 "p" 'ebrowse-switch-member-buffer-to-previous-sibling-class))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2191
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2192 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2193 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2194 (define-key map "D" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2195 (define-key map1 "a" 'ebrowse-toggle-member-attributes-display)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2196 (define-key map1 "b" 'ebrowse-toggle-base-class-display)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2197 (define-key map1 "f" 'ebrowse-freeze-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2198 (define-key map1 "l" 'ebrowse-toggle-long-short-display)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2199 (define-key map1 "r" 'ebrowse-toggle-regexp-display)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2200 (define-key map1 "w" 'ebrowse-set-member-buffer-column-width))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2201
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2202 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2203 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2204 (define-key map "F" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2205 (let ((map2 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2206 (suppress-keymap map2 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2207 (define-key map1 "a" map2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2208 (define-key map2 "i" 'ebrowse-toggle-private-member-filter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2209 (define-key map2 "o" 'ebrowse-toggle-protected-member-filter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2210 (define-key map2 "u" 'ebrowse-toggle-public-member-filter))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2211 (define-key map1 "c" 'ebrowse-toggle-const-member-filter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2212 (define-key map1 "i" 'ebrowse-toggle-inline-member-filter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2213 (define-key map1 "p" 'ebrowse-toggle-pure-member-filter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2214 (define-key map1 "r" 'ebrowse-remove-all-member-filters)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2215 (define-key map1 "v" 'ebrowse-toggle-virtual-member-filter))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2216
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2217 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2218 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2219 (define-key map "L" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2220 (define-key map1 "d" 'ebrowse-display-friends-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2221 (define-key map1 "f" 'ebrowse-display-function-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2222 (define-key map1 "F" 'ebrowse-display-static-functions-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2223 (define-key map1 "n" 'ebrowse-display-next-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2224 (define-key map1 "p" 'ebrowse-display-previous-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2225 (define-key map1 "t" 'ebrowse-display-types-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2226 (define-key map1 "v" 'ebrowse-display-variables-member-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2227 (define-key map1 "V" 'ebrowse-display-static-variables-member-list))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2228
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2229 (let ((map1 (make-sparse-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2230 (suppress-keymap map1 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2231 (define-key map "G" map1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2232 (define-key map1 "m" 'ebrowse-goto-visible-member/all-member-lists)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2233 (define-key map1 "n" 'ebrowse-repeat-member-search)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2234 (define-key map1 "v" 'ebrowse-goto-visible-member))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2235
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2236 (define-key map "f" 'ebrowse-find-member-declaration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2237 (define-key map "m" 'ebrowse-switch-to-next-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2238 (define-key map "q" 'bury-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2239 (define-key map "t" 'ebrowse-show-displayed-class-in-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2240 (define-key map "v" 'ebrowse-view-member-declaration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2241 (define-key map " " 'ebrowse-view-member-definition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2242 (define-key map "?" 'describe-mode)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2243 (define-key map "\C-i" 'ebrowse-pop-from-member-to-tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2244 (define-key map "\C-l" 'ebrowse-redisplay-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2245 (define-key map "\C-m" 'ebrowse-find-member-definition)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2246
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2247
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2248
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2249 ;;; Member mode
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2250
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
2251 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2252 (defun ebrowse-member-mode ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2253 "Major mode for Ebrowse member buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2254
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2255 \\{ebrowse-member-mode-map}"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2256 (kill-all-local-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2257 (use-local-map ebrowse-member-mode-map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2258 (setq major-mode 'ebrowse-member-mode)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2259 (mapcar 'make-local-variable
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2260 '(ebrowse--decl-column ;display column
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2261 ebrowse--n-columns ;number of short columns
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2262 ebrowse--column-width ;width of columns above
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2263 ebrowse--show-inherited-flag ;include inherited members?
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2264 ebrowse--filters ;public, protected, private
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2265 ebrowse--accessor ;vars, functions, friends
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2266 ebrowse--displayed-class ;class displayed
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2267 ebrowse--long-display-flag ;display with regexps?
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2268 ebrowse--source-regexp-flag ;show source regexp?
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2269 ebrowse--attributes-flag ;show `virtual' and `inline'
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2270 ebrowse--member-list ;list of members displayed
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2271 ebrowse--tree ;the class tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2272 ebrowse--member-mode-strings ;part of mode line
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2273 ebrowse--tags-file-name ;
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2274 ebrowse--header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2275 ebrowse--tree-obarray
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2276 ebrowse--virtual-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2277 ebrowse--inline-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2278 ebrowse--const-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2279 ebrowse--pure-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2280 ebrowse--frozen-flag)) ;buffer not automagically reused
28548
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
2281 (setq mode-name "Ebrowse-Members"
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
2282 mode-line-buffer-identification
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
2283 (propertized-buffer-identification "C++ Members")
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2284 buffer-read-only t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2285 ebrowse--long-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2286 ebrowse--attributes-flag t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2287 ebrowse--show-inherited-flag t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2288 ebrowse--source-regexp-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2289 ebrowse--filters [0 1 2]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2290 ebrowse--decl-column ebrowse-default-declaration-column
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2291 ebrowse--column-width ebrowse-default-column-width
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2292 ebrowse--virtual-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2293 ebrowse--inline-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2294 ebrowse--const-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2295 ebrowse--pure-display-flag nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2296 (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
2297 (run-mode-hooks 'ebrowse-member-mode-hook))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2298
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2299
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2300
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2301 ;;; Member mode mode line
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2302
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2303 (defsubst ebrowse-class-name-displayed-in-member-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2304 "Return the name of the class displayed in the member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2305 (ebrowse-cs-name (ebrowse-ts-class ebrowse--displayed-class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2306
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2307
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2308 (defsubst ebrowse-member-list-name ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2309 "Return a string describing what is displayed in the member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2310 (get ebrowse--accessor (if (ebrowse-globals-tree-p ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2311 'ebrowse-global-title
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2312 'ebrowse-title)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2313
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2314
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2315 (defun ebrowse-update-member-buffer-mode-line ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2316 "Update the mode line of member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2317 (let* ((name (when ebrowse--frozen-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2318 (concat (ebrowse-class-name-displayed-in-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2319 " ")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2320 (ident (concat name (ebrowse-member-list-name))))
28548
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
2321 (setq mode-line-buffer-identification
19c5020c0db3 (ebrowse-tree-mode): Use
Gerd Moellmann <gerd@gnu.org>
parents: 28541
diff changeset
2322 (propertized-buffer-identification ident))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2323 (ebrowse-rename-buffer (if name ident ebrowse-member-buffer-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2324 (force-mode-line-update)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2325
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2326
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2327 ;;; Misc member buffer commands
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2328
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2329 (defun ebrowse-freeze-member-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2330 "Toggle frozen status of current buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2331 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2332 (setq ebrowse--frozen-flag (not ebrowse--frozen-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2333 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2334
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2335
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2336 (defun ebrowse-show-displayed-class-in-tree (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2337 "Show the currently displayed class in the tree window.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2338 With prefix ARG, switch to the tree buffer else pop to it."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2339 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2340 (let ((class-name (ebrowse-class-name-displayed-in-member-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2341 (when (ebrowse-pop-from-member-to-tree-buffer arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2342 (ebrowse-read-class-name-and-go class-name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2343
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2344
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2345 (defun ebrowse-set-member-buffer-column-width ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2346 "Set the column width of the member display.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2347 The new width is read from the minibuffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2348 (interactive)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
2349 (let ((width (string-to-number
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2350 (read-from-minibuffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2351 (concat "Column width ("
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2352 (int-to-string (if ebrowse--long-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2353 ebrowse--decl-column
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2354 ebrowse--column-width))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2355 "): ")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2356 (when (plusp width)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2357 (if ebrowse--long-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2358 (setq ebrowse--decl-column width)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2359 (setq ebrowse--column-width width))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2360 (ebrowse-redisplay-member-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2361
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2362
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2363 (defun ebrowse-pop-from-member-to-tree-buffer (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2364 "Pop from a member buffer to the matching tree buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2365 Switch to the buffer if prefix ARG. If no tree buffer exists,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2366 make one."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2367 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2368 (let ((buf (or (get-buffer (ebrowse-frozen-tree-buffer-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2369 ebrowse--tags-file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2370 (get-buffer ebrowse-tree-buffer-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2371 (ebrowse-create-tree-buffer ebrowse--tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2372 ebrowse--tags-file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2373 ebrowse--header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2374 ebrowse--tree-obarray
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2375 'pop))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2376 (and buf
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2377 (funcall (if arg 'switch-to-buffer 'pop-to-buffer) buf))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2378 buf))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2379
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2380
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2381
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2382 ;;; Switching between member lists
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2383
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2384 (defun ebrowse-display-member-list-for-accessor (accessor)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2385 "Switch the member buffer to display the member list for ACCESSOR."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2386 (setf ebrowse--accessor accessor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2387 ebrowse--member-list (funcall accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2388 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2389
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2390
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2391 (defun ebrowse-cyclic-display-next/previous-member-list (incr)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2392 "Switch buffer to INCR'th next/previous list of members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2393 (let ((index (ebrowse-position ebrowse--accessor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2394 ebrowse-member-list-accessors)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2395 (setf ebrowse--accessor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2396 (cond ((plusp incr)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2397 (or (nth (1+ index)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2398 ebrowse-member-list-accessors)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2399 (first ebrowse-member-list-accessors)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2400 ((minusp incr)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2401 (or (and (>= (decf index) 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2402 (nth index
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2403 ebrowse-member-list-accessors))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2404 (first (last ebrowse-member-list-accessors))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2405 (ebrowse-display-member-list-for-accessor ebrowse--accessor)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2406
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2407
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2408 (defun ebrowse-display-next-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2409 "Switch buffer to next member list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2410 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2411 (ebrowse-cyclic-display-next/previous-member-list 1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2412
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2413
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2414 (defun ebrowse-display-previous-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2415 "Switch buffer to previous member list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2416 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2417 (ebrowse-cyclic-display-next/previous-member-list -1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2418
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2419
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2420 (defun ebrowse-display-function-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2421 "Display the list of member functions."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2422 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2423 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-member-functions))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2424
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2425
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2426 (defun ebrowse-display-variables-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2427 "Display the list of member variables."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2428 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2429 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-member-variables))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2430
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2431
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2432 (defun ebrowse-display-static-variables-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2433 "Display the list of static member variables."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2434 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2435 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-static-variables))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2436
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2437
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2438 (defun ebrowse-display-static-functions-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2439 "Display the list of static member functions."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2440 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2441 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-static-functions))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2442
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2443
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2444 (defun ebrowse-display-friends-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2445 "Display the list of friends."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2446 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2447 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-friends))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2448
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2449
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2450 (defun ebrowse-display-types-member-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2451 "Display the list of types."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2452 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2453 (ebrowse-display-member-list-for-accessor 'ebrowse-ts-types))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2454
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2455
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2456
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2457 ;;; Filters and other display attributes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2458
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2459 (defun ebrowse-toggle-member-attributes-display ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2460 "Toggle display of `virtual', `inline', `const' etc."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2461 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2462 (setq ebrowse--attributes-flag (not ebrowse--attributes-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2463 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2464
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2465
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2466 (defun ebrowse-toggle-base-class-display ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2467 "Toggle the display of members inherited from base classes."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2468 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2469 (setf ebrowse--show-inherited-flag (not ebrowse--show-inherited-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2470 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2471
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2472
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2473 (defun ebrowse-toggle-pure-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2474 "Toggle display of pure virtual members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2475 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2476 (setf ebrowse--pure-display-flag (not ebrowse--pure-display-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2477 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2478
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2479
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2480 (defun ebrowse-toggle-const-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2481 "Toggle display of const members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2482 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2483 (setf ebrowse--const-display-flag (not ebrowse--const-display-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2484 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2485
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2486
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2487 (defun ebrowse-toggle-inline-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2488 "Toggle display of inline members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2489 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2490 (setf ebrowse--inline-display-flag (not ebrowse--inline-display-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2491 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2492
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2493
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2494 (defun ebrowse-toggle-virtual-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2495 "Toggle display of virtual members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2496 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2497 (setf ebrowse--virtual-display-flag (not ebrowse--virtual-display-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2498 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2499
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2500
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2501 (defun ebrowse-remove-all-member-filters ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2502 "Remove all filters."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2503 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2504 (dotimes (i 3)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2505 (aset ebrowse--filters i i))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2506 (setq ebrowse--pure-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2507 ebrowse--const-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2508 ebrowse--virtual-display-flag nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2509 ebrowse--inline-display-flag nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2510 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2511
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2512
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2513 (defun ebrowse-toggle-public-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2514 "Toggle visibility of public members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2515 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2516 (ebrowse-set-member-access-visibility 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2517 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2518
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2519
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2520 (defun ebrowse-toggle-protected-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2521 "Toggle visibility of protected members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2522 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2523 (ebrowse-set-member-access-visibility 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2524 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2525
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2526
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2527 (defun ebrowse-toggle-private-member-filter ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2528 "Toggle visibility of private members."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2529 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2530 (ebrowse-set-member-access-visibility 2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2531 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2532
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2533
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2534 (defun ebrowse-set-member-access-visibility (vis)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2535 (setf (aref ebrowse--filters vis)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2536 (if (aref ebrowse--filters vis) nil vis)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2537
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2538
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2539 (defun ebrowse-toggle-long-short-display ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2540 "Toggle between long and short display form of member buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2541 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2542 (setf ebrowse--long-display-flag (not ebrowse--long-display-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2543 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2544
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2545
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2546 (defun ebrowse-toggle-regexp-display ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2547 "Toggle declaration/definition regular expression display.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2548 Used in member buffers showing the long display form."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2549 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2550 (setf ebrowse--source-regexp-flag (not ebrowse--source-regexp-flag))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2551 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2552
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2553
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2554
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2555 ;;; Viewing/finding members
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2556
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2557 (defun ebrowse-find-member-definition (&optional prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2558 "Find the file containing a member definition.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2559 With PREFIX 4. find file in another window, with prefix 5
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2560 find file in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2561 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2562 (ebrowse-view/find-member-declaration/definition prefix nil t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2563
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2564
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2565 (defun ebrowse-view-member-definition (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2566 "View the file containing a member definition.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2567 With PREFIX 4. find file in another window, with prefix 5
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2568 find file in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2569 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2570 (ebrowse-view/find-member-declaration/definition prefix t t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2571
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2572
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2573 (defun ebrowse-find-member-declaration (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2574 "Find the file containing a member's declaration.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2575 With PREFIX 4. find file in another window, with prefix 5
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2576 find file in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2577 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2578 (ebrowse-view/find-member-declaration/definition prefix nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2579
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2580
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2581 (defun ebrowse-view-member-declaration (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2582 "View the file containing a member's declaration.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2583 With PREFIX 4. find file in another window, with prefix 5
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2584 find file in another frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2585 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2586 (ebrowse-view/find-member-declaration/definition prefix t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2587
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2588
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2589 (defun* ebrowse-view/find-member-declaration/definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2590 (prefix view &optional definition info header tags-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2591 "Find or view a member declaration or definition.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2592 With PREFIX 4. find file in another window, with prefix 5
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2593 find file in another frame.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2594 DEFINITION non-nil means find the definition, otherwise find the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2595 declaration.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2596 INFO is a list (TREE ACCESSOR MEMBER) describing the member to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2597 search.
28816
03f206c5d91b Change file name `EBROWSE' to `BROWSE'.
Gerd Moellmann <gerd@gnu.org>
parents: 28705
diff changeset
2598 TAGS-FILE-NAME is the file name of the BROWSE file."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2599 (unless header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2600 (setq header ebrowse--header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2601 (unless tags-file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2602 (setq tags-file-name ebrowse--tags-file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2603 (let (tree member accessor file on-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2604 (where (if (= prefix 4) 'other-window
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2605 (if (= prefix 5) 'other-frame 'this-window))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2606 ;; If not given as parameters, get the necessary information
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2607 ;; out of the member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2608 (if info
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2609 (setq tree (first info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2610 accessor (second info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2611 member (third info))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2612 (multiple-value-setq (tree member on-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2613 (ebrowse-member-info-from-point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2614 (setq accessor ebrowse--accessor))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2615 ;; View/find class if on a line containing a class name.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2616 (when on-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2617 (return-from ebrowse-view/find-member-declaration/definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2618 (ebrowse-view/find-file-and-search-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2619 (ebrowse-ts-class tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2620 (list ebrowse--header (ebrowse-ts-class tree) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2621 (ebrowse-cs-file (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2622 tags-file-name view where)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2623 ;; For some member lists, it doesn't make sense to search for
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2624 ;; a definition. If this is requested, silently search for the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2625 ;; declaration.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2626 (when (and definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2627 (eq accessor 'ebrowse-ts-member-variables))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2628 (setq definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2629 ;; Construct a suitable `browse' struct for definitions.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2630 (when definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2631 (setf member (make-ebrowse-ms
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2632 :name (ebrowse-ms-name member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2633 :file (ebrowse-ms-definition-file member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2634 :pattern (ebrowse-ms-definition-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2635 member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2636 :flags (ebrowse-ms-flags member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2637 :point (ebrowse-ms-definition-point
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2638 member))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2639 ;; When no file information in member, use that of the class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2640 (setf file (or (ebrowse-ms-file member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2641 (if definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2642 (ebrowse-cs-source-file (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2643 (ebrowse-cs-file (ebrowse-ts-class tree)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2644 ;; When we have no regular expressions in the database the only
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2645 ;; indication that the parser hasn't seen a definition/declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2646 ;; is that the search start point will be zero.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2647 (if (or (null file) (zerop (ebrowse-ms-point member)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2648 (if (y-or-n-p (concat "No information about "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2649 (if definition "definition" "declaration")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2650 ". Search for "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2651 (if definition "declaration" "definition")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2652 " of `"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2653 (ebrowse-ms-name member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2654 "'? "))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2655 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2656 (message nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2657 ;; Recurse with new info.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2658 (ebrowse-view/find-member-declaration/definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2659 prefix view (not definition) info header tags-file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2660 (error "Search canceled"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2661 ;; Find that thing.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2662 (ebrowse-view/find-file-and-search-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2663 (make-ebrowse-bs :name (ebrowse-ms-name member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2664 :pattern (ebrowse-ms-pattern member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2665 :file (ebrowse-ms-file member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2666 :flags (ebrowse-ms-flags member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2667 :point (ebrowse-ms-point member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2668 (list header member accessor)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2669 file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2670 tags-file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2671 view
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2672 where))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2673
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2674
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2675
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2676 ;;; Drawing the member buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2677
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2678 (defun ebrowse-redisplay-member-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2679 "Force buffer redisplay."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2680 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2681 (let ((display-fn (if ebrowse--long-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2682 'ebrowse-draw-member-long-fn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2683 'ebrowse-draw-member-short-fn)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2684 (ebrowse-output
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2685 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2686 ;; Show this class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2687 (ebrowse-draw-member-buffer-class-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2688 (funcall display-fn ebrowse--member-list ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2689 ;; Show inherited members if corresponding switch is on
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2690 (when ebrowse--show-inherited-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2691 (dolist (super (ebrowse-base-classes ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2692 (goto-char (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2693 (insert (if (bolp) "\n\n" "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2694 (ebrowse-draw-member-buffer-class-line super)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2695 (funcall display-fn (funcall ebrowse--accessor super) super)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2696 (ebrowse-update-member-buffer-mode-line))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2697
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2698
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2699 (defun ebrowse-draw-member-buffer-class-line (&optional class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2700 "Display the title line for a class section in the member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2701 CLASS non-nil means display that class' title. Otherwise use
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2702 the class cursor is on."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2703 (let ((start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2704 (tree (or class ebrowse--displayed-class))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2705 class-name-start
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2706 class-name-end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2707 (insert "class ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2708 (setq class-name-start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2709 (insert (ebrowse-qualified-class-name (ebrowse-ts-class tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2710 (when (ebrowse-template-p (ebrowse-ts-class tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2711 (insert "<>"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2712 (setq class-name-end (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2713 (insert ":\n\n")
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
2714 (ebrowse-set-face start (point) 'ebrowse-member-class)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2715 (add-text-properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2716 class-name-start class-name-end
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2717 '(ebrowse-what class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2718 mouse-face highlight
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2719 help-echo "mouse-3: menu"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2720 (put-text-property start class-name-end 'ebrowse-tree tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2721
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2722
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2723 (defun ebrowse-display-member-buffer (list &optional stand-alone class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2724 "Start point for member buffer creation.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2725 LIST is the member list to display. STAND-ALONE non-nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2726 means the member buffer is standalone. CLASS is its class."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2727 (let* ((classes ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2728 (tree ebrowse--tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2729 (tags-file-name ebrowse--tags-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2730 (header ebrowse--header)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2731 temp-buffer-setup-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2732 (temp-buffer (get-buffer ebrowse-member-buffer-name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2733 ;; Get the class description from the name the cursor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2734 ;; is on if not specified as an argument.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2735 (unless class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2736 (setq class (ebrowse-tree-at-point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2737 (with-output-to-temp-buffer ebrowse-member-buffer-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2738 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2739 (set-buffer standard-output)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2740 ;; If new buffer, set the mode and initial values of locals
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2741 (unless temp-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2742 (ebrowse-member-mode))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2743 ;; Set local variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2744 (setq ebrowse--member-list (funcall list class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2745 ebrowse--displayed-class class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2746 ebrowse--accessor list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2747 ebrowse--tree-obarray classes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2748 ebrowse--frozen-flag stand-alone
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2749 ebrowse--tags-file-name tags-file-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2750 ebrowse--header header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2751 ebrowse--tree tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2752 buffer-read-only t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2753 (ebrowse-redisplay-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2754 (current-buffer)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2755
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2756
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2757 (defun ebrowse-member-display-p (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2758 "Return t if MEMBER must be displayed under the current filter settings."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2759 (if (and (aref ebrowse--filters (ebrowse-ms-visibility member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2760 (or (null ebrowse--const-display-flag)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2761 (ebrowse-const-p member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2762 (or (null ebrowse--inline-display-flag)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2763 (ebrowse-inline-p member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2764 (or (null ebrowse--pure-display-flag)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2765 (ebrowse-bs-p member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2766 (or (null ebrowse--virtual-display-flag)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2767 (ebrowse-virtual-p member)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2768 member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2769
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2770
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2771 (defun ebrowse-draw-member-attributes (member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2772 "Insert a string for the attributes of MEMBER."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2773 (insert (if (ebrowse-template-p member) "T" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2774 (if (ebrowse-extern-c-p member) "C" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2775 (if (ebrowse-virtual-p member) "v" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2776 (if (ebrowse-inline-p member) "i" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2777 (if (ebrowse-const-p member) "c" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2778 (if (ebrowse-pure-virtual-p member) "0" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2779 (if (ebrowse-mutable-p member) "m" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2780 (if (ebrowse-explicit-p member) "e" "-")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2781 (if (ebrowse-throw-list-p member) "t" "-")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2782
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2783
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2784 (defun ebrowse-draw-member-regexp (member-struc)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2785 "Insert a string for the regular expression matching MEMBER-STRUC."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2786 (let ((pattern (if ebrowse--source-regexp-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2787 (ebrowse-ms-definition-pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2788 member-struc)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2789 (ebrowse-ms-pattern member-struc))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2790 (cond ((stringp pattern)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2791 (insert (ebrowse-trim-string pattern) "...\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2792 (beginning-of-line 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2793 (move-to-column (+ 4 ebrowse--decl-column))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2794 (while (re-search-forward "[ \t]+" nil t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2795 (delete-region (match-beginning 0) (match-end 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2796 (insert " "))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2797 (beginning-of-line 2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2798 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2799 (insert "[not recorded or unknown]\n")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2800
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2801
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2802 (defun ebrowse-draw-member-long-fn (member-list tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2803 "Display member buffer for MEMBER-LIST in long form.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2804 TREE is the class tree of MEMBER-LIST."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2805 (dolist (member-struc (mapcar 'ebrowse-member-display-p member-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2806 (when member-struc
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2807 (let ((name (ebrowse-ms-name member-struc))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2808 (start (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2809 ;; Insert member name truncated to the right length
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2810 (insert (substring name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2811 0
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2812 (min (length name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2813 (1- ebrowse--decl-column))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2814 (add-text-properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2815 start (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2816 `(mouse-face highlight ebrowse-what member-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2817 ebrowse-member ,member-struc
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2818 ebrowse-tree ,tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2819 help-echo "mouse-2: view definition; mouse-3: menu"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2820 ;; Display virtual, inline, and const status
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2821 (setf start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2822 (indent-to ebrowse--decl-column)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2823 (put-text-property start (point) 'mouse-face nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2824 (when ebrowse--attributes-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2825 (let ((start (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2826 (insert "<")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2827 (ebrowse-draw-member-attributes member-struc)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2828 (insert ">")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2829 (ebrowse-set-face start (point)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
2830 'ebrowse-member-attribute)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2831 (insert " ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2832 (ebrowse-draw-member-regexp member-struc))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2833 (insert "\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2834 (goto-char (point-min)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2835
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2836
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2837 (defun ebrowse-draw-member-short-fn (member-list tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2838 "Display MEMBER-LIST in short form.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2839 TREE is the class tree in which the members are found."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2840 (let ((i 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2841 (column-width (+ ebrowse--column-width
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2842 (if ebrowse--attributes-flag 12 0))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2843 ;; Get the number of columns to draw.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2844 (setq ebrowse--n-columns
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2845 (max 1 (/ (ebrowse-width-of-drawable-area) column-width)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2846 (dolist (member (mapcar #'ebrowse-member-display-p member-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2847 (when member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2848 (let ((name (ebrowse-ms-name member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2849 start-of-entry
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2850 (start-of-column (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2851 start-of-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2852 (indent-to (* i column-width))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2853 (put-text-property start-of-column (point) 'mouse-face nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2854 (setq start-of-entry (point))
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
2855 ;; Show various attributes
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2856 (when ebrowse--attributes-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2857 (insert "<")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2858 (ebrowse-draw-member-attributes member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2859 (insert "> ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2860 (ebrowse-set-face start-of-entry (point)
63448
b9811baefe1a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
2861 'ebrowse-member-attribute))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2862 ;; insert member name truncated to column width
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2863 (setq start-of-name (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2864 (insert (substring name 0
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2865 (min (length name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2866 (1- ebrowse--column-width))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2867 ;; set text properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2868 (add-text-properties
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2869 start-of-name (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2870 `(ebrowse-what member-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2871 ebrowse-member ,member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2872 mouse-face highlight
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2873 ebrowse-tree ,tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2874 help-echo "mouse-2: view definition; mouse-3: menu"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2875 (incf i)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2876 (when (>= i ebrowse--n-columns)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2877 (setf i 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2878 (insert "\n")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2879 (when (plusp i)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2880 (insert "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2881 (goto-char (point-min))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2882
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2883
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2884
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2885 ;;; Killing members from tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2886
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2887 (defun ebrowse-member-info-from-point ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2888 "Ger information about the member at point.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2889 The result has the form (TREE MEMBER NULL-P). TREE is the tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2890 we're in, MEMBER is the member we're on. NULL-P is t if MEMBER
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2891 is nil."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2892 (let ((tree (or (get-text-property (point) 'ebrowse-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2893 (error "No information at point")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2894 (member (get-text-property (point) 'ebrowse-member)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2895 (list tree member (null member))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2896
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2897
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2898
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2899 ;;; Switching member buffer to display a selected member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2900
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2901 (defun ebrowse-goto-visible-member/all-member-lists (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2902 "Position cursor on a member read from the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2903 With PREFIX, search all members in the tree. Otherwise consider
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2904 only members visible in the buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2905 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2906 (ebrowse-ignoring-completion-case
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2907 (let* ((completion-list (ebrowse-name/accessor-alist-for-class-members))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2908 (member (completing-read "Goto member: " completion-list nil t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2909 (accessor (cdr (assoc member completion-list))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2910 (unless accessor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2911 (error "`%s' not found" member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2912 (unless (eq accessor ebrowse--accessor)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2913 (setf ebrowse--accessor accessor
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2914 ebrowse--member-list (funcall accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2915 (ebrowse-redisplay-member-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2916 (ebrowse-move-point-to-member member))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2917
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2918
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2919 (defun ebrowse-goto-visible-member (repeat)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2920 "Position point on a member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2921 Read the member's name from the minibuffer. Consider only members
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2922 visible in the member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2923 REPEAT non-nil means repeat the search that number of times."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2924 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2925 (ebrowse-ignoring-completion-case
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2926 ;; Read member name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2927 (let* ((completion-list (ebrowse-name/accessor-alist-for-visible-members))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2928 (member (completing-read "Goto member: " completion-list nil t)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2929 (ebrowse-move-point-to-member member repeat))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2930
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2931
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2932
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2933 ;;; Searching a member in the member buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2934
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2935 (defun ebrowse-repeat-member-search (repeat)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2936 "Repeat the last regular expression search.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2937 REPEAT, if specified, says repeat the search REPEAT times."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2938 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2939 (unless ebrowse--last-regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2940 (error "No regular expression remembered"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2941 ;; Skip over word the point is on
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2942 (skip-chars-forward "^ \t\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2943 ;; Search for regexp from point
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2944 (if (re-search-forward ebrowse--last-regexp nil t repeat)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2945 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2946 (goto-char (match-beginning 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2947 (skip-chars-forward " \t\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2948 ;; If not found above, repeat search from buffer start
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2949 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2950 (if (re-search-forward ebrowse--last-regexp nil t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2951 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2952 (goto-char (match-beginning 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2953 (skip-chars-forward " \t\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2954 (error "Not found"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2955
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2956
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2957 (defun* ebrowse-move-point-to-member (name &optional count &aux member)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2958 "Set point on member NAME in the member buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2959 COUNT, if specified, says search the COUNT'th member with the same name."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2960 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2961 (widen)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2962 (setq member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2963 (substring name 0 (min (length name) (1- ebrowse--column-width)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2964 ebrowse--last-regexp
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2965 (concat "[ \t\n]" (regexp-quote member) "[ \n\t]"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2966 (if (re-search-forward ebrowse--last-regexp nil t count)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2967 (goto-char (1+ (match-beginning 0)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2968 (error "Not found")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2969
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2970
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2971
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2972 ;;; Switching member buffer to another class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2973
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2974 (defun ebrowse-switch-member-buffer-to-other-class (title compl-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2975 "Switch member buffer to a class read from the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2976 Use TITLE as minibuffer prompt.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2977 COMPL-LIST is a completion list to use."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2978 (let* ((initial (unless (second compl-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2979 (first (first compl-list))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2980 (class (or (ebrowse-completing-read-value title compl-list initial)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2981 (error "Not found"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2982 (setf ebrowse--displayed-class class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2983 ebrowse--member-list (funcall ebrowse--accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2984 (ebrowse-redisplay-member-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2985
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2986
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2987 (defun ebrowse-switch-member-buffer-to-any-class ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2988 "Switch member buffer to a class read from the minibuffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2989 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2990 (ebrowse-switch-member-buffer-to-other-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2991 "Goto class: " (ebrowse-tree-obarray-as-alist)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2992
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2993
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2994 (defun ebrowse-switch-member-buffer-to-base-class (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2995 "Switch buffer to ARG'th base class."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2996 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2997 (let ((supers (or (ebrowse-direct-base-classes ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2998 (error "No base classes"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2999 (if (and arg (second supers))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3000 (let ((alist (loop for s in supers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3001 collect (cons (ebrowse-qualified-class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3002 (ebrowse-ts-class s))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3003 s))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3004 (ebrowse-switch-member-buffer-to-other-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3005 "Goto base class: " alist))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3006 (setq ebrowse--displayed-class (first supers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3007 ebrowse--member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3008 (funcall ebrowse--accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3009 (ebrowse-redisplay-member-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3010
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3011 (defun ebrowse-switch-member-buffer-to-next-sibling-class (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3012 "Move to ARG'th next sibling."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3013 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3014 (ebrowse-switch-member-buffer-to-sibling-class arg))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3015
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3016
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3017 (defun ebrowse-switch-member-buffer-to-previous-sibling-class (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3018 "Move to ARG'th previous sibling."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3019 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3020 (ebrowse-switch-member-buffer-to-sibling-class (- arg)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3021
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3022
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3023 (defun ebrowse-switch-member-buffer-to-sibling-class (inc)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3024 "Switch member display to nth sibling class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3025 Prefix arg INC specifies which one."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3026 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3027 (let ((containing-list ebrowse--tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3028 index cls
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3029 (supers (ebrowse-direct-base-classes ebrowse--displayed-class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3030 (flet ((trees-alist (trees)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3031 (loop for tr in trees
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3032 collect (cons (ebrowse-cs-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3033 (ebrowse-ts-class tr)) tr))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3034 (when supers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3035 (let ((tree (if (second supers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3036 (ebrowse-completing-read-value
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3037 "Relative to base class: "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3038 (trees-alist supers) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3039 (first supers))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3040 (unless tree (error "Not found"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3041 (setq containing-list (ebrowse-ts-subclasses tree)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3042 (setq index (+ inc (ebrowse-position ebrowse--displayed-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3043 containing-list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3044 (cond ((minusp index) (message "No previous class"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3045 ((null (nth index containing-list)) (message "No next class")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3046 (setq index (max 0 (min index (1- (length containing-list)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3047 (setq cls (nth index containing-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3048 (setf ebrowse--displayed-class cls
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3049 ebrowse--member-list (funcall ebrowse--accessor cls))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3050 (ebrowse-redisplay-member-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3051
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3052
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3053 (defun ebrowse-switch-member-buffer-to-derived-class (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3054 "Switch member display to nth derived class.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3055 Prefix arg ARG says which class should be displayed. Default is
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3056 the first derived class."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3057 (interactive "P")
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3058 (flet ((ebrowse-tree-obarray-as-alist ()
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3059 (loop for s in (ebrowse-ts-subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3060 ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3061 collect (cons (ebrowse-cs-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3062 (ebrowse-ts-class s)) s))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3063 (let ((subs (or (ebrowse-ts-subclasses ebrowse--displayed-class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3064 (error "No derived classes"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3065 (if (and arg (second subs))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3066 (ebrowse-switch-member-buffer-to-other-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3067 "Goto derived class: " (ebrowse-tree-obarray-as-alist))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3068 (setq ebrowse--displayed-class (first subs)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3069 ebrowse--member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3070 (funcall ebrowse--accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3071 (ebrowse-redisplay-member-buffer)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3072
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3073
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3074
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3075 ;;; Member buffer mouse functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3076
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3077 (defun ebrowse-displaying-functions ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3078 (eq ebrowse--accessor 'ebrowse-ts-member-functions))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3079 (defun ebrowse-displaying-variables ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3080 (eq ebrowse--accessor 'ebrowse-ts-member-variables))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3081 (defun ebrowse-displaying-static-functions ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3082 )
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3083 (defun ebrowse-displaying-static-variables ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3084 )
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3085 (defun ebrowse-displaying-types ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3086 (eq ebrowse--accessor 'ebrowse-ts-types))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3087 (defun ebrowse-displaying-friends ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3088 (eq ebrowse--accessor 'ebrowse-ts-friends))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3089
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3090 (easy-menu-define
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3091 ebrowse-member-buffer-object-menu ebrowse-member-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3092 "Object menu for the member buffer itself."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3093 '("Members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3094 ("Members List"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3095 ["Functions" ebrowse-display-function-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3096 :help "Show the list of member functions"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3097 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3098 :selected (eq ebrowse--accessor 'ebrowse-ts-member-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3099 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3100 ["Variables" ebrowse-display-variables-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3101 :help "Show the list of member variables"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3102 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3103 :selected (eq ebrowse--accessor 'ebrowse-ts-member-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3104 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3105 ["Static Functions" ebrowse-display-static-functions-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3106 :help "Show the list of static member functions"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3107 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3108 :selected (eq ebrowse--accessor 'ebrowse-ts-static-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3109 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3110 ["Static Variables" ebrowse-display-static-variables-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3111 :help "Show the list of static member variables"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3112 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3113 :selected (eq ebrowse--accessor 'ebrowse-ts-static-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3114 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3115 ["Types" ebrowse-display-types-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3116 :help "Show the list of nested types"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3117 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3118 :selected (eq ebrowse--accessor 'ebrowse-ts-types)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3119 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3120 ["Friends/Defines" ebrowse-display-friends-member-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3121 :help "Show the list of friends or defines"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3122 :style radio
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3123 :selected (eq ebrowse--accessor 'ebrowse-ts-friends)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3124 :active t])
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3125 ("Class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3126 ["Up" ebrowse-switch-member-buffer-to-base-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3127 :help "Show the base class of this class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3128 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3129 ["Down" ebrowse-switch-member-buffer-to-derived-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3130 :help "Show a derived class class of this class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3131 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3132 ["Next Sibling" ebrowse-switch-member-buffer-to-next-sibling-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3133 :help "Show the next sibling class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3134 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3135 ["Previous Sibling" ebrowse-switch-member-buffer-to-previous-sibling-class
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3136 :help "Show the previous sibling class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3137 :active t])
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3138 ("Member"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3139 ["Show in Tree" ebrowse-show-displayed-class-in-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3140 :help "Show this class in the class tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3141 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3142 ["Find in this Class" ebrowse-goto-visible-member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3143 :help "Search for a member of this class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3144 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3145 ["Find in Tree" ebrowse-goto-visible-member/all-member-lists
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3146 :help "Search for a member in any class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3147 :active t])
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3148 ("Display"
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3149 ["Inherited" ebrowse-toggle-base-class-display
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3150 :help "Toggle display of inherited members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3151 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3152 :selected ebrowse--show-inherited-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3153 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3154 ["Attributes" ebrowse-toggle-member-attributes-display
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3155 :help "Show member attributes"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3156 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3157 :selected ebrowse--attributes-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3158 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3159 ["Long Display" ebrowse-toggle-long-short-display
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3160 :help "Toggle the member display format"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3161 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3162 :selected ebrowse--long-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3163 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3164 ["Column Width" ebrowse-set-member-buffer-column-width
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3165 :help "Set the display's column width"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3166 :active t])
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3167 ("Filter"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3168 ["Public" ebrowse-toggle-public-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3169 :help "Toggle the visibility of public members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3170 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3171 :selected (not (aref ebrowse--filters 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3172 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3173 ["Protected" ebrowse-toggle-protected-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3174 :help "Toggle the visibility of protected members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3175 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3176 :selected (not (aref ebrowse--filters 1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3177 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3178 ["Private" ebrowse-toggle-private-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3179 :help "Toggle the visibility of private members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3180 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3181 :selected (not (aref ebrowse--filters 2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3182 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3183 ["Virtual" ebrowse-toggle-virtual-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3184 :help "Toggle the visibility of virtual members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3185 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3186 :selected ebrowse--virtual-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3187 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3188 ["Inline" ebrowse-toggle-inline-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3189 :help "Toggle the visibility of inline members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3190 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3191 :selected ebrowse--inline-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3192 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3193 ["Const" ebrowse-toggle-const-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3194 :help "Toggle the visibility of const members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3195 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3196 :selected ebrowse--const-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3197 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3198 ["Pure" ebrowse-toggle-pure-member-filter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3199 :help "Toggle the visibility of pure virtual members"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3200 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3201 :selected ebrowse--pure-display-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3202 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3203 "-----------------"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3204 ["Show all" ebrowse-remove-all-member-filters
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3205 :help "Remove any display filters"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3206 :active t])
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3207 ("Buffer"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3208 ["Tree" ebrowse-pop-from-member-to-tree-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3209 :help "Pop to the class tree buffer"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3210 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3211 ["Next Member Buffer" ebrowse-switch-to-next-member-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3212 :help "Switch to the next member buffer of this class tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3213 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3214 ["Freeze" ebrowse-freeze-member-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3215 :help "Freeze (do not reuse) this member buffer"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3216 :active t])))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3217
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3218
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3219 (defun ebrowse-on-class-name ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3220 "Value is non-nil if point is on a class name."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3221 (eq (get-text-property (point) 'ebrowse-what) 'class-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3222
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3223
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3224 (defun ebrowse-on-member-name ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3225 "Value is non-nil if point is on a member name."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3226 (eq (get-text-property (point) 'ebrowse-what) 'member-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3227
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3228
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3229 (easy-menu-define
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3230 ebrowse-member-class-name-object-menu ebrowse-member-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3231 "Object menu for class names in member buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3232 '("Class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3233 ["Find" ebrowse-find-member-definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3234 :help "Find this class in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3235 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3236 ["View" ebrowse-view-member-definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3237 :help "View this class in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3238 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3239
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3240
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3241 (easy-menu-define
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3242 ebrowse-member-name-object-menu ebrowse-member-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3243 "Object menu for member names"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3244 '("Ebrowse"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3245 ["Find Definition" ebrowse-find-member-definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3246 :help "Find this member's definition in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3247 :active (ebrowse-on-member-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3248 ["Find Declaration" ebrowse-find-member-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3249 :help "Find this member's declaration in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3250 :active (ebrowse-on-member-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3251 ["View Definition" ebrowse-view-member-definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3252 :help "View this member's definition in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3253 :active (ebrowse-on-member-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3254 ["View Declaration" ebrowse-view-member-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3255 :help "View this member's declaration in the source files"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3256 :active (ebrowse-on-member-name)]))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3257
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3258
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3259 (defun ebrowse-member-mouse-3 (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3260 "Handle `mouse-3' events in member buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3261 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3262 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3263 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3264 (case (event-click-count event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3265 (2 (ebrowse-find-member-definition))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3266 (1 (case (get-text-property (posn-point (event-start event))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3267 'ebrowse-what)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3268 (member-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3269 (ebrowse-popup-menu ebrowse-member-name-object-menu event))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3270 (class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3271 (ebrowse-popup-menu ebrowse-member-class-name-object-menu event))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3272 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3273 (ebrowse-popup-menu ebrowse-member-buffer-object-menu event))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3274
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3275
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3276 (defun ebrowse-member-mouse-2 (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3277 "Handle `mouse-2' events in member buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3278 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3279 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3280 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3281 (case (event-click-count event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3282 (2 (ebrowse-find-member-definition))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3283 (1 (case (get-text-property (posn-point (event-start event))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3284 'ebrowse-what)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3285 (member-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3286 (ebrowse-view-member-definition 0))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3287
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3288
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3289
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3290 ;;; Tags view/find
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3291
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3292 (defun ebrowse-class-alist-for-member (tree-header name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3293 "Return information about a member in a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3294 TREE-HEADER is the header structure of the class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3295 NAME is the name of the member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3296 Value is an alist of elements (CLASS-NAME . (CLASS LIST NAME)),
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3297 where each element describes one occurrence of member NAME in the tree.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3298 CLASS-NAME is the qualified name of the class in which the
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3299 member was found. The CDR of the acons is described in function
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3300 `ebrowse-class/index/member-for-member'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3301 (let ((table (ebrowse-member-table tree-header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3302 known-classes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3303 alist)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3304 (when name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3305 (dolist (info (gethash name table) alist)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3306 (unless (memq (first info) known-classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3307 (setf alist (acons (ebrowse-qualified-class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3308 (ebrowse-ts-class (first info)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3309 info alist)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3310 known-classes (cons (first info) known-classes)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3311
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3312
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3313 (defun ebrowse-choose-tree ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3314 "Choose a class tree to use.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3315 If there's more than one class tree loaded, let the user choose
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3316 the one he wants. Value is (TREE HEADER BUFFER), with TREE being
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3317 the class tree, HEADER the header structure of the tree, and BUFFER
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3318 being the tree or member buffer containing the tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3319 (let* ((buffer (ebrowse-choose-from-browser-buffers)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3320 (if buffer (list (ebrowse-value-in-buffer 'ebrowse--tree buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3321 (ebrowse-value-in-buffer 'ebrowse--header buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3322 buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3323
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3324
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3325 (defun ebrowse-tags-read-name (header prompt)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3326 "Read a C++ identifier from the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3327 HEADER is the `ebrowse-hs' structure of the class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3328 Prompt with PROMPT. Insert into the minibuffer a C++ identifier read
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3329 from point as default. Value is a list (CLASS-NAME MEMBER-NAME)."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3330 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3331 (let* (start member-info (members (ebrowse-member-table header)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3332 (multiple-value-bind (class-name member-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3333 (ebrowse-tags-read-member+class-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3334 (unless member-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3335 (error "No member name at point"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3336 (if members
46353
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
3337 (let* ((name (ebrowse-ignoring-completion-case
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
3338 (completing-read prompt members nil nil member-name)))
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
3339 (completion-result (try-completion name members)))
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 41773
diff changeset
3340 ;; Cannot rely on `try-completion' returning t for exact
42706
be541feb06cc Fix typo.
Pavel Janík <Pavel@Janik.cz>
parents: 42205
diff changeset
3341 ;; matches! It returns the name as a string.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3342 (unless (setq member-info (gethash name members))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3343 (if (y-or-n-p "No exact match found. Try substrings? ")
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3344 (setq name
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3345 (or (first (ebrowse-list-of-matching-members
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3346 members (regexp-quote name) name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3347 (error "Sorry, nothing found")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3348 (error "Canceled")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3349 (list class-name name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3350 (list class-name (read-from-minibuffer prompt member-name)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3351
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3352
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3353 (defun ebrowse-tags-read-member+class-name ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3354 "Read a C++ identifier from point.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3355 Value is (CLASS-NAME MEMBER-NAME).
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3356 CLASS-NAME is the name of the class if the identifier was qualified.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3357 It is nil otherwise.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3358 MEMBER-NAME is the name of the member found."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3359 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3360 (skip-chars-backward "a-zA-Z0-9_")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3361 (let* ((start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3362 (name (progn (skip-chars-forward "a-zA-Z0-9_")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3363 (buffer-substring start (point))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3364 class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3365 (list class name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3366
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3367
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3368 (defun ebrowse-tags-choose-class (tree header name initial-class-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3369 "Read a class name for a member from the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3370 TREE is the class tree we operate on.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3371 HEADER is its header structure.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3372 NAME is the name of the member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3373 INITIAL-CLASS-NAME is an initial class name to insert in the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3374 Value is a list (TREE ACCESSOR MEMBER) for the member."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3375 (let ((alist (or (ebrowse-class-alist-for-member header name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3376 (error "No classes with member `%s' found" name))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3377 (ebrowse-ignoring-completion-case
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3378 (if (null (second alist))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3379 (cdr (first alist))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3380 (push ?\? unread-command-events)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3381 (cdr (assoc (completing-read "In class: "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3382 alist nil t initial-class-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3383 alist))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3384
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3385
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3386 (defun* ebrowse-tags-view/find-member-decl/defn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3387 (prefix &key view definition member-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3388 "If VIEW is t, view, else find an occurrence of MEMBER-NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3389
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3390 If DEFINITION is t, find or view the member definition else its
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3391 declaration. This function reads the member's name from the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3392 current buffer like FIND-TAG. It then prepares a completion list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3393 of all classes containing a member with the given name and lets
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3394 the user choose the class to use. As a last step, a tags search
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3395 is performed that positions point on the member declaration or
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3396 definition."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3397 (multiple-value-bind
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3398 (tree header tree-buffer) (ebrowse-choose-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3399 (unless tree (error "No class tree"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3400 (let* ((marker (point-marker))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3401 class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3402 (name member-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3403 info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3404 (unless name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3405 (multiple-value-setq (class-name name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3406 (ebrowse-tags-read-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3407 header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3408 (concat (if view "View" "Find") " member "
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3409 (if definition "definition" "declaration") ": "))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3410 (setq info (ebrowse-tags-choose-class tree header name class-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3411 (ebrowse-push-position marker info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3412 ;; Goto the occurrence of the member
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3413 (ebrowse-view/find-member-declaration/definition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3414 prefix view definition info
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3415 header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3416 (ebrowse-value-in-buffer 'ebrowse--tags-file-name tree-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3417 ;; Record position jumped to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3418 (ebrowse-push-position (point-marker) info t))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3419
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3420
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3421 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3422 (defun ebrowse-tags-view-declaration ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3423 "View declaration of member at point."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3424 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3425 (ebrowse-tags-view/find-member-decl/defn 0 :view t :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3426
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3427
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3428 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3429 (defun ebrowse-tags-find-declaration ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3430 "Find declaration of member at point."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3431 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3432 (ebrowse-tags-view/find-member-decl/defn 0 :view nil :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3433
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3434
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3435 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3436 (defun ebrowse-tags-view-definition ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3437 "View definition of member at point."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3438 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3439 (ebrowse-tags-view/find-member-decl/defn 0 :view t :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3440
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3441
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3442 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3443 (defun ebrowse-tags-find-definition ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3444 "Find definition of member at point."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3445 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3446 (ebrowse-tags-view/find-member-decl/defn 0 :view nil :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3447
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3448
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3449 (defun ebrowse-tags-view-declaration-other-window ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3450 "View declaration of member at point in other window."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3451 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3452 (ebrowse-tags-view/find-member-decl/defn 4 :view t :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3453
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3454
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3455 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3456 (defun ebrowse-tags-find-declaration-other-window ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3457 "Find declaration of member at point in other window."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3458 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3459 (ebrowse-tags-view/find-member-decl/defn 4 :view nil :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3460
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3461
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3462 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3463 (defun ebrowse-tags-view-definition-other-window ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3464 "View definition of member at point in other window."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3465 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3466 (ebrowse-tags-view/find-member-decl/defn 4 :view t :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3467
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3468
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3469 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3470 (defun ebrowse-tags-find-definition-other-window ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3471 "Find definition of member at point in other window."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3472 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3473 (ebrowse-tags-view/find-member-decl/defn 4 :view nil :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3474
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3475
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3476 (defun ebrowse-tags-view-declaration-other-frame ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3477 "View definition of member at point in other frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3478 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3479 (ebrowse-tags-view/find-member-decl/defn 5 :view t :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3480
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3481
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3482 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3483 (defun ebrowse-tags-find-declaration-other-frame ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3484 "Find definition of member at point in other frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3485 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3486 (ebrowse-tags-view/find-member-decl/defn 5 :view nil :definition nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3487
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3488
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3489 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3490 (defun ebrowse-tags-view-definition-other-frame ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3491 "View definition of member at point in other frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3492 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3493 (ebrowse-tags-view/find-member-decl/defn 5 :view t :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3494
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3495
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3496 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3497 (defun ebrowse-tags-find-definition-other-frame ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3498 "Find definition of member at point in other frame."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3499 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3500 (ebrowse-tags-view/find-member-decl/defn 5 :view nil :definition t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3501
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3502
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3503 (defun ebrowse-tags-select/create-member-buffer (tree-buffer info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3504 "Select or create member buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3505 TREE-BUFFER specifies the tree to use. INFO describes the member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3506 It is a list (TREE ACCESSOR MEMBER)."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3507 (let ((buffer (get-buffer ebrowse-member-buffer-name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3508 (cond ((null buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3509 (set-buffer tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3510 (switch-to-buffer (ebrowse-display-member-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3511 (second info) nil (first info))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3512 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3513 (switch-to-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3514 (setq ebrowse--displayed-class (first info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3515 ebrowse--accessor (second info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3516 ebrowse--member-list (funcall ebrowse--accessor ebrowse--displayed-class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3517 (ebrowse-redisplay-member-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3518 (ebrowse-move-point-to-member (ebrowse-ms-name (third info)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3519
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3520
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3521 (defun ebrowse-tags-display-member-buffer (&optional fix-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3522 "Display a member buffer for a member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3523 FIX-NAME non-nil means display the buffer for that member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3524 Otherwise read a member name from point."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3525 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3526 (multiple-value-bind
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3527 (tree header tree-buffer) (ebrowse-choose-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3528 (unless tree (error "No class tree"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3529 (let* ((marker (point-marker)) class-name (name fix-name) info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3530 (unless name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3531 (multiple-value-setq (class-name name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3532 (ebrowse-tags-read-name header
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3533 (concat "Find member list of: "))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3534 (setq info (ebrowse-tags-choose-class tree header name class-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3535 (ebrowse-push-position marker info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3536 (ebrowse-tags-select/create-member-buffer tree-buffer info))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3537
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3538
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3539 (defun ebrowse-list-of-matching-members (members regexp &optional name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3540 "Return a list of members in table MEMBERS matching REGEXP or NAME.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3541 Both NAME and REGEXP may be nil in which case exact or regexp matches
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3542 are not performed."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3543 (let (list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3544 (when (or name regexp)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3545 (maphash #'(lambda (member-name info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3546 (when (or (and name (string= name member-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3547 (and regexp (string-match regexp member-name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3548 (setq list (cons member-name list))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3549 members))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3550 list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3551
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3552
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3553 (defun ebrowse-tags-apropos ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3554 "Display a list of members matching a regexp read from the minibuffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3555 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3556 (let* ((buffer (or (ebrowse-choose-from-browser-buffers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3557 (error "No tree buffer")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3558 (header (ebrowse-value-in-buffer 'ebrowse--header buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3559 (members (ebrowse-member-table header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3560 temp-buffer-setup-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3561 (regexp (read-from-minibuffer "List members matching regexp: ")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3562 (with-output-to-temp-buffer (concat "*Apropos Members*")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3563 (set-buffer standard-output)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3564 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3565 (insert "Members matching `" regexp "'\n\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3566 (loop for s in (ebrowse-list-of-matching-members members regexp) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3567 (loop for info in (gethash s members) do
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3568 (ebrowse-draw-file-member-info info))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3569
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3570
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3571 (defun ebrowse-tags-list-members-in-file ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3572 "Display a list of members found in a file.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3573 The file name is read from the minibuffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3574 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3575 (let* ((buffer (or (ebrowse-choose-from-browser-buffers)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3576 (error "No tree buffer")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3577 (files (save-excursion (set-buffer buffer) (ebrowse-files-table)))
46353
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
3578 (file (completing-read "List members in file: " files nil t))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3579 (header (ebrowse-value-in-buffer 'ebrowse--header buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3580 temp-buffer-setup-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3581 (members (ebrowse-member-table header)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3582 (with-output-to-temp-buffer (concat "*Members in file " file "*")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3583 (set-buffer standard-output)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3584 (maphash
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3585 #'(lambda (member-name list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3586 (loop for info in list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3587 as member = (third info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3588 as class = (ebrowse-ts-class (first info))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3589 when (or (and (null (ebrowse-ms-file member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3590 (string= (ebrowse-cs-file class) file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3591 (string= file (ebrowse-ms-file member)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3592 do (ebrowse-draw-file-member-info info "decl.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3593 when (or (and (null (ebrowse-ms-definition-file member))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3594 (string= (ebrowse-cs-source-file class) file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3595 (string= file (ebrowse-ms-definition-file member)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3596 do (ebrowse-draw-file-member-info info "defn.")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3597 members))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3598
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3599
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3600 (defun* ebrowse-draw-file-member-info (info &optional (kind ""))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3601 "Display a line in an the members per file info buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3602 INFO describes the member. It has the form (TREE ACCESSOR MEMBER).
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3603 TREE is the class of the member to display.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3604 ACCESSOR is the accessor symbol of its member list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3605 MEMBER is the member structure.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3606 KIND is an additional string printed in the buffer."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3607 (let* ((tree (first info))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3608 (globals-p (ebrowse-globals-tree-p tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3609 (unless globals-p
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3610 (insert (ebrowse-cs-name (ebrowse-ts-class tree))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3611 (insert "::" (ebrowse-ms-name (third info)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3612 (indent-to 40)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3613 (insert kind)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3614 (indent-to 50)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3615 (insert (case (second info)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3616 ('ebrowse-ts-member-functions "member function")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3617 ('ebrowse-ts-member-variables "member variable")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3618 ('ebrowse-ts-static-functions "static function")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3619 ('ebrowse-ts-static-variables "static variable")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3620 ('ebrowse-ts-friends (if globals-p "define" "friend"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3621 ('ebrowse-ts-types "type")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3622 (t "unknown"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3623 "\n")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3624
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3625 (defvar ebrowse-last-completion nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3626 "Text inserted by the last completion operation.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3627
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3628
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3629 (defvar ebrowse-last-completion-start nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3630 "String which was the basis for the last completion operation.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3631
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3632
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3633 (defvar ebrowse-last-completion-location nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3634 "Buffer position at which the last completion operation was initiated.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3635
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3636
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3637 (defvar ebrowse-last-completion-obarray nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3638 "Member used in last completion operation.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3639
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3640
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3641 (make-variable-buffer-local 'ebrowse-last-completion-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3642 (make-variable-buffer-local 'ebrowse-last-completion-location)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3643 (make-variable-buffer-local 'ebrowse-last-completion)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3644 (make-variable-buffer-local 'ebrowse-last-completion-start)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3645
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3646
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3647
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3648 (defun ebrowse-some-member-table ()
49735
5cfff357b829 Docstring typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49480
diff changeset
3649 "Return a hash table containing all members of a tree.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3650 If there's only one tree loaded, use that. Otherwise let the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3651 use choose a tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3652 (let* ((buffers (ebrowse-known-class-trees-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3653 (buffer (cond ((and (first buffers) (not (second buffers)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3654 (first buffers))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3655 (t (or (ebrowse-electric-choose-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3656 (error "No tree buffer")))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3657 (header (ebrowse-value-in-buffer 'ebrowse--header buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3658 (ebrowse-member-table header)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3659
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3660
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3661 (defun ebrowse-cyclic-successor-in-string-list (string list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3662 "Return the item following STRING in LIST.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3663 If STRING is the last element, return the first element as successor."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3664 (or (nth (1+ (ebrowse-position string list 'string=)) list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3665 (first list)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3666
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3667
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3668 ;;; Symbol completion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3669
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3670 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3671 (defun* ebrowse-tags-complete-symbol (prefix)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3672 "Perform completion on the C++ symbol preceding point.
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3673 A second call of this function without changing point inserts the next match.
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3674 A call with prefix PREFIX reads the symbol to insert from the minibuffer with
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3675 completion."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3676 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3677 (let* ((end (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3678 (begin (save-excursion (skip-chars-backward "a-zA-Z_0-9") (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3679 (pattern (buffer-substring begin end))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3680 list completion)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3681 (cond
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3682 ;; With prefix, read name from minibuffer with completion.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3683 (prefix
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3684 (let* ((members (ebrowse-some-member-table))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3685 (completion (completing-read "Insert member: "
46353
c6a6286bc21a (ebrowse-symbol-regexp): Avoid cl-set-substring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 45742
diff changeset
3686 members nil t pattern)))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3687 (when completion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3688 (setf ebrowse-last-completion-location nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3689 (delete-region begin end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3690 (insert completion))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3691 ;; If this function is called at the same point the last
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3692 ;; expansion ended, insert the next expansion.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3693 ((eq (point) ebrowse-last-completion-location)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3694 (setf list (all-completions ebrowse-last-completion-start
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3695 ebrowse-last-completion-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3696 completion (ebrowse-cyclic-successor-in-string-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3697 ebrowse-last-completion list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3698 (cond ((null completion)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3699 (error "No completion"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3700 ((string= completion pattern)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3701 (error "No further completion"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3702 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3703 (delete-region begin end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3704 (insert completion)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3705 (setf ebrowse-last-completion completion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3706 ebrowse-last-completion-location (point)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3707 ;; First time the function is called at some position in the
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3708 ;; buffer: Start new completion.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3709 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3710 (let* ((members (ebrowse-some-member-table))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3711 (completion (first (all-completions pattern members nil))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3712 (cond ((eq completion t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3713 ((null completion)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3714 (error "Can't find completion for `%s'" pattern))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3715 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3716 (delete-region begin end)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3717 (insert completion)
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3718
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3719 (setf ebrowse-last-completion-location (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3720 ebrowse-last-completion-start pattern
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3721 ebrowse-last-completion completion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3722 ebrowse-last-completion-obarray members))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3723
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3724
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3725 ;;; Tags query replace & search
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3726
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3727 (defvar ebrowse-tags-loop-form ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3728 "Form for `ebrowse-loop-continue'.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3729 Evaluated for each file in the tree. If it returns nil, proceed
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3730 with the next file.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3731
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3732 (defvar ebrowse-tags-next-file-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3733 "A list of files to be processed.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3734
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3735
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3736 (defvar ebrowse-tags-next-file-path nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3737 "The path relative to which files have to be searched.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3738
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3739
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3740 (defvar ebrowse-tags-loop-last-file nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3741 "The last file visited via `ebrowse-tags-loop'.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3742
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3743
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3744 (defun ebrowse-tags-next-file (&optional initialize tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3745 "Select next file among files in current tag table.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3746 Non-nil argument INITIALIZE (prefix arg, if interactive) initializes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3747 to the beginning of the list of files in the tag table.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3748 TREE-BUFFER specifies the class tree we operate on."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3749 (interactive "P")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3750 ;; Call with INITIALIZE non-nil initializes the files list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3751 ;; If more than one tree buffer is loaded, let the user choose
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3752 ;; on which tree (s)he wants to operate.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3753 (when initialize
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3754 (let ((buffer (or tree-buffer (ebrowse-choose-from-browser-buffers))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3755 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3756 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3757 (setq ebrowse-tags-next-file-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3758 (ebrowse-files-list (ebrowse-marked-classes-p))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3759 ebrowse-tags-loop-last-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3760 nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3761 ebrowse-tags-next-file-path
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3762 (file-name-directory ebrowse--tags-file-name)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3763 ;; End of the loop if the stack of files is empty.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3764 (unless ebrowse-tags-next-file-list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3765 (error "All files processed"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3766 ;; ebrowse-tags-loop-last-file is the last file that was visited due
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3767 ;; to a call to BROWSE-LOOP (see below). If that file is still
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3768 ;; in memory, and it wasn't modified, throw its buffer away to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3769 ;; prevent cluttering up the buffer list.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3770 (when ebrowse-tags-loop-last-file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3771 (let ((buffer (get-file-buffer ebrowse-tags-loop-last-file)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3772 (when (and buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3773 (not (buffer-modified-p buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3774 (kill-buffer buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3775 ;; Remember this buffer file name for later deletion, if it
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3776 ;; wasn't visited by other means.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3777 (let ((file (expand-file-name (car ebrowse-tags-next-file-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3778 ebrowse-tags-next-file-path)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3779 (setq ebrowse-tags-loop-last-file (if (get-file-buffer file) nil file))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3780 ;; Find the file and pop the file list. Pop has to be done
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3781 ;; before the file is loaded because FIND-FILE might encounter
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3782 ;; an error, and we want to be able to proceed with the next
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3783 ;; file in this case.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3784 (pop ebrowse-tags-next-file-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3785 (find-file file)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3786
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3787
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3788 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3789 (defun ebrowse-tags-loop-continue (&optional first-time tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3790 "Repeat last operation on files in tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3791 FIRST-TIME non-nil means this is not a repetition, but the first time.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3792 TREE-BUFFER if indirectly specifies which files to loop over."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3793 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3794 (when first-time
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3795 (ebrowse-tags-next-file first-time tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3796 (goto-char (point-min)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3797 (while (not (eval ebrowse-tags-loop-form))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3798 (ebrowse-tags-next-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3799 (message "Scanning file `%s'..." buffer-file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3800 (goto-char (point-min))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3801
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3802
52529
c4c3b1b0d5c0 Fix broken magic autoload comments.
Masatake YAMATO <jet@gyve.org>
parents: 52401
diff changeset
3803 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3804 (defun ebrowse-tags-search (regexp)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3805 "Search for REGEXP in all files in a tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3806 If marked classes exist, process marked classes, only.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3807 If regular expression is nil, repeat last search."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3808 (interactive "sTree search (regexp): ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3809 (if (and (string= regexp "")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3810 (eq (car ebrowse-tags-loop-form) 're-search-forward))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3811 (ebrowse-tags-loop-continue)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3812 (setq ebrowse-tags-loop-form (list 're-search-forward regexp nil t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3813 (ebrowse-tags-loop-continue 'first-time)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3814
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3815
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3816 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3817 (defun ebrowse-tags-query-replace (from to)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3818 "Query replace FROM with TO in all files of a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3819 With prefix arg, process files of marked classes only."
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3820 (interactive
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3821 "sTree query replace (regexp): \nsTree query replace %s by: ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3822 (setq ebrowse-tags-loop-form
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3823 (list 'and (list 'save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3824 (list 're-search-forward from nil t))
40255
ad4ee591fe2f Adapt to change in perform-replace.
Gerd Moellmann <gerd@gnu.org>
parents: 38412
diff changeset
3825 (list 'not (list 'perform-replace from to t t nil))))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3826 (ebrowse-tags-loop-continue 'first-time))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3827
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3828
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
3829 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3830 (defun ebrowse-tags-search-member-use (&optional fix-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3831 "Search for call sites of a member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3832 If FIX-NAME is specified, search uses of that member.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3833 Otherwise, read a member name from the minibuffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3834 Searches in all files mentioned in a class tree for something that
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3835 looks like a function call to the member."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3836 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3837 ;; Choose the tree to use if there is more than one.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3838 (multiple-value-bind (tree header tree-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3839 (ebrowse-choose-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3840 (unless tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3841 (error "No class tree"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3842 ;; Get the member name NAME (class-name is ignored).
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3843 (let ((name fix-name) class-name regexp)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3844 (unless name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3845 (multiple-value-setq (class-name name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3846 (ebrowse-tags-read-name header "Find calls of: ")))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3847 ;; Set tags loop form to search for member and begin loop.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3848 (setq regexp (concat "\\<" name "[ \t]*(")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3849 ebrowse-tags-loop-form (list 're-search-forward regexp nil t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3850 (ebrowse-tags-loop-continue 'first-time tree-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3851
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3852
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3853
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3854 ;;; Tags position management
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3855
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3856 ;;; Structures of this kind are the elements of the position stack.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3857
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3858 (defstruct (ebrowse-position (:type vector) :named)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3859 file-name ; in which file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3860 point ; point in file
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3861 target ; t if target of a jump
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3862 info) ; (CLASS FUNC MEMBER) jumped to
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3863
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3864
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3865 (defvar ebrowse-position-stack ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3866 "Stack of `ebrowse-position' structured.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3867
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3868
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3869 (defvar ebrowse-position-index 0
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3870 "Current position in position stack.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3871
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3872
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3873 (defun ebrowse-position-name (position)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3874 "Return an identifying string for POSITION.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3875 The string is printed in the electric position list buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3876 (let ((info (ebrowse-position-info position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3877 (concat (if (ebrowse-position-target position) "at " "to ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3878 (ebrowse-cs-name (ebrowse-ts-class (first info)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3879 "::" (ebrowse-ms-name (third info)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3880
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3881
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3882 (defun ebrowse-view/find-position (position &optional view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3883 "Position point on POSITION.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3884 If VIEW is non-nil, view the position, otherwise find it."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3885 (cond ((not view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3886 (find-file (ebrowse-position-file-name position))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3887 (goto-char (ebrowse-position-point position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3888 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3889 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3890 (progn
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3891 (push (function
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3892 (lambda ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3893 (goto-char (ebrowse-position-point position))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3894 view-mode-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3895 (view-file (ebrowse-position-file-name position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3896 (pop view-mode-hook)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3897
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3898
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3899 (defun ebrowse-push-position (marker info &optional target)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3900 "Push current position on position stack.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3901 MARKER is the marker to remember as position.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3902 INFO is a list (CLASS FUNC MEMBER) specifying what we jumped to.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3903 TARGET non-nil means we performed a jump.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3904 Positions in buffers that have no file names are not saved."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3905 (when (buffer-file-name (marker-buffer marker))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3906 (let ((too-much (- (length ebrowse-position-stack)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3907 ebrowse-max-positions)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3908 ;; Do not let the stack grow to infinity.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3909 (when (plusp too-much)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3910 (setq ebrowse-position-stack
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3911 (butlast ebrowse-position-stack too-much)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3912 ;; Push the position.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3913 (push (make-ebrowse-position
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3914 :file-name (buffer-file-name (marker-buffer marker))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3915 :point (marker-position marker)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3916 :target target
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
3917 :info info)
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3918 ebrowse-position-stack))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3919
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3920
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3921 (defun ebrowse-move-in-position-stack (increment)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3922 "Move by INCREMENT in the position stack."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3923 (let ((length (length ebrowse-position-stack)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3924 (when (zerop length)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3925 (error "No positions remembered"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3926 (setq ebrowse-position-index
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3927 (mod (+ increment ebrowse-position-index) length))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3928 (message "Position %d of %d " ebrowse-position-index length)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3929 (ebrowse-view/find-position (nth ebrowse-position-index
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3930 ebrowse-position-stack))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3931
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3932
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
3933 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3934 (defun ebrowse-back-in-position-stack (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3935 "Move backward in the position stack.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3936 Prefix arg ARG says how much."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3937 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3938 (ebrowse-move-in-position-stack (max 1 arg)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3939
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3940
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
3941 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3942 (defun ebrowse-forward-in-position-stack (arg)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3943 "Move forward in the position stack.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3944 Prefix arg ARG says how much."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3945 (interactive "p")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3946 (ebrowse-move-in-position-stack (min -1 (- arg))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3947
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3948
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3949
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3950 ;;; Electric position list
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3951
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3952 (defvar ebrowse-electric-position-mode-map ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3953 "Keymap used in electric position stack window.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3954
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3955
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3956 (defvar ebrowse-electric-position-mode-hook nil
62074
c0b42702a33a (ebrowse-install-1-to-9-keys, ebrowse-print-statistics-line,
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
3957 "If non-nil, its value is called by `ebrowse-electric-position-mode'.")
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3958
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3959
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3960 (unless ebrowse-electric-position-mode-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3961 (let ((map (make-keymap))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3962 (submap (make-keymap)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3963 (setq ebrowse-electric-position-mode-map map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3964 (fillarray (car (cdr map)) 'ebrowse-electric-position-undefined)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3965 (fillarray (car (cdr submap)) 'ebrowse-electric-position-undefined)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3966 (define-key map "\e" submap)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3967 (define-key map "\C-z" 'suspend-emacs)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3968 (define-key map "\C-h" 'Helper-help)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3969 (define-key map "?" 'Helper-describe-bindings)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3970 (define-key map "\C-c" nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3971 (define-key map "\C-c\C-c" 'ebrowse-electric-position-quit)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3972 (define-key map "q" 'ebrowse-electric-position-quit)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3973 (define-key map " " 'ebrowse-electric-select-position)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3974 (define-key map "\C-l" 'recenter)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3975 (define-key map "\C-u" 'universal-argument)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3976 (define-key map "\C-p" 'previous-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3977 (define-key map "\C-n" 'next-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3978 (define-key map "p" 'previous-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3979 (define-key map "n" 'next-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3980 (define-key map "v" 'ebrowse-electric-view-position)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3981 (define-key map "\C-v" 'scroll-up)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3982 (define-key map "\ev" 'scroll-down)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3983 (define-key map "\e\C-v" 'scroll-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3984 (define-key map "\e>" 'end-of-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3985 (define-key map "\e<" 'beginning-of-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3986 (define-key map "\e>" 'end-of-buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3987
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3988 (put 'ebrowse-electric-position-mode 'mode-class 'special)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3989 (put 'ebrowse-electric-position-undefined 'suppress-keymap t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3990
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3991
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3992 (defun ebrowse-electric-position-mode ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3993 "Mode for electric position buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3994 Runs the hook `ebrowse-electric-position-mode-hook'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3995 (kill-all-local-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3996 (use-local-map ebrowse-electric-position-mode-map)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3997 (setq mode-name "Electric Position Menu"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3998 mode-line-buffer-identification "Electric Position Menu")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3999 (when (memq 'mode-name mode-line-format)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4000 (setq mode-line-format (copy-sequence mode-line-format))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4001 (setcar (memq 'mode-name mode-line-format) "Positions"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4002 (make-local-variable 'Helper-return-blurb)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4003 (setq Helper-return-blurb "return to buffer editing"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4004 truncate-lines t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4005 buffer-read-only t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4006 major-mode 'ebrowse-electric-position-mode)
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
4007 (run-mode-hooks 'ebrowse-electric-position-mode-hook))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4008
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4009
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4010 (defun ebrowse-draw-position-buffer ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4011 "Display positions in buffer *Positions*."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4012 (set-buffer (get-buffer-create "*Positions*"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4013 (setq buffer-read-only nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4014 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4015 (insert "File Point Description\n"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4016 "---- ----- -----------\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4017 (dolist (position ebrowse-position-stack)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4018 (insert (file-name-nondirectory (ebrowse-position-file-name position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4019 (indent-to 15)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4020 (insert (int-to-string (ebrowse-position-point position)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4021 (indent-to 22)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4022 (insert (ebrowse-position-name position) "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4023 (setq buffer-read-only t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4024
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4025
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
4026 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4027 (defun ebrowse-electric-position-menu ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4028 "List positions in the position stack in an electric buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4029 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4030 (unless ebrowse-position-stack
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4031 (error "No positions remembered"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4032 (let (select buffer window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4033 (save-window-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4034 (save-window-excursion (ebrowse-draw-position-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4035 (setq window (Electric-pop-up-window "*Positions*")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4036 buffer (window-buffer window))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4037 (shrink-window-if-larger-than-buffer window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4038 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4039 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4040 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4041 (ebrowse-electric-position-mode)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4042 (setq select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4043 (catch 'ebrowse-electric-select-position
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4044 (message "<<< Press Space to bury the list >>>")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4045 (let ((first (progn (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4046 (forward-line 2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4047 (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4048 (last (progn (goto-char (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4049 (forward-line -1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4050 (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4051 (goal-column 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4052 (goto-char first)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4053 (Electric-command-loop 'ebrowse-electric-select-position
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4054 nil t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4055 'ebrowse-electric-position-looper
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4056 (cons first last))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4057 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4058 (bury-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4059 (message nil)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4060 (when select
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4061 (set-buffer buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4062 (ebrowse-electric-find-position select))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4063 (kill-buffer buffer)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4064
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4065
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4066 (defun ebrowse-electric-position-looper (state condition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4067 "Prevent moving point on invalid lines.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4068 Called from `Electric-command-loop'. See there for the meaning
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4069 of STATE and CONDITION."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4070 (cond ((and condition
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4071 (not (memq (car condition) '(buffer-read-only
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4072 end-of-buffer
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4073 beginning-of-buffer))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4074 (signal (car condition) (cdr condition)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4075 ((< (point) (car state))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4076 (goto-char (point-min))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4077 (forward-line 2))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4078 ((> (point) (cdr state))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4079 (goto-char (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4080 (forward-line -1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4081 (if (pos-visible-in-window-p (point-max))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4082 (recenter -1)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4083
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4084
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4085 (defun ebrowse-electric-position-undefined ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4086 "Function called for undefined keys."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4087 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4088 (message "Type C-h for help, ? for commands, q to quit, Space to execute")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4089 (sit-for 4))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4090
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4091
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4092 (defun ebrowse-electric-position-quit ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4093 "Leave the electric position list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4094 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4095 (throw 'ebrowse-electric-select-position nil))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4096
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4097
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4098 (defun ebrowse-electric-select-position ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4099 "Select a position from the list."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4100 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4101 (throw 'ebrowse-electric-select-position (point)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4102
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4103
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4104 (defun ebrowse-electric-find-position (point &optional view)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4105 "View/find what is described by the line at POINT.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4106 If VIEW is non-nil, view else find source files."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4107 (let ((index (- (count-lines (point-min) point) 2)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4108 (ebrowse-view/find-position (nth index
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4109 ebrowse-position-stack) view)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4110
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4111
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4112 (defun ebrowse-electric-view-position ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4113 "View the position described by the line point is in."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4114 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4115 (ebrowse-electric-find-position (point) t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4116
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4117
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4118
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4119 ;;; Saving trees to disk
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4120
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4121 (defun ebrowse-write-file-hook-fn ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4122 "Write current buffer as a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4123 Installed on `local-write-file-hooks'."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4124 (ebrowse-save-tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4125 t)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4126
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4127
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
4128 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4129 (defun ebrowse-save-tree ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4130 "Save current tree in same file it was loaded from."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4131 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4132 (ebrowse-save-tree-as (or buffer-file-name ebrowse--tags-file-name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4133
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4134
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4135 ;;;###autoload
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4136 (defun ebrowse-save-tree-as (&optional file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4137 "Write the current tree data structure to a file.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4138 Read the file name from the minibuffer if interactive.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4139 Otherwise, FILE-NAME specifies the file to save the tree in."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4140 (interactive "FSave tree as: ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4141 (let ((temp-buffer (get-buffer-create "*Tree Output"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4142 (old-standard-output standard-output)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4143 (header (copy-ebrowse-hs ebrowse--header))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4144 (tree ebrowse--tree))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4145 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4146 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4147 (set-buffer (setq standard-output temp-buffer))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4148 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4149 (setf (ebrowse-hs-member-table header) nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4150 (insert (prin1-to-string header) " ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4151 (mapcar 'ebrowse-save-class tree)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4152 (write-file file-name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4153 (message "Tree written to file `%s'" file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4154 (kill-buffer temp-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4155 (set-buffer-modified-p nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4156 (ebrowse-update-tree-buffer-mode-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4157 (setq standard-output old-standard-output))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4158
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4159
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4160 (defun ebrowse-save-class (class)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4161 "Write single class CLASS to current buffer."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4162 (message "%s..." (ebrowse-cs-name (ebrowse-ts-class class)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4163 (insert "[ebrowse-ts ")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4164 (prin1 (ebrowse-ts-class class)) ;class name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4165 (insert "(") ;list of subclasses
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4166 (mapcar 'ebrowse-save-class (ebrowse-ts-subclasses class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4167 (insert ")")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4168 (dolist (func ebrowse-member-list-accessors)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4169 (prin1 (funcall func class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4170 (insert "\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4171 (insert "()") ;base-classes slot
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4172 (prin1 (ebrowse-ts-mark class))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4173 (insert "]\n"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4174
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4175
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4176
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4177 ;;; Statistics
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4178
37426
71d360920aad Fix autoload cookies.
Gerd Moellmann <gerd@gnu.org>
parents: 34304
diff changeset
4179 ;;;###autoload
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4180 (defun ebrowse-statistics ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4181 "Display statistics for a class tree."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4182 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4183 (let ((tree-file (buffer-file-name))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4184 temp-buffer-setup-hook)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4185 (with-output-to-temp-buffer "*Tree Statistics*"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4186 (multiple-value-bind (classes member-functions member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4187 static-functions static-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4188 (ebrowse-gather-statistics)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4189 (set-buffer standard-output)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4190 (erase-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4191 (insert "STATISTICS FOR TREE " (or tree-file "unknown") ":\n\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4192 (ebrowse-print-statistics-line "Number of classes:" classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4193 (ebrowse-print-statistics-line "Number of member functions:"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4194 member-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4195 (ebrowse-print-statistics-line "Number of member variables:"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4196 member-variables)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4197 (ebrowse-print-statistics-line "Number of static functions:"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4198 static-functions)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4199 (ebrowse-print-statistics-line "Number of static variables:"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4200 static-variables)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4201
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4202
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4203 (defun ebrowse-print-statistics-line (title value)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4204 "Print a line in the statistics buffer.
62074
c0b42702a33a (ebrowse-install-1-to-9-keys, ebrowse-print-statistics-line,
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
4205 TITLE is the title of the line, VALUE is a number to be printed
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4206 after that."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4207 (insert title)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4208 (indent-to 40)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4209 (insert (format "%d\n" value)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4210
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4211
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4212 (defun ebrowse-gather-statistics ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4213 "Return statistics for a class tree.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4214 The result is a list (NUMBER-OF-CLASSES NUMBER-OF-MEMBER-FUNCTIONS
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4215 NUMBER-OF-INSTANCE-VARIABLES NUMBER-OF-STATIC-FUNCTIONS
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4216 NUMBER-OF-STATIC-VARIABLES:"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4217 (let ((classes 0) (member-functions 0) (member-variables 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4218 (static-functions 0) (static-variables 0))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4219 (ebrowse-for-all-trees (tree ebrowse--tree-obarray)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4220 (incf classes)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4221 (incf member-functions (length (ebrowse-ts-member-functions tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4222 (incf member-variables (length (ebrowse-ts-member-variables tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4223 (incf static-functions (length (ebrowse-ts-static-functions tree)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4224 (incf static-variables (length (ebrowse-ts-static-variables tree))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4225 (list classes member-functions member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4226 static-functions static-variables)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4227
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4228
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4229
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4230 ;;; Global key bindings
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4231
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4232 ;;; The following can be used to bind key sequences starting with
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4233 ;;; prefix `\C-cb' to browse commands.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4234
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4235 (defvar ebrowse-global-map nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4236 "*Keymap for Ebrowse commands.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4237
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4238
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4239 (defvar ebrowse-global-prefix-key "\C-cb"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4240 "Prefix key for Ebrowse commands.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4241
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4242
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4243 (defvar ebrowse-global-submap-4 nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4244 "Keymap used for `ebrowse-global-prefix' followed by `4'.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4245
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4246
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4247 (defvar ebrowse-global-submap-5 nil
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4248 "Keymap used for `ebrowse-global-prefix' followed by `5'.")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4249
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4250
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4251 (unless ebrowse-global-map
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4252 (setq ebrowse-global-map (make-sparse-keymap))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4253 (setq ebrowse-global-submap-4 (make-sparse-keymap))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4254 (setq ebrowse-global-submap-5 (make-sparse-keymap))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4255 (define-key ebrowse-global-map "a" 'ebrowse-tags-apropos)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4256 (define-key ebrowse-global-map "b" 'ebrowse-pop-to-browser-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4257 (define-key ebrowse-global-map "-" 'ebrowse-back-in-position-stack)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4258 (define-key ebrowse-global-map "+" 'ebrowse-forward-in-position-stack)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4259 (define-key ebrowse-global-map "l" 'ebrowse-tags-list-members-in-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4260 (define-key ebrowse-global-map "m" 'ebrowse-tags-display-member-buffer)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4261 (define-key ebrowse-global-map "n" 'ebrowse-tags-next-file)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4262 (define-key ebrowse-global-map "p" 'ebrowse-electric-position-menu)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4263 (define-key ebrowse-global-map "s" 'ebrowse-tags-search)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4264 (define-key ebrowse-global-map "u" 'ebrowse-tags-search-member-use)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4265 (define-key ebrowse-global-map "v" 'ebrowse-tags-view-definition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4266 (define-key ebrowse-global-map "V" 'ebrowse-tags-view-declaration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4267 (define-key ebrowse-global-map "%" 'ebrowse-tags-query-replace)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4268 (define-key ebrowse-global-map "." 'ebrowse-tags-find-definition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4269 (define-key ebrowse-global-map "f" 'ebrowse-tags-find-definition)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4270 (define-key ebrowse-global-map "F" 'ebrowse-tags-find-declaration)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4271 (define-key ebrowse-global-map "," 'ebrowse-tags-loop-continue)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4272 (define-key ebrowse-global-map " " 'ebrowse-electric-buffer-list)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4273 (define-key ebrowse-global-map "\t" 'ebrowse-tags-complete-symbol)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4274 (define-key ebrowse-global-map "4" ebrowse-global-submap-4)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4275 (define-key ebrowse-global-submap-4 "." 'ebrowse-tags-find-definition-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4276 (define-key ebrowse-global-submap-4 "f" 'ebrowse-tags-find-definition-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4277 (define-key ebrowse-global-submap-4 "v" 'ebrowse-tags-find-declaration-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4278 (define-key ebrowse-global-submap-4 "F" 'ebrowse-tags-view-definition-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4279 (define-key ebrowse-global-submap-4 "V" 'ebrowse-tags-view-declaration-other-window)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4280 (define-key ebrowse-global-map "5" ebrowse-global-submap-5)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4281 (define-key ebrowse-global-submap-5 "." 'ebrowse-tags-find-definition-other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4282 (define-key ebrowse-global-submap-5 "f" 'ebrowse-tags-find-definition-other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4283 (define-key ebrowse-global-submap-5 "v" 'ebrowse-tags-find-declaration-other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4284 (define-key ebrowse-global-submap-5 "F" 'ebrowse-tags-view-definition-other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4285 (define-key ebrowse-global-submap-5 "V" 'ebrowse-tags-view-declaration-other-frame)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4286 (define-key global-map ebrowse-global-prefix-key ebrowse-global-map))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4287
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4288
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4289
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4290 ;;; Electric C++ browser buffer menu
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4291
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4292 ;;; Electric buffer menu customization to display only some buffers
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4293 ;;; (in this case Tree buffers). There is only one problem with this:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4294 ;;; If the very first character typed in the buffer menu is a space,
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4295 ;;; this will select the buffer from which the buffer menu was
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4296 ;;; invoked. But this buffer is not displayed in the buffer list if
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4297 ;;; it isn't a tree buffer. I therefore let the buffer menu command
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4298 ;;; loop read the command `p' via `unread-command-char'. This command
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4299 ;;; has no effect since we are on the first line of the buffer.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4300
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4301 (defvar electric-buffer-menu-mode-hook nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4302
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4303
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4304 (defun ebrowse-hack-electric-buffer-menu ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4305 "Hack the electric buffer menu to display browser buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4306 (let (non-empty)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4307 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4308 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4309 (setq buffer-read-only nil)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4310 (goto-char 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4311 (forward-line 2)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4312 (while (not (eobp))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4313 (let ((b (Buffer-menu-buffer nil)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4314 (if (or (ebrowse-buffer-p b)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4315 (string= (buffer-name b) "*Apropos Members*"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4316 (progn (forward-line 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4317 (setq non-empty t))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4318 (delete-region (point)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4319 (save-excursion (end-of-line)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4320 (min (point-max)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4321 (1+ (point)))))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4322 (unless non-empty
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4323 (error "No tree buffers"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4324 (setf unread-command-events (listify-key-sequence "p"))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4325 (shrink-window-if-larger-than-buffer (selected-window))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4326 (setq buffer-read-only t))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4327
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4328
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4329 (defun ebrowse-select-1st-to-9nth ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4330 "Select the nth entry in the list by the keys 1..9."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4331 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4332 (let* ((maxlin (count-lines (point-min) (point-max)))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62074
diff changeset
4333 (n (min maxlin (+ 2 (string-to-number (this-command-keys))))))
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4334 (goto-line n)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4335 (throw 'electric-buffer-menu-select (point))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4336
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4337
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4338 (defun ebrowse-install-1-to-9-keys ()
62074
c0b42702a33a (ebrowse-install-1-to-9-keys, ebrowse-print-statistics-line,
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
4339 "Define keys 1..9 to select the 1st to 9nth entry in the list."
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4340 (dotimes (i 9)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4341 (define-key (current-local-map) (char-to-string (+ i ?1))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4342 'ebrowse-select-1st-to-9nth)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4343
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4344
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4345 (defun ebrowse-electric-buffer-list ()
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4346 "Display an electric list of Ebrowse buffers."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4347 (interactive)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4348 (unwind-protect
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4349 (progn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4350 (add-hook 'electric-buffer-menu-mode-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4351 'ebrowse-hack-electric-buffer-menu)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4352 (add-hook 'electric-buffer-menu-mode-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4353 'ebrowse-install-1-to-9-keys)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4354 (call-interactively 'electric-buffer-list))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4355 (remove-hook 'electric-buffer-menu-mode-hook
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4356 'ebrowse-hack-electric-buffer-menu)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4357
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4358
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4359 ;;; Mouse support
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4360
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4361 (defun ebrowse-mouse-find-member (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4362 "Find the member clicked on in another frame.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4363 EVENT is a mouse button event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4364 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4365 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4366 (let (start name)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4367 (save-excursion
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4368 (skip-chars-backward "a-zA-Z0-9_")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4369 (setq start (point))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4370 (skip-chars-forward "a-zA-Z0-9_")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4371 (setq name (buffer-substring start (point))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4372 (ebrowse-tags-view/find-member-decl/defn
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4373 5 :view nil :definition t :member-name name)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4374
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4375
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4376 (defun ebrowse-popup-menu (menu event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4377 "Pop up MENU and perform an action if something was selected.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4378 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4379 (save-selected-window
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4380 (select-window (posn-window (event-start event)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4381 (let ((selection (x-popup-menu event menu)) binding)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4382 (while selection
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4383 (setq binding (lookup-key (or binding menu) (vector (car selection)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4384 selection (cdr selection)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4385 (when binding
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4386 (call-interactively binding)))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4387
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4388
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4389 (easy-menu-define
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
4390 ebrowse-tree-buffer-class-object-menu ebrowse-tree-mode-map
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4391 "Object menu for classes in the tree buffer"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4392 '("Class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4393 ["Functions" ebrowse-tree-command:show-member-functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4394 :help "Display a list of member functions"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4395 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4396 ["Variables" ebrowse-tree-command:show-member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4397 :help "Display a list of member variables"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4398 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4399 ["Static Functions" ebrowse-tree-command:show-static-member-functions
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4400 :help "Display a list of static member functions"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4401 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4402 ["Static Variables" ebrowse-tree-command:show-static-member-variables
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4403 :help "Display a list of static member variables"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4404 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4405 ["Friends/ Defines" ebrowse-tree-command:show-friends
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4406 :help "Display a list of friends of a class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4407 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4408 ["Types" ebrowse-tree-command:show-types
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4409 :help "Display a list of types defined in a class"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4410 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4411 "-----------------"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4412 ["View" ebrowse-view-class-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4413 :help "View class declaration"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4414 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4415 ["Find" ebrowse-find-class-declaration
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4416 :help "Find class declaration in file"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4417 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4418 "-----------------"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4419 ["Mark" ebrowse-toggle-mark-at-point
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4420 :help "Mark class point is on"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4421 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4422 "-----------------"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4423 ["Collapse" ebrowse-collapse-branch
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4424 :help "Collapse subtree under class point is on"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4425 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4426 ["Expand" ebrowse-expand-branch
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4427 :help "Expand subtree under class point is on"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4428 :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4429
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4430
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4431 (easy-menu-define
47929
a944203778a1 (ebrowse-ts, ebrowse-view/find-file-and-search-pattern,
Juanma Barranquero <lekktu@gmail.com>
parents: 46353
diff changeset
4432 ebrowse-tree-buffer-object-menu ebrowse-tree-mode-map
28523
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4433 "Object menu for tree buffers"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4434 '("Ebrowse"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4435 ["Filename Display" ebrowse-toggle-file-name-display
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4436 :help "Toggle display of source files names"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4437 :style toggle
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4438 :selected ebrowse--show-file-names-flag
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4439 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4440 ["Tree Indentation" ebrowse-set-tree-indentation
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4441 :help "Set the tree's indentation"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4442 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4443 ["Unmark All Classes" ebrowse-mark-all-classes
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4444 :help "Unmark all classes in the class tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4445 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4446 ["Expand All" ebrowse-expand-all
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4447 :help "Expand all subtrees in the class tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4448 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4449 ["Statistics" ebrowse-statistics
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4450 :help "Show a buffer with class hierarchy statistics"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4451 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4452 ["Find Class" ebrowse-read-class-name-and-go
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4453 :help "Find a class in the tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4454 :active t]
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4455 ["Member Buffer" ebrowse-pop/switch-to-member-buffer-for-same-tree
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4456 :help "Show a member buffer for this class tree"
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4457 :active t]))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4458
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4459
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4460 (defun ebrowse-mouse-3-in-tree-buffer (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4461 "Perform mouse actions in tree buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4462 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4463 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4464 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4465 (let* ((where (posn-point (event-start event)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4466 (property (get-text-property where 'ebrowse-what)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4467 (case (event-click-count event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4468 (1
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4469 (case property
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4470 (class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4471 (ebrowse-popup-menu ebrowse-tree-buffer-class-object-menu event))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4472 (t
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4473 (ebrowse-popup-menu ebrowse-tree-buffer-object-menu event)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4474
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4475
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4476 (defun ebrowse-mouse-2-in-tree-buffer (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4477 "Perform mouse actions in tree buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4478 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4479 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4480 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4481 (let* ((where (posn-point (event-start event)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4482 (property (get-text-property where 'ebrowse-what)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4483 (case (event-click-count event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4484 (1 (case property
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4485 (class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4486 (ebrowse-tree-command:show-member-functions)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4487
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4488
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4489 (defun ebrowse-mouse-1-in-tree-buffer (event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4490 "Perform mouse actions in tree buffers.
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4491 EVENT is the mouse event."
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4492 (interactive "e")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4493 (mouse-set-point event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4494 (let* ((where (posn-point (event-start event)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4495 (property (get-text-property where 'ebrowse-what)))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4496 (case (event-click-count event)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4497 (2 (case property
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4498 (class-name
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4499 (let ((collapsed (save-excursion (skip-chars-forward "^\r\n")
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4500 (looking-at "\r"))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4501 (ebrowse-collapse-fn (not collapsed))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4502 (mark
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4503 (ebrowse-toggle-mark-at-point 1)))))))
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4504
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4505
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4506
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4507 (provide 'ebrowse)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4508
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4509 ;;; Local variables:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4510 ;;; eval:(put 'ebrowse-output 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4511 ;;; eval:(put 'ebrowse-ignoring-completion-case 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4512 ;;; eval:(put 'ebrowse-save-selective 'lisp-indent-hook 0)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4513 ;;; eval:(put 'ebrowse-for-all-trees 'lisp-indent-hook 1)
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4514 ;;; End:
47e1a131eef3 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4515
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49885
diff changeset
4516 ;;; arch-tag: 4fa3c8bf-1771-479b-bcd7-b029c7c9677b
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37426
diff changeset
4517 ;;; ebrowse.el ends here