[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 1aefaea2ab 106/166: ADDED: (sweep-find-file-at-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 1aefaea2ab 106/166: ADDED: (sweep-find-file-at-point): new function |
Date: |
Fri, 30 Sep 2022 04:59:30 -0400 (EDT) |
branch: elpa/sweeprolog
commit 1aefaea2ab0d2537e816b5da37eb67658e831859
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ADDED: (sweep-find-file-at-point): new function
(sweep-mode): add sweep-file-at-point to file-name-at-point-functions
buffer locally.
---
sweep.el | 10 ++++++++++
sweep.pl | 1 -
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/sweep.el b/sweep.el
index 16aa103c50..677a948987 100644
--- a/sweep.el
+++ b/sweep.el
@@ -1213,6 +1213,15 @@ Interactively, a prefix arg means to prompt for BUFFER."
(when (sweep-true-p sol)
(cdr sol)))))
+(defun sweep-find-file-at-point (point)
+ "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)
+ (if-let ((file (sweep-file-at-point point)))
+ (find-file file)
+ (user-error "No file specification found at point!")))
+
(defun sweep-identifier-at-point (&optional point)
(let* ((p (or point (point)))
(beg (save-mark-and-excursion
@@ -1297,6 +1306,7 @@ Interactively, a prefix arg means to prompt for BUFFER."
(sweep-colourise-buffer)
(sweep--set-buffer-module)
(add-hook 'xref-backend-functions #'sweep--xref-backend nil t)
+ (add-hook 'file-name-at-point-functions #'sweep-file-at-point nil t)
(add-hook 'completion-at-point-functions
#'sweep-completion-at-point-function nil t))
;;;; Testing:
diff --git a/sweep.pl b/sweep.pl
index d5d451fef2..56a25be01c 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -161,7 +161,6 @@ sweep_handle_file_at_point(Point, file(File), Beg, Len) :-
sweep_handle_file_at_point(_, _, _, _).
-
sweep_identifier_at_point([Contents0, Path, Point], Identifier) :-
setup_call_cleanup(( new_memory_file(H),
insert_memory_file(H, 0, Contents0),
- [nongnu] elpa/sweeprolog 8dc9359dca 082/166: ADDED: sweep-set-prolog-flag for setting Prolog flags, (continued)
- [nongnu] elpa/sweeprolog 8dc9359dca 082/166: ADDED: sweep-set-prolog-flag for setting Prolog flags, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0f86b23be9 080/166: ENHANCED: emit Prolog messages with color coding, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1f4b1a6dcc 079/166: MODIFIED: use executable-find to locate the swipl executable..., ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f772a136e4 081/166: DOC: fix typos, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 75ec7290be 096/166: ADDED: sweep-load-buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 3717572348 091/166: FIXED: handle more missing color terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1744b29cc2 092/166: FIXED: off by one in sweep-colourise-some-terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 16d1a380ab 122/166: FIXED: (sweep-beginning-of-top-term): possible infinite loop, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f887a4b3f0 085/166: ENHANCED: provide caller predicate in xref-find-references, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 49214a669b 109/166: PORT: don't depend on pos-bol added in Emacs 29, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1aefaea2ab 106/166: ADDED: (sweep-find-file-at-point): new function,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog ce88557fdc 104/166: DOC: NEWS.org: new file, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 28170f629f 124/166: FIXED: (sweep--colourise): handle the dict_content color term, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6d1509a06a 090/166: FIXED: sweep-beginning-of-top-term stopping at comment start, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 9dfbbf9e9b 128/166: ADDED: new user option for choosing indentation increments, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 19d725b869 129/166: New make target: make info, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog a563bc36dc 121/166: FIXED: package-lint complaint about autoloaded private function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c94b509fcb 119/166: DOC: Add Top-level history section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog fc6c2964d9 105/166: ADDED: (sweep-file-at-point): new function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1f83ce9f04 088/166: FIXED: use operators from xref in sweep_colourise_some_terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 92f599fbbc 094/166: FIXED: premature cut in sweep_predicate_location/2, ELPA Syncer, 2022/09/30