From cf90a2144e8ac1ed4000df8f854fd88898de1bf2 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 6 Jun 2023 08:24:36 +0300 Subject: [PATCH] Add docstring for 'sweeprolog-definition-at-point' --- sweeprolog.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sweeprolog.el b/sweeprolog.el index ce8be3f..8027059 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -3567,6 +3567,21 @@ of them signal success by returning non-nil." (remove-hook 'sweeprolog-analyze-region-fragment-hook cb t))) (defun sweeprolog-definition-at-point (&optional point) + "Get information about the Prolog definition at POINT. + +If POINT is nil, it defaults to point. + +If POINT is not inside a clause, return nil. Otherwise, return a +list (BEG FUNCTOR ARITY END NECK MODULE). + +When the head term of clause is module-qualified, MODULE is the +name of that module. If the head is not module-qualified, MODULE +is nil. FUNCTOR and ARITY are the functor and arity of predicate +that the clause is part of, and NECK is the neck operator that it +uses (e.g. \"-->\" for DCG rules). + +BEG and END are buffer positions corresponding to the beginning +and end positions of the clause." (save-excursion (when point (goto-char point)) (let ((functor nil) -- 2.39.5