Function: ebrowse-view/find-file-and-search-pattern
ebrowse-view/find-file-and-search-pattern is a byte-compiled function
defined in ebrowse.el.gz.
Signature
(ebrowse-view/find-file-and-search-pattern STRUC INFO FILE TAGS-FILE &optional VIEW WHERE)
Documentation
Find or view a member or class.
STRUC is an ebrowse-bs structure (or a structure including that)
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 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 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
specifies where to find/view the result.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/ebrowse.el.gz
(defun ebrowse-view/find-file-and-search-pattern
(struc info file tags-file &optional view where)
"Find or view a member or class.
STRUC is an `ebrowse-bs' structure (or a structure including that)
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 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 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
specifies where to find/view the result."
(unless file
(error "Sorry, no file information available for %s"
(ebrowse-bs-name struc)))
;; Get the source file to view or find.
(setf file (ebrowse-find-source-file file tags-file))
;; If current window is dedicated, use another frame.
(when (window-dedicated-p)
(setf where 'other-window))
(cond (view
(setf ebrowse-temp-position-to-view struc
ebrowse-temp-info-to-view info)
(add-hook 'view-mode-hook #'ebrowse-find-pattern)
(pcase where
('other-window (view-file-other-window file))
('other-frame (ebrowse-view-file-other-frame file))
(_ (view-file file))))
(t
(pcase where
('other-window (find-file-other-window file))
('other-frame (find-file-other-frame file))
(_ (find-file file)))
(ebrowse-find-pattern struc info))))