From: Eshel Yaron Date: Sun, 11 Sep 2022 20:52:36 +0000 (+0300) Subject: DOC: Following file specifications: new section X-Git-Tag: v0.2.1~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2abad939fef81af14d88d3a5796f4fd1221d1ac7;p=dict.git DOC: Following file specifications: new section --- diff --git a/NEWS.org b/NEWS.org index fb6f1e5..d8d2628 100644 --- a/NEWS.org +++ b/NEWS.org @@ -16,10 +16,17 @@ This file is about changes in =sweep= up to version Loads a =sweep-mode= buffer. If called from a =sweep-mode= buffer, loads the current buffer by default. +** New command =sweep-find-file-at-point=. + +Follows file specifications in =sweep-mode= buffers. + * New keybindings in =sweep-mode= buffers -=C-c C-l= is now bound to =sweep-load-buffer=. +** =C-c C-l= is now bound to =sweep-load-buffer=. + +** =C-c C-o= is now bound to =sweep-find-file-at-point=. + * New keybindings in =sweep-prefix-map= -The key =l= is now bound under =sweep-prefix-map= to =sweep-load-buffer=. +** The =l= key is now bound to =sweep-load-buffer=. diff --git a/README.org b/README.org index 368f829..d726b72 100644 --- a/README.org +++ b/README.org @@ -329,6 +329,27 @@ This enables the many commands that the =xref= interface provides, like [[info:emacs#Find Identifiers][Find Identifiers in the Emacs manual]] for an overview of the available commands. +** Following file specifications +:PROPERTIES: +:CUSTOM_ID: following-file-specs +:END: + +#+FINDEX: sweep-find-file-at-point +File specifications that occur in =sweep-mode= buffers can be followed +with =C-c C-o= (or =M-x sweep-find-file-at-point=) whenever point is over +a valid file specification. For example, consider a Prolog file buffer with the common +directive =use_module/1=: + +#+begin_src prolog +:- use_module(library(lists)). +#+end_src + +With point in any position inside =library(lists)=, typing =C-c C-o= will +open the =lists.pl= file in the Prolog library. + +For more information about file specifications in SWI-Prolog, see +[[https://www.swi-prolog.org/pldoc/doc_for?object=absolute_file_name/3][absolute_file_name/3]] in the SWI-Prolog manual. + ** Loading buffers :PROPERTIES: :CUSTOM_ID: loading-buffers @@ -347,6 +368,9 @@ otherwise. To choose a different buffer to load while visiting a =sweep-mode= buffer, invoke =sweep-load-buffer= with a prefix argument (=C-u C-c C-l=). +More relevant information about loading code in SWI-Prolog can be +found in [[https://www.swi-prolog.org/pldoc/man?section=consulting][Loading Prolog source files]] in the SWI-Prolog manual. + * The Prolog top-level :PROPERTIES: :CUSTOM_ID: prolog-top-level diff --git a/sweep.el b/sweep.el index f2f89db..490dd6e 100644 --- a/sweep.el +++ b/sweep.el @@ -1218,7 +1218,7 @@ Interactively, a prefix arg means to prompt for BUFFER." "Find file specificed by the Prolog file spec at POINT. Interactively, POINT is set to the current point." - (interactive "d" sweep-mode sweep-top-level-mode) + (interactive "d" sweep-mode) (if-let ((file (sweep-file-at-point point))) (find-file file) (user-error "No file specification found at point!")))