[elpa] externals/lin bf149502de: Operate only in non-hidden buffers when enabling/disabling the mode

2024-09-05 Thread ELPA Syncer
branch: externals/lin
commit bf149502de09786c8d906c92a950b7b21fb2ae54
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Operate only in non-hidden buffers when enabling/disabling the mode
---
 lin.el | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lin.el b/lin.el
index 1d298929db..fb0800f1ae 100644
--- a/lin.el
+++ b/lin.el
@@ -394,15 +394,23 @@ With optional non-nil REVERSE argument, remove those 
hooks."
 (when lin-mode
   (lin-mode -1
 
+(defun lin--buffer-hidden-p (buffer)
+  "Return non-nil if BUFFER is hidden."
+  (string-prefix-p " " buffer))
+
+(defun lin--non-hidden-buffers ()
+  "Return `buffer-list' without hidden buffers."
+  (seq-remove #'lin--buffer-hidden-p (buffer-list)))
+
 (defun lin-enable-mode-in-buffers ()
   "Enable (restart) `lin-mode' if already enabled in any buffer.
-Do so by checking the `buffer-list'."
-  (mapc #'lin--mode-enable (buffer-list)))
+Do so by checking the `lin--non-hidden-buffers'."
+  (mapc #'lin--mode-enable (lin--non-hidden-buffers)))
 
 (defun lin-disable-mode-in-buffers ()
   "Restart `lin-mode' if already enabled in any buffer.
-Do so by checking the `buffer-list'."
-  (mapc #'lin--mode-disable (buffer-list)))
+Do so by checking the `lin--non-hidden-buffers'."
+  (mapc #'lin--mode-disable (lin--non-hidden-buffers)))
 
 (provide 'lin)
 



[nongnu] elpa/haskell-ts-mode 0d2c2b746f 1/3: Fixed indentation of where

2024-09-05 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 0d2c2b746f0ebfdcc141689b69d5bdd4daab9120
Author: pranshu 
Commit: pranshu 

Fixed indentation of where

Now offset is 4
---
 haskell-ts-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 1703dd0f56..1b35097853 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -136,7 +136,7 @@
`(["(" ")" "[" "]"] @font-lock-operator-face
  (infix operator: (_) @font-lock-operator-face
 
-(defvar haskell-ts-indent-rules
+(setq haskell-ts-indent-rules
   (let ((p-prev-sib
 (lambda (node _ _)
   (let ((n (treesit-node-prev-sibling node)))
@@ -196,7 +196,7 @@
  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
3)
((parent-is "local_binds\\|instance_declarations") ,p-prev-sib 0)
-   ((node-is "^where$") parent 2)
+   ((node-is "^where$") parent 4)

;; Match
;; ((match "match" nil 2 2 nil) ,p-prev-sib 0)



[nongnu] elpa/haskell-ts-mode updated (0be6d1c39b -> 75ea1a0454)

2024-09-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/haskell-ts-mode.

  from  0be6d1c39b Merge pull request 'Fix byte-compile warnings' (#1) from 
syohex/haskell-ts-mode:fix-byte-compile-warnings into main
   new  0d2c2b746f Fixed indentation of where
   new  b71c5f37f4 Forgot to set indent rules back to defvar(again)
   new  75ea1a0454 Fixed more indent


Summary of changes:
 haskell-ts-mode.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)



[nongnu] elpa/haskell-ts-mode 75ea1a0454 3/3: Fixed more indent

2024-09-05 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 75ea1a045411dd8c329257e4c3e8761ab281e525
Author: pranshu 
Commit: pranshu 

Fixed more indent

Now indent does not change AST, tested using ghc
---
 haskell-ts-mode.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 74dbcdef43..2c965cd52a 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -154,9 +154,12 @@
;; Lambda
((parent-is "lambda") standalone-parent 2)
 
+   ((parent-is "class_declarations") prev-sibling 0)
+   ;; ((lambda (a b c) (message (treesit-node-type b)) nil))
+   
;; in
((node-is "^in$") parent 0)
-   
+ 
;; list
((node-is "]") parent 0)
((parent-is "list") parent 1)
@@ -185,7 +188,7 @@
(no-node prev-adaptive-prefix 0)

((parent-is "data_constructors") parent 0)
-
+ 
;; where
((lambda (node _ _)
  (let ((n (treesit-node-prev-sibling node)))
@@ -230,7 +233,7 @@
((parent-is "haskell") column-0 0)
((parent-is "declarations") column-0 0)
 
-   ((parent-is "record") grand-parent 0)
+   ((parent-is "record") standalone-parent 2)
 
((parent-is "exports")
(lambda (_ b _) (treesit-node-start (treesit-node-prev-sibling b)))
@@ -295,7 +298,7 @@
   (interactive "d")
   (let ((node (treesit-node-at pos)))
 (while (not (string-match
-"declarations\\|haskell"
+"^declarations$\\|haskell"
 (treesit-node-type (treesit-node-parent node
   (setq node (treesit-node-parent node)))
 (indent-region (treesit-node-start node) (treesit-node-end node



[nongnu] elpa/haskell-ts-mode b71c5f37f4 2/3: Forgot to set indent rules back to defvar(again)

2024-09-05 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit b71c5f37f441b3cb125aea2f15e69ec9d322fe95
Author: pranshu 
Commit: pranshu 

Forgot to set indent rules back to defvar(again)
---
 haskell-ts-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 1b35097853..74dbcdef43 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -136,7 +136,7 @@
`(["(" ")" "[" "]"] @font-lock-operator-face
  (infix operator: (_) @font-lock-operator-face
 
-(setq haskell-ts-indent-rules
+(defvar haskell-ts-indent-rules
   (let ((p-prev-sib
 (lambda (node _ _)
   (let ((n (treesit-node-prev-sibling node)))



[elpa] externals/eev c88e745c65: Many changes in (find-try-sly-intro).

2024-09-05 Thread ELPA Syncer
branch: externals/eev
commit c88e745c65a740f11004e0d1c1108a052ce1acc7
Author: Eduardo Ochs 
Commit: Eduardo Ochs 

Many changes in (find-try-sly-intro).
---
 ChangeLog |   4 ++
 VERSION   |   4 +-
 eev-intro.el  | 125 +-
 eev-tlinks.el |   5 ++-
 4 files changed, 124 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 40ec52fa6f..34d49a6769 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-09-05  Eduardo Ochs  
+
+   * eev-intro.el (find-try-sly-intro): rewrote several sections.
+
 2024-09-04  Eduardo Ochs  
 
* eev-tlinks.el (ee-dot-emacs-sly): new function.
diff --git a/VERSION b/VERSION
index daaa9d41a3..24e7c133c1 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Wed Sep  4 08:04:37 GMT 2024
-Wed Sep  4 05:04:37 -03 2024
+Thu Sep  5 08:39:46 GMT 2024
+Thu Sep  5 05:39:46 -03 2024
diff --git a/eev-intro.el b/eev-intro.el
index c937d1120e..e578719c14 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author: Eduardo Ochs 
 ;; Maintainer: Eduardo Ochs 
-;; Version:20240904
+;; Version:20240905
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -18317,20 +18317,125 @@ sbcl --load quicklisp.lisp
 
 
 
-Etc
-===
+6. Sly: basic keys
+==
+If you run this,
 
-  ;; Inspect the ~/quicklisp/ directory:
-  ;;   (find-qlfile \"\")
-  ;;   (find-qlsh \"find * | sort\")
+ (eepitch-sly)
+ (eepitch-kill)
+ (eepitch-sly)
+  (inspect (make-pathname :name \"FOO\"))
+
+you will get a target buffer with a name like \"*sly-mrepl for sbcl*\",
+and the output of the `(inspect ...)' will be something like this:
+
+  CL-USER> (inspect (make-pathname :name \"FOO\"))
+  The object is a PATHNAME.
+  0. NAMESTRING: NIL
+  1. HOST: #}>
+  2. DEVICE: NIL
+  3. DIR+HASH: NIL
+  4. NAME: \"FOO\"
+  5. TYPE: NIL
+  6. VERSION: NIL
+  > 
+
+We will use that buffer to learn how to use three key sequences: `M-.',
+`M-,', and `C-c I'. They are explained in these info pages:
+
+  (find-slynode \"Finding definitions\" \"M-.\" \"Go to\")
+  (find-slynode \"Finding definitions\" \"M-,\" \"Go back\")
+  (find-emajormode-links 'sly-inspector-mode)
+
+The major mode of our target buffer is `sly-mrepl-mode', and if you run
+`C-h m' on that buffer you will see that the list of active minor modes
+there has several modes of with names like `sly-*'. This means that
+`M-.', `M-,', and `C-c I' may be defined in keymaps that are not
+`sly-mrepl-mode-map'; if you have `helpful' installed, try:
+
+  (find-emajormode-links 'sly-mrepl-mode)
+  (find-hfunction 'sly-mrepl-mode)
+  (find-hvariable 'sly-mrepl-mode-map)
+  (find-hfunction 'sly-autodoc-mode)
+  (find-hvariable 'sly-autodoc-mode-map)
+  (find-hfunction 'sly-interactive-buttons-mode)
+  (find-hfunction 'sly-mode)
+  (find-hvariable 'sly-mode-map)
+  (find-hfunction 'sly-stickers-shortcut-mode)
+  (find-hvariable 'sly-stickers-shortcut-mode-map)
+  (find-hvariable 'sly-stickers-mode-map)
+  (find-hfunction 'sly-trace-dialog-shortcut-mode)
+  (find-hvariable 'sly-trace-dialog-shortcut-mode-map)
+
+They are all in `sly-mode-map'. Anyway, run this again,
+
+ (eepitch-sly)
+ (eepitch-kill)
+ (eepitch-sly)
+  (inspect (make-pathname :name \"FOO\"))
 
- (eepitch-sbcl)
+put the point on the \"SB-IMPL::UNIX-HOST\" in the target buffer, and
+type `M-.'; this will take you to the source of SB-IMPL::UNIX-HOST. Then
+type `M-,'; this will take you back to the previous buffer.
+
+Then go to the target buffer again, put the point between the two
+closing parentheses of the (inspect (...)) sexp , and type `C-c I'. The
+default for `C-c I' is to inspect the sexp before point, so it will say
+
+  [sly] Inspect value (evaluated): (make-pathname :name \"FOO\")
+
+in the minibuffer, and ask for a confirmation. Type RET; this will open
+a buffer with a name like \"*sly-inspector for sbcl*\", whose major mode
+is `sly-inspector-mode'. Again, its Sly-related keybings are in several
+keymaps:
+
+  (find-emajormode-links 'sly-inspector-mode)
+  (find-hfunction 'sly-inspector-mode)
+  (find-hvariable 'sly-inspector-mode-map)
+  (find-hfunction 'sly-mode)
+  (find-hvariable 'sly-mode-map)
+  (find-hfunction 'sly-stickers-shortcut-mode)
+  (find-hvariable 'sly-stickers-shortcut-mode-map)
+  (find-hvariable 'sly-stickers-mode-map)
+  (find-hfunction 'sly-trace-dialog-shortcut-mode)
+  (find-hvariable 'sly-trace-dialog-shortcut-mode-map)
+
+
+
+7. Tell Maxima how to load Sly
+==
+Use this:
+
+;;-- (ee-copy

[elpa] externals/ef-themes 9c9a713e0b: Add explicit support for forge package

2024-09-05 Thread ELPA Syncer
branch: externals/ef-themes
commit 9c9a713e0b98daaf6d83cfd459ddcc7743668081
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add explicit support for forge package
---
 README.org   |  2 +-
 ef-themes.el | 17 +
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 5cd0cb8846..ee788e5165 100644
--- a/README.org
+++ b/README.org
@@ -1386,6 +1386,7 @@ everything most users need.
 - flymake
 - flyspell
 - font-lock
+- forge [ Part of {{{development-version}}}. ]
 - git-commit
 - git-gutter
 - git-gutter-fr
@@ -1477,7 +1478,6 @@ themes already cover:
 
 - apropos
 - dim-autoload
-- forge
 - hl-todo
 - icomplete
 - ido
diff --git a/ef-themes.el b/ef-themes.el
index f8b0959878..037298944e 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -1440,6 +1440,23 @@ text should not be underlined as well) yet still blend 
in."
 `(font-lock-type-face ((,c :foreground ,type)))
 `(font-lock-variable-name-face ((,c :foreground ,variable)))
 `(font-lock-warning-face ((,c :foreground ,warning)))
+ forge
+`(forge-dimmed ((,c :inherit shadow)))
+`(forge-issue-completed ((,c :inherit shadow)))
+`(forge-issue-open (( )))
+`(forge-issue-unplanned ((,c :inherit shadow :strike-through t)))
+`(forge-post-author ((,c :inherit bold :foreground ,name)))
+`(forge-post-date ((,c :inherit bold :foreground ,date-common)))
+`(forge-pullreq-merged ((,c :foreground ,fg-alt)))
+`(forge-pullreq-open ((,c :foreground ,info)))
+`(forge-pullreq-rejected ((,c :foreground ,err :strike-through t)))
+`(forge-topic-done ((,c :foreground ,info)))
+`(forge-topic-pending ((,c :foreground ,warning)))
+`(forge-topic-slug-completed ((,c :inherit shadow)))
+`(forge-topic-slug-open ((,c :inherit shadow)))
+`(forge-topic-slug-saved ((,c :inherit success)))
+`(forge-topic-slug-unplanned ((,c :inherit shadow :strike-through t)))
+`(forge-topic-unread ((,c :inherit bold)))
  git-commit
 `(git-commit-comment-action ((,c :inherit font-lock-comment-face)))
 `(git-commit-comment-branch-local ((,c :inherit font-lock-comment-face 
:foreground ,accent-0)))



[elpa] externals/modus-themes 1725bfd1ed: Refine support for forge

2024-09-05 Thread ELPA Syncer
branch: externals/modus-themes
commit 1725bfd1ed2b621349d80682c7fa5529ccfb7cba
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Refine support for forge
---
 modus-themes.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modus-themes.el b/modus-themes.el
index 60923240d0..5fe78e4f6c 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -2445,16 +2445,17 @@ FG and BG are the main colors."
 `(forge-issue-open (( )))
 `(forge-issue-unplanned ((,c :inherit shadow :strike-through t)))
 `(forge-post-author ((,c :inherit bold :foreground ,name)))
-`(forge-post-date ((,c :foreground ,date-common)))
+`(forge-post-date ((,c :inherit bold :foreground ,date-common)))
 `(forge-pullreq-merged ((,c :foreground ,fg-alt)))
 `(forge-pullreq-open ((,c :foreground ,info)))
 `(forge-pullreq-rejected ((,c :foreground ,err :strike-through t)))
-`(forge-topic-done (( )))
-`(forge-topic-pending ((,c :inherit italic :foreground ,prose-todo)))
+`(forge-topic-done ((,c :foreground ,info)))
+`(forge-topic-pending ((,c :foreground ,warning)))
 `(forge-topic-slug-completed ((,c :inherit shadow)))
 `(forge-topic-slug-open ((,c :inherit shadow)))
 `(forge-topic-slug-saved ((,c :inherit success)))
 `(forge-topic-slug-unplanned ((,c :inherit shadow :strike-through t)))
+`(forge-topic-unread ((,c :inherit bold)))
 ; geiser
 `(geiser-font-lock-autodoc-current-arg ((,c :inherit bold :background 
,bg-active-argument :foreground ,fg-active-argument)))
 `(geiser-font-lock-autodoc-identifier ((,c :foreground ,docstring)))



[elpa] externals/orderless 860a10222a: orderless-expand-prefix: Support the values `prefix`, `substring` and `nil`

2024-09-05 Thread ELPA Syncer
branch: externals/orderless
commit 860a10222a1a6be3ea87a77d34d09cd0e2dfd422
Author: Daniel Mendler 
Commit: Daniel Mendler 

orderless-expand-prefix: Support the values `prefix`, `substring` and `nil`

Using `completion-substring-try-completion` can be costly in comparison to
prefix completion only via `try-completion`, in particular in the context of
timer-based auto completion. As a compromise, default to `prefix` completion
only. Performance should not be affected, while expansion is still provided.
Depending on preference the expansion setting can be escalated to 
`substring` or
even disabled, in case the restrictive Orderless (non-)expansion behavior is
preferred.
---
 orderless.el | 86 
 1 file changed, 46 insertions(+), 40 deletions(-)

diff --git a/orderless.el b/orderless.el
index 187fd38d37..4e731fb5cd 100644
--- a/orderless.el
+++ b/orderless.el
@@ -212,14 +212,17 @@ is determined by the values of `completion-ignore-case',
 `read-buffer-completion-ignore-case', as usual for completion."
   :type 'boolean)
 
-(defcustom orderless-expand-substring t
+(defcustom orderless-expand-substring 'prefix
   "Whether to perform literal substring expansion.
-If enabled, `orderless-try-completion' will first attempt literal
-substring expansion via `completion-substring-try-completion'.
-Otherwise expansion is only performed for single unique matches.
 This configuration option affects the behavior of some completion
-interfaces when pressing TAB."
-  :type 'boolean)
+interfaces when pressing TAB.  If enabled `orderless-try-completion'
+will first attempt literal substring expansion.  If disabled,
+expansion is only performed for single unique matches.  For
+performance reasons only `prefix' expansion is enabled by default.
+Set the variable to `substring' for full substring expansion."
+  :type '(choice (const :tag "No expansion" nil)
+ (const :tag "Substring" substring)
+ (const :tag "Prefix (efficient)" prefix)))
 
 ;;; Matching styles
 
@@ -563,40 +566,43 @@ match, it completes to that match.  If there are no 
matches, it
 returns nil.  In any other case it \"completes\" STRING to
 itself, without moving POINT.
 This function is part of the `orderless' completion style."
-  (or (and orderless-expand-substring
-   (completion-substring-try-completion string table pred point))
-  (catch 'orderless--many
-(pcase-let ((`(,prefix ,regexps ,ignore-case ,pred)
- (orderless--compile string table pred))
-(one nil))
-  ;; Abuse all-completions/orderless--filter as a fast search loop.
-  ;; Should be almost allocation-free since our "predicate" is not
-  ;; called more than two times.
-  (orderless--filter
-   prefix regexps ignore-case table
-   (orderless--predicate-normalized-and
-pred
-(lambda (arg)
-  ;; Check if there is more than a single match (= many).
-  (when (and one (not (equal one arg)))
-(throw 'orderless--many (cons string point)))
-  (setq one arg)
-  t)))
-  (when one
-;; Prepend prefix if the candidate does not already have the same
-;; prefix.  This workaround is needed since the predicate may 
either
-;; receive an unprefixed or a prefixed candidate as argument.  Most
-;; completion tables consistently call the predicate with 
unprefixed
-;; candidates, for example `completion-file-name-table'.  In 
contrast,
-;; `completion-table-with-context' calls the predicate with 
prefixed
-;; candidates.  This could be an unintended bug or oversight in
-;; `completion-table-with-context'.
-(unless (or (equal prefix "")
-(and (string-prefix-p prefix one)
- (test-completion one table pred)))
-  (setq one (concat prefix one)))
-(or (equal string one) ;; Return t for unique exact match
-(cons one (length one
+  (or
+   (pcase orderless-expand-substring
+ ('nil nil)
+ ('prefix (completion-emacs21-try-completion string table pred point))
+ (_ (completion-substring-try-completion string table pred point)))
+   (catch 'orderless--many
+ (pcase-let ((`(,prefix ,regexps ,ignore-case ,pred)
+  (orderless--compile string table pred))
+ (one nil))
+   ;; Abuse all-completions/orderless--filter as a fast search loop.
+   ;; Should be almost allocation-free since our "predicate" is not
+   ;; called more than two times.
+   (orderless--filter
+prefix regexps ignore-case table
+(orderless--predicate-normalized-and
+ pred
+ (lambda (arg)
+   ;; Check if there is more than a single match (= 

[nongnu] elpa/haskell-ts-mode 3c68ec42d1: Added optional highlihgting to type signature

2024-09-05 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 3c68ec42d1369f1579606ef4cebb871e7c65b030
Author: pranshu 
Commit: pranshu 

Added optional highlihgting to type signature

Disabled by default
---
 README.org | 18 +++---
 haskell-ts-mode.el | 19 ---
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index 6910ee9fac..95069bbe08 100644
--- a/README.org
+++ b/README.org
@@ -66,21 +66,25 @@ implement indentation, so I thought why not use tree sitter?
 The package is avaiable on elpa, you can install it using:
 M-x package-install RET haskell-ts-mode RET
 
-#+BEGIN_SRC: elisp
+#+begin_src elisp
 (add-to-list 'load-path "path/to/haskell-ts-mode")
 (require 'haskell-ts-mode)
-#+END_SRC
+#+end_src
 
 * Customization
 
-if colour is too much or too less for you, adjust
+If colour is too much or too less for you, adjust
 treesit-font-lock-level accordingly.
 
-If that is not enough, you can customize haskell-ts-font-lock-feature-list
+If you want to highlight signature declarations (disabled by default),
+add the following to your init file:
+#+begin_src emacs-lisp
+(setq haskell-ts-highlight-signature t)
+#+end_src
 
 ** how to disable haskell-ts-mode indentation
 
-#+begin_src: emacs-lisp
+#+begin_src emacs-lisp
 (setq haskell-ts-use-indent nil)
 #+end_src
 
@@ -88,7 +92,7 @@ If that is not enough, you can customize 
haskell-ts-font-lock-feature-list
 prettify symbols mode can be used to replace common symbols with
 unicode alternatives.
 
-#+begin_src: emacs-lisp
+#+begin_src emacs-lisp
 (add-hook 'haskell-ts-mode 'prettify-symbols-mode)
 #+end_src
 
@@ -98,7 +102,7 @@ set haskell-ts-font-lock-level accordingly.
 ** Language server
 haskell-ts-mode is not compatiable with lsp-haskell. To enable eglot
 support, use the following function:
-#+begin_src: emacs-lisp
+#+begin_src emacs-lisp
 (with-eval-after-load 'eglot (haskell-ts-setup-eglot))
 #+end_src
 
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 2c965cd52a..e17df7f466 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -44,8 +44,17 @@
   "Group that contains haskell-ts-mode variables"
   :group 'langs)
 
+(defcustom haskell-ts-highlight-signature nil
+  "Set to non-nil to enable highlighting of signature names."
+  :type 'boolean
+  :group 'haskell-ts-mode)
+
 (defvar haskell-ts-font-lock-feature-list
-  '((comment str pragma parens)
+  `(,(funcall
+  (if haskell-ts-highlight-signature
+ (lambda (ls) (append ls '(type-sig)))
+   'identity)
+  '(comment str pragma parens))
 (type definition function args)
 (match keyword)
 (otherwise signature)))
@@ -83,6 +92,10 @@
`(((match (guards guard: (boolean (variable) @font-lock-keyword-face)))
   (:match "otherwise" @font-lock-keyword-face)))
:language 'haskell
+   :feature 'type-sig
+   "(signature (binding_list (variable) @font-lock-doc-markup-face))
+(signature (variable) @font-lock-doc-markup-face)"
+   :language 'haskell
:feature 'args
:override 'keep
(concat
@@ -159,7 +172,7 @@

;; in
((node-is "^in$") parent 0)
- 
+   
;; list
((node-is "]") parent 0)
((parent-is "list") parent 1)
@@ -188,7 +201,7 @@
(no-node prev-adaptive-prefix 0)

((parent-is "data_constructors") parent 0)
- 
+   
;; where
((lambda (node _ _)
  (let ((n (treesit-node-prev-sibling node)))



[nongnu] elpa/proof-general 39f967e5ef 04/10: Change _CoqProject separator settings

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 39f967e5ef5c8d4dfed3419138026cb02ebff71d
Author: Columbus240 <8899730+columbus...@users.noreply.github.com>
Commit: Columbus240 <8899730+columbus...@users.noreply.github.com>

Change _CoqProject separator settings

According to the code of coq_makefile, `\r` is not considered
white-space in _CoqProject.

(https://github.com/coq/coq/blob/a7f51315db5d70888af3b96a579eb799a2b45ca9/lib/coqProject_file.ml#L84)
---
 coq/coq-system.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coq/coq-system.el b/coq/coq-system.el
index 28c9dce4f3..ad65cc4bc2 100644
--- a/coq/coq-system.el
+++ b/coq/coq-system.el
@@ -550,7 +550,7 @@ alreadyopen is t if buffer already existed."
  (find-file-noselect projectfile t t
  (list projectbuffer projectbufferalreadyopen))
 
-(defconst coq--project-file-separator "[\r\n[:space:]]+")
+(defconst coq--project-file-separator "[\r\t\n[:space:]]+")
 
 (defconst coq--makefile-switch-arities
   '(("-R" . 2)



[nongnu] elpa/proof-general 067bffa4bb 07/10: Merge pull request #782 from Matafou/fix-no-strip-newlines

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 067bffa4bb0f11f163a7c47b4cb562e37b1fbe46
Merge: c3e6c391e7 037baeafcb
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #782 from Matafou/fix-no-strip-newlines

Fix #781 PG does not position to error + other buggy locations.
---
 ci/coq-tests.el   |  86 ++---
 ci/test_error_loc_1.v |   9 +++
 coq/coq.el| 150 ++
 3 files changed, 164 insertions(+), 81 deletions(-)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index 9b2a96d661..78e53dcf93 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -255,12 +255,83 @@ For example, COMMENT could be (*test-definition*)"
(coq-test-full-path "test_stepwise.v")
(lambda ()
  (coq-test-goto-before " (*test-lemma2*)")
- (let ((proof-point (save-excursion (coq-test-goto-after "(*error*)" 
- (proof-goto-point)
- (proof-shell-wait)
- (coq-should-buffer-string "Error: Unable to unify \"false\" with 
\"true\".")
- (should (equal (proof-queue-or-locked-end) proof-point))
-
+ ;; redefining this function locally so that self removing spans
+ ;; remain longer. Cf span.el
+ (cl-letf (((symbol-function 'span-make-self-removing-span)
+(lambda (beg end &rest props)
+  (let ((ol (span-make beg end)))
+(while props
+  (overlay-put ol (car props) (cadr props))
+  (setq props (cddr props)))
+(add-timeout 10 'delete-overlay ol)
+ol
+   
+   (let ((proof-point (save-excursion (coq-test-goto-after "(*error*)") 
(point)))
+ (proof-cmd-point (save-excursion
+(coq-test-goto-after "(*error*)")
+(re-search-forward "reflexivity")
+(re-search-backward "reflexivity" 
+ (proof-goto-point)
+ (proof-shell-wait)
+ (coq-should-buffer-string "Error: Unable to unify \"false\" with 
\"true\".")
+ ;; checking that there is an overlay with warning face exactly
+ ;; on "reflexivity". WARNING: this overlat lasts only for 2
+ ;; secs, if this test is done in a (very) slow virtual machine
+ ;; this may fail.
+ (should (equal (point) proof-cmd-point))
+ (let ((sp (span-at proof-cmd-point 'face)))
+   (should sp)
+   (should (equal (span-property sp 'face) 'proof-warning-face))
+   (should (equal (span-start sp) proof-cmd-point))
+   ;; coq-8.11 used to hace ending ps shifted by one
+   (should (or (equal (span-end sp) (+ proof-cmd-point (length 
"reflexivity")))
+   (equal (span-end sp) (+ 1 proof-cmd-point (length 
"reflexivity")
+   )
+ (should (equal (proof-queue-or-locked-end) proof-point)))
+
+
+;; Testing the error location for curly braces specifically. Coq bug
+;; #19355 (coq <= 8.20) needs to be worked around.
+(ert-deftest 51_coq-test-error-highlight ()
+  "Test error highlghting for curly brace."
+  (coq-fixture-on-file
+   (coq-test-full-path "test_error_loc_1.v")
+   (lambda ()
+ (coq-test-goto-before " (*test-lemma*)")
+ ;; redefining this function locally so that self removing spans
+ ;; remain longer. Cf span.el
+ (cl-letf (((symbol-function 'span-make-self-removing-span)
+(lambda (beg end &rest props)
+  (let ((ol (span-make beg end)))
+(while props
+  (overlay-put ol (car props) (cadr props))
+  (setq props (cddr props)))
+(add-timeout 10 'delete-overlay ol)
+ol
+   
+   (let ((proof-point (save-excursion (coq-test-goto-after "(*error*)") 
(point)))
+ (proof-cmd-point (save-excursion
+(coq-test-goto-after "(*error*)")
+(re-search-forward "}")
+(re-search-backward "}" 
+ (coq-test-goto-before " (*test-lemma*)")
+ (proof-goto-point)
+ (proof-shell-wait)
+ (coq-should-buffer-string "Error: The proof is not focused")
+ ;; checking that there is an overlay with warning face exactly
+ ;; on "reflexivity". WARNING: this overlat lasts only for 2
+ ;; secs, if this test is done in a (very) slow virtual machine
+ ;; this may fail.
+ (should (equal (point) proof-cmd-point))
+ (let ((sp (span-at proof-cmd-point 'face)))
+   (should sp)
+   (should (equal (span-property sp 'face) 'proof-warning-face))
+   (should (equal (span-start sp) proof-cmd-point))
+   ;; coq-8.11 used to hace ending ps shifted by one
+   (should (or (equal (span-end sp) (+ proof-cmd-point (length "}")))
+   (equal (span-end sp) (+ 1 pr

[nongnu] elpa/proof-general 9c8cf89e81 02/10: EasyCrypt: add `ecall` keyword

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 9c8cf89e81e173418b1657da1bd2b72a131d52f8
Author: Rui Fernandes 
Commit: Rui Fernandes 

EasyCrypt: add `ecall` keyword
---
 easycrypt/easycrypt-keywords.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/easycrypt/easycrypt-keywords.el b/easycrypt/easycrypt-keywords.el
index feb64fb10e..fa5ab97116 100644
--- a/easycrypt/easycrypt-keywords.el
+++ b/easycrypt/easycrypt-keywords.el
@@ -150,6 +150,7 @@
   "sim"
   "skip"
   "call"
+  "ecall"
   "rcondt"
   "rcondf"
   "swap"



[nongnu] elpa/proof-general 734bcdb27f 10/10: Merge pull request #776 from jgarte/jgarte-patch-1

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 734bcdb27fdcf54fbe6ab05bf957408e70c69748
Merge: 1b89aa3611 c70d0732ca
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #776 from jgarte/jgarte-patch-1

Update Makefile
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4d8f51ccab..7a5df56023 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ ELISP_EXTRAS=
 # to be installed
 EXTRA_DIRS = images
 
-DOC_FILES=AUTHORS BUGS COMPATIBILITY CHANGES COPYING INSTALL README doc/*.pdf
+DOC_FILES=AUTHORS BUGS COMPATIBILITY CHANGES COPYING INSTALL README.md 
doc/*.pdf
 DOC_EXAMPLES=pgshell/*.pgsh phox/*.phx
 DOC_SUBDIRS=${DOC_EXAMPLES} */README* */CHANGES */BUGS 
 



[nongnu] elpa/proof-general 1b89aa3611 09/10: Merge pull request #783 from ruipedro16/add-ecall-keyword

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 1b89aa361149dac88005d491894f21a8d83df6fc
Merge: 11dcebe247 9c8cf89e81
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #783 from ruipedro16/add-ecall-keyword

EasyCrypt: add `ecall` keyword
---
 easycrypt/easycrypt-keywords.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/easycrypt/easycrypt-keywords.el b/easycrypt/easycrypt-keywords.el
index feb64fb10e..fa5ab97116 100644
--- a/easycrypt/easycrypt-keywords.el
+++ b/easycrypt/easycrypt-keywords.el
@@ -150,6 +150,7 @@
   "sim"
   "skip"
   "call"
+  "ecall"
   "rcondt"
   "rcondf"
   "swap"



[nongnu] elpa/proof-general c70d0732ca 01/10: Update Makefile

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit c70d0732caf24bcf7c24b2da8e8e557e5f34de21
Author: Jorge Gomez 
Commit: GitHub 

Update Makefile
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4d8f51ccab..7a5df56023 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ ELISP_EXTRAS=
 # to be installed
 EXTRA_DIRS = images
 
-DOC_FILES=AUTHORS BUGS COMPATIBILITY CHANGES COPYING INSTALL README doc/*.pdf
+DOC_FILES=AUTHORS BUGS COMPATIBILITY CHANGES COPYING INSTALL README.md 
doc/*.pdf
 DOC_EXAMPLES=pgshell/*.pgsh phox/*.phx
 DOC_SUBDIRS=${DOC_EXAMPLES} */README* */CHANGES */BUGS 
 



[nongnu] elpa/proof-general 05e3dc3ad4 03/10: Remove duplicate def. of `coq-looking-at-comment`

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 05e3dc3ad4482a166be120b65930f9b5aa19d8db
Author: Columbus240 <8899730+columbus...@users.noreply.github.com>
Commit: Columbus240 <8899730+columbus...@users.noreply.github.com>

Remove duplicate def. of `coq-looking-at-comment`
---
 coq/coq-indent.el | 5 -
 1 file changed, 5 deletions(-)

diff --git a/coq/coq-indent.el b/coq/coq-indent.el
index e4f72c0367..b1e3e0425b 100644
--- a/coq/coq-indent.el
+++ b/coq/coq-indent.el
@@ -264,11 +264,6 @@ if found, to (point-max) otherwise.  Return t if found, 
nil otherwise."
   (setq nbopen (- nbopen 1
   (= nbopen 0
 
-(defun coq-looking-at-comment ()
-  "Return non-nil if point is inside a comment."
-  (or (proof-inside-comment (point))
-  (proof-inside-comment (+ 1 (point)
-
 (defun coq-find-comment-start ()
   "Go to the current comment start.
 If inside nested comments, go to the start of the outer most comment.



[nongnu] elpa/proof-general 16b70c953c 05/10: Fix #781 PG does not position to error.

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 16b70c953cc999a1d271eaecce90edd104d80af9
Author: Pierre Courtieu 
Commit: Pierre Courtieu 

Fix #781 PG does not position to error.

Tests is also added to check the exact position of the error
highlighting.

Description of the fix.

We cannot use the " ^^^ " thing to compute the error location because
commands are not stripped of newlines anymore (#774).

Solution: use the character position information given in the error
message with the following subtleties:

- position are given by coq **bytes** positions.
- position given by coq is the position from the previous "." fed to
  coq. I.e. we must be careful to strip any blank after the final "." of
  a command.
- Coq < 8.11 has a small glitch on positions, the test is compatible
  with both behaviour.
- coq <= 8.20 has a bug on position for curly braces.

In the test we make the disappearing timeout of overlay bigger
so that tests don't fail on slow VMs (maybe useless).

NOTE: coq error locations are quite wrong when we insert
spaces (instead of a newline) after a command. PG was wrongly
inserting a space after Set Silent./ Unset Silent, which triggered
this problem. This is fixed by this PR. But other silent commends
should triped of trailing blanks. I leave it to another PR.
---
 ci/coq-tests.el   |  86 ++-
 ci/test_error_loc_1.v |   9 +
 coq/coq.el| 100 ++
 3 files changed, 138 insertions(+), 57 deletions(-)

diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index 9b2a96d661..78e53dcf93 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -255,12 +255,83 @@ For example, COMMENT could be (*test-definition*)"
(coq-test-full-path "test_stepwise.v")
(lambda ()
  (coq-test-goto-before " (*test-lemma2*)")
- (let ((proof-point (save-excursion (coq-test-goto-after "(*error*)" 
- (proof-goto-point)
- (proof-shell-wait)
- (coq-should-buffer-string "Error: Unable to unify \"false\" with 
\"true\".")
- (should (equal (proof-queue-or-locked-end) proof-point))
-
+ ;; redefining this function locally so that self removing spans
+ ;; remain longer. Cf span.el
+ (cl-letf (((symbol-function 'span-make-self-removing-span)
+(lambda (beg end &rest props)
+  (let ((ol (span-make beg end)))
+(while props
+  (overlay-put ol (car props) (cadr props))
+  (setq props (cddr props)))
+(add-timeout 10 'delete-overlay ol)
+ol
+   
+   (let ((proof-point (save-excursion (coq-test-goto-after "(*error*)") 
(point)))
+ (proof-cmd-point (save-excursion
+(coq-test-goto-after "(*error*)")
+(re-search-forward "reflexivity")
+(re-search-backward "reflexivity" 
+ (proof-goto-point)
+ (proof-shell-wait)
+ (coq-should-buffer-string "Error: Unable to unify \"false\" with 
\"true\".")
+ ;; checking that there is an overlay with warning face exactly
+ ;; on "reflexivity". WARNING: this overlat lasts only for 2
+ ;; secs, if this test is done in a (very) slow virtual machine
+ ;; this may fail.
+ (should (equal (point) proof-cmd-point))
+ (let ((sp (span-at proof-cmd-point 'face)))
+   (should sp)
+   (should (equal (span-property sp 'face) 'proof-warning-face))
+   (should (equal (span-start sp) proof-cmd-point))
+   ;; coq-8.11 used to hace ending ps shifted by one
+   (should (or (equal (span-end sp) (+ proof-cmd-point (length 
"reflexivity")))
+   (equal (span-end sp) (+ 1 proof-cmd-point (length 
"reflexivity")
+   )
+ (should (equal (proof-queue-or-locked-end) proof-point)))
+
+
+;; Testing the error location for curly braces specifically. Coq bug
+;; #19355 (coq <= 8.20) needs to be worked around.
+(ert-deftest 51_coq-test-error-highlight ()
+  "Test error highlghting for curly brace."
+  (coq-fixture-on-file
+   (coq-test-full-path "test_error_loc_1.v")
+   (lambda ()
+ (coq-test-goto-before " (*test-lemma*)")
+ ;; redefining this function locally so that self removing spans
+ ;; remain longer. Cf span.el
+ (cl-letf (((symbol-function 'span-make-self-removing-span)
+(lambda (beg end &rest props)
+  (let ((ol (span-make beg end)))
+(while props
+  (overlay-put ol (car props) (cadr props))
+  (setq props (cddr props)))
+(add-timeout 10 'delete-overlay ol)
+ol
+   
+   (let ((proof-point (save-excursion (coq-test-goto-after "(*err

[nongnu] elpa/sweeprolog bd31199a34 2/2: Announce recent changes in NEWS.org and bump version to 0.27.6

2024-09-05 Thread ELPA Syncer
branch: elpa/sweeprolog
commit bd31199a34c0619b346954f25875fcb7239e2b86
Author: Eshel Yaron 
Commit: Eshel Yaron 

Announce recent changes in NEWS.org and bump version to 0.27.6
---
 NEWS.org  | 8 
 sweep.texi| 4 ++--
 sweeprolog.el | 2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 30ff451ff9..7c51622476 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -11,6 +11,14 @@ SWI-Prolog in Emacs.
 For further details, see the Sweep manual:
 [[https://eshelyaron.com/sweep.html][https://eshelyaron.com/sweep.html]].
 
+* Version 0.27.6 on 2024-09-05
+
+This is a maintenance release, including a couple of bug fixes:
+
+** Fix crash when closing top-level with recent SWI-Prolog versions
+
+** Recognize variable names with underscores between words
+
 * Version 0.27.5 on 2024-04-11
 
 ** Work around Emacs reliance on certain locale settings
diff --git a/sweep.texi b/sweep.texi
index 134ba9515b..b658249800 100644
--- a/sweep.texi
+++ b/sweep.texi
@@ -11,7 +11,7 @@
 @c %**end of header
 
 @copying
-This manual is for Sweep (version 0.27.5), an Emacs package providing
+This manual is for Sweep (version 0.27.6), an Emacs package providing
 an embedded SWI-Prolog runtime inside of Emacs along with an advanced
 SWI-Prolog development environment.
 
@@ -42,7 +42,7 @@ Invariant Sections, no Front-Cover Texts, and no Back-Cover 
Texts.
 @node Top
 @top Sweep: SWI-Prolog Embedded in Emacs
 
-This manual is for Sweep (version 0.27.5), an Emacs package providing
+This manual is for Sweep (version 0.27.6), an Emacs package providing
 an embedded SWI-Prolog runtime inside of Emacs along with an advanced
 SWI-Prolog development environment.
 
diff --git a/sweeprolog.el b/sweeprolog.el
index 73f555fc33..15b593b992 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Eshel Yaron <~eshel/d...@lists.sr.ht>
 ;; Keywords: prolog languages extensions
 ;; URL: https://git.sr.ht/~eshel/sweep
-;; Package-Version: 0.27.5
+;; Package-Version: 0.27.6
 ;; Package-Requires: ((emacs "27.1") (compat "29.1.4.2"))
 
 ;; This file is NOT part of GNU Emacs.



[nongnu] elpa/proof-general 037baeafcb 06/10: Stripping hardwired command strings from trailing spaces.

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 037baeafcbda9215ff0241cbd11ef46b3d0f99a4
Author: Pierre Courtieu 
Commit: Pierre Courtieu 

Stripping hardwired command strings from trailing spaces.
---
 coq/coq.el | 50 ++
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/coq/coq.el b/coq/coq.el
index 84e7c83fd5..4eb4938106 100644
--- a/coq/coq.el
+++ b/coq/coq.el
@@ -121,8 +121,8 @@ Namely, goals that do not fit in the goals window."
  ;; Should this variable be buffer-local? No opinion on that but if yes we
  ;; should re-intialize to coq-search-blacklist-string instead of
  ;; keeping the current value (that may come from another file).
- ,(format "Add Search Blacklist %s. " coq-search-blacklist-current-string))
-   '("Set Suggest Proof Using. ") coq-user-init-cmd)
+ ,(format "Add Search Blacklist %s." coq-search-blacklist-current-string))
+   '("Set Suggest Proof Using.") coq-user-init-cmd)
   "Command to initialize the Coq Proof Assistant.")
 
 ;; FIXME: Even if we don't use coq-indent for indentation, we still need it for
@@ -704,7 +704,7 @@ If locked span already has a state number, then do nothing. 
Also updates
   (if (= proofdepth 0) (proof-clean-buffer proof-goals-buffer))
   (setq coq--retract-naborts naborts)
   (list
-   (format "BackTo %s . "
+   (format "BackTo %s ."
(int-to-string span-staten))
 
 (defvar coq-current-goal 1
@@ -897,7 +897,7 @@ is nil (t by default)."
   (if shft (if id "About" "Locate")
 (if ctrl (if id "Print" "Locate")))
 (proof-shell-invisible-command
- (format (concat  cmd " %s . ")
+ (format (concat  cmd " %s .")
  ;; Notation need to be surrounded by ""
  (if id id (concat "\"" notat "\""
 
@@ -925,7 +925,7 @@ Otherwise propose identifier at point if any."
 (proof-shell-ready-prover)
 (setq cmd (coq-guess-or-ask-for-string ask dontguess))
 (proof-shell-invisible-command
- (format (concat do " %s . ") (funcall postform cmd))
+ (format (concat do " %s .") (funcall postform cmd))
  wait)))
 
 
@@ -946,12 +946,12 @@ the time of writing this documentation)."
 ;; to trigger "Show" or anything that we usually insert after a group of
 ;; commands.
 (unless flag-is-on (proof-shell-invisible-command
-(format " %s . " (funcall postform setcmd))
+(format " %s ." (funcall postform setcmd))
 nil nil 'no-response-display 'empty-action-list))
 (proof-shell-invisible-command
- (format " %s . " (funcall postform cmd)) 'wait nil 'empty-action-list)
+ (format " %s ." (funcall postform cmd)) 'wait nil 'empty-action-list)
 (unless flag-is-on (proof-shell-invisible-command
-(format " %s . " (funcall postform unsetcmd))
+(format " %s ." (funcall postform unsetcmd))
 'waitforit  nil 'no-response-display 
'empty-action-list
 
 (defun coq-ask-do-set-unset (ask do setcmd unsetcmd
@@ -991,7 +991,7 @@ UNSETCMD.  See `coq-command-with-set-unset'."
   ;;   (setq cmd (coq-guess-or-ask-for-string ask dontguess))
   ;;   (coq-command-with-set-unset
   ;;"Set Printing Implicit"
-  ;;(format (concat do " %s . ") cmd)
+  ;;(format (concat do " %s .") cmd)
   ;;"Unset Printing Implicit" )
   ;;   ))
 
@@ -1086,7 +1086,7 @@ This is specific to `coq-mode'."
))
 
 (defun coq-set-undo-limit (undos)
-  (proof-shell-invisible-command (format "Set Undo %s . " undos)))
+  (proof-shell-invisible-command (format "Set Undo %s ." undos)))
 
 (defun coq-Pwd ()
   "Display the current Coq working directory."
@@ -1760,7 +1760,7 @@ See  `coq-fold-hyp'."
 (coq-fold-hyp h)))
 ;;;
 
-(proof-definvisible coq-PrintHint "Print Hint. ")
+(proof-definvisible coq-PrintHint "Print Hint.")
 
 ;; Items on show menu
 (proof-definvisible coq-show-tree "Show Tree.")
@@ -1784,8 +1784,8 @@ See  `coq-fold-hyp'."
 (proof-definvisible coq-set-printing-wildcards "Set Printing Wildcard.")
 (proof-definvisible coq-unset-printing-wildcards "Unset Printing Wildcard.")
 ; Takes an argument
-;(proof-definvisible coq-set-printing-printing-depth "Set Printing Printing 
Depth . ")
-;(proof-definvisible coq-unset-printing-printing-depth "Unset Printing 
Printing Depth . ")
+;(proof-definvisible coq-set-printing-printing-depth "Set Printing Printing 
Depth .")
+;(proof-definvisible coq-unset-printing-printing-depth "Unset Printing 
Printing Depth .")
 
 ;; Persistent setting, non-boolean, non cross-version compatible (Coq >= 8.10)
 (defconst coq-diffs--function #'coq-diffs
@@ -1903,11 +1903,11 @@ at `proof-assistant-settings-cmds' evaluation time.")
   (setq proof-query-file-save-when-activating-scripting nil)
 
   ;; Commands sent to proof engine
-  (setq proof-showproof-command "Show. "
-proof-conte

[nongnu] elpa/proof-general updated (c3e6c391e7 -> 734bcdb27f)

2024-09-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/proof-general.

  from  c3e6c391e7 Merge pull request #778 from hendriktews/ci-rc
   new  16b70c953c Fix #781 PG does not position to error.
   new  037baeafcb Stripping hardwired command strings from trailing spaces.
   new  067bffa4bb Merge pull request #782 from 
Matafou/fix-no-strip-newlines
   new  05e3dc3ad4 Remove duplicate def. of `coq-looking-at-comment`
   new  39f967e5ef Change _CoqProject separator settings
   new  11dcebe247 Merge pull request #784 from Columbus240/CoqProject
   new  9c8cf89e81 EasyCrypt: add `ecall` keyword
   new  1b89aa3611 Merge pull request #783 from ruipedro16/add-ecall-keyword
   new  c70d0732ca Update Makefile
   new  734bcdb27f Merge pull request #776 from jgarte/jgarte-patch-1


Summary of changes:
 Makefile|   2 +-
 ci/coq-tests.el |  86 ---
 ci/test_error_loc_1.v   |   9 +++
 coq/coq-indent.el   |   5 --
 coq/coq-system.el   |   2 +-
 coq/coq.el  | 150 +---
 easycrypt/easycrypt-keywords.el |   1 +
 7 files changed, 167 insertions(+), 88 deletions(-)
 create mode 100644 ci/test_error_loc_1.v



[nongnu] elpa/proof-general 11dcebe247 08/10: Merge pull request #784 from Columbus240/CoqProject

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 11dcebe247632f91c162392b4b7b3c37a9ded44a
Merge: 067bffa4bb 39f967e5ef
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #784 from Columbus240/CoqProject

Change _CoqProject separator settings
---
 coq/coq-indent.el | 5 -
 coq/coq-system.el | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/coq/coq-indent.el b/coq/coq-indent.el
index e4f72c0367..b1e3e0425b 100644
--- a/coq/coq-indent.el
+++ b/coq/coq-indent.el
@@ -264,11 +264,6 @@ if found, to (point-max) otherwise.  Return t if found, 
nil otherwise."
   (setq nbopen (- nbopen 1
   (= nbopen 0
 
-(defun coq-looking-at-comment ()
-  "Return non-nil if point is inside a comment."
-  (or (proof-inside-comment (point))
-  (proof-inside-comment (+ 1 (point)
-
 (defun coq-find-comment-start ()
   "Go to the current comment start.
 If inside nested comments, go to the start of the outer most comment.
diff --git a/coq/coq-system.el b/coq/coq-system.el
index 28c9dce4f3..ad65cc4bc2 100644
--- a/coq/coq-system.el
+++ b/coq/coq-system.el
@@ -550,7 +550,7 @@ alreadyopen is t if buffer already existed."
  (find-file-noselect projectfile t t
  (list projectbuffer projectbufferalreadyopen))
 
-(defconst coq--project-file-separator "[\r\n[:space:]]+")
+(defconst coq--project-file-separator "[\r\t\n[:space:]]+")
 
 (defconst coq--makefile-switch-arities
   '(("-R" . 2)



[nongnu] elpa/sweeprolog updated (142fba8cc7 -> bd31199a34)

2024-09-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/sweeprolog.

  from  142fba8cc7 ; Minor docstring fixes
   new  650a0339c2 ; Avoid deprecated thread_exit/1
   new  bd31199a34 Announce recent changes in NEWS.org and bump version to 
0.27.6


Summary of changes:
 NEWS.org  | 8 
 sweep.pl  | 4 ++--
 sweep.texi| 4 ++--
 sweeprolog.el | 2 +-
 4 files changed, 13 insertions(+), 5 deletions(-)



[nongnu] elpa/sweeprolog 650a0339c2 1/2: ; Avoid deprecated thread_exit/1

2024-09-05 Thread ELPA Syncer
branch: elpa/sweeprolog
commit 650a0339c26c800cbf298f9c5b96e676e8b7f6f6
Author: Eshel Yaron 
Commit: Eshel Yaron 

; Avoid deprecated thread_exit/1

This circumvents a crash during top-level threads termination.

See https://github.com/SWI-Prolog/swipl-devel/issues/1317.
---
 sweep.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sweep.pl b/sweep.pl
index d4c088d862..bbffab2922 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -2043,11 +2043,11 @@ cleanup_thread_(T) :-
 !,
 thread_detach(T),
 (   thread_property(T, status(running))
-->  thread_signal(T, thread_exit(0))
+->  thread_signal(T, throw(exit))
 ;   true
 ).
 cleanup_thread_(T) :-
-thread_signal(T, thread_exit(0)).
+thread_signal(T, throw(exit)).
 
 sweep_async_goal([GoalString|FD], TId) :-
 term_string(Goal, GoalString),



[elpa] externals/debbugs b0d2f90878: Fix NOCACHE handling

2024-09-05 Thread Michael Albinus via
branch: externals/debbugs
commit b0d2f90878e5c444c931fc4b5b6b961e8e99e8c5
Author: Michael Albinus 
Commit: Michael Albinus 

Fix NOCACHE handling

* debbugs-gnu.el (debbugs-gnu-current-nocache): New defvar.
(debbugs-gnu, debbugs-gnu-show-reports, debbugs-gnu-rescan): Use it.
---
 debbugs-gnu.el | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index f15fbb43ee..d0d1154574 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -470,6 +470,9 @@ The specification which bugs shall be suppressed is taken 
from
 (defvar debbugs-gnu-current-message nil
   "The message to be shown after getting the bugs.")
 
+(defvar debbugs-gnu-current-nocache nil
+  "Whether `debbugs-gnu-rescan' has been called with NOCACHE.")
+
 (defvar debbugs-gnu-current-print-function #'tabulated-list-print
   "Which function to apply printing the tabulated list..
 See `debbugs-gnu-package' for an alternative.")
@@ -911,6 +914,7 @@ value, like in `debbugs-gnu-get-bugs' or 
`debbubgs-gnu-tagged'."
   debbugs-gnu-current-suppress nil
debbugs-gnu-current-id nil
debbugs-gnu-current-message nil
+   debbugs-gnu-current-nocache nil
debbugs-gnu-show-reports-function
debbugs-gnu-default-show-reports-function)
 
@@ -926,6 +930,7 @@ value, like in `debbugs-gnu-get-bugs' or 
`debbubgs-gnu-tagged'."
debbugs-gnu-current-suppress nil
 debbugs-gnu-current-id nil
 debbugs-gnu-current-message nil
+debbugs-gnu-current-nocache nil
 debbugs-gnu-show-reports-function
 debbugs-gnu-default-show-reports-function
 
@@ -1040,7 +1045,9 @@ are taken from the cache instead."
 ;; Print bug reports.
 (dolist (status
 (sort
- (let ((debbugs-cache-expiry (if offline nil debbugs-cache-expiry))
+ (let ((debbugs-cache-expiry
+ (if offline nil
+   (or debbugs-gnu-current-nocache debbugs-cache-expiry)))
ids)
(apply #'debbugs-get-status
   (if offline
@@ -1321,9 +1328,9 @@ Interactively, it is non-nil with the prefix argument."
debbugs-gnu-current-filter debbugs-gnu-local-filter
debbugs-gnu-current-suppress debbugs-gnu-local-suppress
 debbugs-gnu-current-id (debbugs-gnu-current-id t)
-   debbugs-gnu-current-print-function debbugs-gnu-local-print-function
-   debbugs-cache-expiry (if nocache t debbugs-cache-expiry)
-debbugs-gnu-current-message "Reverting finished")
+debbugs-gnu-current-message "Reverting finished"
+   debbugs-gnu-current-nocache (and nocache t)
+   debbugs-gnu-current-print-function debbugs-gnu-local-print-function)
   (message "Reverting buffer")
   (debbugs-gnu nil))
 



[nongnu] elpa/gptel b7a147d624: gptel-rewrite: Add a better refactor/rewrite system

2024-09-05 Thread ELPA Syncer
branch: elpa/gptel
commit b7a147d624e15aabaaecf1119ba5894552e18527
Author: Karthik Chikmagalur 
Commit: Karthik Chikmagalur 

gptel-rewrite: Add a better refactor/rewrite system

* gptel-transient.el (gptel-menu): Move all the rewriting-related
functions and transient items into gptel-rewrite.

* gptel-rewrite.el (gptel-rewrite-actions-map,
gptel--rewrite-overlays, gptel--rewrite-sanitize-overlays,
gptel--refactor-or-rewrite, gptel--rewrite-message,
gptel--rewrite-key-help, gptel--rewrite-overlay-at,
gptel--rewrite-prepare-buffer, gptel--rewrite-clear,
gptel--rewrite-apply, gptel--rewrite-diff, gptel--rewrite-ediff,
gptel-rewrite-menu, gptel--infix-rewrite-prompt,
gptel--rewrite-infix-diff:-U, gptel--suffix-rewrite,
gptel--suffix-rewrite-diff, gptel--suffix-rewrite-ediff,
gptel--suffix-rewrite-apply, gptel--suffix-rewrite-clear): Add new
rewrite system to gptel.  It works as follows:
- Refactoring is a two step process.
- Step 1: Select a region, and from gptel's rewrite menu, set a
refactoring directive and call
`gptel--suffix-rewrite`.  The transient will exit and you can use
Emacs as normal.
- Step 2: When the refactored text is ready, the region being
refactored will be highlighted.  You can then accept or reject the
changes, and diff or ediff the changes.  You can do this from the
rewrite menu (it will recognize a refactor "in progress"), or just
by moving the cursor into the highlighted region and using
keybindings.  Keybinding hints are provided if eldoc-mode is on, or
if you hover over the highlighted region.

There are several advantages to this asynchronous method:
- You can refactor several regions and diff the whole buffer from
the transient menu.
- You can have several refactoring sessions simultaneously active.
- The Diff and Ediff methods are much more robust than before.

This is a tentative release, and the UI will change further
depending on feedback.
---
 gptel-rewrite.el   | 345 +
 gptel-transient.el | 130 ++--
 2 files changed, 353 insertions(+), 122 deletions(-)

diff --git a/gptel-rewrite.el b/gptel-rewrite.el
new file mode 100644
index 00..0c6faa171f
--- /dev/null
+++ b/gptel-rewrite.el
@@ -0,0 +1,345 @@
+;;; gptel-rewrite.el --- Refactoring functions for gptel  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2024  Karthik Chikmagalur
+
+;; Author: Karthik Chikmagalur 
+;; Keywords: hypermedia, convenience, tools
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+(require 'gptel)
+(require 'transient)
+(require 'cl-lib)
+
+(defvar eldoc-documentation-functions)
+(defvar diff-entire-buffers)
+
+(declare-function diff-no-select "diff")
+
+
+;; * Variables
+
+(defvar-keymap gptel-rewrite-actions-map
+  :doc "Keymap for gptel rewrite actions at point."
+  "C-c C-k" 'gptel--rewrite-clear
+  "C-c C-a" 'gptel--rewrite-apply
+  "C-c C-d" 'gptel--rewrite-diff
+  "C-c C-e" 'gptel--rewrite-ediff)
+
+(defvar-local gptel--rewrite-overlays nil
+  "List of active rewrite overlays in the buffer.")
+
+(defvar-local gptel--rewrite-message nil)
+
+;; * Helper functions
+
+(defun gptel--rewrite-sanitize-overlays ()
+  "TODO"
+  (setq gptel--rewrite-overlays
+(cl-delete-if-not #'overlay-buffer
+  gptel--rewrite-overlays)))
+
+(defun gptel--refactor-or-rewrite ()
+  "Rewrite should be refactored into refactor.
+
+Or is it the other way around?"
+  (if (derived-mode-p 'prog-mode)
+  "Refactor" "Rewrite"))
+
+(defun gptel--rewrite-message ()
+  "Set a generic refactor/rewrite message for the buffer."
+  (if (derived-mode-p 'prog-mode)
+  (format "You are a %s programmer. Generate only code, no explanation, no 
code fences. Refactor the following code."
+  (gptel--strip-mode-suffix major-mode))
+(format "You are a prose editor. Rewrite the following text to be more 
professional.")))
+
+(defun gptel--rewrite-key-help (callback)
+  "Eldoc documentation function for gptel rewrite actions.
+
+CALLBACK is supplied by Eldoc, see
+`eldoc-documentation-functions'."
+  (when (and gptel--rewrite-overlays
+ (get-char-property (point) 'gptel-rewrite))
+  (funcall callback
+   (forma

[nongnu] elpa/proof-general 6200721187 1/2: Adding unicode arrow >->

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 62007211878246a33281d4fcb9cc881cad39a154
Author: Alessandro Bruni 
Commit: GitHub 

Adding unicode arrow >->
---
 coq/coq-unicode-tokens.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coq/coq-unicode-tokens.el b/coq/coq-unicode-tokens.el
index c4a26b7bab..0b8555aa28 100644
--- a/coq/coq-unicode-tokens.el
+++ b/coq/coq-unicode-tokens.el
@@ -124,6 +124,7 @@
 ("<=" "≤")
 (">=" "≥")
 ("=>" "⇒")
+(">->" "↣")
 ("->" "→")  ; or ⟶ or ⟹ if you prefer
 ("<-" "←")  ; or ⟵ or ⟸
 ("<->" "↔") ; or ⟷ ...



[nongnu] elpa/proof-general 3a99da2755 2/2: Merge pull request #741 from hoheinzollern/patch-1

2024-09-05 Thread ELPA Syncer
branch: elpa/proof-general
commit 3a99da275523c8f844fdfa3dd073295eece939f3
Merge: 734bcdb27f 6200721187
Author: Pierre Courtieu 
Commit: GitHub 

Merge pull request #741 from hoheinzollern/patch-1

Adding unicode arrow >->
---
 coq/coq-unicode-tokens.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coq/coq-unicode-tokens.el b/coq/coq-unicode-tokens.el
index c4a26b7bab..0b8555aa28 100644
--- a/coq/coq-unicode-tokens.el
+++ b/coq/coq-unicode-tokens.el
@@ -124,6 +124,7 @@
 ("<=" "≤")
 (">=" "≥")
 ("=>" "⇒")
+(">->" "↣")
 ("->" "→")  ; or ⟶ or ⟹ if you prefer
 ("<-" "←")  ; or ⟵ or ⟸
 ("<->" "↔") ; or ⟷ ...



[elpa] externals/lin d363ce5db3: Fix missing 'buffer-name' from commit bf14950

2024-09-05 Thread ELPA Syncer
branch: externals/lin
commit d363ce5db37f54915ab842517a0cfce791566807
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix missing 'buffer-name' from commit bf14950

Thanks to Kai von Fintel for reporting this in issue 1:
.
---
 lin.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lin.el b/lin.el
index fb0800f1ae..2100252c69 100644
--- a/lin.el
+++ b/lin.el
@@ -396,7 +396,7 @@ With optional non-nil REVERSE argument, remove those hooks."
 
 (defun lin--buffer-hidden-p (buffer)
   "Return non-nil if BUFFER is hidden."
-  (string-prefix-p " " buffer))
+  (string-prefix-p " " (buffer-name buffer)))
 
 (defun lin--non-hidden-buffers ()
   "Return `buffer-list' without hidden buffers."



[nongnu] elpa/cider 8fdb53e8be: Bump cider-nrepl to 0.50.2 (#3738)

2024-09-05 Thread ELPA Syncer
branch: elpa/cider
commit 8fdb53e8be764704f5023fa024d023bffedf5a8b
Author: Oleksandr Yakushev 
Commit: GitHub 

Bump cider-nrepl to 0.50.2 (#3738)
---
 CHANGELOG.md   |  2 +-
 cider.el   |  2 +-
 dev/docker-sample-project/project.clj  |  2 +-
 dev/tramp-sample-project/project.clj   |  2 +-
 .../ROOT/pages/basics/middleware_setup.adoc| 12 +++---
 doc/modules/ROOT/pages/basics/up_and_running.adoc  |  4 +-
 doc/modules/ROOT/pages/cljs/shadow-cljs.adoc   |  2 +-
 doc/modules/ROOT/pages/cljs/up_and_running.adoc|  2 +-
 test/cider-tests.el| 44 +++---
 9 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 895bf5ecb6..18db4705ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@
 ### Changes
 
 - Bump the injected nREPL version to 1.3.
-- Bump the injected `cider-nrepl` to 
[0.50.1](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0501-2024-08-28).
+- Bump the injected `cider-nrepl` to 
[0.50.2](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0502-2024-09-03).
   * Introduce new backend for CIDER tracing functionality.
   * Remove special handling of Boot classpath.
 - [#3733](https://github.com/clojure-emacs/cider/issues/3733): Remove support 
for sideloading. (this experimental feature was removed from nREPL 1.3)
diff --git a/cider.el b/cider.el
index c08ea43cd4..a8ea1d9b22 100644
--- a/cider.el
+++ b/cider.el
@@ -573,7 +573,7 @@ the artifact.")
 
 Used when `cider-jack-in-auto-inject-clojure' is set to `latest'.")
 
-(defconst cider-required-middleware-version "0.50.1"
+(defconst cider-required-middleware-version "0.50.2"
   "The CIDER nREPL version that's known to work properly with CIDER.")
 
 (defcustom cider-injected-middleware-version cider-required-middleware-version
diff --git a/dev/docker-sample-project/project.clj 
b/dev/docker-sample-project/project.clj
index c91d6f04f0..d640f99332 100644
--- a/dev/docker-sample-project/project.clj
+++ b/dev/docker-sample-project/project.clj
@@ -2,4 +2,4 @@
   :dependencies [[org.clojure/clojure "1.11.1"]
  [clj-http "3.12.3"]]
   :source-paths ["src"]
-  :plugins [[cider/cider-nrepl "0.50.1"]])
+  :plugins [[cider/cider-nrepl "0.50.2"]])
diff --git a/dev/tramp-sample-project/project.clj 
b/dev/tramp-sample-project/project.clj
index 9cec749ead..f97ead85d5 100644
--- a/dev/tramp-sample-project/project.clj
+++ b/dev/tramp-sample-project/project.clj
@@ -2,5 +2,5 @@
   :dependencies [[org.clojure/clojure "1.11.1"]
  [clj-http "3.12.3"]]
   :source-paths ["src"]
-  :plugins [[cider/cider-nrepl "0.50.1"]
+  :plugins [[cider/cider-nrepl "0.50.2"]
 [refactor-nrepl "3.9.0"]])
diff --git a/doc/modules/ROOT/pages/basics/middleware_setup.adoc 
b/doc/modules/ROOT/pages/basics/middleware_setup.adoc
index d9766b832f..fc98507fdf 100644
--- a/doc/modules/ROOT/pages/basics/middleware_setup.adoc
+++ b/doc/modules/ROOT/pages/basics/middleware_setup.adoc
@@ -32,14 +32,14 @@ Use the convenient plugin for defaults, either in your 
project's
 
 [source,clojure]
 
-:plugins [[cider/cider-nrepl "0.50.1"]]
+:plugins [[cider/cider-nrepl "0.50.2"]]
 
 
 A minimal `profiles.clj` for CIDER would be:
 
 [source,clojure]
 
-{:repl {:plugins [[cider/cider-nrepl "0.50.1"]]}}
+{:repl {:plugins [[cider/cider-nrepl "0.50.2"]]}}
 
 
 WARNING: Be careful not to place this in the `:user` profile, as this way 
CIDER's
@@ -59,7 +59,7 @@ all of their projects using a `~/.boot/profile.boot` file 
like so:
 (require 'boot.repl)
 
 (swap! boot.repl/*default-dependencies*
-   concat '[[cider/cider-nrepl "0.50.1"]])
+   concat '[[cider/cider-nrepl "0.50.2"]])
 
 (swap! boot.repl/*default-middleware*
conj 'cider.nrepl/cider-middleware)
@@ -76,11 +76,11 @@ run `cider-connect` or `cider-connect-cljs`.
 
 [source,clojure]
 
-  :cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.50.1"}}
+  :cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.50.2"}}
   :main-opts ["-m" "nrepl.cmdline" "--middleware" 
"[cider.nrepl/cider-middleware]"]}
 
   :cider-cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.339"}
-cider/cider-nrepl {:mvn/version "0.50.1"}
+cider/cider-nrepl {:mvn/version "0.50.2"}
 cider/piggieback {:mvn/version "0.5.3"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware"

"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
@@ -99,7 +99,7 @@ NOTE: Make sure you're using 
https://github.com/clojurephant/clojurephant[Clojur
 
 dependencies {
   devImplementation 'nrepl:nrepl:0.9.0'
-  devImplementation 'cider:cider-nrepl:0.50.1'
+  devImplementation 'cider:cider-nrepl:0.50.2'
 }
 
 tasks.named('c

[nongnu] elpa/gnosis cfa0462972 01/19: packaging: Version 0.4.2-dev

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit cfa0462972a45afd1135ce4814e0652ae68271f8
Author: Thanos Apollo 
Commit: Thanos Apollo 

packaging: Version 0.4.2-dev

* Begin development 0.4.2-dev.
---
 gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnosis.el b/gnosis.el
index 3c04826e30..e0165e641d 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -5,7 +5,7 @@
 ;; Author: Thanos Apollo 
 ;; Keywords: extensions
 ;; URL: https://thanosapollo.org/projects/gnosis
-;; Version: 0.4.1
+;; Version: 0.4.2-dev
 
 ;; Package-Requires: ((emacs "27.2") (emacsql "4.0.0") (compat "29.1.4.2") 
(transient "0.7.2"))
 



[nongnu] elpa/gnosis 487d903de1 04/19: New file: Add manifest.scm

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 487d903de1f3f7463206a52cd480d123331e4c7c
Author: Thanos Apollo 
Commit: Thanos Apollo 

New file: Add manifest.scm

* Packages to run 'make'.
---
 manifest.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/manifest.scm b/manifest.scm
new file mode 100644
index 00..ce98337fa0
--- /dev/null
+++ b/manifest.scm
@@ -0,0 +1,3 @@
+;;
+(specifications->manifest
+  (list "make" "texinfo" "emacs" "emacs-org"))



[nongnu] elpa/gnosis 48ca4aa6f2 07/19: [Refactor] Rewrite org-insert-heading

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 48ca4aa6f2420676de468f3ce43608d4cab41fca
Author: Thanos Apollo 
Commit: Thanos Apollo 

[Refactor] Rewrite org-insert-heading

* Adjust for list answers.
* Use gnosis-id.
---
 gnosis-org.el | 25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/gnosis-org.el b/gnosis-org.el
index e194e88bc7..e977083e58 100644
--- a/gnosis-org.el
+++ b/gnosis-org.el
@@ -64,24 +64,29 @@ BUFFER defaults to the current buffer if not specified."
   (if results (reverse results)
 (message "No custom properties found for %s" property)
 nil
-
-(cl-defun gnosis-org-insert-custom-heading (&key main id body type (buffer 
(current-buffer)))
-  "Insert an Org heading in BUFFER.
+;; TODO: Add support for tags.
+(cl-defun gnosis-org-insert-heading (&key main id answer type)
+  "Insert an Org heading in current buffer.
 
 - MAIN as the title.
-- ID as CUSTOM_ID.
-- BODY as the content.
+- ID as GNOSIS_ID.
+- ANSWER as the subheading.
 - TYPE as the note type.
 
 If BUFFER is not specified, defaults to the current buffer."
   (cl-assert (stringp main) nil "MAIN must be a string representing the 
heading title.")
-  (cl-assert (stringp id) nil "ID must be a string representing the 
CUSTOM_ID.")
-  (cl-assert (stringp body) nil "BODY must be a string representing the 
content.")
+  (cl-assert (stringp id) nil "ID must be a string representing the 
GNOSIS_ID.")
   (cl-assert (stringp type) nil "TYPE must be a string representing the TYPE 
property.")
-  (with-current-buffer buffer
+  (let ((main (if (string-match-p "\n" main) (replace-regexp-in-string "\n" 
"n" main) main))
+   (answer (cond ((stringp answer)
+  answer)
+ ((numberp answer)
+  (number-to-string answer))
+ (t (mapconcat 'identity answer ", ")
 (goto-char (point-max)) ;; Ensure we're at the end of the buffer
-(insert (format "* %s\n:PROPERTIES:\n:CUSTOM_ID: %s\n:TYPE: 
%s\n:END:\n%s\n" main id type body))
-(message "Inserted heading: %s with CUSTOM_ID %s and TYPE %s" main id 
type)))
+(insert (format "* %s\n:PROPERTIES:\n:GNOSIS_ID: %s\n:TYPE: %s\n:END:\n** 
%s\n"
+   main id type answer))
+(message "Inserted heading: %s with GNOSIS_ID %s and TYPE %s" main id 
type)))
 
 (provide 'gnosis-org)
 ;;; gnosis-org.el ends here.



[nongnu] elpa/gnosis 1e8e5fc529 11/19: New variable-watcher: custom-values-watcher.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 1e8e5fc529ad7dd1f1ca0fb8988cd309e3e24bd8
Author: Thanos Apollo 
Commit: Thanos Apollo 

New variable-watcher: custom-values-watcher.

* Watch & validate new custom gnosis values.
---
 gnosis.el | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index 61ab5db0cb..caef741d52 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2027,8 +2027,7 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend"
  (stringp (nth 1 entry))
  (listp (nth 2 entry))) ; Ensure the third element is a plist
   (error "Each entry should a :deck or :tag keyword, a string, and a plist 
of custom values"))
-(let ((nested-plist (nth 2 entry))
-  (proto (plist-get (nth 2 entry) :proto))
+(let ((proto (plist-get (nth 2 entry) :proto))
   (anagnosis (plist-get (nth 2 entry) :anagnosis))
   (epignosis (plist-get (nth 2 entry) :epignosis))
   (agnoia (plist-get (nth 2 entry) :agnoia))
@@ -2046,6 +2045,20 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend"
 (error "Amnesia should be a number between 0 and 1"))
   (unless (or (null lethe) (and (integerp lethe) (> lethe 0)))
 (error "Lethe should be an integer greater than 0")
+
+(defun gnosis-custom-values-watcher (symbol new-value _operation _where)
+  "Watcher for gnosis custom values.
+
+SYMBOL to watch changes for.
+NEW-VALUE is the new value set to the variable.
+OPERATION is the type of operation being performed.
+WHERE is the buffer or object where the change happens."
+  (when (eq symbol 'gnosis-custom-values)
+(gnosis-validate-custom-values new-value)))
+
+(add-variable-watcher 'gnosis-custom-values 'gnosis-custom-values-watcher)
+
+;; Validate custom values during review process as well.
 (defun gnosis-get-custom-values--validate (plist valid-keywords)
   "Verify that PLIST consists of VALID-KEYWORDS."
   (let ((keys (let (ks)



[nongnu] elpa/gnosis 4d90489c5b 05/19: elpaignore: Add manifest.scm

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 4d90489c5bb573ff547723b8caeb0a2b6cf7eb50
Author: Thanos Apollo 
Commit: Thanos Apollo 

elpaignore: Add manifest.scm
---
 .elpaignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.elpaignore b/.elpaignore
index d8ed22f052..9a93dadc28 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -1,3 +1,4 @@
 CONTRIBUTING.org
 LICENSE
 Makefile
+manifest.scm



[nongnu] elpa/gnosis bc626d511c 16/19: dashboard: Update dashboard-mode keymap.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit bc626d511c111545387df12219a6412506eaf5a1
Author: Thanos Apollo 
Commit: Thanos Apollo 

dashboard: Update dashboard-mode keymap.

* dashboard-mode-keymap has the same keybindings as the transient buffer.
---
 gnosis-dashboard.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 50231e9377..23a04f71e1 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -46,6 +46,7 @@
 (declare-function gnosis-center-string "gnosis.el")
 (declare-function gnosis-get-date-new-notes "gnosis.el")
 (declare-function gnosis-review-get-due-notes "gnosis.el")
+(declare-function gnosis-review "gnosis.el")
 (declare-function gnosis-algorithm-date "gnosis-algorithm.el")
 (declare-function gnosis-get-tags--unique "gnosis.el")
 (declare-function gnosis-get-tag-notes "gnosis.el")
@@ -422,7 +423,14 @@ When called with called with a prefix, unsuspend all notes 
of deck."
 (defvar-keymap gnosis-dashboard-mode-map
   :doc "gnosis-dashboard keymap"
   "q" #'quit-window
-  "h" #'gnosis-dashboard-menu)
+  "h" #'gnosis-dashboard-menu
+  "r" #'gnosis-review
+  "a" #'gnosis-add-note
+  "A" #'gnosis-add-deck
+  "s" #'gnosis-dashboard-suffix-query
+  "n" #'(lambda () (interactive) (gnosis-dashboard-output-notes 
(gnosis-collect-note-ids)))
+  "d" #'gnosis-dashboard-suffix-decks
+  "t" #'(lambda () (interactive) (gnosis-dashboard-output-tags)))
 
 (define-derived-mode gnosis-dashboard-mode tabulated-list-mode "Gnosis 
Dashboard"
   "Major mode for displaying Gnosis dashboard."



[nongnu] elpa/gnosis 11e526b496 02/19: New module: gnosis-org: Use org-mode with gnosis.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 11e526b4965412c1632461eb3961b6ebb22d8ec9
Author: Thanos Apollo 
Commit: Thanos Apollo 

New module: gnosis-org: Use org-mode with gnosis.

* This module will handle exports of decks as org files.
* Sync of org files/deck exports with database.

The main goal of incorporating org-mode is to promote collaboration of
decks through git integration.
---
 gnosis-org.el | 87 +++
 1 file changed, 87 insertions(+)

diff --git a/gnosis-org.el b/gnosis-org.el
new file mode 100644
index 00..e194e88bc7
--- /dev/null
+++ b/gnosis-org.el
@@ -0,0 +1,87 @@
+;;; gnosis-org.el --- Org module for Gnosis  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2023-2024  Thanos Apollo
+
+;; Author: Thanos Apollo 
+;; Keywords: extensions
+;; URL: https://git.thanosapollo.org/gnosis
+;; Version: 0.0.1
+
+;; Package-Requires: ((emacs "27.2") (compat "29.1.4.2"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; Under development.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'org)
+(require 'org-element)
+
+(defun gnosis-org--global-props (name &optional buffer)
+  "Get the plists of global org properties by NAME in BUFFER.
+
+NAME is a string representing the property name to search for.
+BUFFER defaults to the current buffer if not specified."
+  (cl-assert (stringp name) nil "NAME must be a string.")
+  (with-current-buffer (or buffer (current-buffer))
+(let ((elements (org-element-map (org-element-parse-buffer) 'keyword
+  (lambda (el)
+(when (string= (org-element-property :key el) name)
+  el))
+  nil t)))
+  (if elements elements
+(message "No properties found for %s" name)
+nil
+
+(defun gnosis-org--heading-props (property &optional buffer)
+  "Get the values of a custom PROPERTY from all headings in BUFFER.
+
+PROPERTY is a string representing the property name to search for.
+BUFFER defaults to the current buffer if not specified."
+  (cl-assert (stringp property) nil "PROPERTY must be a string.")
+  (with-current-buffer (or buffer (current-buffer))
+(let ((results nil))
+  (org-element-map (org-element-parse-buffer) 'headline
+(lambda (headline)
+  (let ((prop (org-element-property (intern (concat ":" property)) 
headline)))
+(when prop
+  (push prop results)
+  (if results (reverse results)
+(message "No custom properties found for %s" property)
+nil
+
+(cl-defun gnosis-org-insert-custom-heading (&key main id body type (buffer 
(current-buffer)))
+  "Insert an Org heading in BUFFER.
+
+- MAIN as the title.
+- ID as CUSTOM_ID.
+- BODY as the content.
+- TYPE as the note type.
+
+If BUFFER is not specified, defaults to the current buffer."
+  (cl-assert (stringp main) nil "MAIN must be a string representing the 
heading title.")
+  (cl-assert (stringp id) nil "ID must be a string representing the 
CUSTOM_ID.")
+  (cl-assert (stringp body) nil "BODY must be a string representing the 
content.")
+  (cl-assert (stringp type) nil "TYPE must be a string representing the TYPE 
property.")
+  (with-current-buffer buffer
+(goto-char (point-max)) ;; Ensure we're at the end of the buffer
+(insert (format "* %s\n:PROPERTIES:\n:CUSTOM_ID: %s\n:TYPE: 
%s\n:END:\n%s\n" main id type body))
+(message "Inserted heading: %s with CUSTOM_ID %s and TYPE %s" main id 
type)))
+
+(provide 'gnosis-org)
+;;; gnosis-org.el ends here.



[nongnu] elpa/gnosis 061633adca 03/19: packaging: Require emacsql-4.0.1.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 061633adca08d6978a694ad408cb42cda3b11697
Author: Thanos Apollo 
Commit: Thanos Apollo 

packaging: Require emacsql-4.0.1.

* Require latest version of emacsql, supported by nongnu.
---
 gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnosis.el b/gnosis.el
index e0165e641d..83fbb0a400 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -7,7 +7,7 @@
 ;; URL: https://thanosapollo.org/projects/gnosis
 ;; Version: 0.4.2-dev
 
-;; Package-Requires: ((emacs "27.2") (emacsql "4.0.0") (compat "29.1.4.2") 
(transient "0.7.2"))
+;; Package-Requires: ((emacs "27.2") (emacsql "4.0.1") (compat "29.1.4.2") 
(transient "0.7.2"))
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by



[nongnu] elpa/gnosis 56ed928045 09/19: export-deck: Add demo export.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 56ed928045f20bb7e9a6840774d852599489a585
Author: Thanos Apollo 
Commit: Thanos Apollo 

export-deck: Add demo export.
---
 gnosis.el | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/gnosis.el b/gnosis.el
index 5476d52e2f..2e8af51275 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -50,6 +50,8 @@
 (require 'gnosis-string-edit)
 (require 'gnosis-dashboard)
 
+(require 'gnosis-org)
+
 (require 'animate)
 
 (defgroup gnosis nil
@@ -2509,6 +2511,19 @@ If STRING-SECTION is nil, apply FACE to the entire 
STRING."
:tags note-tags))
   (error "Demo deck already exists"
 
+;; Export
+;; This is a demo!
+(defun gnosis-export-deck (&optional deck)
+  "Export contents of DECK."
+  (interactive (list (gnosis--get-deck-id)))
+  (with-current-buffer (get-buffer-create "*test*")
+(insert (format "#+GNOSIS_DECK: %s\n\n" (gnosis--get-deck-name deck)))
+(cl-loop for note in (gnosis-select '[main answer id type] 'notes `(= 
deck-id ,deck))
+do (gnosis-org-insert-heading :main (car note)
+  :answer (cadr note)
+  :id (number-to-string (caddr note))
+  :type (cadddr note)
+
 ;; Gnosis mode ;;
 ;
 



[nongnu] elpa/gnosis 52da178372 15/19: Rewrite README as markdown

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 52da178372d118875aa986ea455ef05e0430fbde
Author: Thanos Apollo 
Commit: Thanos Apollo 

Rewrite README as markdown

* Rewrite README as markdown to work with nongnu elpa.
---
 README| 9 -
 README.md | 9 +
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/README b/README
deleted file mode 100644
index 34e8089467..00
--- a/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Gnosis (γνῶσις)
-
-
-Gnosis (γνῶσις), pronounced "noh-sis", meaning knowledge in Greek,
-is a Spaced Repetition System for note taking and self testing.
-
-- Project's Page: 
-- User Manual:
diff --git a/README.md b/README.md
new file mode 100644
index 00..8ed18df1ef
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+# Γνῶσις | Gnosis
+
+## About
+
+Γνῶσις (gnosis), pronounced "GNU-sis", meaning knowledge in Greek,
+is a GNU Emacs Spaced Repetition System for storing knowledge.
+
+- [Project's Page](https://thanosapollo.org/projects/gnosis/)
+- [User Manual](https://elpa.nongnu.org/nongnu/doc/gnosis.html)



[nongnu] elpa/gnosis 02a4e13520 12/19: [fix] display-images: Display images only on graphical envs.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 02a4e1352025e023d4345cd7dd71ae063d396538
Author: Thanos Apollo 
Commit: Thanos Apollo 

[fix] display-images: Display images only on graphical envs.

* Fix issues for running gnosis on tty & termux.
---
 gnosis.el | 28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index caef741d52..db5a6f4c85 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -484,19 +484,21 @@ or =extra-image'.  Instead of using =extra-image' post 
review, prefer
 =gnosis-display-extra' which displays the =extra-image' as well.
 
 Refer to =gnosis-db-schema-extras' for informations on images stored."
-  (let* ((img (gnosis-get image 'extras `(= id ,id)))
- (path-to-image (expand-file-name (or img "") (file-name-as-directory 
gnosis-images-dir)))
- (image (create-image path-to-image 'png nil :width gnosis-image-width 
:height gnosis-image-height))
- (image-width (car (image-size image t)))
- (frame-width (window-text-width))) ;; Width of the current window in 
columns
-(cond ((or (not img) (string-empty-p img))
-   (insert "\n\n"))
-  ((and img (file-exists-p path-to-image))
-   (let* ((padding-cols (/ (- frame-width (floor (/ image-width 
(frame-char-width 2))
-  (padding (make-string (max 0 padding-cols) ?\s)))
- (insert "\n\n" padding)  ;; Insert padding before the image
- (insert-image image)
- (insert "\n\n"))
+  ;; Only display images on graphical env
+  (when (display-graphic-p)
+(let* ((img (gnosis-get image 'extras `(= id ,id)))
+   (path-to-image (expand-file-name (or img "") 
(file-name-as-directory gnosis-images-dir)))
+   (image (create-image path-to-image 'png nil :width 
gnosis-image-width :height gnosis-image-height))
+   (image-width (car (image-size image t)))
+   (frame-width (window-text-width))) ;; Width of the current window 
in columns
+  (cond ((or (not img) (string-empty-p img))
+ (insert "\n\n"))
+((and img (file-exists-p path-to-image))
+ (let* ((padding-cols (/ (- frame-width (floor (/ image-width 
(frame-char-width 2))
+(padding (make-string (max 0 padding-cols) ?\s)))
+   (insert "\n\n" padding)  ;; Insert padding before the image
+   (insert-image image)
+   (insert "\n\n")))
 
 (defun gnosis-display-mcq-options (id)
   "Display answer options for mcq note ID."



[nongnu] elpa/gnosis updated (013fca6bae -> 731f0ba491)

2024-09-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/gnosis.

  from  013fca6bae [fix] demo: typos & rewrite explanations.
   new  bc626d511c dashboard: Update dashboard-mode keymap.
   new  cfa0462972 packaging: Version 0.4.2-dev
   new  11e526b496 New module: gnosis-org: Use org-mode with gnosis.
   new  061633adca packaging: Require emacsql-4.0.1.
   new  487d903de1 New file: Add manifest.scm
   new  4d90489c5b elpaignore: Add manifest.scm
   new  907308c45e makefile: Add tests & use quick (-Q) option.
   new  48ca4aa6f2 [Refactor] Rewrite org-insert-heading
   new  bb1469aad5 Update todos.
   new  56ed928045 export-deck: Add demo export.
   new  a783b56772 New function: Add validate-custom-values.
   new  1e8e5fc529 New variable-watcher: custom-values-watcher.
   new  02a4e13520 [fix] display-images: Display images only on graphical 
envs.
   new  88a32f1918 edit-update-note: Update assertions.
   new  8f0bb68c87 demo: Update formatting (aesthetics).
   new  52da178372 Rewrite README as markdown
   new  f9c6885cd5 doc: Update for new version.
   new  d034335bde Packaging: Add version 0.4.2.
   new  731f0ba491 Release version 0.4.2.


Summary of changes:
 .elpaignore |   1 +
 Makefile|   8 +++-
 README  |   9 -
 README.md   |   9 +
 doc/gnosis.org  |  60 +++
 gnosis-dashboard.el |  10 -
 gnosis-org.el   |  92 ++
 gnosis.el   | 114 +++-
 manifest.scm|   3 ++
 9 files changed, 231 insertions(+), 75 deletions(-)
 delete mode 100644 README
 create mode 100644 README.md
 create mode 100644 gnosis-org.el
 create mode 100644 manifest.scm



[nongnu] elpa/gnosis d034335bde 18/19: Packaging: Add version 0.4.2.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit d034335bde30c7873768bfbbae531a704d011245
Author: Thanos Apollo 
Commit: Thanos Apollo 

Packaging: Add version 0.4.2.

* Comment out gnosis-org sections that are under development.
* Fix display issues on non-grapical interface.
* Add variable watchers for custom algorithm values.
* Update assertions for editing notes

This is a minor release with a few bug fixes.
---
 gnosis.el | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index 40e4061d74..4619fa94fd 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -5,7 +5,7 @@
 ;; Author: Thanos Apollo 
 ;; Keywords: extensions
 ;; URL: https://thanosapollo.org/projects/gnosis
-;; Version: 0.4.2-dev
+;; Version: 0.4.2
 
 ;; Package-Requires: ((emacs "27.2") (emacsql "4.0.1") (compat "29.1.4.2") 
(transient "0.7.2"))
 
@@ -50,7 +50,7 @@
 (require 'gnosis-string-edit)
 (require 'gnosis-dashboard)
 
-(require 'gnosis-org)
+;; (require 'gnosis-org)
 
 (require 'animate)
 
@@ -2557,18 +2557,17 @@ If STRING-SECTION is nil, apply FACE to the entire 
STRING."
:tags note-tags))
   (error "Demo deck already exists"
 
-;; Export
-;; This is a demo!
-(defun gnosis-export-deck (&optional deck)
-  "Export contents of DECK."
-  (interactive (list (gnosis--get-deck-id)))
-  (with-current-buffer (get-buffer-create "*test*")
-(insert (format "#+GNOSIS_DECK: %s\n\n" (gnosis--get-deck-name deck)))
-(cl-loop for note in (gnosis-select '[main answer id type] 'notes `(= 
deck-id ,deck))
-do (gnosis-org-insert-heading :main (car note)
-  :answer (cadr note)
-  :id (number-to-string (caddr note))
-  :type (cadddr note)
+;; TODO: Add Export funcs
+;; (defun gnosis-export-deck (&optional deck)
+;;   "Export contents of DECK."
+;;   (interactive (list (gnosis--get-deck-id)))
+;;   (with-current-buffer (get-buffer-create "*test*")
+;; (insert (format "#+GNOSIS_DECK: %s\n\n" (gnosis--get-deck-name deck)))
+;; (cl-loop for note in (gnosis-select '[main answer id type] 'notes `(= 
deck-id ,deck))
+;;  do (gnosis-org-insert-heading :main (car note)
+;;:answer (cadr note)
+;;:id (number-to-string (caddr note))
+;;:type (cadddr note)
 
 ;; Gnosis mode ;;
 ;



[nongnu] elpa/gnosis f9c6885cd5 17/19: doc: Update for new version.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit f9c6885cd56cd2e929992c1fa319b527f179a6cd
Author: Thanos Apollo 
Commit: Thanos Apollo 

doc: Update for new version.

* Update manual entries.
* Fix typos.
* Adjust section for customizing note types.
---
 doc/gnosis.org | 60 ++
 1 file changed, 23 insertions(+), 37 deletions(-)

diff --git a/doc/gnosis.org b/doc/gnosis.org
index 15afc52cc7..9d0efb94cc 100644
--- a/doc/gnosis.org
+++ b/doc/gnosis.org
@@ -4,8 +4,8 @@
 #+language: en
 #+options: ':t toc:nil author:t email:t num:t
 #+startup: content
-#+macro: stable-version 0.4.0
-#+macro: release-date 2024-08-7
+#+macro: stable-version 0.4.2
+#+macro: release-date 2024-09-5
 #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@
 #+macro: space @@texinfo:@: @@
 #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@
@@ -22,15 +22,16 @@
 #+texinfo_header: @set MAINTAINERCONTACT 
@uref{mailto:pub...@thanosapollo.org,contact the maintainer}
 
 
-Gnosis is a customizable spaced repetition system designed to enhance
+Gnosis (GNU-sis) is a customizable spaced repetition system designed to enhance
 memory retention through active recall.  It allows users to set
 specific review intervals for note decks & tags, creating an optimal
-learning environment tailored to each specific topic.
+learning environment tailored to each specific topic/subject.
 
 #+texinfo: @noindent
 This manual is written for Gnosis version {{{stable-version}}}, released on 
{{{release-date}}}.
 
-+ Official manual: 
++ Official manual:
+  + 
 + Git repositories:
   + 
 
@@ -260,7 +261,6 @@ name suggests, they rely on =vc= to work properly.
 Depending on your setup, =vc= might require an external package for
 the ssh passphrase dialog, such as ~x11-ssh-askpass~.
 
-
 To automatically push changes after a review session, add this to your 
configuration:
 #+begin_src emacs-lisp
 (setf gnosis-vc-auto-push t)
@@ -268,44 +268,30 @@ To automatically push changes after a review session, add 
this to your configura
 #+end_src
 
 * Configuring Note Types
-** Adjust Current Types Entries
+** Custom Note Types
 Each gnosis note type has an /interactive/ function, named
-=gnosis-add-note-TYPE=.  You can set default values for each entry by
-hard coding specific values to their keywords.
+=gnosis-add-note-TYPE= and a "hidden" function
+named =gnosis-add-note--TYPE=.  You can create your own custom interactive
+functions to ignore or hard-code specific values by using already
+defined hidden functions that handle all the logic.
 
 For example:
 
 #+begin_src emacs-lisp
-(defun gnosis-add-note-basic (deck)
-  (gnosis-add-note--basic :deck deck
- :question (gnosis-read-string-from-buffer "Question: 
" "")
- :answer (read-string "Answer: ")
- :hint (gnosis-hint-prompt gnosis-previous-note-hint)
- :extra ""
- :images nil
- :tags (gnosis-prompt-tags--split 
gnosis-previous-note-tags)))
+  (defun gnosis-add-note-custombasic (deck)
+(gnosis-add-note--basic :deck deck
+ :question (gnosis-read-string-from-buffer "Question: 
" "")
+ :answer (read-string "Answer: ")
+ :hint (gnosis-hint-prompt gnosis-previous-note-hint)
+ :extra ""
+ :images nil
+ :tags (gnosis-prompt-tags--split 
gnosis-previous-note-tags)))
+  ;; Add custom note type to gnosis-note-types
+  (add-to-list 'gnosis-note-types "custombasic")
 #+end_src
 
-By evaluating the above code snippet, you won't be prompted to enter
-anything for ~extra~ & ~images~. 
-** Creating Custom Note Types
-
-Creating custom note types for gnosis is a fairly simple thing to do
-
-+ First add your NEW-TYPE to =gnosis-note-types=
-
-#+begin_src emacs-lisp
-(add-to-list 'gnosis-note-types "NEW-TYPE")
-  #+end_src
-+ Create an interactive function
-
-Each note type has a =gnosis-add-note-TYPE= that is used interactively
-& a "hidden function" =gnosis-add-note--TYPE= that handles all the
-logic.  You can use one of the =current gnosis-add-note--TYPE=
-functions or create one of your own.
-
-Refer to =gnosis-add-note-basic= & =gnosis-add-note--basic= for a simple
-example of how this is done, as well as =gnosis-add-note-double=.
+Now ~custombasic~ is available as a note type, for which you won't be prompted 
to enter
+anything for ~extra~ & ~images~.
 
 ** Development
 To make development and customization easier, gnosis comes with



[nongnu] elpa/gnosis 731f0ba491 19/19: Release version 0.4.2.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 731f0ba4910c872efedf7e460d904f3d9c3be9a7
Merge: bc626d511c d034335bde
Author: Thanos Apollo 
Commit: Thanos Apollo 

Release version 0.4.2.

* Comment out gnosis-org sections that are under development.
   * gnosis-org should be ready by next version.
* Fix display issues on non-grapical interface.
* Add variable watchers for custom algorithm values.
* Update assertions for editing notes

This is a minor release with a few bug fixes.
---
 .elpaignore|   1 +
 Makefile   |   8 +++-
 README |   9 -
 README.md  |   9 +
 doc/gnosis.org |  60 --
 gnosis-org.el  |  92 ++
 gnosis.el  | 114 +++--
 manifest.scm   |   3 ++
 8 files changed, 222 insertions(+), 74 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index d8ed22f052..9a93dadc28 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -1,3 +1,4 @@
 CONTRIBUTING.org
 LICENSE
 Makefile
+manifest.scm
diff --git a/Makefile b/Makefile
index 4ee28ad675..9b1a262a14 100644
--- a/Makefile
+++ b/Makefile
@@ -6,15 +6,21 @@ EMACS = emacs
 ORG := doc/gnosis.org
 TEXI := doc/gnosis.texi
 INFO := doc/gnosis.info
-
+TEST_FILE := gnosis-test.el
 
 all: doc
 
 doc:   $(ORG)
$(EMACS) --batch \
+   -Q \
--load org \
--eval "(with-current-buffer (find-file \"$(ORG)\") 
(org-texinfo-export-to-texinfo) (org-texinfo-export-to-info) (save-buffer))" \
--kill
 
+test:
+   $(EMACS) --batch \
+   --load $(TEST_FILE) \
+   --eval "(ert-run-tests-batch-and-exit)"
+
 clean:
rm -f $(TEXI) $(INFO)
diff --git a/README b/README
deleted file mode 100644
index 34e8089467..00
--- a/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Gnosis (γνῶσις)
-
-
-Gnosis (γνῶσις), pronounced "noh-sis", meaning knowledge in Greek,
-is a Spaced Repetition System for note taking and self testing.
-
-- Project's Page: 
-- User Manual:
diff --git a/README.md b/README.md
new file mode 100644
index 00..8ed18df1ef
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+# Γνῶσις | Gnosis
+
+## About
+
+Γνῶσις (gnosis), pronounced "GNU-sis", meaning knowledge in Greek,
+is a GNU Emacs Spaced Repetition System for storing knowledge.
+
+- [Project's Page](https://thanosapollo.org/projects/gnosis/)
+- [User Manual](https://elpa.nongnu.org/nongnu/doc/gnosis.html)
diff --git a/doc/gnosis.org b/doc/gnosis.org
index 15afc52cc7..9d0efb94cc 100644
--- a/doc/gnosis.org
+++ b/doc/gnosis.org
@@ -4,8 +4,8 @@
 #+language: en
 #+options: ':t toc:nil author:t email:t num:t
 #+startup: content
-#+macro: stable-version 0.4.0
-#+macro: release-date 2024-08-7
+#+macro: stable-version 0.4.2
+#+macro: release-date 2024-09-5
 #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@
 #+macro: space @@texinfo:@: @@
 #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@
@@ -22,15 +22,16 @@
 #+texinfo_header: @set MAINTAINERCONTACT 
@uref{mailto:pub...@thanosapollo.org,contact the maintainer}
 
 
-Gnosis is a customizable spaced repetition system designed to enhance
+Gnosis (GNU-sis) is a customizable spaced repetition system designed to enhance
 memory retention through active recall.  It allows users to set
 specific review intervals for note decks & tags, creating an optimal
-learning environment tailored to each specific topic.
+learning environment tailored to each specific topic/subject.
 
 #+texinfo: @noindent
 This manual is written for Gnosis version {{{stable-version}}}, released on 
{{{release-date}}}.
 
-+ Official manual: 
++ Official manual:
+  + 
 + Git repositories:
   + 
 
@@ -260,7 +261,6 @@ name suggests, they rely on =vc= to work properly.
 Depending on your setup, =vc= might require an external package for
 the ssh passphrase dialog, such as ~x11-ssh-askpass~.
 
-
 To automatically push changes after a review session, add this to your 
configuration:
 #+begin_src emacs-lisp
 (setf gnosis-vc-auto-push t)
@@ -268,44 +268,30 @@ To automatically push changes after a review session, add 
this to your configura
 #+end_src
 
 * Configuring Note Types
-** Adjust Current Types Entries
+** Custom Note Types
 Each gnosis note type has an /interactive/ function, named
-=gnosis-add-note-TYPE=.  You can set default values for each entry by
-hard coding specific values to their keywords.
+=gnosis-add-note-TYPE= and a "hidden" function
+named =gnosis-add-note--TYPE=.  You can create your own custom interactive
+functions to ignore or hard-code specific values by using already
+defined hidden functions that handle all the logic.
 
 For example:
 
 #+begin_src emacs-lisp
-(defun gnosis-add-note-basic (deck)
-  (gnosis-add-note--basic :deck deck
-  

[nongnu] elpa/gnosis 8f0bb68c87 14/19: demo: Update formatting (aesthetics).

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 8f0bb68c87843fee900b2bb10567fae96afe5186
Author: Thanos Apollo 
Commit: Thanos Apollo 

demo: Update formatting (aesthetics).

* Adjust extras formatting of y-or-p exapmle to avoid breakage.
---
 gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnosis.el b/gnosis.el
index a722fe1ca8..40e4061d74 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2548,7 +2548,7 @@ If STRING-SECTION is nil, apply FACE to the entire 
STRING."
   (gnosis-add-note--cloze :deck deck-name
   :note "GNU Emacs is an extensible editor 
created by {{c1::Richard}} {{c1::Stallman}} in {{c2::1984::year}}"
   :tags note-tags
-  :extra "Emacs was originally implemented 
in 1976 on the MIT AI Lab's Incompatible Timesharing System (ITS), as a 
collection of TECO macros.  The name “Emacs” was originally chosen as an 
abbreviation of “Editor MACroS”. =This version of Emacs=, GNU Emacs, was 
originally *written in 1984*")
+  :extra "Emacs was originally implemented 
in 1976 on the MIT AI Lab's Incompatible Timesharing System (ITS), as a 
collection of TECO macros.  The name “Emacs” was originally chosen as an 
abbreviation of “Editor MACroS”. This version of Emacs, =GNU= =Emacs=, was 
originally written in _1984_")
   (gnosis-add-note--y-or-n :deck deck-name
:question "Is GNU Emacs the 
unparalleled pinnacle of all software creation?"
:hint "Duh"



[nongnu] elpa/gnosis bb1469aad5 08/19: Update todos.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit bb1469aad5e488f1cf5ed1983feee3ee283a7152
Author: Thanos Apollo 
Commit: Thanos Apollo 

Update todos.

* Update todos to work with magit-todos.
---
 gnosis.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index 83fbb0a400..5476d52e2f 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -217,7 +217,7 @@ When nil, review new notes last."
 (defvar gnosis-review-notes nil
   "Review notes.")
 
-;; TODO: Make this as a defcustom
+;; TODO: Make this as a defcustom.
 (defvar gnosis-custom-values
   '((:deck "demo" (:proto (0 1 3) :anagnosis 3 :epignosis 0.5 :agnoia 0.3 
:amnesia 0.5 :lethe 3))
 (:tag "demo" (:proto (1 2) :anagnosis 3 :epignosis 0.5 :agnoia 0.3 
:amnesia 0.45 :lethe 3)))
@@ -1269,7 +1269,7 @@ Optionally, add cusotm PROMPT."
   (cl-loop for tags in (gnosis-select 'tags 'notes '1=1 t)
nconc tags into all-tags
finally return (delete-dups all-tags)))
-;; TODO: Rewrite this using `gnosis-get-tag-notes'.
+;; TODO: Rewrite this using gnosis-get-tag-notes.
 (defun gnosis-select-by-tag (input-tags &optional due suspended-p)
   "Return note ID's for every note with INPUT-TAGS.
 
@@ -1389,8 +1389,8 @@ provided, use it as the default value."
 
 ;; Collecting note ids
 
-;; TODO: Rewrite.  Tags should be an input of strings, interactive
-;; handling should be done by "helper" funcs
+;; TODO: Rewrite this! Tags should be an input of strings,
+;; interactive handling should be done by "helper" funcs
 (cl-defun gnosis-collect-note-ids (&key (tags nil) (due nil) (deck nil) (query 
nil))
   "Return list of note ids based on TAGS, DUE, DECKS, QUERY.
 
@@ -1739,7 +1739,7 @@ NOTE-COUNT: The number of notes reviewed in the session 
to be commited."
   (error "Git not found, please install git"))
 (unless (file-exists-p (expand-file-name ".git" gnosis-dir))
   (vc-create-repo 'Git))
-;; TODO: Redo this using vc
+;; TODO: Redo this using vc.
 (unless gnosis-testing
   (shell-command (format "%s %s %s" git "add" (shell-quote-argument 
"gnosis.db")))
   (shell-command (format "%s %s %s" git "commit -m"
@@ -1834,7 +1834,7 @@ NOTE-COUNT: Total notes to be commited for session."
  (cl-incf note-count)
  (gnosis-review-actions success note note-count))
 finally
-;; TODO: Add optional arg to repeat for specific deck/tag
+;; TODO: Add optional arg, repeat for specific deck/tag.
 ;; Repeat until there are no due notes
 (and due (gnosis-review-session (gnosis-collect-note-ids :due 
t) t note-count
   (gnosis-dashboard)
@@ -2251,7 +2251,7 @@ Defaults to current date."
   (let* ((date (or date (gnosis-algorithm-date)))
 (reviewed-new (or (car (gnosis-select 'reviewed-new 'activity-log `(= 
date ',date) t)) 0)))
 reviewed-new))
-;; TODO: Auto tag overdue tags
+;; TODO: Auto tag overdue tags.
 (defun gnosis-tags--append (id tag)
   "Append TAG to the list of tags of note ID."
   (cl-assert (numberp id) nil "ID must be the note id number")



[nongnu] elpa/gnosis 88a32f1918 13/19: edit-update-note: Update assertions.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 88a32f19180e36ce31f1819171ce9a9337c70568
Author: Thanos Apollo 
Commit: Thanos Apollo 

edit-update-note: Update assertions.

* Update assertions, to avoid edits that will lead to bugs such as
  inserting numbers to the tags list.
---
 gnosis.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index db5a6f4c85..a722fe1ca8 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1986,10 +1986,12 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend"
 "Second-image must be a string, path to image file from 
`gnosis-images-dir', or nil")
   (cl-assert (or (stringp extra-notes) (null extra-notes)) nil
 "Extra-notes must be a string, or nil")
-  (cl-assert (listp tags) nil "Tags must be a list of strings")
-  (cl-assert (and (listp gnosis) (length= gnosis 3)) nil "gnosis must be a 
list of 3 floats")
-  (cl-assert (or (stringp options) (listp options)) nil "Options must be a 
string, or a list for MCQ")
-  (cl-assert (or (= suspend 0) (= suspend 1)) nil "Suspend must be either 0 or 
1")
+  (cl-assert (and (listp tags) (cl-every #'stringp tags)) nil "Tags must be a 
list of strings")
+  (cl-assert (and (listp gnosis) (length= gnosis 3) (cl-every #'floatp gnosis))
+nil "gnosis must be a list of 3 floats")
+  (cl-assert (or (stringp options) (and (listp options) (cl-every #'stringp 
options)))
+nil "Options must be a string or a list of strings")
+  (cl-assert (and (numberp suspend) (or (= suspend 0) (= suspend 1))) nil 
"Suspend must be either 0 or 1")
   (when (and (string= (gnosis-get-type id) "cloze")
 (not (stringp options)))
 (cl-assert (or (listp options) (stringp options)) nil "Options must be a 
list or a string.")



[nongnu] elpa/gnosis a783b56772 10/19: New function: Add validate-custom-values.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit a783b56772fe44111395e3045cfebbf986259495
Author: Thanos Apollo 
Commit: Thanos Apollo 

New function: Add validate-custom-values.

* Function to be used with a variable watcher to validate custom
gnosis values.
---
 gnosis.el | 29 +
 1 file changed, 29 insertions(+)

diff --git a/gnosis.el b/gnosis.el
index 2e8af51275..61ab5db0cb 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2017,6 +2017,35 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend"
 (gnosis-update 'notes `(= ,field ',value) `(= id ,id)))
(t (gnosis-update 'notes `(= ,field ,value) `(= id ,id))
 
+(defun gnosis-validate-custom-values (new-value)
+  "Validate the structure and values of NEW-VALUE for gnosis-custom-values."
+  (unless (listp new-value)
+(error "GNOSIS-CUSTOM-VALUES should be a list of entries"))
+  (dolist (entry new-value)
+(unless (and (listp entry) (= (length entry) 3)
+ (memq (nth 0 entry) '(:deck :tag))
+ (stringp (nth 1 entry))
+ (listp (nth 2 entry))) ; Ensure the third element is a plist
+  (error "Each entry should a :deck or :tag keyword, a string, and a plist 
of custom values"))
+(let ((nested-plist (nth 2 entry))
+  (proto (plist-get (nth 2 entry) :proto))
+  (anagnosis (plist-get (nth 2 entry) :anagnosis))
+  (epignosis (plist-get (nth 2 entry) :epignosis))
+  (agnoia (plist-get (nth 2 entry) :agnoia))
+  (amnesia (plist-get (nth 2 entry) :amnesia))
+  (lethe (plist-get (nth 2 entry) :lethe)))
+  (unless (listp proto)
+(error "Proto must be a list of interval integer values"))
+  (unless (or (null anagnosis) (integerp anagnosis))
+(error "Anagnosis should be an integer"))
+  (unless (or (null epignosis) (numberp epignosis))
+(error "Epignosis should be a number"))
+  (unless (or (null agnoia) (numberp agnoia))
+(error "Agnoia should be a number"))
+  (unless (or (null amnesia) (and (numberp amnesia) (<= amnesia 1) (>= 
amnesia 0)))
+(error "Amnesia should be a number between 0 and 1"))
+  (unless (or (null lethe) (and (integerp lethe) (> lethe 0)))
+(error "Lethe should be an integer greater than 0")
 (defun gnosis-get-custom-values--validate (plist valid-keywords)
   "Verify that PLIST consists of VALID-KEYWORDS."
   (let ((keys (let (ks)



[nongnu] elpa/gnosis 907308c45e 06/19: makefile: Add tests & use quick (-Q) option.

2024-09-05 Thread ELPA Syncer
branch: elpa/gnosis
commit 907308c45e8221fedb8c34596cd57497c2736c01
Author: Thanos Apollo 
Commit: Thanos Apollo 

makefile: Add tests & use quick (-Q) option.
---
 Makefile | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4ee28ad675..9b1a262a14 100644
--- a/Makefile
+++ b/Makefile
@@ -6,15 +6,21 @@ EMACS = emacs
 ORG := doc/gnosis.org
 TEXI := doc/gnosis.texi
 INFO := doc/gnosis.info
-
+TEST_FILE := gnosis-test.el
 
 all: doc
 
 doc:   $(ORG)
$(EMACS) --batch \
+   -Q \
--load org \
--eval "(with-current-buffer (find-file \"$(ORG)\") 
(org-texinfo-export-to-texinfo) (org-texinfo-export-to-info) (save-buffer))" \
--kill
 
+test:
+   $(EMACS) --batch \
+   --load $(TEST_FILE) \
+   --eval "(ert-run-tests-batch-and-exit)"
+
 clean:
rm -f $(TEXI) $(INFO)



[nongnu] elpa/gptel 26b515a8f4 4/4: gptel: Add Cerebras support (#372)

2024-09-05 Thread ELPA Syncer
branch: elpa/gptel
commit 26b515a8f4ef61abd5a81b3c622bf00fe73261a7
Author: Ian <180469889+bytegori...@users.noreply.github.com>
Commit: GitHub 

gptel: Add Cerebras support (#372)

* README.org: Add Cerebras to the supported providers.  Fixing
  typos in the README

* gptel.el: Mention Cerebras in the package commentary.
---
 README.org | 37 +
 gptel.el   |  8 
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index ef4c2df0a4..d7076c0d23 100644
--- a/README.org
+++ b/README.org
@@ -24,6 +24,7 @@ gptel is a simple Large Language Model chat client for Emacs, 
with support for m
 | OpenRouter | ✓  | [[https://openrouter.ai/keys][API key]]
|
 | PrivateGPT | ✓  | 
[[https://github.com/zylon-ai/private-gpt#-documentation][PrivateGPT running 
locally]] |
 | DeepSeek   | ✓  | [[https://platform.deepseek.com/api_keys][API 
key]]|
+| Cerebras   | ✓  | [[https://cloud.cerebras.ai/][API key]]
|
 #+html: 
 
 *General usage*: ([[https://www.youtube.com/watch?v=bsRnh_brggM][YouTube 
Demo]])
@@ -69,6 +70,7 @@ gptel uses Curl if available, but falls back to url-retrieve 
to work without ext
   - [[#openrouter][OpenRouter]]
   - [[#privategpt][PrivateGPT]]
   - [[#deepseek][DeepSeek]]
+  - [[#cerebras][Cerebras]]
   - [[#usage][Usage]]
 - [[#in-any-buffer][In any buffer:]]
 - [[#in-a-dedicated-chat-buffer][In a dedicated chat buffer:]]
@@ -638,6 +640,41 @@ The above code makes the backend available to select.  If 
you want it to be the
 
 #+end_src
 
+#+html: 
+#+html: 
+ Cerebras
+#+html: 
+
+Register a backend with
+#+begin_src emacs-lisp
+;; Cerebras offers an instant OpenAI compatible API
+(gptel-make-openai "Cerebras"
+  :host "api.cerebras.ai"
+  :endpoint "/v1/chat/completions"
+  :stream t ;optionally nil as Cerebras is instant 
AI
+  :key "your-api-key"   ;can be a function that returns the key
+  :models '("llama3.1-70b"
+"llama3.1-8b"))
+#+end_src
+
+You can pick this backend from the menu when using gptel (see 
[[#usage][Usage]]).
+
+* (Optional) Set as the default gptel backend
+
+The above code makes the backend available to select.  If you want it to be 
the default backend for gptel, you can set this as the value of 
=gptel-backend=.  Use this instead of the above.
+#+begin_src emacs-lisp
+;; OPTIONAL configuration
+(setq gptel-model   "llama3.1-8b"
+  gptel-backend
+  (gptel-make-openai "Cerebras"
+:host "api.cerebras.ai"
+:endpoint "/v1/chat/completions"
+:stream nil
+:key "your-api-key"
+:models '("llama3.1-70b"
+  "llama3.1-8b")))
+#+end_src
+
 #+html: 
 
 ** Usage
diff --git a/gptel.el b/gptel.el
index 9f947dd282..88892ebe4d 100644
--- a/gptel.el
+++ b/gptel.el
@@ -32,8 +32,8 @@
 ;; gptel supports
 ;;
 ;; - The services ChatGPT, Azure, Gemini, Anthropic AI, Anyscale, Together.ai,
-;;   Perplexity, Anyscale, OpenRouter, Groq, PrivateGPT, DeepSeek and Kagi
-;;   (FastGPT & Summarizer)
+;;   Perplexity, Anyscale, OpenRouter, Groq, PrivateGPT, DeepSeek, Cerebras and
+;;   Kagi (FastGPT & Summarizer)
 ;; - Local models via Ollama, Llama.cpp, Llamafiles or GPT4All
 ;;
 ;;  Additionally, any LLM service (local or remote) that provides an
@@ -61,8 +61,8 @@
 ;; - For Gemini: define a gptel-backend with `gptel-make-gemini', which see.
 ;; - For Anthropic (Claude): define a gptel-backend with 
`gptel-make-anthropic',
 ;;   which see
-;; - For Together.ai, Anyscale, Perplexity, Groq, OpenRouter or DeepSeek: 
define
-;;   a gptel-backend with `gptel-make-openai', which see.
+;; - For Together.ai, Anyscale, Perplexity, Groq, OpenRouter, DeepSeek or
+;;   Cerebras: define a gptel-backend with `gptel-make-openai', which see.
 ;; - For PrivateGPT: define a backend with `gptel-make-privategpt', which see.
 ;; - For Kagi: define a gptel-backend with `gptel-make-kagi', which see.
 ;;



[nongnu] elpa/gptel 6995b5c0d9 1/4: gptel-rewrite: Add rewrite overlay navigation commands

2024-09-05 Thread ELPA Syncer
branch: elpa/gptel
commit 6995b5c0d9b4ef967d947d0ecffefc3e3ffabdeb
Author: Karthik Chikmagalur 
Commit: Karthik Chikmagalur 

gptel-rewrite: Add rewrite overlay navigation commands

* gptel-rewrite.el (gptel-rewrite-actions-map,
gptel--rewrite-move, gptel--rewrite-next,
gptel--rewrite-previous): Add commands and keybinds for moving to
the next and previous rewrite overlay in the buffer, when they are
available. (#357)
---
 gptel-rewrite.el | 35 +++
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index 0c6faa171f..fa60170749 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -37,10 +37,12 @@
 
 (defvar-keymap gptel-rewrite-actions-map
   :doc "Keymap for gptel rewrite actions at point."
-  "C-c C-k" 'gptel--rewrite-clear
-  "C-c C-a" 'gptel--rewrite-apply
-  "C-c C-d" 'gptel--rewrite-diff
-  "C-c C-e" 'gptel--rewrite-ediff)
+  "C-c C-k" #'gptel--rewrite-clear
+  "C-c C-a" #'gptel--rewrite-apply
+  "C-c C-d" #'gptel--rewrite-diff
+  "C-c C-e" #'gptel--rewrite-ediff
+  "C-c C-n" #'gptel--rewrite-next
+  "C-c C-p" #'gptel--rewrite-previous)
 
 (defvar-local gptel--rewrite-overlays nil
   "List of active rewrite overlays in the buffer.")
@@ -82,6 +84,31 @@ CALLBACK is supplied by Eldoc, see
":" gptel-model)
'face 'mode-line-emphasis)
 
+(defun gptel--rewrite-move (search-func)
+  "Move directionally to a gptel rewrite location using SEARCH-FUNC."
+  (let* ((ov (cdr (get-char-property-and-overlay (point) 'gptel-rewrite)))
+ (pt (save-excursion
+   (if ov
+   (goto-char
+(funcall search-func (overlay-start ov) 'gptel-rewrite))
+ (goto-char
+  (max (1- (funcall search-func (point) 'gptel-rewrite))
+   (point-min
+   (funcall search-func (point) 'gptel-rewrite
+(if (get-char-property pt 'gptel-rewrite)
+(goto-char pt)
+  (user-error "No further rewrite regions!"
+
+(defun gptel--rewrite-next ()
+  "Go to next pending LLM rewrite in buffer, if one exists."
+  (interactive)
+  (gptel--rewrite-move #'next-single-char-property-change))
+
+(defun gptel--rewrite-previous ()
+  "Go to previous pending LLM rewrite in buffer, if one exists."
+  (interactive)
+  (gptel--rewrite-move #'previous-single-char-property-change))
+
 (defun gptel--rewrite-overlay-at (&optional pt)
   "Check for a gptel rewrite overlay at PT and return it.
 



[nongnu] elpa/gptel updated (b7a147d624 -> 26b515a8f4)

2024-09-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/gptel.

  from  b7a147d624 gptel-rewrite: Add a better refactor/rewrite system
   new  6995b5c0d9 gptel-rewrite: Add rewrite overlay navigation commands
   new  c960428d17 gptel-rewrite: Improve docstrings and formatting
   new  6f7e005a8a gptel-rewrite: New user option for rewrite message
   new  26b515a8f4 gptel: Add Cerebras support (#372)


Summary of changes:
 README.org   | 37 ++
 gptel-rewrite.el | 81 +++-
 gptel.el |  8 +++---
 3 files changed, 103 insertions(+), 23 deletions(-)



[nongnu] elpa/gptel c960428d17 2/4: gptel-rewrite: Improve docstrings and formatting

2024-09-05 Thread ELPA Syncer
branch: elpa/gptel
commit c960428d17f80e27f3dbf43da02d010f45cb6fdf
Author: Karthik Chikmagalur 
Commit: Karthik Chikmagalur 

gptel-rewrite: Improve docstrings and formatting

* gptel-rewrite.el (gptel--rewrite-ediff, gptel--rewrite-diff,
gptel--rewrite-apply, gptel--rewrite-prepare-buffer,
gptel--rewrite-sanitize-overlays): Docstrings and formatting.
---
 gptel-rewrite.el | 19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index fa60170749..a76cbca744 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -52,7 +52,7 @@
 ;; * Helper functions
 
 (defun gptel--rewrite-sanitize-overlays ()
-  "TODO"
+  "Ensure gptel's rewrite overlays in buffer are consistent."
   (setq gptel--rewrite-overlays
 (cl-delete-if-not #'overlay-buffer
   gptel--rewrite-overlays)))
@@ -146,17 +146,15 @@ the changed regions. BUF is the (current) buffer."
 (goto-char pt)
 ;; We mostly just want font-locking
 ;; (delay-mode-hooks (funcall mode))
-;; MAYBE: Copy mark and local variables?
 ;; Apply the changes to the new buffer
 (save-excursion
-  ;; TODO: Use gptel--rewrite-apply here
   (gptel--rewrite-apply ovs)))
   newbuf)))
 
 ;; * Refactor action functions
 
 (defun gptel--rewrite-clear (&optional ovs)
-  "TODO"
+  "Clear pending LLM responses in OVS or at point."
   (interactive (list (gptel--rewrite-overlay-at)))
   (dolist (ov (ensure-list ovs))
 (setq gptel--rewrite-overlays (delq ov gptel--rewrite-overlays))
@@ -166,7 +164,7 @@ the changed regions. BUF is the (current) buffer."
   (message "Cleared pending LLM response(s)."))
 
 (defun gptel--rewrite-apply (&optional ovs)
-  "TODO"
+  "Apply pending LLM responses in OVS or at point."
   (interactive (list (gptel--rewrite-overlay-at)))
   (cl-loop for ov in (ensure-list ovs)
for ov-beg = (overlay-start ov)
@@ -179,7 +177,7 @@ the changed regions. BUF is the (current) buffer."
   (message "Replaced region(s) with LLM output."))
 
 (defun gptel--rewrite-diff (&optional ovs switches)
-  "TODO"
+  "Diff pending LLM responses in OVS or at point."
   (interactive (list (gptel--rewrite-overlay-at)))
   (let* ((buf (current-buffer))
  (newbuf (gptel--rewrite-prepare-buffer ovs))
@@ -192,7 +190,7 @@ the changed regions. BUF is the (current) buffer."
 (display-buffer diff-buf)))
 
 (defun gptel--rewrite-ediff (&optional ovs)
-  "TODO"
+  "Ediff pending LLM responses in OVS or at point."
   (interactive (list (gptel--rewrite-overlay-at)))
   (letrec ((newbuf (gptel--rewrite-prepare-buffer ovs))
(cwc (current-window-configuration))
@@ -224,10 +222,7 @@ the changed regions. BUF is the (current) buffer."
 (gptel--rewrite-infix-diff:-U)]
[:description gptel--refactor-or-rewrite
 :if use-region-p
-(gptel--suffix-rewrite)
-;; (gptel--suffix-rewrite-and-replace)
-;; (gptel--suffix-rewrite-and-ediff)
-]
+(gptel--suffix-rewrite)]
[:description (lambda () (concat "Continue " (gptel--refactor-or-rewrite)))
 :if (lambda () (gptel--rewrite-sanitize-overlays))
 (gptel--suffix-rewrite-diff)
@@ -306,7 +301,7 @@ the changed regions. BUF is the (current) buffer."
   (overlay-put ov 'keymap gptel-rewrite-actions-map)
   (overlay-put ov 'before-string
(concat (propertize
-" " 'display `(space :align-to (- right 
,(+ (length hint-str) 2
+" " 'display `(space :align-to (- right 
,(1+ (length hint-str)
(propertize hint-str 'face 'success)))
   (overlay-put ov 'help-echo
(format "%s rewrite available:



[nongnu] elpa/gptel 6f7e005a8a 3/4: gptel-rewrite: New user option for rewrite message

2024-09-05 Thread ELPA Syncer
branch: elpa/gptel
commit 6f7e005a8aae369357dac836583aadc7b7903f01
Author: Karthik Chikmagalur 
Commit: Karthik Chikmagalur 

gptel-rewrite: New user option for rewrite message

* gptel-rewrite.el (gptel-rewrite-directives-hook,
gptel-rewrite-menu): New user option
`gptel-rewrite-directives-hook` for customizing the default
rewrite/refactor directive.  Each function in the hook is called
until one returns a non-nil value, the string to use as the
directive in the current context.  This can be used to customize
the refactoring prompt based on any predicate, such as the major
mode or the contents of the buffer. (#370)
---
 gptel-rewrite.el | 27 ---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index a76cbca744..bb6c6e4def 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -32,6 +32,20 @@
 
 (declare-function diff-no-select "diff")
 
+;; * User options
+
+(defcustom gptel-rewrite-directives-hook (list #'gptel--rewrite-message)
+  "Hook run to generate gptel's default rewrite directives.
+
+Each function in this hook is called with no arguments until one
+returns a non-nil value, the base string to use as the
+rewrite/refactor instruction.
+
+Use this hook to tailor context-specific refactoring directives.
+For example, you can specialize the default refactor directive
+for a particular major-mode."
+  :group 'gptel
+  :type 'hook)
 
 ;; * Variables
 
@@ -211,7 +225,7 @@ the changed regions. BUF is the (current) buffer."
(lambda ()
  (format "Directive:  %s"
  (truncate-string-to-width
-  (or gptel--rewrite-message (gptel--rewrite-message))
+  gptel--rewrite-message
   (max (- (window-width) 14) 20) nil nil t)))
(gptel--infix-rewrite-prompt)]
   [[:description "Diff Options"
@@ -232,7 +246,10 @@ the changed regions. BUF is the (current) buffer."
 (gptel--suffix-rewrite-clear)]]
   (interactive)
   (unless gptel--rewrite-message
-(setq gptel--rewrite-message (gptel--rewrite-message)))
+(setq gptel--rewrite-message
+  (save-mark-and-excursion
+(run-hook-with-args-until-success
+ 'gptel-rewrite-directives-hook
   (transient-setup 'gptel-rewrite-menu))
 
 ;; * Transient infixes for rewriting/refactoring
@@ -249,7 +266,11 @@ the changed regions. BUF is the (current) buffer."
   :prompt "Set directive for rewrite: "
   :reader (lambda (prompt _ history)
 (read-string
- prompt (gptel--rewrite-message) history)))
+ prompt
+ (save-mark-and-excursion
+   (run-hook-with-args-until-success
+'gptel-rewrite-directives-hook))
+ history)))
 
 (transient-define-argument gptel--rewrite-infix-diff:-U ()
   :description "Context lines"



[elpa] externals/llm 152a6ed44a: Fix Vertex and Open AI's parallel call tool use (#78)

2024-09-05 Thread ELPA Syncer
branch: externals/llm
commit 152a6ed44ae43641e35a0d2ce2cf9f9d35f23999
Author: Andrew Hyatt 
Commit: GitHub 

Fix Vertex and Open AI's parallel call tool use (#78)

Change how we store in the prompt the results to support parallel calls.

This is an alternate fix for https://github.com/ahyatt/llm/issues/71, so
undoes https://github.com/ahyatt/llm/pull/73 and makes a fix along the
lines of what Paul Nelson speculated would be needed.
---
 NEWS.org|   1 +
 llm-claude.el   | 107 
 llm-integration-test.el |  47 +
 llm-openai.el   |  49 +-
 llm-provider-utils.el   |  83 +
 llm-vertex.el   |  19 +
 llm.el  |   8 ++--
 7 files changed, 149 insertions(+), 165 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 42955c58b4..f72ee35b80 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,5 +1,6 @@
 * Version 0.17.4
 - Fix problem with Open AI's =llm-chat-token-limit=.
+- Fix Open AI and Gemini's parallel function calling.
 * Version 0.17.3
 - More fixes with Claude and Ollama function calling conversation, thanks to 
Paul Nelson.
 - Make =llm-chat-streaming-to-point= more efficient, just inserting new text, 
thanks to Paul Nelson.
diff --git a/llm-claude.el b/llm-claude.el
index c4c6cc19c1..15c2720e10 100644
--- a/llm-claude.el
+++ b/llm-claude.el
@@ -50,102 +50,29 @@
 ("input_schema" . ,(llm-provider-utils-openai-arguments
 (llm-function-call-args call)
 
-(defun llm-claude--postprocess-messages (messages)
-  "Post-process MESSAGES, as in `llm-provider-chat-request'.
-
-Currently this flattens consecutive user tool results, for reasons
-explained in the final couple sentences of URL
-`https://docs.anthropic.com/en/docs/build-with-claude/\
-tool-use#multiple-tool-example'
-
-Example input:
-
- (((\"role\" . user) (\"content\" . \"Compute 2+3 and 4+5.\"))
-  ((\"role\" . assistant)
-   (\"content\"
-((type . \"tool_use\") (id . \"toolu_017epyv32yDx5zwhNPVprRrQ\")
- (name . \"add\") (input (a . 2) (b . 3)))
-((type . \"tool_use\") (id . \"toolu_01EPALH8MdwuWVxzX8ErNKWM\")
- (name . \"add\") (input (a . 4) (b . 5)
-  ((\"role\" . user)
-   (\"content\"
-((\"type\" . \"tool_result\")
- (\"tool_use_id\" . \"toolu_017epyv32yDx5zwhNPVprRrQ\")
- (\"content\" . \"5\"
-  ((\"role\" . user)
-   (\"content\"
-((\"type\" . \"tool_result\")
- (\"tool_use_id\" . \"toolu_01EPALH8MdwuWVxzX8ErNKWM\")
- (\"content\" . \"9\")
-
-Example output:
-
- (((\"role\" . user) (\"content\" . \"Compute 2+3 and 4+5.\"))
-  ((\"role\" . assistant)
-   (\"content\"
-((type . \"tool_use\") (id . \"toolu_017epyv32yDx5zwhNPVprRrQ\")
- (name . \"add\") (input (a . 2) (b . 3)))
-((type . \"tool_use\") (id . \"toolu_01EPALH8MdwuWVxzX8ErNKWM\")
- (name . \"add\") (input (a . 4) (b . 5)
-  ((\"role\" . \"user\")
-   (\"content\"
-((\"type\" . \"tool_result\")
- (\"tool_use_id\" . \"toolu_017epyv32yDx5zwhNPVprRrQ\")
- (\"content\" . \"5\"))
-((\"type\" . \"tool_result\")
- (\"tool_use_id\" . \"toolu_01EPALH8MdwuWVxzX8ErNKWM\")
- (\"content\" . \"9\")"
-  (let ((result '())
-(tool-results '()))
-(dolist (message messages)
-  (let* ((role (alist-get "role" message nil nil #'equal))
- (content (alist-get "content" message nil nil #'equal))
- (is-tool-result
-  (and (equal role 'user)
-   (listp content)
-   (let ((type
-  (alist-get "type" (car content) nil nil #'equal)))
- (equal type "tool_result")
-(cond
- (is-tool-result
-  (setq tool-results (append tool-results content)))
-
- ;; End of segment of user tool-results
- ((and (null is-tool-result) tool-results)
-  (push `(("role" . "user") ("content" . ,tool-results)) result)
-  (setq tool-results '())
-  (push message result))
-
- (t
-  (push message result)
-
-(when tool-results
-  (push `(("role" . "user") ("content" . ,tool-results)) result))
-
-(nreverse result)))
-
 (cl-defmethod llm-provider-chat-request ((provider llm-claude) prompt stream)
   (let ((request `(("model" . ,(llm-claude-chat-model provider))
("stream" . ,(if stream t :json-false))
;; Claude requires max_tokens
("max_tokens" . ,(or (llm-chat-prompt-max-tokens prompt) 
4096))
("messages" .
-,(llm-claude--postprocess-messages
-  (mapcar (lambda (interaction)
-`(("role" . ,(pcase 
(llm-chat-prompt-interaction-role interaction)
-   ('function 'user)
-