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

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

[nongnu] elpa/sweeprolog 0c7c5d2d9a 3/4: ADDED: make flymake optionally


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 0c7c5d2d9a 3/4: ADDED: make flymake optionally complain about implicit autoloads
Date: Sat, 26 Nov 2022 09:59:24 -0500 (EST)

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

    ADDED: make flymake optionally complain about implicit autoloads
    
    * sweeprolog.el (sweeprolog-note-implicit-autoloads): new user-option.
    (sweeprolog-analyze-fragment-flymake): use it.
    * README.org ("Managing Dependencies"): mention it.
---
 README.org    |  7 +++++++
 sweeprolog.el | 12 ++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/README.org b/README.org
index 2e29becc62..c85916af60 100644
--- a/README.org
+++ b/README.org
@@ -1157,6 +1157,13 @@ sweeprolog-update-dependencies~ bound to ~C-c C-u~.  
This command
 analyzes the current buffer and adds or updates ~autoload/2~ and
 ~use_module/2~ as needed.
 
+#+VINDEX: sweeprolog-note-implicit-autoloads
+By default, when ~flymake~ integration is enabled (see 
[[#diagnostics][Examining
+diagnostics]]), calls to implicitly autoloaded predicates are detected
+and marked as note-level diagnostics.  To inhibit ~flymake~ from
+diagnosing implicit autoloads, customize the user option
+~sweeprolog-note-implicit-autoloads~ to nil.
+
 * Prolog Help
 :PROPERTIES:
 :CUSTOM_ID: prolog-help
diff --git a/sweeprolog.el b/sweeprolog.el
index 4476f0feab..b726e66eb2 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -295,6 +295,12 @@ inserted to the input history in 
`sweeprolog-top-level-mode' buffers."
   :type 'boolean
   :group 'sweeprolog)
 
+(defcustom sweeprolog-note-implicit-autoloads t
+  "If non-nil, `flymake' notes implicitly autoload predicates."
+  :package-version '((sweeprolog "0.9.2"))
+  :type 'boolean
+  :group 'sweeprolog)
+
 (defcustom sweeprolog-enable-eldoc t
   "If non-nil, enable `eldoc' suport in `sweeprolog-mode' buffers."
   :package-version '((sweeprolog "0.4.7"))
@@ -2062,6 +2068,12 @@ resulting list even when found in the current clause."
                 (`("goal" "undefined" ,f ,a)
                  (cons :warning
                        (format "Undefined predicate %s/%s" f a)))
+                (`("goal" ("autoload" . ,file) . ,_)
+                 (when sweeprolog-note-implicit-autoloads
+                   (cons :note
+                         (substitute-command-keys
+                          (format "Implicit autoload from %s, use 
\\[sweeprolog-update-dependencies] to add dependecy directive"
+                                  file)))))
                 ("instantiation_error"
                  (cons :warning "Instantiation error"))
                 ("type_error"



reply via email to

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