Emacs find and replace3/28/2023 ![]() TAB ĭisplay the reference on the current line and bury the *xref* buffer ( xref-quit-and-goto-xref). C-o ĭisplay the reference on the current line in the other window ( xref-show-location-at-point). Move to the previous reference and display it in the other window ( xref-prev-line). Move to the next reference and display it in the other window ( xref-next-line). ![]() ![]() The following commands are provided in the *xref* buffer by the special XREF mode: RET mouse-2 ĭisplay the reference on the current line. (For this to work, be sure to run etags to create the tags table in the directory tree of the source files, see Create Tags Table.) 28.4.1.2 Commands Available in the *xref* Buffer To this end, turn on the Xref Etags minor mode with M-x xref-etags-mode, then invoke M. fails to find some identifiers, you can try forcing xref to use the etags backend (see Xref). will by default find only functions and variables from Lisp packages which are loaded into the current Emacs session or are auto-loaded (see Autoload in The Emacs Lisp Reference Manual). For example, in Emacs Lisp mode (see Lisp Eval) M. Some major modes install xref support facilities that might sometimes fail to find certain identifiers. M-, allows you to retrace your steps to a depth determined by the variable xref-marker-ring-length, which defaults to 16. and then return to where you were with M. Thus you can find and examine the definition of something with M. It jumps back to the point of the last invocation of M. To go back to places from where you found the definition, use M-, ( xref-pop-marker-stack). In that buffer, you have several specialized commands, described in Xref Commands. When any of the above commands finds more than one definition, it presents the *xref* buffer showing the definition candidates. except that it does regexp matching of identifiers instead of matching symbol names as fixed strings. ( xref-find-apropos) finds the definitions of one or more identifiers that match a specified regular expression. This command is intended to be bound to a mouse event, such as C-M-mouse-1, for example. The command xref-find-definitions-at-mouse works like xref-find-definitions, but it looks for the identifier name at or around the place of a mouse event. ( xref-find-definitions-other-window), and the latter is C-x 5 . Like most commands that can switch buffers, xref-find-definitions has a variant that displays the new buffer in another window, and one that makes a new frame for it. When entering the identifier argument to M-., the usual minibuffer completion commands can be used (see Completion), with the known identifier names as completion candidates. Selecting one of these candidates by typing RET or clicking mouse-2 will pop a buffer showing the corresponding definition. If the identifier has more than one possible definition (e.g., in an object-oriented language, or if there’s a function and a variable by the same name), the command shows the candidate definitions in the *xref* buffer, together with the files in which these definitions are found. If the specified identifier has only one definition, the command jumps to it. (If you want it to always prompt, customize xref-prompt-for-identifier to t.) With a prefix argument, or if there’s no identifier at point, it prompts for the identifier. ( xref-find-definitions) shows the definitions of the identifier at point. Go back to where you previously invoked M. M-x xref-find-definitions-at-mouse įind definition of identifier at mouse click. RET įind definition of identifier, and display it in a new frame ( xref-find-definitions-other-frame). RET įind definitions of identifier, but display it in another window ( xref-find-definitions-other-window). pattern RET įind all identifiers whose name matches pattern ( xref-find-apropos). ![]() įind definitions of an identifier ( xref-find-definitions). The most important thing that xref enables you to do is to find the definition of a specific identifier. Listing identifiers and completing on them. Each such reference could define an identifier, e.g., provide the implementation of a program subunit or the text of a document section or it could use the identifier, e.g., call a function or a method, assign a value to a variable, mention a chapter in a cross-reference, etc.Ĭommands to find the definition of an identifier. This subsection describes the commands that find references to identifiers and perform various queries about identifiers. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |