]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ebrowse.el
(ebrowse-view-file-other-window): Delete function.
[gnu-emacs] / lisp / progmodes / ebrowse.el
index 04e8b2fc52ac368d970ca0f15cdff25a7ef1cb69..7f13971bdb11b635e8275975006c7b9c42f0de09 100644 (file)
@@ -1,7 +1,8 @@
 ;;; ebrowse.el --- Emacs C++ class browser & tags facility
 
-;; Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, 2005
-;;  Free Software Foundation Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+;; 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; Free Software Foundation Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Maintainer: FSF
@@ -11,7 +12,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -21,7 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -1001,7 +1003,7 @@ type `ebrowse-hs' is set to the resulting obarray."
 
 
 (defun ebrowse-member-table (header)
-  "Return the member obarray.  Build it it hasn't been set up yet.
+  "Return the member obarray.  Build it if it hasn't been set up yet.
 HEADER is the tree header structure of the class tree."
   (when (null (ebrowse-hs-member-table header))
     (loop for buffer in (ebrowse-browser-buffer-list)
@@ -1611,21 +1613,6 @@ and (b) in the directories named in `ebrowse-search-path'."
     file-name))
 
 
-(defun ebrowse-view-file-other-window (file)
-  "View a file FILE in another window.
-This is a replacement for `view-file-other-window' which does not
-seem to work. It should be removed when `view.el' is fixed."
-  (interactive)
-  (let ((old-arrangement (current-window-configuration))
-       (had-a-buf (get-file-buffer file))
-       (buf-to-view (find-file-noselect file)))
-    (switch-to-buffer-other-window buf-to-view)
-    (view-mode-enter old-arrangement
-                    (and (not had-a-buf)
-                         (not (buffer-modified-p buf-to-view))
-                         'kill-buffer))))
-
-
 (defun ebrowse-view-exit-fn (buffer)
   "Function called when exiting View mode in BUFFER.
 Restore frame configuration active before viewing the file,
@@ -1646,10 +1633,9 @@ and possibly kill the viewed buffer."
 
 (defun ebrowse-view-file-other-frame (file)
   "View a file FILE in another frame.
-The new frame is deleted when it is no longer used."
+The new frame is deleted when you quit viewing the file in that frame."
   (interactive)
   (let ((old-frame-configuration (current-frame-configuration))
-       (old-arrangement (current-window-configuration))
        (had-a-buf (get-file-buffer file))
        (buf-to-view (find-file-noselect file)))
     (switch-to-buffer-other-frame buf-to-view)
@@ -1660,8 +1646,8 @@ The new frame is deleted when it is no longer used."
          (and (not had-a-buf)
               (not (buffer-modified-p buf-to-view))
               'kill-buffer))
-    (view-mode-enter old-arrangement 'ebrowse-view-exit-fn)))
-
+    (view-mode-enter (cons (selected-window) (cons (selected-window) t))
+                    'ebrowse-view-exit-fn)))
 
 (defun ebrowse-view/find-file-and-search-pattern
   (struc info file tags-file-name &optional view where)
@@ -1696,7 +1682,7 @@ specifies where to find/view the result."
           (setq view-mode-hook nil))
         (push 'ebrowse-find-pattern view-mode-hook)
         (case where
-          (other-window (ebrowse-view-file-other-window file))
+          (other-window (view-file-other-window file))
           (other-frame  (ebrowse-view-file-other-frame file))
           (t            (view-file file))))
        (t
@@ -1796,7 +1782,7 @@ INFO is a list (TREE-HEADER TREE-OR-MEMBER MEMBER-LIST)."
       ;; START will be 0.
       (when (and (boundp 'ebrowse-debug)
                 (symbol-value 'ebrowse-debug))
-       (y-or-n-p (format "start = %d" start))
+       (y-or-n-p (format "start = %d" start))
        (y-or-n-p pattern))
       (setf found
            (loop do (goto-char (max (point-min) (- start offset)))
@@ -2732,24 +2718,24 @@ means the member buffer is standalone.  CLASS is its class."
     ;; is on if not specified as an argument.
     (unless class
       (setq class (ebrowse-tree-at-point)))
-    (with-output-to-temp-buffer ebrowse-member-buffer-name
-      (save-excursion
-       (set-buffer standard-output)
+    (save-selected-window
+      (if temp-buffer
+         (pop-to-buffer temp-buffer)
+       (pop-to-buffer (get-buffer-create ebrowse-member-buffer-name))
        ;; If new buffer, set the mode and initial values of locals
-       (unless temp-buffer
-         (ebrowse-member-mode))
-       ;; Set local variables
-       (setq ebrowse--member-list (funcall list class)
-             ebrowse--displayed-class class
-             ebrowse--accessor list
-             ebrowse--tree-obarray classes
-             ebrowse--frozen-flag stand-alone
-             ebrowse--tags-file-name tags-file-name
-             ebrowse--header header
-             ebrowse--tree tree
-             buffer-read-only t)
-       (ebrowse-redisplay-member-buffer)
-       (current-buffer)))))
+       (ebrowse-member-mode))
+      ;; Set local variables
+      (setq ebrowse--member-list (funcall list class)
+           ebrowse--displayed-class class
+           ebrowse--accessor list
+           ebrowse--tree-obarray classes
+           ebrowse--frozen-flag stand-alone
+           ebrowse--tags-file-name tags-file-name
+           ebrowse--header header
+           ebrowse--tree tree
+           buffer-read-only t)
+      (ebrowse-redisplay-member-buffer)
+      (current-buffer))))
 
 
 (defun ebrowse-member-display-p (member)
@@ -3596,7 +3582,7 @@ The file name is read from the minibuffer."
 
 
 (defun* ebrowse-draw-file-member-info (info &optional (kind ""))
-  "Display a line in an the members per file info buffer.
+  "Display a line in the members info buffer.
 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.
@@ -4228,13 +4214,13 @@ NUMBER-OF-STATIC-VARIABLES:"
 ;;; Global key bindings
 
 ;;; The following can be used to bind key sequences starting with
-;;; prefix `\C-cb' to browse commands.
+;;; prefix `\C-c\C-m' to browse commands.
 
 (defvar ebrowse-global-map nil
   "*Keymap for Ebrowse commands.")
 
 
-(defvar ebrowse-global-prefix-key "\C-cb"
+(defvar ebrowse-global-prefix-key "\C-c\C-m"
   "Prefix key for Ebrowse commands.")