[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog d226bbb70c 063/166: ENHANCED: set per buffer mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog d226bbb70c 063/166: ENHANCED: set per buffer module name in sweep-mode |
Date: |
Fri, 30 Sep 2022 04:59:26 -0400 (EDT) |
branch: elpa/sweeprolog
commit d226bbb70c7260d1bb1d6f8165daa913e864cd10
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ENHANCED: set per buffer module name in sweep-mode
---
sweep.el | 11 ++++++++++-
sweep.pl | 7 +++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/sweep.el b/sweep.el
index bf3aff17bb..16ce920f17 100644
--- a/sweep.el
+++ b/sweep.el
@@ -262,6 +262,14 @@ module name, F is a functor name and N is its arity."
pat)))))))
(completing-read sweep-read-module-prompt col)))
+
+(defun sweep--set-buffer-module ()
+ (sweep-open-query "user" "sweep" "sweep_path_module" (buffer-file-name))
+ (let ((sol (sweep-next-solution)))
+ (sweep-close-query)
+ (when (sweep-true-p sol)
+ (setq sweep-buffer-module (cdr sol)))))
+
;;;###autoload
(defun sweep-find-module (mod)
"Jump to the source file of the Prolog module MOD."
@@ -970,7 +978,8 @@ Interactively, a prefix arg means to prompt for BUFFER."
nil
nil
(font-lock-fontify-region-function .
sweep-colourise-some-terms)))
- (sweep-colourise-buffer))
+ (sweep-colourise-buffer)
+ (sweep--set-buffer-module))
;;;; Testing:
diff --git a/sweep.pl b/sweep.pl
index 3d65efa01d..c24bae8b60 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -35,6 +35,7 @@
sweep_colourise_some_terms/2,
sweep_documentation/2,
sweep_expand_file_name/2,
+ sweep_path_module/2,
sweep_predicate_location/2,
sweep_predicates_collection/2,
sweep_modules_collection/2,
@@ -350,3 +351,9 @@ sweep_expand_file_name_(Dir, Spec, Exp) :-
relative_to(Dir),
solutions(all),
extensions(['', '.pl'])]).
+
+sweep_path_module([], "user") :- !.
+sweep_path_module(Path0, Module) :-
+ atom_string(Path, Path0),
+ xref_module(Path, Module0),
+ atom_string(Module0, Module).
- [nongnu] elpa/sweeprolog b67e5b5e3d 029/166: DOC: Expand the manual section about Querying Prolog, (continued)
- [nongnu] elpa/sweeprolog b67e5b5e3d 029/166: DOC: Expand the manual section about Querying Prolog, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5455c53eaf 031/166: ENHANCED: Add optional "reverse" argument flag to sweep-open-query, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ff13d97396 034/166: DOC: Add CUSTOM_ID properties to README.org headings where needed, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5fa0e16ee3 037/166: DOC: Document sweep_funcall/2, 3 in the manual, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 66ac977deb 045/166: Make use of the new SWI-Prolog embedded GMP handling..., ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 8f1275f113 044/166: Remove the swipl-devel git submodule, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5dcdec144d 052/166: PORT: use swipl --dump-runtime-variables to locate SWI-Prolog.h, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b24f66da61 051/166: Add licensing information, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 43e5cdaf91 054/166: ADDED: global keymap sweep-prefix-map, not bound by default, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 239e205add 059/166: ADDED: sweep-mode, a major mode for editing Prolog code, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d226bbb70c 063/166: ENHANCED: set per buffer module name in sweep-mode,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog d974b0fe0a 071/166: ADDED: prepare xref backend, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 27c441ab49 068/166: PORT: don't rely on defvar-keymap available only since Emacs 29, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0b054bac88 072/166: ENHANCED: better detection of the identifier at point, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c59ead20f7 075/166: ENHANCED: redirect Prolog messages to Emacs message function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 031c07ac93 076/166: DOC: document the Prolog messages buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 8ac0e7afb9 065/166: ENHANCED: also complete predicate names from xref, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 85ca3a5dc2 067/166: FIXED: bind SourceId in xref based completions, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 21a4475306 112/166: Makefile: Allow specifying the path to emacs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ec01154a41 102/166: PORT: sweep.el: require Emacs version 28 for RTLD_GLOBAL, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e991b1a92c 097/166: ENHANCED: (sweep-load-buffer): use read-buffer to choose a buffer, ELPA Syncer, 2022/09/30