emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 5eb4ede8f8 113/166: ADDED: (sweep-prefix-operat


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 5eb4ede8f8 113/166: ADDED: (sweep-prefix-operators): New function
Date: Fri, 30 Sep 2022 04:59:30 -0400 (EDT)

branch: elpa/sweeprolog
commit 5eb4ede8f8ece589f72d3f01bb67e5470769e38d
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ADDED: (sweep-prefix-operators): New function
---
 sweep.el | 10 ++++++++++
 sweep.pl | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/sweep.el b/sweep.el
index 66dbb5a386..914155704f 100644
--- a/sweep.el
+++ b/sweep.el
@@ -342,6 +342,15 @@ FLAG and VALUE are specified as strings and read as Prolog 
terms."
               (forward-char))
             (cons start (point))))))))
 
+(defun sweep-prefix-operators (&optional file)
+  (sweep-open-query "user"
+                    "sweep" "sweep_prefix_ops"
+                    (or file (buffer-file-name)))
+  (let ((sol (sweep-next-solution)))
+    (sweep-close-query)
+    (when (sweep-true-p sol)
+      (cdr sol))))
+
 (defun sweep-completion-at-point-function ()
   (when-let ((bounds (sweep-predicate-prefix-boundaries)))
     (let ((start (car bounds))
@@ -1101,6 +1110,7 @@ Interactively, a prefix arg means to prompt for BUFFER."
        ((sweep-indent-line-ends-with-else point))
        ((sweep-indent-line-ends-with-arg point))
        ((sweep-indent-line-ends-with-neck-p)              4)
+       ;; ((sweep-indent-line-ends-with-prefix-operator))
        (t (sweep-indent-line-fallback))))))
 
 (defun sweep-indent-line-fallback ()
diff --git a/sweep.pl b/sweep.pl
index 56a25be01c..8d6297420a 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -51,6 +51,7 @@
             sweep_modules_collection/2,
             sweep_packs_collection/2,
             sweep_pack_install/2,
+            sweep_prefix_ops/2,
             sweep_module_path/2
           ]).
 
@@ -668,6 +669,15 @@ should_handle_message_kind(warning, "warning").
 should_handle_message_kind(informational, "informational").
 should_handle_message_kind(debug(Topic0), ["debug"|Topic]) :- 
atom_string(Topic0, Topic).
 
+sweep_prefix_ops(Path0, Ops) :-
+    atom_string(Path, Path0),
+    findall(Op, current_op(_, fx, Op),        Ops0, Tail0),
+    findall(Op, current_op(_, fy, Op),        Tail0, Tail1),
+    findall(Op, xref_op(Path, op(_, fx, Op)), Tail1, Tail),
+    findall(Op, xref_op(Path, op(_, fy, Op)), Tail),
+    maplist(atom_string, Ops0, Ops1),
+    list_to_set(Ops1, Ops).
+
 sweep_load_buffer([String|Path0], Result) :-
     atom_string(Path, Path0),
     with_buffer_stream(Stream,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]