From: Eshel Yaron Date: Tue, 6 Jun 2023 05:24:36 +0000 (+0300) Subject: Add docstring for 'sweeprolog-definition-at-point' X-Git-Tag: V9.1.10-sweep-0.18.4~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf90a2144e8ac1ed4000df8f854fd88898de1bf2;p=sweep.git Add docstring for 'sweeprolog-definition-at-point' --- 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)