• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:replace +defs:regexp +defs:in +defs:string

18 ;; GNU Emacs is distributed in the hope that it will be useful,
36 ;; Documentation is found in a separate Info file.
58 "*List of directories to search for source files in a class tree.
63 (string :tag "Directory"))))
98 "*Hook run in each new tree buffer."
106 :type 'string)
110 "*The amount by which subclasses are indented in the tree."
116 "*The column in which source file names are displayed in the tree."
136 "*The column in which member declarations are displayed in member buffers."
142 "*The width of the columns in member buffers (short display form)."
150 :type 'string)
154 "*Run in each new member buffer."
169 "*The face used for the mark character in the tree."
178 "*The face used for root classes in the tree."
186 "*The face for filenames displayed in the tree."
194 "*Face for everything else in the tree not having other faces."
211 "*Face used to display the class title in member buffers."
254 "Return the position of ITEM in LIST or nil if not found.
309 "For all trees in SPEC, eval BODY."
332 "Read a string in the minibuffer, with completion.
333 Case is ignored in completions.
335 PROMPT is a string to prompt with; normally it ends in a colon and a space.
338 If INITIAL-INPUT is non-nil, insert it in the minibuffer initially.
340 is STRING, but point is placed POSITION characters into the string."
345 (defun ebrowse-value-in-buffer (sym buffer)
346 "Return the value of SYM in BUFFER."
365 (defun ebrowse-trim-string (string)
368 (when (string-match "^[ \t\n\r]+" string)
369 (setq string (substring string (match-end 0))))
370 (loop while (string-match "[\n]+" string)
371 finally return string do
372 (setq string (replace-match " " nil t string))))
377 If buffer is displayed in a window, use that window's width,
390 ;; A version string that is compared against the version number of
400 ;; set to a hash table mapping members to lists of classes in which
414 ;; Lists of `ebrowse-ms' structures for each member in a group of
421 ;; A marker slot used in the tree buffer (can be saved back to disk.
427 A common structure defining an occurrence of some name in the
429 ;; The class or member name as a string constant
431 ;; An optional string for the scope of nested classes or for
437 ;; File in which the entity is found. If this is part of a
439 ;; search for the name in the SOURCE-FILE of the members class.
441 ;; Regular expression to search for. This slot can be a number in
443 ;; expression is found in a separate regexp file (see the header
444 ;; structure). This slot can be nil in which case the regular
454 This is the structure stored in the CLASS slot of a `ebrowse-ts'
466 ;; The file in which the member's definition can be found.
533 (defconst ebrowse-version-string "ebrowse 5.0"
534 "Version string expected in BROWSE files.")
542 (defvar ebrowse--last-regexp nil
543 "Last regular expression searched for in tree and member buffers.
545 (make-variable-buffer-local 'ebrowse--last-regexp)
558 in an `ebrowse-ts' structure.")
565 Buffer-local in Ebrowse buffers.")
570 Buffer-local in Ebrowse buffers.")
575 Buffer-local in Ebrowse buffers.")
580 Buffer-local in Ebrowse buffers.")
584 "Non-nil means show file names in a tree buffer.
585 Buffer-local in Ebrowse tree buffers.")
589 "Non-nil means show members in long display form.
590 Buffer-local in Ebrowse member buffers.")
595 Buffer-local in Ebrowse member buffers.")
600 Buffer-local in Ebrowse member buffers.")
604 "Non-nil means display virtual members in a member buffer.
605 Buffer-local in Ebrowse member buffers.")
609 "Non-nil means display inline members in a member buffer.
610 Buffer-local in Ebrowse member buffers.")
614 "Non-nil means display const members in a member buffer.
615 Buffer-local in Ebrowse member buffers.")
619 "Non-nil means display pure virtual members in a member buffer.
620 Buffer-local in Ebrowse member buffers.")
627 Buffer-local in Ebrowse member buffers.")
631 "Non-nil means display inherited members in a member buffer.
632 Buffer-local in Ebrowse member buffers.")
636 "Non-nil means display member attributes in a member buffer.
637 Buffer-local in Ebrowse member buffers.")
640 (defvar ebrowse--source-regexp-flag nil
641 "Non-nil means display member regexps in a member buffer.
642 Buffer-local in Ebrowse member buffers.")
646 "Class displayed in a member buffer, a `ebrowse-ts' structure.
647 Buffer-local in Ebrowse member buffers.")
651 "Member list displayed in a member buffer.
653 member list in `ebrowse-cs' structures.
654 Buffer-local in Ebrowse member buffers.")
658 "The list of `ebrowse-ms' structures displayed in a member buffer.
659 Buffer-local in Ebrowse member buffers.")
663 "Column in which declarations are displayed in member buffers.
664 Buffer-local in Ebrowse member buffers.")
668 "Frame configuration saved when viewing a class/member in another frame.
669 Buffer-local in Ebrowse buffers.")
675 Buffer-local in Ebrowse buffers.")
680 Buffer-local in Ebrowse buffers.")
690 "The keymap used in tree mode buffers.")
694 "Strings displayed in the mode line of member buffers.")
698 "The keymap used in the member buffers.")
723 "Return an obarray containing all files mentioned in the current tree.
724 The tree is expected in the buffer-local variable `ebrowse--tree-obarray'.
733 ;; Add files mentioned in class description
740 ;; For all member lists in this class
741 (loop for accessor in ebrowse-member-list-accessors do
742 (loop for m in (funcall accessor tree)
753 "Return a list containing all files mentioned in a tree.
762 "Value is non-nil if any class in the current class tree is marked."
770 (string= (ebrowse-bs-name (ebrowse-ts-class tree))
782 "Return an alist describing all classes in a tree.
783 Each elements in the list has the form (CLASS-NAME . TREE).
787 The class tree is found in the buffer-local variable `ebrowse--tree-obarray'."
805 (string< (ebrowse-qualified-class-name (ebrowse-ts-class a))
809 (defun ebrowse-class-in-tree (class tree)
810 "Search for a class with name CLASS in TREE.
812 is used during the load phase where classes appended to a file replace older
818 (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class (car root-ptr)))
857 "Return an alist containing all members of TREE in group ACCESSOR.
861 (loop for member in (funcall accessor tree)
866 "Return an alist describing all members visible in the current buffer.
869 accessor with which the member's list can be accessed in an `ebrowse-ts'
875 (loop for tree in (ebrowse-base-classes
885 are visible in the buffer."
910 (propertize (make-string ebrowse-n-boxes
919 "Read `ebrowse-hs' and `ebrowse-ts' structures in the current buffer.
929 (unless (string= (ebrowse-hs-version header) ebrowse-version-string)
931 (ebrowse-hs-version header) ebrowse-version-string))
937 (old-root-ptr (ebrowse-class-in-tree root tree)))
947 "Function installed as `revert-buffer-function' in tree buffers.
951 (loop for member-buffer in (ebrowse-same-tree-member-buffer-list)
964 OBARRAY is an obarray with a symbol for each class in the tree.
988 "Return an obarray holding all members of all classes in the current tree.
994 MEMBER) where TREE is the tree in which the member is defined,
995 MEMBER-LIST is a symbol describing the member list in which the member
1008 (loop for f in ebrowse-member-list-accessors do
1009 (loop for m in (funcall f c) do
1021 (loop for buffer in (ebrowse-browser-buffer-list)
1022 until (eq header (ebrowse-value-in-buffer 'ebrowse--header buffer))
1035 "Make sure every class in TREE is represented by a unique object.
1036 Build obarray of all classes in TREE."
1039 (loop for root in tree
1050 "Build base class lists in class tree TREE.
1059 We have to be cautious here not to end up in an infinite recursion
1060 if for some reason a circle is in the inheritance graph."
1061 (loop for class in tree
1070 ;; Replace the subclass tree with the one found in
1072 ;; in it. Otherwise make a new entry.
1075 ;; preprocessor in class declarations, a name is marked
1077 ;; in an endless loop. We have to omit subclasses from
1095 (define-key map [down-mouse-3] 'ebrowse-mouse-3-in-tree-buffer)
1096 (define-key map [mouse-2] 'ebrowse-mouse-2-in-tree-buffer)
1097 (define-key map [down-mouse-1] 'ebrowse-mouse-1-in-tree-buffer))
1144 Each line corresponds to a class in a class tree.
1146 File operations in the tree buffer work on class tree data structures.
1193 (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
1251 ;;; Marking classes in the tree buffer
1269 ;; For all these classes, reverse the mark char in the display
1270 ;; by a regexp replace over the whole buffer. The reason for this
1272 ;; the case, they are displayed more than once in the tree.
1274 (loop for tree in to-change
1275 as regexp = (concat "^.*\\b"
1276 (regexp-quote
1281 (loop while (re-search-forward regexp nil t)
1291 "Unmark, with PREFIX mark, all classes in the tree."
1299 "Display class marker signs in the tree between START and END."
1311 "Display class marker signs in TREE between START and END."
1325 ;;; File name display in tree buffers
1328 "Show filename in the line point is in.
1354 "Toggle display of filenames in tree buffer."
1408 (let ((tree (ebrowse-value-in-buffer 'ebrowse--tree buffer)))
1419 (eq (ebrowse-value-in-buffer 'ebrowse--tree buffer)
1455 (loop for buffer in (ebrowse-member-buffer-list)
1456 as class = (ebrowse-value-in-buffer 'ebrowse--displayed-class buffer)
1489 (let ((width (string-to-number (read-from-minibuffer
1491 (int-to-string ebrowse--indentation)
1512 (setq ebrowse--last-regexp (concat "\\b" class "\\b"))
1513 (if (re-search-forward ebrowse--last-regexp nil t)
1525 "Display member variables; with prefix ARG in frozen member buffer."
1531 "Display member functions; with prefix ARG in frozen member buffer."
1537 "Display static member variables; with prefix ARG in frozen member buffer."
1543 "Display static member functions; with prefix ARG in frozen member buffer."
1549 "Display friend functions; with prefix ARG in frozen member buffer."
1555 "Display types defined in a class; with prefix ARG in frozen member buffer."
1592 PREFIX-ARG 4 means find it in another window.
1593 PREFIX-ARG 5 means find it in another frame."
1604 PREFIX-ARG 4 means view it in another window.
1605 PREFIX-ARG 5 means view it in another frame."
1622 and (b) in the directories named in `ebrowse-search-path'."
1628 (let ((search-in ebrowse-search-path))
1629 (while (and search-in
1631 (let ((try-file (expand-file-name file (car search-in))))
1634 (setq search-in (cdr search-in))))))
1641 "View a file FILE in another window.
1656 "Function called when exiting View mode in BUFFER.
1664 ;; Delete the frame in which we viewed.
1666 (loop for frame in (frame-list)
1674 "View a file FILE in another frame.
1702 FILE is the file to search the member in.
1703 FILE is not taken out of STRUC here because the filename in STRUC
1704 may be nil in which case the filename of the class description is used.
1736 (defun ebrowse-symbol-regexp (name)
1738 This is `regexp-quote' for most symbols, except for operator names
1739 which may contain whitespace. For these symbols, replace white
1740 space in the symbol name (generated by BROWSE) with a regular
1742 (loop with regexp = (regexp-quote name)
1744 finally return regexp
1745 while (string-match "[ \t]+" regexp start)
1746 do (setq regexp (concat (substring regexp 0 (match-beginning 0))
1748 (substring regexp (match-end 0)))
1752 (defun ebrowse-class-declaration-regexp (name)
1753 "Construct a regexp for a declaration of class NAME."
1756 (ebrowse-symbol-regexp name)
1760 (defun ebrowse-variable-declaration-regexp (name)
1761 "Construct a regexp for matching a variable NAME."
1762 (concat "\\S_" (ebrowse-symbol-regexp name) "\\S_"))
1765 (defun ebrowse-function-declaration/definition-regexp (name)
1766 "Construct a regexp for matching a function NAME."
1768 (ebrowse-symbol-regexp name)
1772 (defun ebrowse-pp-define-regexp (name)
1773 "Construct a regexp matching a define of NAME."
1774 (concat "^[ \t]*#[ \t]*define[ \t]+" (regexp-quote name)))
1781 a pattern. To be able to do a search in a viewed buffer,
1799 (setq pattern (concat "^.*" (regexp-quote pattern))))
1808 (setf pattern (ebrowse-variable-declaration-regexp
1812 (setf pattern (ebrowse-pp-define-regexp (ebrowse-bs-name position)))
1813 (setf pattern (ebrowse-function-declaration/definition-regexp
1816 (setf pattern (ebrowse-class-declaration-regexp
1820 ;; When there is no regular expression in the database and a
1944 \(The class cursor is on.) With prefix ARG, fold all trees in the buffer."
1952 "Expand or fold all trees in the buffer.
1992 "Hide/show a single line in the tree.
2024 "Keymap used in electric Ebrowse buffer list window.")
2144 (if (pos-visible-in-window-p (point-max))
2168 "Get a buffer corresponding to the line POINT is in."
2227 (define-key map1 "r" 'ebrowse-toggle-regexp-display)
2267 (define-key map "t" 'ebrowse-show-displayed-class-in-tree)
2297 ebrowse--source-regexp-flag ;show source regexp?
2317 ebrowse--source-regexp-flag nil
2325 (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
2333 (defsubst ebrowse-class-name-displayed-in-member-buffer ()
2334 "Return the name of the class displayed in the member buffer."
2339 "Return a string describing what is displayed in the member buffer."
2348 (concat (ebrowse-class-name-displayed-in-member-buffer)
2366 (defun ebrowse-show-displayed-class-in-tree (arg)
2367 "Show the currently displayed class in the tree window.
2370 (let ((class-name (ebrowse-class-name-displayed-in-member-buffer)))
2379 (let ((width (string-to-number
2382 (int-to-string (if ebrowse--long-display-flag
2578 (defun ebrowse-toggle-regexp-display ()
2580 Used in member buffers showing the long display form."
2582 (setf ebrowse--source-regexp-flag (not ebrowse--source-regexp-flag))
2592 With PREFIX 4. find file in another window, with prefix 5
2593 find file in another frame."
2600 With PREFIX 4. find file in another window, with prefix 5
2601 find file in another frame."
2608 With PREFIX 4. find file in another window, with prefix 5
2609 find file in another frame."
2616 With PREFIX 4. find file in another window, with prefix 5
2617 find file in another frame."
2625 With PREFIX 4. find file in another window, with prefix 5
2626 find file in another frame.
2672 ;; When no file information in member, use that of the class
2677 ;; When we have no regular expressions in the database the only
2734 "Display the title line for a class section in the member buffer.
2806 "Insert a string for the attributes of MEMBER."
2818 (defun ebrowse-draw-member-regexp (member-struc)
2819 "Insert a string for the regular expression matching MEMBER-STRUC."
2820 (let ((pattern (if ebrowse--source-regexp-flag
2825 (insert (ebrowse-trim-string pattern) "...\n")
2837 "Display member buffer for MEMBER-LIST in long form.
2866 (ebrowse-draw-member-regexp member-struc))))
2872 "Display MEMBER-LIST in short form.
2873 TREE is the class tree in which the members are found."
2925 we're in, MEMBER is the member we're on. NULL-P is t if MEMBER
2939 With PREFIX, search all members in the tree. Otherwise consider
2940 only members visible in the buffer."
2958 visible in the member buffer.
2970 ;;; Searching a member in the member buffer
2976 (unless ebrowse--last-regexp
2980 ;; Search for regexp from point
2981 (if (re-search-forward ebrowse--last-regexp nil t repeat)
2987 (if (re-search-forward ebrowse--last-regexp nil t)
2995 "Set point on member NAME in the member buffer
3001 ebrowse--last-regexp
3002 (concat "[ \t\n]" (regexp-quote member) "[ \n\t]"))
3003 (if (re-search-forward ebrowse--last-regexp nil t count)
3038 (let ((alist (loop for s in supers
3069 (loop for tr in trees
3097 (loop for s in (ebrowse-ts-subclasses
3178 ["Show in Tree" ebrowse-show-displayed-class-in-tree
3179 :help "Show this class in the class tree"
3181 ["Find in this Class" ebrowse-goto-visible-member
3184 ["Find in Tree" ebrowse-goto-visible-member/all-member-lists
3185 :help "Search for a member in any class"
3270 "Object menu for class names in member buffer."
3273 :help "Find this class in the source files"
3276 :help "View this class in the source files"
3285 :help "Find this member's definition in the source files"
3288 :help "Find this member's declaration in the source files"
3291 :help "View this member's definition in the source files"
3294 :help "View this member's declaration in the source files"
3299 "Handle `mouse-3' events in member buffers.
3316 "Handle `mouse-2' events in member buffers.
3333 "Return information about a member in a class tree.
3337 where each element describes one occurrence of member NAME in the tree.
3338 CLASS-NAME is the qualified name of the class in which the
3339 member was found. The CDR of the acons is described in function
3360 (if buffer (list (ebrowse-value-in-buffer 'ebrowse--tree buffer)
3361 (ebrowse-value-in-buffer 'ebrowse--header buffer)
3381 ;; matches! It returns the name as a string.
3386 members (regexp-quote name) name))
3413 INITIAL-CLASS-NAME is an initial class name to insert in the minibuffer.
3456 (ebrowse-value-in-buffer 'ebrowse--tags-file-name tree-buffer))
3490 "View declaration of member at point in other window."
3497 "Find declaration of member at point in other window."
3504 "View definition of member at point in other window."
3511 "Find definition of member at point in other window."
3517 "View definition of member at point in other frame."
3524 "Find definition of member at point in other frame."
3531 "View definition of member at point in other frame."
3538 "Find definition of member at point in other frame."
3579 (defun ebrowse-list-of-matching-members (members regexp &optional name)
3580 "Return a list of members in table MEMBERS matching REGEXP or NAME.
3581 Both NAME and REGEXP may be nil in which case exact or regexp matches
3584 (when (or name regexp)
3586 (when (or (and name (string= name member-name))
3587 (and regexp (string-match regexp member-name)))
3594 "Display a list of members matching a regexp read from the minibuffer."
3598 (header (ebrowse-value-in-buffer 'ebrowse--header buffer))
3601 (regexp (read-from-minibuffer "List members matching regexp: ")))
3605 (insert "Members matching `" regexp "'\n\n")
3606 (loop for s in (ebrowse-list-of-matching-members members regexp) do
3607 (loop for info in (gethash s members) do
3611 (defun ebrowse-tags-list-members-in-file ()
3612 "Display a list of members found in a file.
3618 (file (completing-read "List members in file: " files nil t))
3619 (header (ebrowse-value-in-buffer 'ebrowse--header buffer))
3622 (with-output-to-temp-buffer (concat "*Members in file " file "*")
3626 (loop for info in list
3630 (string= (ebrowse-cs-file class) file))
3631 (string= file (ebrowse-ms-file member)))
3634 (string= (ebrowse-cs-source-file class) file))
3635 (string= file (ebrowse-ms-definition-file member)))
3641 "Display a line in an the members per file info buffer.
3646 KIND is an additional string printed in the buffer."
3678 "Member used in last completion operation.")
3698 (header (ebrowse-value-in-buffer 'ebrowse--header buffer)))
3702 (defun ebrowse-cyclic-successor-in-string-list (string list)
3703 "Return the item following STRING in LIST.
3705 (or (nth (1+ (ebrowse-position string list 'string=)) list)
3738 completion (ebrowse-cyclic-successor-in-string-list
3742 ((string= completion pattern)
3749 ;; First time the function is called at some position in the
3768 ;;; Tags query replace & search
3772 Evaluated for each file in the tree. If it returns nil, proceed
3788 "Select next file among files in current tag table.
3790 to the beginning of the list of files in the tag table.
3811 ;; in memory, and it wasn't modified, throw its buffer away to
3826 ;; file in this case.
3833 "Repeat last operation on files in tree.
3847 (defun ebrowse-tags-search (regexp)
3848 "Search for REGEXP in all files in a tree.
3851 (interactive "sTree search (regexp): ")
3852 (if (and (string= regexp "")
3855 (setq ebrowse-tags-loop-form (list 're-search-forward regexp nil t))
3860 (defun ebrowse-tags-query-replace (from to)
3861 "Query replace FROM with TO in all files of a class tree.
3864 "sTree query replace (regexp): \nsTree query replace %s by: ")
3868 (list 'not (list 'perform-replace from to t t nil))))
3877 Searches in all files mentioned in a class tree for something that
3886 (let ((name fix-name) class-name regexp)
3891 (setq regexp (concat "\\<" name "[ \t]*(")
3892 ebrowse-tags-loop-form (list 're-search-forward regexp nil t))
3903 file-name ; in which file
3904 point ; point in file
3914 "Current position in position stack.")
3918 "Return an identifying string for POSITION.
3919 The string is printed in the electric position list buffer."
3948 Positions in buffers that have no file names are not saved."
3965 (defun ebrowse-move-in-position-stack (increment)
3966 "Move by INCREMENT in the position stack."
3978 (defun ebrowse-back-in-position-stack (arg)
3979 "Move backward in the position stack.
3982 (ebrowse-move-in-position-stack (max 1 arg)))
3986 (defun ebrowse-forward-in-position-stack (arg)
3987 "Move forward in the position stack.
3990 (ebrowse-move-in-position-stack (min -1 (- arg))))
3998 "Keymap used in electric position stack window.")
4056 "Display positions in buffer *Positions*."
4065 (insert (int-to-string (ebrowse-position-point position)))
4073 "List positions in the position stack in an electric buffer."
4126 (if (pos-visible-in-window-p (point-max))
4158 "View the position described by the line point is in."
4176 "Save current tree in same file it was loaded from."
4185 Otherwise, FILE-NAME specifies the file to save the tree in."
4196 (insert (prin1-to-string header) " ")
4251 "Print a line in the statistics buffer.
4305 (define-key ebrowse-global-map "-" 'ebrowse-back-in-position-stack)
4306 (define-key ebrowse-global-map "+" 'ebrowse-forward-in-position-stack)
4307 (define-key ebrowse-global-map "l" 'ebrowse-tags-list-members-in-file)
4315 (define-key ebrowse-global-map "%" 'ebrowse-tags-query-replace)
4342 ;;; (in this case Tree buffers). There is only one problem with this:
4343 ;;; If the very first character typed in the buffer menu is a space,
4345 ;;; invoked. But this buffer is not displayed in the buffer list if
4364 (string= (buffer-name b) "*Apropos Members*"))
4379 "Select the nth entry in the list by the keys 1..9."
4382 (n (min maxlin (+ 2 (string-to-number (this-command-keys))))))
4388 "Define keys 1..9 to select the 1st to 9nth entry in the list."
4390 (define-key (current-local-map) (char-to-string (+ i ?1))
4412 "Find the member clicked on in another frame.
4441 "Object menu for classes in the tree buffer"
4459 :help "Display a list of types defined in a class"
4466 :help "Find class declaration in file"
4494 :help "Unmark all classes in the class tree"
4497 :help "Expand all subtrees in the class tree"
4503 :help "Find a class in the tree"
4510 (defun ebrowse-mouse-3-in-tree-buffer (event)
4511 "Perform mouse actions in tree buffers.
4526 (defun ebrowse-mouse-2-in-tree-buffer (event)
4527 "Perform mouse actions in tree buffers.
4539 (defun ebrowse-mouse-1-in-tree-buffer (event)
4540 "Perform mouse actions in tree buffers.