]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ebrowse.el
(compilation-start): In the no-async-subprocesses branch, call
[gnu-emacs] / lisp / progmodes / ebrowse.el
index 0bacb36da4a1da79d804453e4b145263a046d596..478ce403b31fbaf09b225c5083437fde54e20a7b 100644 (file)
@@ -1,6 +1,7 @@
 ;;; ebrowse.el --- Emacs C++ class browser & tags facility
 
-;; Copyright (C) 1992-1999, 2000 Free Software Foundation Inc.
+;; Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002
+;;  Free Software Foundation Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Maintainer: FSF
@@ -30,7 +31,7 @@
 ;; - A complete set of tags-like functions working on class trees
 ;; - An electric buffer list showing class browser buffers only
 
-;; Documentation is found in a separate Info file. 
+;; Documentation is found in a separate Info file.
 
 ;;; Code:
 
@@ -53,7 +54,7 @@
 (defcustom ebrowse-search-path nil
   "*List of directories to search for source files in a class tree.
 Elements should be directory names; nil as an element means to try
-to find source files relative to the location of the EBROWSE file loaded."
+to find source files relative to the location of the BROWSE file loaded."
   :group 'ebrowse
   :type '(repeat (choice (const :tag "Default" nil)
                          (string :tag "Directory"))))
@@ -254,15 +255,10 @@ This is a destructive operation."
     result))
 
 
-(defun ebrowse-copy-list (list)
-  "Return a shallow copy of LIST."
-  (apply #'list list))
-
-
 (defmacro ebrowse-output (&rest body)
   "Eval BODY with a writable current buffer.
 Preserve buffer's modified state."
-  (let ((modified (gensym "--ebrowse-output--")))
+  (let ((modified (make-symbol "--ebrowse-output--")))
     `(let (buffer-read-only (,modified (buffer-modified-p)))
        (unwind-protect
           (progn ,@body)
@@ -364,12 +360,12 @@ otherwise use the current frame's width."
 ;;; Structure definitions
 
 (defstruct (ebrowse-hs (:type vector) :named)
-  "Header structure found at the head of EBROWSE files."
+  "Header structure found at the head of BROWSE files."
   ;; A version string that is compared against the version number of
   ;; the Lisp package when the file is loaded.  This is done to
   ;; detect file format changes.
   version
-  ;; Command line options used for producing the EBROWSE file.
+  ;; Command line options used for producing the BROWSE file.
   command-line-options
   ;; The following slot is currently not used.  It's kept to keep
   ;; the file format compatible.
@@ -379,10 +375,10 @@ otherwise use the current frame's width."
   ;; they are defined.
   member-table)
 
-    
+
 (defstruct (ebrowse-ts (:type vector) :named)
   "Tree structure.
-Following the header structure, an EBROWSE file contains a number
+Following the header structure, a BROWSE file contains a number
 of `ebrowse-ts' structures, each one describing one root class of
 the class hierarchy with all its subclasses."
   ;; A `ebrowse-cs' structure describing the root class.
@@ -508,7 +504,7 @@ members."
 
 
 (defconst ebrowse-version-string "ebrowse 5.0"
-  "Version string expected in EBROWSE files.")
+  "Version string expected in BROWSE files.")
 
 
 (defconst ebrowse-globals-name "*Globals*"
@@ -518,8 +514,7 @@ This must be the same that `ebrowse' uses.")
 
 (defvar ebrowse--last-regexp nil
   "Last regular expression searched for in tree and member buffers.
-Automatically buffer-local so that each tree and member buffer
-maintains its own search history.")
+Each tree and member buffer maintains its own search history.")
 (make-variable-buffer-local 'ebrowse--last-regexp)
 
 
@@ -544,7 +539,7 @@ Buffer-local in Ebrowse buffers.")
 
 
 (defvar ebrowse--tags-file-name nil
-  "File from which EBROWSE file was loaded.
+  "File from which BROWSE file was loaded.
 Buffer-local in Ebrowse buffers.")
 
 
@@ -556,7 +551,7 @@ Buffer-local in Ebrowse buffers.")
 (defvar ebrowse--frozen-flag nil
   "Non-nil means an Ebrowse buffer won't be reused.
 Buffer-local in Ebrowse buffers.")
-  
+
 
 (defvar ebrowse--show-file-names-flag nil
   "Non-nil means show file names in a tree buffer.
@@ -577,7 +572,7 @@ Buffer-local in Ebrowse member buffers.")
   "Width of a columns to display for short member display form.
 Buffer-local in Ebrowse member buffers.")
 
-  
+
 (defvar ebrowse--virtual-display-flag nil
   "Non-nil means display virtual members in a member buffer.
 Buffer-local in Ebrowse member buffers.")
@@ -642,11 +637,6 @@ Buffer-local in Ebrowse member buffers.")
 Buffer-local in Ebrowse member buffers.")
 
 
-(defvar ebrowse--mode-strings nil
-  "Strings displayed in the mode line.
-Buffer-local in Ebrowse tree buffers.")
-
-
 (defvar ebrowse--frame-configuration nil
   "Frame configuration saved when viewing a class/member in another frame.
 Buffer-local in Ebrowse buffers.")
@@ -663,11 +653,6 @@ Buffer-local in Ebrowse buffers.")
 Buffer-local in Ebrowse buffers.")
 
 
-(defvar ebrowse--mode-line-props nil
-  "Text properties of mode line strings in member buffers.
-Buffer-local in Ebrowse member buffers.")
-
-
 ;;; Temporaries used to communicate with `ebrowse-find-pattern'.
 
 (defvar ebrowse-temp-position-to-view nil)
@@ -811,7 +796,7 @@ information."
 
 (defun ebrowse-base-classes (tree)
   "Return list of base-classes of TREE by searching subclass lists.
-This function must be used instead of the struct slot 
+This function must be used instead of the struct slot
 `base-classes' to access the base-class list directly because it
 computes this information lazily."
   (or (ebrowse-ts-base-classes tree)
@@ -899,16 +884,8 @@ this is the first progress message displayed."
 \f
 ;;; Reading a tree from disk
 
-(defun ebrowse-find-file ()
-  "Function installed as `find-file hook'.
-This loads a tree when it sees a special signature at the beginning of
-the file loaded."
-  (when (looking-at "\\[ebrowse-hs")
-    (ebrowse-load buffer-file-name 'switch)))
-
-
 (defun ebrowse-read ()
-  "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.  
+  "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.
 Return a list (HEADER TREE) where HEADER is the file header read
 and TREE is a list of `ebrowse-ts' structures forming the class tree."
   (let ((header (condition-case nil
@@ -924,7 +901,7 @@ and TREE is a list of `ebrowse-ts' structures forming the class tree."
     ;; Read Lisp objects.  Temporarily increase `gc-cons-threshold' to
     ;; prevent a GC that would not free any memory.
     (let ((gc-cons-threshold 2000000))
-      (while (not (eobp))
+      (while (not (progn (skip-chars-forward " \t\n\r") (eobp)))
        (let* ((root (read (current-buffer)))
               (old-root (ebrowse-class-in-tree root tree)))
          (ebrowse-show-progress "Reading data" (null tree))
@@ -935,88 +912,39 @@ and TREE is a list of `ebrowse-ts' structures forming the class tree."
     (list header tree)))
 
 
-(defun ebrowse-load (file &optional switch)
-  "Load an Ebrowse file FILE into memory and make a tree buffer.
-Optional SWITCH non-nil means switch to the tree buffer afterwards.
-This function is normally called from a `find-file-hook'.
-Value is the tree buffer created."
-  (let (tree
-       header
-       (buffer (get-file-buffer file))
-       tree-buffer)
-    (if buffer
-       (multiple-value-setq (header tree)
-         (ebrowse-read))
-      (save-excursion
-       ;; Since find-file hooks may be involved, we must visit the
-       ;; file in a way that these hooks are not called.
-       (set-buffer (create-file-buffer file))
-       (erase-buffer)
-       (insert-file file)
-       (set-buffer-modified-p nil)
-       (unwind-protect
-           (multiple-value-setq (header tree)
-             (ebrowse-read))
-         (kill-buffer (current-buffer)))))
-    (when tree
-      (message "Sorting. Please be patient...")
-      (setf tree (ebrowse-sort-tree-list tree))
-      ;; Create tree buffer
-      (setf tree-buffer
-           (ebrowse-create-tree-buffer tree file header
-                                       (ebrowse-build-tree-obarray tree)
-                                       switch buffer))
-      (message nil)
-      tree-buffer)))
-
-
 (defun ebrowse-revert-tree-buffer-from-file (ignore-auto-save noconfirm)
   "Function installed as `revert-buffer-function' in tree buffers.
 See that variable's documentation for the meaning of IGNORE-AUTO-SAVE and
 NOCONFIRM."
-  (interactive)
-  (when (or noconfirm
-           (yes-or-no-p "Revert tree from disk? "))
-    (let ((ebrowse-file (or buffer-file-name ebrowse--tags-file-name)))
-      (loop for member-buffer in (ebrowse-same-tree-member-buffer-list)
-           do (kill-buffer member-buffer))
-      (kill-buffer (current-buffer))
-      (switch-to-buffer (ebrowse-load ebrowse-file)))))
+  (when (or noconfirm (yes-or-no-p "Revert tree from disk? "))
+    (loop for member-buffer in (ebrowse-same-tree-member-buffer-list)
+         do (kill-buffer member-buffer))
+    (erase-buffer)
+    (insert-file (or buffer-file-name ebrowse--tags-file-name))
+    (ebrowse-tree-mode)
+    (current-buffer)))
 
 
-(defun ebrowse-create-tree-buffer (tree tags-file header obarray pop
-                                       &optional find-file-buffer)
+(defun ebrowse-create-tree-buffer (tree tags-file header obarray pop)
   "Create a new tree buffer for tree TREE.
 The tree was loaded from file TAGS-FILE.
 HEADER is the header structure of the file.
 OBARRAY is an obarray with a symbol for each class in the tree.
 POP non-nil means popup the buffer up at the end.
-FIND-FILE-BUFFER, if non-nil, is the buffer from which the Lisp data
-was read.
 Return the buffer created."
-  (let (name)
-    (cond (find-file-buffer
-          (set-buffer find-file-buffer)
-          (erase-buffer)
-          (setq name (ebrowse-frozen-tree-buffer-name tags-file))
-          (ebrowse-rename-buffer name))
-         (t
-          (setq name ebrowse-tree-buffer-name)
-          (set-buffer (get-buffer-create name))))
-    ;; Switch to tree mode and initialize buffer local variables.
+  (let ((name ebrowse-tree-buffer-name))
+    (set-buffer (get-buffer-create name))
     (ebrowse-tree-mode)
-    (setf ebrowse--tree          tree
+    (setq ebrowse--tree tree
          ebrowse--tags-file-name tags-file
-         ebrowse--tree-obarray  obarray
-         ebrowse--header        header
-         ebrowse--frozen-flag        (not (null find-file-buffer)))
-    ;; Switch or pop to the tree buffer; display the tree and return the
-    ;; buffer.
-    (case pop 
-      (switch (switch-to-buffer name))
-      (pop    (pop-to-buffer name)))
+         ebrowse--tree-obarray obarray
+         ebrowse--header header
+         ebrowse--frozen-flag nil)
     (ebrowse-redraw-tree)
     (set-buffer-modified-p nil)
+    (case pop
+      (switch (switch-to-buffer name))
+      (pop (pop-to-buffer name)))
     (current-buffer)))
 
 
@@ -1128,11 +1056,11 @@ if for some reason a circle is in the inheritance graph."
     (setf ebrowse-tree-mode-map map)
     (suppress-keymap map)
 
-    (when window-system
+    (when (display-mouse-p)
       (define-key map [down-mouse-3] 'ebrowse-mouse-3-in-tree-buffer)
       (define-key map [mouse-2] 'ebrowse-mouse-2-in-tree-buffer)
       (define-key map [down-mouse-1] 'ebrowse-mouse-1-in-tree-buffer))
-  
+
     (let ((map1 (make-sparse-keymap)))
       (suppress-keymap map1 t)
       (define-key map "L" map1)
@@ -1184,43 +1112,58 @@ E.g.\\[save-buffer] writes the tree to the file it was loaded from.
 
 Tree mode key bindings:
 \\{ebrowse-tree-mode-map}"
-  (kill-all-local-variables)
-  (mapcar 'make-local-variable
-         '(ebrowse--tags-file-name
-           ebrowse--indentation
-           ebrowse--tree
-           ebrowse--header
-           ebrowse--show-file-names-flag
-           ebrowse--frozen-flag
-           ebrowse--tree-obarray
-           ebrowse--mode-strings
-           revert-buffer-function))
-  (use-local-map ebrowse-tree-mode-map)
-  (let* ((props (text-properties-at
-                0
-                (car (default-value 'mode-line-buffer-identification))))
-        (ident (apply #'propertize "C++ Tree" props)))
+  (interactive)
+  (let* ((ident (propertized-buffer-identification "C++ Tree"))
+        header tree buffer-read-only)
+
+    (kill-all-local-variables)
+    (use-local-map ebrowse-tree-mode-map)
+
+    (unless (zerop (buffer-size))
+      (goto-char (point-min))
+      (multiple-value-setq (header tree) (ebrowse-read))
+      (message "Sorting. Please be patient...")
+      (setq tree (ebrowse-sort-tree-list tree))
+      (erase-buffer)
+      (message nil))
+
+    (mapcar 'make-local-variable
+           '(ebrowse--tags-file-name
+             ebrowse--indentation
+             ebrowse--tree
+             ebrowse--header
+             ebrowse--show-file-names-flag
+             ebrowse--frozen-flag
+             ebrowse--tree-obarray
+             revert-buffer-function))
+
     (setf ebrowse--show-file-names-flag nil
          ebrowse--tree-obarray (make-vector 127 0)
          ebrowse--frozen-flag nil
          major-mode 'ebrowse-tree-mode
          mode-name "Ebrowse-Tree"
-         mode-line-buffer-identification (list ident)
+         mode-line-buffer-identification ident
          buffer-read-only t
          selective-display t
          selective-display-ellipses t
-         revert-buffer-function 'ebrowse-revert-tree-buffer-from-file))
-  (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn)
-  (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
-  (run-hooks 'ebrowse-tree-mode-hook))
+         revert-buffer-function 'ebrowse-revert-tree-buffer-from-file
+         ebrowse--header header
+         ebrowse--tree tree
+         ebrowse--tags-file-name (buffer-file-name)
+         ebrowse--tree-obarray (and tree (ebrowse-build-tree-obarray tree))
+         ebrowse--frozen-flag nil)
+
+    (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn)
+    (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
+    (when tree
+      (ebrowse-redraw-tree)
+      (set-buffer-modified-p nil))
+    (run-hooks 'ebrowse-tree-mode-hook)))
+
 
 
 (defun ebrowse-update-tree-buffer-mode-line ()
   "Update the tree buffer mode line."
-  (setf ebrowse--mode-strings
-       (concat (if ebrowse--frozen-flag (or buffer-file-name
-                                            ebrowse--tags-file-name))
-               (if (buffer-modified-p) "-**")))
   (ebrowse-rename-buffer (if ebrowse--frozen-flag
                             (ebrowse-frozen-tree-buffer-name
                              ebrowse--tags-file-name)
@@ -1279,7 +1222,7 @@ If given a numeric N-TIMES argument, mark that many classes."
     (condition-case error
        (loop repeat (or n-times 1)
              as tree = (ebrowse-tree-at-point)
-             do (progn 
+             do (progn
                   (setf (ebrowse-ts-mark tree) (not (ebrowse-ts-mark tree)))
                   (forward-line 1)
                   (push tree to-change)))
@@ -1352,7 +1295,6 @@ With PREFIX, insert that many filenames."
        (let ((tree (ebrowse-tree-at-point))
              start
              file-name-existing)
-         (unless tree return)
          (beginning-of-line)
          (skip-chars-forward " \t*a-zA-Z0-9_")
          (setq start (point)
@@ -1483,11 +1425,11 @@ If no member buffer exists, make one."
   "Pop to a browser buffer from any other buffer.
 Pop to member buffer if no prefix ARG, to tree buffer otherwise."
   (interactive "P")
-  (let ((buffer (get-buffer (if arg 
+  (let ((buffer (get-buffer (if arg
                                ebrowse-tree-buffer-name
                              ebrowse-member-buffer-name))))
     (unless buffer
-      (setq buffer 
+      (setq buffer
            (get-buffer (if arg
                            ebrowse-member-buffer-name
                          ebrowse-tree-buffer-name))))
@@ -1593,7 +1535,7 @@ VIEW non-nil means view it.  WHERE is additional position info."
                         :file (ebrowse-cs-file class)
                         :point (ebrowse-cs-point class))))
     (ebrowse-view/find-file-and-search-pattern
-     browse-struct 
+     browse-struct
      (list ebrowse--header class nil)
      file
      ebrowse--tags-file-name
@@ -1695,7 +1637,7 @@ The new frame is deleted when it is no longer used."
     (make-local-variable 'ebrowse--frame-configuration)
     (setq ebrowse--frame-configuration old-frame-configuration)
     (make-local-variable 'ebrowse--view-exit-action)
-    (setq ebrowse--view-exit-action 
+    (setq ebrowse--view-exit-action
          (and (not had-a-buf)
               (not (buffer-modified-p buf-to-view))
               'kill-buffer))
@@ -1710,12 +1652,12 @@ describing what to search.
 INFO is a list (HEADER MEMBER-OR-CLASS ACCESSOR).  HEADER is the
 header structure of a class tree.  MEMBER-OR-CLASS is either an
 `ebrowse-ms' or `ebrowse-cs' structure depending on what is searched.
-ACCESSOR is an accessor function for the member list of an member
+ACCESSOR is an accessor function for the member list of a member
 if MEMBER-OR-CLASS is an `ebrowse-ms'.
 FILE is the file to search the member in.
 FILE is not taken out of STRUC here because the filename in STRUC
 may be nil in which case the filename of the class description is used.
-TAGS-FILE-NAME is the name of the EBROWSE file from which the
+TAGS-FILE-NAME is the name of the BROWSE file from which the
 tree was loaded.
 If VIEW is non-nil, view file else find the file.
 WHERE is either `other-window', `other-frame' or `this-window' and
@@ -1727,7 +1669,7 @@ specifies where to find/view the result."
   (setf file (ebrowse-find-source-file file tags-file-name))
   ;; If current window is dedicated, use another frame.
   (when (window-dedicated-p (selected-window))
-    (setf where 'other-frame))
+    (setf where 'other-window))
   (cond (view
         (setf ebrowse-temp-position-to-view struc
               ebrowse-temp-info-to-view info)
@@ -1750,19 +1692,20 @@ specifies where to find/view the result."
   "Generate a suitable regular expression for a member or class NAME.
 This is `regexp-quote' for most symbols, except for operator names
 which may contain whitespace.  For these symbols, replace white
-space in the symbol name (generated by EBROWSE) with a regular
+space in the symbol name (generated by BROWSE) with a regular
 expression matching any number of whitespace characters."
   (loop with regexp = (regexp-quote name)
        with start = 0
        finally return regexp
        while (string-match "[ \t]+" regexp start)
-       do (setf (substring regexp (match-beginning 0) (match-end 0))
-                "[ \t]*"
+       do (setq regexp (concat (substring regexp 0 (match-beginning 0))
+                               "[ \t]*"
+                               (substring regexp (match-end 0)))
                 start (+ (match-beginning 0) 5))))
 
 
 (defun ebrowse-class-declaration-regexp (name)
-  "Construct a regexp for a declaration of class NAME." 
+  "Construct a regexp for a declaration of class NAME."
   (concat "^[ \t]*\\(template[ \t\n]*<.*>\\)?"
          "[ \t\n]*\\(class\\|struct\\|union\\).*\\S_"
          (ebrowse-symbol-regexp name)
@@ -1885,10 +1828,10 @@ TREE denotes the class shown."
 
 
 (defun* ebrowse-draw-tree-fn (&aux stack1 stack2 start)
-  "Display a single class and recursively it's subclasses.
+  "Display a single class and recursively its subclasses.
 This function may look weird, but this is faster than recursion."
   (setq stack1 (make-list (length ebrowse--tree) 0)
-       stack2 (ebrowse-copy-list ebrowse--tree))
+       stack2 (copy-sequence ebrowse--tree))
   (loop while stack2
        as level = (pop stack1)
        as tree = (pop stack2)
@@ -1897,13 +1840,13 @@ This function may look weird, but this is faster than recursion."
              start-of-class-name end-of-class-name)
          ;; Insert mark
          (insert (if (ebrowse-ts-mark tree) ">" " "))
-         
+
          ;; Indent and insert class name
          (indent-to (+ (* level ebrowse--indentation)
                        ebrowse-tree-left-margin))
          (setq start (point))
          (insert (ebrowse-qualified-class-name class))
-         
+
          ;; If template class, add <>
          (when (ebrowse-template-p class)
            (insert "<>"))
@@ -1931,7 +1874,7 @@ This function may look weird, but this is faster than recursion."
        ;; Push subclasses, if any.
        (when (ebrowse-ts-subclasses tree)
          (setq stack2
-               (nconc (ebrowse-copy-list (ebrowse-ts-subclasses tree)) stack2)
+               (nconc (copy-sequence (ebrowse-ts-subclasses tree)) stack2)
                stack1
                (nconc (make-list (length (ebrowse-ts-subclasses tree))
                                  (1+ level)) stack1)))))
@@ -2212,7 +2155,7 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
     (setf ebrowse-member-mode-map map)
     (suppress-keymap map)
 
-  (when window-system
+  (when (display-mouse-p)
     (define-key map [down-mouse-3] 'ebrowse-member-mouse-3)
     (define-key map [mouse-2] 'ebrowse-member-mouse-2))
 
@@ -2224,7 +2167,7 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
     (define-key map1 "d" 'ebrowse-switch-member-buffer-to-derived-class)
     (define-key map1 "n" 'ebrowse-switch-member-buffer-to-next-sibling-class)
     (define-key map1 "p" 'ebrowse-switch-member-buffer-to-previous-sibling-class))
-    
+
   (let ((map1 (make-sparse-keymap)))
     (suppress-keymap map1 t)
     (define-key map "D" map1)
@@ -2234,7 +2177,7 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
     (define-key map1 "l" 'ebrowse-toggle-long-short-display)
     (define-key map1 "r" 'ebrowse-toggle-regexp-display)
     (define-key map1 "w" 'ebrowse-set-member-buffer-column-width))
-    
+
   (let ((map1 (make-sparse-keymap)))
     (suppress-keymap map1 t)
     (define-key map "F" map1)
@@ -2249,7 +2192,7 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
     (define-key map1 "p" 'ebrowse-toggle-pure-member-filter)
     (define-key map1 "r" 'ebrowse-remove-all-member-filters)
     (define-key map1 "v" 'ebrowse-toggle-virtual-member-filter))
-    
+
   (let ((map1 (make-sparse-keymap)))
     (suppress-keymap map1 t)
     (define-key map "L" map1)
@@ -2261,14 +2204,14 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
     (define-key map1 "t" 'ebrowse-display-types-member-list)
     (define-key map1 "v" 'ebrowse-display-variables-member-list)
     (define-key map1 "V" 'ebrowse-display-static-variables-member-list))
-    
+
   (let ((map1 (make-sparse-keymap)))
     (suppress-keymap map1 t)
     (define-key map "G" map1)
     (define-key map1 "m" 'ebrowse-goto-visible-member/all-member-lists)
     (define-key map1 "n" 'ebrowse-repeat-member-search)
     (define-key map1 "v" 'ebrowse-goto-visible-member))
-    
+
   (define-key map "f" 'ebrowse-find-member-declaration)
   (define-key map "m" 'ebrowse-switch-to-next-member-buffer)
   (define-key map "q" 'bury-buffer)
@@ -2284,7 +2227,7 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
 \f
 ;;; Member mode
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-member-mode ()
   "Major mode for Ebrowse member buffers.
 
@@ -2313,13 +2256,10 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
            ebrowse--inline-display-flag
            ebrowse--const-display-flag
            ebrowse--pure-display-flag
-           ebrowse--mode-line-props
            ebrowse--frozen-flag))      ;buffer not automagically reused
-  (setq ebrowse--mode-line-props (text-properties-at
-                                 0 (car (default-value
-                                         'mode-line-buffer-identification)))
-       mode-name "Ebrowse-Members"
-       mode-line-buffer-identification 'ebrowse--member-mode-strings
+  (setq mode-name "Ebrowse-Members"
+       mode-line-buffer-identification
+       (propertized-buffer-identification "C++ Members")
        buffer-read-only t
        ebrowse--long-display-flag nil
        ebrowse--attributes-flag t
@@ -2357,8 +2297,8 @@ See 'Electric-command-loop' for a description of STATE and CONDITION."
                 (concat (ebrowse-class-name-displayed-in-member-buffer)
                         " ")))
         (ident (concat name (ebrowse-member-list-name))))
-    (setq ebrowse--member-mode-strings
-         (apply #'propertize ident ebrowse--mode-line-props))
+    (setq mode-line-buffer-identification
+         (propertized-buffer-identification ident))
     (ebrowse-rename-buffer (if name ident ebrowse-member-buffer-name))
     (force-mode-line-update)))
 
@@ -2634,7 +2574,7 @@ DEFINITION non-nil means find the definition, otherwise find the
 declaration.
 INFO is a list (TREE ACCESSOR MEMBER) describing the member to
 search.
-TAGS-FILE-NAME is the file name of the EBROWSE file."
+TAGS-FILE-NAME is the file name of the BROWSE file."
   (unless header
     (setq header ebrowse--header))
   (unless tags-file-name
@@ -2741,7 +2681,7 @@ CLASS non-nil means display that class' title.  Otherwise use
 the class cursor is on."
   (let ((start (point))
        (tree  (or class ebrowse--displayed-class))
-       class-name-start 
+       class-name-start
        class-name-end)
     (insert "class ")
     (setq class-name-start (point))
@@ -2891,7 +2831,7 @@ TREE is the class tree in which the members are found."
          (indent-to (* i column-width))
          (put-text-property start-of-column (point) 'mouse-face nil)
          (setq start-of-entry (point))
-         ;; Show various attributes 
+         ;; Show various attributes
          (when ebrowse--attributes-flag
            (insert "<")
            (ebrowse-draw-member-attributes member)
@@ -3094,7 +3034,7 @@ Prefix arg INC specifies which one."
 Prefix arg ARG says which class should be displayed.  Default is
 the first derived class."
   (interactive "P")
-  (flet ((ebrowse-tree-obarray-as-alist () 
+  (flet ((ebrowse-tree-obarray-as-alist ()
                                        (loop for s in (ebrowse-ts-subclasses
                                                        ebrowse--displayed-class)
                                              collect (cons (ebrowse-cs-name
@@ -3184,7 +3124,7 @@ the first derived class."
     ["Find in Tree" ebrowse-goto-visible-member/all-member-lists
      :help "Search for a member in any class"
      :active t])
-   ("Display" 
+   ("Display"
     ["Inherited" ebrowse-toggle-base-class-display
      :help "Toggle display of inherited members"
      :style toggle
@@ -3277,7 +3217,7 @@ the first derived class."
     :active (eq (get-text-property (point) 'ebrowse-what) 'class-name)]))
 
 
-(easy-menu-define 
+(easy-menu-define
  ebrowse-member-name-object-menu ebrowse-member-mode-map
  "Object menu for member names"
  '("Ebrowse"
@@ -3334,7 +3274,7 @@ TREE-HEADER is the header structure of the class tree.
 NAME is the name of the member.
 Value is an alist of elements (CLASS-NAME . (CLASS LIST NAME)),
 where each element describes one occurrence of member NAME in the tree.
-CLASS-NAME is the qualified name of the class in which the 
+CLASS-NAME is the qualified name of the class in which the
 member was found.  The CDR of the acons is described in function
 `ebrowse-class/index/member-for-member'."
   (let ((table (ebrowse-member-table tree-header))
@@ -3373,16 +3313,15 @@ from point as default.  Value is a list (CLASS-NAME MEMBER-NAME)."
        (unless member-name
          (error "No member name at point"))
        (if members
-           (let* ((alist (ebrowse-hash-table-to-alist members))
-                  (name (ebrowse-ignoring-completion-case
-                          (completing-read prompt alist nil nil member-name)))
-                  (completion-result (try-completion name alist)))
-             ;; Cannot rely on `try-completion' returning T for exact
-             ;; matches!  it returns the the name as a string.
+           (let* ((name (ebrowse-ignoring-completion-case
+                          (completing-read prompt members nil nil member-name)))
+                  (completion-result (try-completion name members)))
+             ;; Cannot rely on `try-completion' returning t for exact
+             ;; matches!  It returns the name as a string.
              (unless (setq member-info (gethash name members))
                (if (y-or-n-p "No exact match found.  Try substrings? ")
-                   (setq name 
-                         (or (first (ebrowse-list-of-matching-members 
+                   (setq name
+                         (or (first (ebrowse-list-of-matching-members
                                      members (regexp-quote name) name))
                              (error "Sorry, nothing found")))
                  (error "Canceled")))
@@ -3458,28 +3397,28 @@ definition."
       (ebrowse-push-position (point-marker) info t))))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-view-declaration ()
   "View declaration of member at point."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 0 :view t :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-declaration ()
   "Find declaration of member at point."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 0 :view nil :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-view-definition ()
   "View definition of member at point."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 0 :view t :definition t))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-definition ()
   "Find definition of member at point."
   (interactive)
@@ -3492,21 +3431,21 @@ definition."
   (ebrowse-tags-view/find-member-decl/defn 4 :view t :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-declaration-other-window ()
   "Find declaration of member at point in other window."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 4 :view nil :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-view-definition-other-window ()
   "View definition of member at point in other window."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 4 :view t :definition t))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-definition-other-window ()
   "Find definition of member at point in other window."
   (interactive)
@@ -3519,21 +3458,21 @@ definition."
   (ebrowse-tags-view/find-member-decl/defn 5 :view t :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-declaration-other-frame ()
   "Find definition of member at point in other frame."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 5 :view nil :definition nil))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-view-definition-other-frame ()
   "View definition of member at point in other frame."
   (interactive)
   (ebrowse-tags-view/find-member-decl/defn 5 :view t :definition t))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-find-definition-other-frame ()
   "Find definition of member at point in other frame."
   (interactive)
@@ -3615,8 +3554,7 @@ The file name is read from the minibuffer."
   (let* ((buffer (or (ebrowse-choose-from-browser-buffers)
                     (error "No tree buffer")))
         (files (save-excursion (set-buffer buffer) (ebrowse-files-table)))
-        (alist (ebrowse-hash-table-to-alist files))
-        (file (completing-read "List members in file: " alist nil t))
+        (file (completing-read "List members in file: " files nil t))
         (header (ebrowse-value-in-buffer 'ebrowse--header buffer))
         temp-buffer-setup-hook
         (members (ebrowse-member-table header)))
@@ -3644,7 +3582,7 @@ INFO describes the member.  It has the form (TREE ACCESSOR MEMBER).
 TREE is the class of the member to display.
 ACCESSOR is the accessor symbol of its member list.
 MEMBER is the member structure.
-KIND is a an additional string printed in the buffer."
+KIND is an additional string printed in the buffer."
   (let* ((tree (first info))
         (globals-p (ebrowse-globals-tree-p tree)))
     (unless globals-p
@@ -3687,7 +3625,7 @@ KIND is a an additional string printed in the buffer."
 
 \f
 (defun ebrowse-some-member-table ()
-  "Return a hash table containing all member of a tree.
+  "Return a hash table containing all members of a tree.
 If there's only one tree loaded, use that.  Otherwise let the
 use choose a tree."
   (let* ((buffers (ebrowse-known-class-trees-buffer-list))
@@ -3699,15 +3637,6 @@ use choose a tree."
     (ebrowse-member-table header)))
 
 
-(defun ebrowse-hash-table-to-alist (table)
-  "Return an alist holding all key/value pairs of hash table TABLE."
-  (let ((list))
-    (maphash #'(lambda (key value)
-                (setq list (cons (cons key value) list)))
-            table)
-    list))
-  
-
 (defun ebrowse-cyclic-successor-in-string-list (string list)
   "Return the item following STRING in LIST.
 If STRING is the last element, return the first element as successor."
@@ -3720,7 +3649,7 @@ If STRING is the last element, return the first element as successor."
 ;;;###autoload
 (defun* ebrowse-tags-complete-symbol (prefix)
   "Perform completion on the C++ symbol preceding point.
-A second call of this function without changing point inserts the next match. 
+A second call of this function without changing point inserts the next match.
 A call with prefix PREFIX reads the symbol to insert from the minibuffer with
 completion."
   (interactive "P")
@@ -3732,9 +3661,8 @@ completion."
      ;; With prefix, read name from minibuffer with completion.
      (prefix
       (let* ((members (ebrowse-some-member-table))
-            (alist (ebrowse-hash-table-to-alist members))
             (completion (completing-read "Insert member: "
-                                         alist nil t pattern)))
+                                         members nil t pattern)))
        (when completion
          (setf ebrowse-last-completion-location nil)
          (delete-region begin end)
@@ -3766,7 +3694,7 @@ completion."
              (t
               (delete-region begin end)
               (insert completion)
-              
+
               (setf ebrowse-last-completion-location (point)
                     ebrowse-last-completion-start pattern
                     ebrowse-last-completion completion
@@ -3851,7 +3779,7 @@ TREE-BUFFER if indirectly specifies which files to loop over."
     (goto-char (point-min))))
 
 
-;;###autoload
+;;;###autoload
 (defun ebrowse-tags-search (regexp)
   "Search for REGEXP in all files in a tree.
 If marked classes exist, process marked classes, only.
@@ -3868,7 +3796,7 @@ If regular expression is nil, repeat last search."
 (defun ebrowse-tags-query-replace (from to)
   "Query replace FROM with TO in all files of a class tree.
 With prefix arg, process files of marked classes only."
-  (interactive 
+  (interactive
    "sTree query replace (regexp): \nsTree query replace %s by: ")
   (setq ebrowse-tags-loop-form
        (list 'and (list 'save-excursion
@@ -3877,7 +3805,7 @@ With prefix arg, process files of marked classes only."
   (ebrowse-tags-loop-continue 'first-time))
 
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-tags-search-member-use (&optional fix-name)
   "Search for call sites of a member.
 If FIX-NAME is specified, search uses of that member.
@@ -3939,7 +3867,7 @@ If VIEW is non-nil, view the position, otherwise find it."
        (t
         (unwind-protect
             (progn
-              (push (function 
+              (push (function
                      (lambda ()
                        (goto-char (ebrowse-position-point position))))
                     view-mode-hook)
@@ -3965,7 +3893,7 @@ Positions in buffers that have no file names are not saved."
             :file-name (buffer-file-name (marker-buffer marker))
             :point (marker-position marker)
             :target target
-            :info info) 
+            :info info)
            ebrowse-position-stack))))
 
 
@@ -3981,7 +3909,7 @@ Positions in buffers that have no file names are not saved."
                                     ebrowse-position-stack))))
 
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-back-in-position-stack (arg)
   "Move backward in the position stack.
 Prefix arg ARG says how much."
@@ -3989,7 +3917,7 @@ Prefix arg ARG says how much."
   (ebrowse-move-in-position-stack (max 1 arg)))
 
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-forward-in-position-stack (arg)
   "Move forward in the position stack.
 Prefix arg ARG says how much."
@@ -4074,7 +4002,7 @@ Runs the hook `ebrowse-electric-position-mode-hook'."
   (setq buffer-read-only t))
 
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-electric-position-menu ()
   "List positions in the position stack in an electric buffer."
   (interactive)
@@ -4176,7 +4104,7 @@ Installed on `local-write-file-hooks'."
   t)
 
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-save-tree ()
   "Save current tree in same file it was loaded from."
   (interactive)
@@ -4227,7 +4155,7 @@ Otherwise, FILE-NAME specifies the file to save the tree in."
 \f
 ;;; Statistics
 
-;;; ###autoload
+;;;###autoload
 (defun ebrowse-statistics ()
   "Display statistics for a class tree."
   (interactive)
@@ -4438,7 +4366,7 @@ EVENT is the mouse event."
 
 
 (easy-menu-define
- ebrowse-tree-buffer-class-object-menu ebrowse-tree-mode-map 
+ ebrowse-tree-buffer-class-object-menu ebrowse-tree-mode-map
  "Object menu for classes in the tree buffer"
  '("Class"
    ["Functions" ebrowse-tree-command:show-member-functions
@@ -4480,7 +4408,7 @@ EVENT is the mouse event."
 
 
 (easy-menu-define
- ebrowse-tree-buffer-object-menu ebrowse-tree-mode-map 
+ ebrowse-tree-buffer-object-menu ebrowse-tree-mode-map
  "Object menu for tree buffers"
  '("Ebrowse"
    ["Filename Display" ebrowse-toggle-file-name-display
@@ -4554,11 +4482,6 @@ EVENT is the mouse event."
            (ebrowse-toggle-mark-at-point 1)))))))
 
 
-\f
-;;; Hooks installed
-
-(add-hook 'find-file-hooks 'ebrowse-find-file)
-
 \f
 (provide 'ebrowse)
 
@@ -4569,5 +4492,5 @@ EVENT is the mouse event."
 ;;; eval:(put 'ebrowse-for-all-trees 'lisp-indent-hook 1)
 ;;; End:
 
-;;; ebrowse.el ends here.    
-
+;;; arch-tag: 4fa3c8bf-1771-479b-bcd7-b029c7c9677b
+;;; ebrowse.el ends here