[elpa] externals/denote 001fe15eec 4/4: Document the command denote-backlinks-toggle-context

2024-09-04 Thread ELPA Syncer
branch: externals/denote
commit 001fe15eec09a41996cb04458fff7ca5542f1af7
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Document the command denote-backlinks-toggle-context
---
 README.org | 5 +
 1 file changed, 5 insertions(+)

diff --git a/README.org b/README.org
index 4ec4ceebe1..7ad1072a93 100644
--- a/README.org
+++ b/README.org
@@ -2867,6 +2867,11 @@ Backlinks to "On being honest" (20220614T130812)
 62: indifference.  In [[denote:20220614T130812][On being honest]] I alluded
 #+end_example
 
+#+findex: denote-backlinks-toggle-context
+The command ~denote-backlinks-toggle-context~ will toggle between the
+compact and detailed views inside of the current backlinks buffer. [
+Part of {{{development-version}}}. ]
+
 Note that the width of the lines in the context depends on the
 underlying file.  In the above example, the lines are split at the
 ~fill-column~.  Long lines will show up just fine.  Also note that the



[elpa] externals/denote e33890300a 3/4: Fix some spacing issues with the denote-rename-buffer formatting

2024-09-04 Thread ELPA Syncer
branch: externals/denote
commit e33890300afefa52a466635ddd1084eceec77e5e
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Fix some spacing issues with the denote-rename-buffer formatting
---
 denote-rename-buffer.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/denote-rename-buffer.el b/denote-rename-buffer.el
index 936590029d..ba8c037a9e 100644
--- a/denote-rename-buffer.el
+++ b/denote-rename-buffer.el
@@ -41,13 +41,13 @@
 (defvaralias 'denote-buffer-has-backlinks-string 
'denote-rename-buffer-backlinks-indicator
   "Alias for `denote-rename-buffer-backlinks-indicator'.")
 
-(defcustom denote-rename-buffer-backlinks-indicator "<-->"
+(defcustom denote-rename-buffer-backlinks-indicator " <-->"
   "A string used to indicate that a buffer has backlinks pointing to it."
   :type 'string
   :package-version '(denote . "3.1.0")
   :group 'denote-rename-buffer)
 
-(defcustom denote-rename-buffer-format "[D] %t %b"
+(defcustom denote-rename-buffer-format "[D] %t%b"
   "The format of the buffer name `denote-rename-buffer' should use.
 Thie value is a string that treats specially the following
 specifiers:



[elpa] externals/denote 1df7c9d8a4 2/4: Prepend a liteal "[D]" to denote-rename-buffer-format

2024-09-04 Thread ELPA Syncer
branch: externals/denote
commit 1df7c9d8a4083196886faeff578f33f9d72bda19
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Prepend a liteal "[D]" to denote-rename-buffer-format

I have been using this for a long time now and I think it is a good default.
---
 denote-rename-buffer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote-rename-buffer.el b/denote-rename-buffer.el
index 4337712f4e..936590029d 100644
--- a/denote-rename-buffer.el
+++ b/denote-rename-buffer.el
@@ -47,7 +47,7 @@
   :package-version '(denote . "3.1.0")
   :group 'denote-rename-buffer)
 
-(defcustom denote-rename-buffer-format "%t %b"
+(defcustom denote-rename-buffer-format "[D] %t %b"
   "The format of the buffer name `denote-rename-buffer' should use.
 Thie value is a string that treats specially the following
 specifiers:



[elpa] externals/denote aea9ebb32f 1/4: Add TODO for denote--file-has-backlinks-p

2024-09-04 Thread ELPA Syncer
branch: externals/denote
commit aea9ebb32f5c2dd3069f060fc8e38ee3d7cce1ca
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add TODO for denote--file-has-backlinks-p
---
 denote.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/denote.el b/denote.el
index 348137ac91..702740bc49 100644
--- a/denote.el
+++ b/denote.el
@@ -4139,6 +4139,9 @@ Also see `denote-link-return-links'."
  (id (denote-retrieve-filename-identifier-with-error 
current-file)))
 (delete current-file (denote--retrieve-files-in-xrefs id
 
+;; TODO 2024-09-04: Instead of using `denote-link-return-backlinks' we
+;; should have a function that does not try to find all backlinks but
+;; simply exits as soon as it finds one.
 (defun denote--file-has-backlinks-p (file)
   "Return non-nil if FILE has backlinks."
   (not (zerop (length (denote-link-return-backlinks file)



[elpa] externals/denote updated (717e41d683 -> 001fe15eec)

2024-09-04 Thread ELPA Syncer
elpasync pushed a change to branch externals/denote.

  from  717e41d683 Use correct samples for non-ASCII in slugs
   new  aea9ebb32f Add TODO for denote--file-has-backlinks-p
   new  1df7c9d8a4 Prepend a liteal "[D]" to denote-rename-buffer-format
   new  e33890300a Fix some spacing issues with the denote-rename-buffer 
formatting
   new  001fe15eec Document the command denote-backlinks-toggle-context


Summary of changes:
 README.org  | 5 +
 denote-rename-buffer.el | 4 ++--
 denote.el   | 3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)



[nongnu] branch elpa/haskell-ts-mode created (now c49a063e9a)

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

at  c49a063e9a Fixed defcusotm

This branch includes the following new commits:

   new  78b685d6ea first commit
   new  c87a208012 added haskell.el
   new  b4d522b2b5 fix
   new  7892c1150e added to todo
   new  cc627feca3 added 'instance' to be highlighted
   new  1525dc1dc7 ic
   new  1c017f310e at
   new  5e58b16de5 Added indentation
   new  44d5bdb92f added intent docu to readme
   new  e6ee63c713 Merge branch 'indent'
   new  8499f4c29e uc
   new  38595a001e Major indent fixes
   new  5178ff240f nl indent fix
   new  3e2e2aa769 fix comment
   new  b6426584ca Major updates
   new  020175db62 Major changes
   new  cbfa8eb7c5 Added licence
   new  a0fbb19e80 Added installation instructions
   new  09a1d6647f Fixed argument indenting
   new  d7554fc2ee Major update to font lock
   new  5248e03fc6 uc and major syntax
   new  994edb715d mv filed
   new  15c68f9296 README changed
   new  ebc222940f typo
   new  c87df5d07b added kw
   new  113e443752 Fix quasiquotes
   new  4886b37b9a Fix comment problem
   new  98660f4cce Major changes to comment and indent
   new  dccba09b18 More fixes
   new  eacca94b5c Dont indent quasi quote body
   new  edc4f1dfc9 quasi quote body no indent
   new  00a397204d Major changed, to indentation, font lock
   new  155bf79867 more indent fixes
   new  02f280400c Added eglot supprt
   new  f798439f8a Major indent edits(again)
   new  04971e0c4e Updated ss, added more info in readme
   new  4b14396789 Fixed ge and le sign in prettify sym mode and ss
   new  baf2c373ca f
   new  9f450166d8 better docu
   new  59c4c2a5a6 pattern matching docu
   new  2f49fe8e6a Fixed ss name
   new  834f15a29d temp
   new  764d8414ef fixed image
   new  9c032dc8c4 Better formating and general code quality changes
   new  58d158bef4 More linting
   new  5d3bd04e43 Better keymap formatting
   new  d9afd84e46 Linting fixes
   new  044c1e54fd changed syntax table
   new  a32b73374e Added indent para
   new  998fc309bd General code changes
   new  4cf9f99d93 More changes
   new  6a3c2d27e9 fixed electric pair
   new  c0fe26d991 fixed defgroup error
   new  bd85e76757 Fixed commint mode, as eariler ones did not work
   new  7acc4e8627 Colouring for type synonmyms
   new  dd16b23b60 Fixed comment problems
   new  c2d4c88738 run haskell changes
   new  6586064122 Removed a todo item
   new  e66403b8e6 Changes to indentatoin for infix
   new  9566f23699 new indent funciton
   new  c49a063e9a Fixed defcusotm




[nongnu] elpa/haskell-ts-mode edc4f1dfc9 31/61: quasi quote body no indent

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit edc4f1dfc9873c0371f9f385471e5bb5cfd58328
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

quasi quote body no indent
---
 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 c524a52c9e..e5d4777cbc 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -106,7 +106,7 @@
 (quasiquote (quoter) @font-lock-type-face)
 (quasiquote (quasiquote_body) @font-lock-preprocessor-face
 
-(setq haskell-ts-indent-rules
+(defvar haskell-ts-indent-rules
   (let ((p-prev-sib
 (lambda (node parent bol)
   (let ((n (treesit-node-prev-sibling node)))



[nongnu] elpa/haskell-ts-mode b4d522b2b5 03/61: fix

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit b4d522b2b5ec57c721443b7d2418df5778641c59
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

fix
---
 haskell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haskell.el b/haskell.el
index 26d66d992b..cd715c4190 100644
--- a/haskell.el
+++ b/haskell.el
@@ -3,7 +3,7 @@
 (require 'comint)
 (declare-function treesit-parser-create "treesit.c")
 
-(setq haskell-ts-mode--treesit-font-lock-settings
+(setq haskell-ts-font-lock
  (treesit-font-lock-rules
   :language 'haskell
   :feature 'keyword



[nongnu] elpa/haskell-ts-mode 998fc309bd 50/61: General code changes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 998fc309bd953a64fda225d9d98f2fc64851d8ba
Author: pranshu 
Commit: pranshu 

General code changes
---
 haskell-ts-mode.el | 66 --
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 4ba7f42461..0a08f61ab0 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -23,7 +23,8 @@
 ;; along with this program.  If not, see .
 
 ;;; Commentary:
-;; This is a WIP mode that uses treesitter to provide all the basic
+
+;; This is a major mode that uses treesitter to provide all the basic
 ;; major mode stuff, like indentation, font lock, etc...
 
 ;;; Code:
@@ -39,17 +40,22 @@
 (declare-function treesit-node-type "treesit.c")
 (declare-function treesit-search-subtree "treesit.c")
 
+(defgroup 'haskell-ts-mode nil
+  "Group that contains haskell-ts-mode variables")
+
 (defvar haskell-ts-font-lock-feature-list
   '((comment str pragma parens)
 (type definition function args)
 (match keyword)
 (otherwise signature)))
 
-(defvar haskell-ts-use-indent t
-  "Set to nil if you don't want to use Emacs indent.")
+(defcustom haskell-ts-use-indent t
+  "Set to non-nil to use the indentation provided by haskell-ts-mode"
+  :group 'haskell-ts-mode)
 
-(defvar haskell-ts-font-lock-level 4
-  "Level of font lock, 1 for minimum highlghting and 4 for maximum.")
+(defcustom haskell-ts-font-lock-level 4
+  "Level of font lock, 1 for minimum highlghting and 4 for maximum."
+  :group 'haskell-ts-mode)
 
 (defvar haskell-ts-prettify-symbols-alits
   '(("\\" . "λ")
@@ -61,6 +67,7 @@
(">=" . "≤")))
 
 (defun haskell-ts-font-lock ()
+  "A function that returns the treesit font lock lock settings for haskell."
 (treesit-font-lock-rules
:language 'haskell
:feature 'keyword
@@ -157,7 +164,6 @@
   ((parent-is "apply") parent -1)
   ((node-is "quasiquote") grand-parent 2)
   ((parent-is "quasiquote_body") (lambda (_ _ c) c) 0)
-  ;; Do Hg
   ((lambda (node parent bol)
  (let ((n (treesit-node-prev-sibling node)))
(while (string= "comment" (treesit-node-type n))
@@ -241,16 +247,16 @@
(modify-syntax-entry k "_" table
 (char-table-parent table))
;; whitechar
-   (seq-do
+   (mapc
 (lambda (it) (modify-syntax-entry it " " table))
 (string-to-list "\r\n\f\v \t"))
;; ascSymbol
-   (seq-do
+   (mapc
 (lambda (it) (modify-syntax-entry it "_" table))
 (string-to-list "!#$%&*+./<=>?\\^|-~:"))
(modify-syntax-entry ?_ "_" table)
;; some special (treated like punctuation)
-   (seq-do
+   (mapc
 (lambda (it) (modify-syntax-entry it "." table))
 (string-to-list ",;@"))
;; apostrophe as a word, not delimiter
@@ -268,7 +274,7 @@
(modify-syntax-entry ?\{  "(}1nb" table)
(modify-syntax-entry ?\}  "){4nb" table)
(modify-syntax-entry ?-  "_ 123" table) ;; TODO --> is not a comment
-   (seq-do
+   (mapc
 (lambda (it) (modify-syntax-entry it ">" table))
 (string-to-list "\r\n\f\v"))
table))
@@ -280,34 +286,29 @@
  (haskell-ts-defun-name node)
nil)))
 
-(defun haskell-ts-indent-para()
+(defun haskell-ts-indent-para ()
   "Indent the current paragraph."
   (interactive)
-  (save-excursion
-(backward-paragraph)
-(let ((p (point)))
-  (forward-paragraph)
-  (indent-region p (point)
+  (when-let ((par (bounds-of-thing-at-point 'paragraph)))
+(indent-region (car par) (cdr par
 
 (defvar haskell-ts-mode-map
   (let ((km (make-sparse-keymap)))
 (define-key km (kbd "C-c C-c") 'haskell-ts-compile-region-and-go)
 (define-key km (kbd "C-c C-r") 'haskell-ts-run-haskell)
-(define-key km (kbd "C-M-q") 'haskell-ts-indent-para)
+(define-key km (kbd "C-M-q") 'haskell-ts-indent-para) ; For those who 
don't have emacs 30
 km)
-  "Map for haskell-ts-mode")
+  "Map for haskell-ts-mode.")
 
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
   "Major mode for Haskell files using tree-sitter."
-  :syntax-table haskell-ts-mode-syntax-table
-  :interactive t
   (unless (treesit-ready-p 'haskell)
 (error "Tree-sitter for Haskell is not available"))
   (treesit-parser-create 'haskell)
   (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
   ;; Indent
-  (and haskell-ts-use-indent
+  (when haskell-ts-use-indent
(setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
(setq-local indent-tabs-mode nil))
   ;; Comment
@@ -316,7 +317,7 @@
   (setq-local comment-start-skip "\\(?: \\|^\\)-+")
   ;; Elecric
   (setq-local electric-pair-pairs
- (list (cons ?` ?`) (cons ?\( ?\)) (cons ?{ ?}) (cons ?\" ?\") 
(cons ?\[ ?\])))
+ '((cons ?` ?`) (co

[nongnu] elpa/haskell-ts-mode 58d158bef4 45/61: More linting

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 58d158bef475536e78e2a145f2029c49924fb19a
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

More linting
---
 haskell-ts-mode.el | 63 +++---
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 6d367c2e6d..c6937939f1 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -5,7 +5,9 @@
 
 ;; Author: Pranshu Sharma 
 ;; URL: https://codeberg.org/pranshu/haskell-ts-mode
-;; Keywords: tree-sitter, haskell, emacs
+;; Package-Requires: ((emacs "29.3"))
+;; Version: 1
+;; Keywords: languages, haskell
 
 ;; 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
@@ -26,7 +28,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'comint) (require 'treesit))
+(require 'comint)
+(require 'treesit)
 
 (declare-function treesit-parser-create "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
@@ -77,8 +80,7 @@
"(function (infix right_operand: (_) @haskell-ts-fontify-arg))"
"(generator . (_) @haskell-ts-fontify-arg)"
"(bind (as (variable) . (_) @haskell-ts-fontify-arg))"
-"(patterns) @haskell-ts-fontify-arg"
-   )
+"(patterns) @haskell-ts-fontify-arg")
:language 'haskell
:feature 'type
`((type) @font-lock-type-face
@@ -226,8 +228,7 @@
   ((n-p-gp nil "signature" "foreign_import") grand-parent 3)
   
   ;; Backup
-  (catch-all parent 2)
-  
+  (catch-all parent 2)
 
 ;; Copied from haskell-tng-mode
 (defvar haskell-ts-mode-syntax-table
@@ -270,20 +271,25 @@
(seq-do
 (lambda (it) (modify-syntax-entry it ">" table))
 (string-to-list "\r\n\f\v"))
-
table))
 
 
+(defmacro haskell-ts-imenu-name-function (check-func)
+  `(lambda (node)
+  (if (funcall ,check-func node)
+ (haskell-ts-defun-name node)
+   nil)))
+
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
-  "major mode for Haskell files using tree-sitter"
+  "Major mode for Haskell files using tree-sitter."
   :syntax-table haskell-ts-mode-syntax-table
   :interactive t
   (unless (treesit-ready-p 'haskell)
 (error "Tree-sitter for Haskell is not available"))
   (treesit-parser-create 'haskell)
   (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
-  ;; Indent 
+  ;; Indent
   (and haskell-ts-use-indent
(setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
(setq-local indent-tabs-mode nil))
@@ -304,17 +310,17 @@
 ,(haskell-ts-imenu-name-function 
'haskell-ts-imenu-func-node-p))
("Signatures.." haskell-ts-imenu-sig-node-p nil
 ,(haskell-ts-imenu-name-function 'haskell-ts-imenu-sig-node-p))
-   ("Data..." haskell_ts-imenu-data-type-p nil
+   ("Data..." haskell-ts-imenu-data-type-p nil
 (lambda (node)
   (treesit-node-text (treesit-node-child node 1))
   ;; font-lock.
   (setq-local treesit-font-lock-level haskell-ts-font-lock-level)
   (setq-local treesit-font-lock-settings (haskell-ts-font-lock))
-  (setq-local treesit-font-lock-feature-list   
+  (setq-local treesit-font-lock-feature-list
  haskell-ts-font-lock-feature-list)
   (treesit-major-mode-setup))
 
-(defun haskell-ts-fontify-arg (node &optional override start end)
+(defun haskell-ts-fontify-arg (node &optional _ _ _)
   (if (string= "variable" (treesit-node-type node))
   (put-text-property
(treesit-node-start node)
@@ -322,7 +328,7 @@
'face font-lock-variable-name-face)
 (mapc 'haskell-ts-fontify-arg (treesit-node-children node
 
-(defun haskell-ts-fontify-type (node &optional override start end)
+(defun haskell-ts-fontify-type (node &optional _ _ _)
   (let ((last-child (treesit-node-child node -1)))
 (if (string= (treesit-node-type last-child) "function")
(haskell-ts-fontify-type last-child)
@@ -331,13 +337,6 @@
(treesit-node-end last-child)
'face font-lock-variable-name-face
 
-(defmacro haskell-ts-imenu-name-function (check-func)
-  `(lambda (node)
-(let ((name (treesit-node-text node)))
-  (if (funcall ,check-func node)
- (haskell-ts-defun-name node)
-   nil
-
 (defun haskell-ts-imenu-node-p (regex node)
 (and (string-match-p regex (treesit-node-type node))
 (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
@@ -348,33 +347,35 @@
 (defun haskell-ts-imenu-sig-node-p (node)
   (haskell-ts-imenu-node-p "signature" node))
 
-(defun haskell_ts-imenu-data-type-p (node)
+(defun haskell-ts-imenu-data-type-p (node)
   (haskell-ts-imenu-node-p "data_type" node))
 
 (defun haskell-ts-defun-name (node)
   (treesit-node-text (treesit-node-child node 0)))
 
-(defun hask

[nongnu] elpa/haskell-ts-mode 02f280400c 34/61: Added eglot supprt

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 02f280400c79e933629684401c0fcede8d2bd7e0
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Added eglot supprt
---
 haskell-ts-mode.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index ad8beba5f8..436d2891f9 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -350,6 +350,10 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
+(with-eval-after-load 'eglot
+  (add-to-list 'eglot-server-programs 
+  '(haskell-ts-mode . ("haskell-language-server-wrapper" 
"--lsp"
+
 (when (treesit-ready-p 'haskell)
   (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)))
 



[nongnu] elpa/haskell-ts-mode 9c032dc8c4 44/61: Better formating and general code quality changes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 9c032dc8c47b87d644d2b087d2e713431fa311ef
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Better formating and general code quality changes
---
 haskell-ts-mode.el | 48 
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 63857317c5..6d367c2e6d 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -26,9 +26,7 @@
 
 ;;; Code:
 
-(eval-when-compile
- (require 'treesit)
- (require 'comint))
+(eval-when-compile (require 'comint) (require 'treesit))
 
 (declare-function treesit-parser-create "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
@@ -45,10 +43,10 @@
 (otherwise signature)))
 
 (defvar haskell-ts-use-indent t
-  "Set to nil if you don't want to use emacs indent")
+  "Set to nil if you don't want to use Emacs indent.")
 
 (defvar haskell-ts-font-lock-level 4
-  "Level of font lock, 1 for minimum highlghting and 4 for maximum")
+  "Level of font lock, 1 for minimum highlghting and 4 for maximum.")
 
 (defvar haskell-ts-prettify-symbols-alits
   '(("\\" . "λ")
@@ -59,8 +57,8 @@
("<=" . "≥")
(">=" . "≤")))
 
-(defvar haskell-ts-font-lock
-  (treesit-font-lock-rules
+(defun haskell-ts-font-lock ()
+(treesit-font-lock-rules
:language 'haskell
:feature 'keyword
`(["module" "import" "data" "let" "where" "case"
@@ -126,21 +124,20 @@
(infix operator: (_) @font-lock-operator-face
 
 (defvar haskell-ts-indent-rules
-  (let ((bind-reg "local_binds\\|instance_declarations")
-   (p-prev-sib
-(lambda (node parent bol)
+  (let ((p-prev-sib
+(lambda (node _ _)
   (let ((n (treesit-node-prev-sibling node)))
 (while (string= "comment" (treesit-node-type n))
   (setq n (treesit-node-prev-sibling n)))
 (treesit-node-start n)
`((haskell
   ((node-is "comment") column-0 0)
+  ((node-is "cpp") column-0 0)
   ((parent-is "comment") column-0 0)
   ((parent-is "imports") column-0 0)
   ;; Infix
   ((parent-is "infix") standalone-parent 1)
   ((node-is "infix") standalone-parent 2)
-
   ;; Lambda
   ((parent-is "lambda") standalone-parent 2)
 
@@ -157,7 +154,7 @@
 
   ((parent-is "apply") parent -1)
   ((node-is "quasiquote") grand-parent 2)
-  ((parent-is "quasiquote_body") (lambda (a b c) c) 0)
+  ((parent-is "quasiquote_body") (lambda (_ _ c) c) 0)
   ;; Do Hg
   ((lambda (node parent bol)
  (let ((n (treesit-node-prev-sibling node)))
@@ -168,7 +165,7 @@
   ((parent-is "do") ,p-prev-sib 0)
 
   ((node-is "alternatives")
-   (lambda (a b c)
+   (lambda (_ b _)
  (treesit-node-start (treesit-node-child b 0)))
   4)
   ((parent-is "alternatives") ,p-prev-sib 0)
@@ -178,12 +175,12 @@
   ((parent-is "data_constructors") parent 0)
 
   ;; where
-  ((lambda (node parent bol)
+  ((lambda (node _ _)
  (let ((n (treesit-node-prev-sibling node)))
 (while (string= "comment" (treesit-node-type n))
   (setq n (treesit-node-prev-sibling n)))
 (string= "where" (treesit-node-type n
-   (lambda (a b c)
+   (lambda (_ b _)
  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
3)
   ((parent-is "local_binds\\|instance_declarations") ,p-prev-sib 0)
@@ -191,7 +188,7 @@
   
   ;; Match
   ;; ((match "match" nil 2 2 nil) ,p-prev-sib 0)
-  ((lambda (node parent bol)
+  ((lambda (node _ _)
  (and (string= (treesit-node-type node) "match")
   (let ((pos 3)
 (n node)
@@ -204,7 +201,7 @@
 (and (null n) (eq pos 0)
parent 2)
   ;; ((match "match" nil nil 3 nil) ,p-prev-sib 0)
-  ((lambda (node parent bol)
+  ((lambda (node _ _)
  (and (string= (treesit-node-type node) "match")
   (let ((pos 4)
 (n node)
@@ -224,7 +221,7 @@
   ((parent-is "record") grand-parent 0)
 
   ((parent-is "exports")
-   (lambda (a b c) (treesit-node-start (treesit-node-prev-sibling b)))
+   (lambda (_ b _) (treesit-node-start (treesit-node-prev-sibling b)))
0)
   ((n-p-gp nil "signature" "foreign_import") grand-parent 3)
   
@@ -296,7 +293,7 @@
   (setq-local comment-start-skip "\\(?: \\|^\\)-+")
   ;; Elecric
   (setq-local electric-pair-pairs
- (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))
+ (list (cons ?` ?`) (cons ?\( ?\)) (cons ?{ ?}) (cons ?\" ?\") 
(cons ?\[ ?\])))
   ;; Nav
   (setq-local treesit-defu

[nongnu] elpa/haskell-ts-mode 7892c1150e 04/61: added to todo

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 7892c1150e36e9993065ab1bfff2e32a8da90dae
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

added to todo
---
 README.org | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.org b/README.org
index 0f9e1d3549..4c2932d1fb 100644
--- a/README.org
+++ b/README.org
@@ -6,3 +6,4 @@ A WIP haskell mode that requires treesitter and offers syntax 
highlighting and i
 - Autoloading
 - Syntax table
 - Fix treesit-font-lock-feature-list
+- Comment problem



[nongnu] elpa/haskell-ts-mode 78b685d6ea 01/61: first commit

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 78b685d6ea400ea4dfcab096c4b33345d277582b
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

first commit
---
 README.org | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/README.org b/README.org
new file mode 100644
index 00..e69de29bb2



[nongnu] elpa/haskell-ts-mode 38595a001e 12/61: Major indent fixes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 38595a001eb8562ea464e49df721a109da7f970d
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major indent fixes
---
 haskell.el | 189 -
 1 file changed, 99 insertions(+), 90 deletions(-)

diff --git a/haskell.el b/haskell.el
index 9c57f1852f..6b594aa5f7 100644
--- a/haskell.el
+++ b/haskell.el
@@ -5,84 +5,93 @@
 
 ;; TODO change to defvar
 (setq haskell-ts-font-lock
- (treesit-font-lock-rules
-  :language 'haskell
-  :feature 'keyword
-  `(["module" "import" "data" "let" "where" "case"
- "if" "then" "else" "of" "do" "in" "instance"]
- @font-lock-keyword-face
-["(" ")" "[" "]"] @font-lock-operator-face)
-  :language 'haskell
-  :feature 'type
-  `((type) @font-lock-type-face
-(constructor) @font-lock-type-face)
-  :language 'haskell
-  :feature 'function
-  `((function (variable) @font-lock-function-name-face)
-(function (infix (operator)  @font-lock-function-name-face))
-(bind (variable) @font-lock-function-name-face)
-(function (infix (infix_id (variable) 
@font-lock-function-name-face
-  :language 'haskell
-  :feature 'args
-  `((function (patterns) @font-lock-variable-name-face)
-(function (infix (variable)  @font-lock-variable-name-face))
-(lambda (patterns (variable) @font-lock-variable-name-face)))
-  :language 'haskell
-  :feature 'match
-  `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
-(match ("->" @font-lock-doc-face)))
-  :language 'haskell
-  :feature 'comment
-  `(((comment) @font-lock-comment-face))
-  :language 'haskell
-  :feature 'pragma
-  `((pragma) @font-lock-preprocessor-face)
-  :language 'haskell
-  :feature 'str
-  `((char) @font-lock-string-face
-(string) @font-lock-string-face)))
+  (treesit-font-lock-rules
+   :language 'haskell
+   :feature 'keyword
+   `(["module" "import" "data" "let" "where" "case"
+ "if" "then" "else" "of" "do" "in" "instance"]
+@font-lock-keyword-face
+["(" ")" "[" "]"] @font-lock-operator-face)
+   :language 'haskell
+   :feature 'type
+   `((type) @font-lock-type-face
+(constructor) @font-lock-type-face)
+   :language 'haskell
+   :feature 'function
+   `((function (variable) @font-lock-function-name-face)
+(function (infix (operator)  @font-lock-function-name-face))
+(bind (variable) @font-lock-function-name-face)
+(function (infix (infix_id (variable) @font-lock-function-name-face
+   :language 'haskell
+   :feature 'args
+   `((function (patterns) @font-lock-variable-name-face)
+(function (infix (variable)  @font-lock-variable-name-face))
+(lambda (patterns (variable) @font-lock-variable-name-face)))
+   :language 'haskell
+   :feature 'match
+   `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
+(match ("->" @font-lock-doc-face)))
+   :language 'haskell
+   :feature 'comment
+   `(((comment) @font-lock-comment-face))
+   :language 'haskell
+   :feature 'pragma
+   `((pragma) @font-lock-preprocessor-face)
+   :language 'haskell
+   :feature 'str
+   `((char) @font-lock-string-face
+(string) @font-lock-string-face)))
 
 ;; TODO change to defvar
 (setq haskell-ts-indent-rules
- `((haskell
-((node-is "comment") column-0 0)
-((parent-is "haskell") column-0 0)
-((parent-is "declarations") column-0 0)
-((parent-is "imports") column-0 0)
-((parent-is "local_binds") prev-sibling 0)
-((parent-is "apply") parent 2)
-;; Match
-((match "match" nil nil 2 2) parent 2)
-((node-is "match") prev-sibling 0)
-;; Do Hg
-((parent-is "do") prev-sibling 0)
-((match nil "do" nil 1 1) great-grand-parent 2)
-((node-is "alternatives") grand-parent 0)
-((parent-is "alternatives") grand-parent 2)
-
-;; Infix
-((node-is "infix") grand-parent 2)
-((parent-is "infix") parent 0)
-;; Where PS  TODO 2nd
-
-((lambda (node parent bol)
-   (string= "where" (treesit-node-type 
(treesit-node-prev-sibling node
- (lambda (a b c)
-  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
- 3)
-((parent-is "local_binds") prev-sibling 2)
-((node-is "^where$") parent 2)
-;;

[nongnu] elpa/haskell-ts-mode 4b14396789 37/61: Fixed ge and le sign in prettify sym mode and ss

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 4b14396789d3449d2dd3f53707294225e32fde05
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Fixed ge and le sign in prettify sym mode and ss
---
 haskell-ts-mode.el |   3 ++-
 ss.png | Bin 76449 -> 76104 bytes
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 440360252e..a32d657a32 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -56,7 +56,8 @@
("->" . "→")
("=>" . "⇒")
("<-" . "←")
-   ("<=" . "⇐")))
+   ("<=" . "≥")
+   (">=" . "≤")))
 
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
diff --git a/ss.png b/ss.png
index 03ddc1eb48..af195c39cc 100644
Binary files a/ss.png and b/ss.png differ



[nongnu] elpa/haskell-ts-mode 9566f23699 60/61: new indent funciton

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 9566f23699dadfbe00f90b38445c122d06e2390e
Author: pranshu 
Commit: pranshu 

new indent funciton

Replaced haskell-ts-indent-paragraph with a function based alt.
---
 haskell-ts-mode.el | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index ff6ab5572e..463e17f3a3 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -287,17 +287,21 @@
 (haskell-ts-defun-name node)
nil)))
 
-(defun haskell-ts-indent-para ()
-  "Indent the current paragraph."
-  (interactive)
-  (when-let ((par (bounds-of-thing-at-point 'paragraph)))
-(indent-region (car par) (cdr par
+(defun haskell-ts-indent-defun (pos)
+  "Indent the current function."
+  (interactive "d")
+  (let ((node (treesit-node-at pos)))
+(while (not (string-match
+"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
 
 (defvar haskell-ts-mode-map
   (let ((km (make-sparse-keymap)))
 (define-key km (kbd "C-c C-c") 'haskell-ts-compile-region-and-go)
 (define-key km (kbd "C-c C-r") 'haskell-ts-run-haskell)
-(define-key km (kbd "C-M-q") 'haskell-ts-indent-para) ; For those who 
don't have emacs 30
+(define-key km (kbd "C-M-q") 'haskell-ts-indent-defun) ; For those who 
don't have emacs 30
 km)
   "Map for haskell-ts-mode.")
 



[nongnu] elpa/haskell-ts-mode 4886b37b9a 27/61: Fix comment problem

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 4886b37b9a00bb57343ee74381fc7f7fd1421664
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Fix comment problem
---
 haskell-ts-mode.el | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 65d3bed6fa..07f8b30506 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -201,10 +201,9 @@
   ;; Indent 
   (setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
   ;; Misc
-  (setq-local comment-start "{- ")
-  (setq-local comment-end "-}")
-  (setq-local comment-start-skip "\\(?:--+\\|{-+\\) *")
-  (setq-local comment-end-skip "[ \t]*--+}")
+  (setq-local comment-start "-- ")
+  (setq-local comment-use-syntax nil)
+  (setq-local comment-start-skip "\\(?: \\|^\\)-+")
   (setq-local indent-tabs-mode nil)
   (setq-local electric-pair-pairs
  (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))



[nongnu] elpa/haskell-ts-mode b6426584ca 15/61: Major updates

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit b6426584cab9313ea29f071e8260c425ff548255
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major updates
---
 README.org | 10 +-
 haskell.el | 64 +-
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/README.org b/README.org
index cd1d5a96e8..6e4dfa2618 100644
--- a/README.org
+++ b/README.org
@@ -1,10 +1,10 @@
 
-A WIP haskell mode that requires treesitter and offers basic
-indentation, syntax highlighting and imenu, and a comint repl.
+A haskell mode that requires treesitter and offers:
+- Syntax highliting
+- Indentation
+- Imenu support
+- REPL
 
 * TODO
 - Autoloading
 - Syntax table
-- Fix treesit-font-lock-feature-list
-- Comment problem
-- Better imenu supprt
diff --git a/haskell.el b/haskell.el
index 8edb48a353..7fd313b013 100644
--- a/haskell.el
+++ b/haskell.el
@@ -103,7 +103,10 @@
   ;; Indent 
   (setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
   ;; Misc
-  (setq-local comment-start "--")
+  (setq-local comment-start "{- ")
+  (setq-local comment-end "-}")
+  (setq-local comment-start-skip "\\(?:--+\\|{-+\\) *")
+  (setq-local comment-end-skip "[ \t]*--+}")
   (setq-local indent-tabs-mode nil)
   (setq-local electric-pair-pairs
  (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?' ?') (cons 
?" ?")))
@@ -111,33 +114,52 @@
   (setq-local treesit-defun-type-regexp "function")
   ;; Imenu
   (setq-local treesit-simple-imenu-settings
- `((nil haskell-ts-imenu-func-node-p nil 
haskell-ts-imenu-name-function)
-   ("Signatures.." haskell-ts-imenu-sig-node-p nil 
haskell-ts-imenu-sig-name-function)))
+ `((nil haskell-ts-imenu-func-node-p nil
+,(haskell-ts-imenu-name-function 
'haskell-ts-imenu-func-node-p))
+   ("Signatures.." haskell-ts-imenu-sig-node-p nil
+,(haskell-ts-imenu-name-function 'haskell-ts-imenu-sig-node-p))
+   ("Data..." haskell_ts-imenu-data-type-p nil
+(lambda (node)
+  (treesit-node-text (treesit-node-child node 1))
   ;; font-lock.
   (setq-local treesit-font-lock-settings haskell-ts-font-lock)
-  (setq-local treesit-font-lock-feature-list
- '(( comment  str pragma type keyword definition function args 
match)))
+  (setq-local treesit-font-lock-feature-list   
+ '(( comment  str pragma)
+   (type definition )
+   (args function match)
+   (keyword)))
   (treesit-major-mode-setup))
 
+(defun haskell-ts-imenu-node-p (regex node)
+(and (string-match-p regex (treesit-node-type node))
+(string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
+
+(defmacro haskell-ts-imenu-name-function (check-func)
+  `(lambda (node)
+(let ((name (treesit-node-text node)))
+  (if (funcall ,check-func node)
+ (haskell-ts-defun-name node)
+   nil
+
 (defun haskell-ts-imenu-func-node-p (node)
-  (and (string-match-p "function\\|bind" (treesit-node-type node))
-   (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
+  (haskell-ts-imenu-node-p "function\\|bind" node))
 
 (defun haskell-ts-imenu-sig-node-p (node)
-  (and (string-match-p "signature" (treesit-node-type node))
-   (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
-
-(defun haskell-ts-imenu-sig-name-function (node)
-  (let ((name (treesit-node-text node)))
-(if (haskell-ts-imenu-sig-node-p node)
-   (haskell-ts-defun-name node)
-  nil)))
-
-(defun haskell-ts-imenu-name-function (node)
-  (let ((name (treesit-node-text node)))
-(if (haskell-ts-imenu-func-node-p node)
-   (haskell-ts-defun-name node)
-  nil)))
+  (haskell-ts-imenu-node-p "signature" node))
+
+(defun haskell_ts-imenu-data-type-p (node)
+  (haskell-ts-imenu-node-p "data_type" node))
+
+;; (defun haskell-ts-imenu-sig-name-function (node) }}-
+;;   (let ((name (treesit-node-text node))) }}-
+;; (if (haskell-ts-imenu-sig-node-p node) }}-
+;; (haskell-ts-defun-name node) }}-
+;;   nil))) }}-
+;; (defun haskell-ts-imenu-name-function (node) }}-
+;;   (let ((name (treesit-node-text node))) }}-
+;; (if (haskell-ts-imenu-func-node-p node) }}-
+;; (haskell-ts-defun-name node) }}-
+;;   nil))) }}-
 
 (defun haskell-ts-defun-name (node)
   (treesit-node-text (treesit-node-child node 0)))



[nongnu] elpa/haskell-ts-mode cbfa8eb7c5 17/61: Added licence

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit cbfa8eb7c5a8f3dbb4daa4b59fd3ae14c68e2d7b
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Added licence
---
 LICENSE| 674 +
 haskell.el |  27 +++
 2 files changed, 701 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00..871ce8e638
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permissio

[nongnu] elpa/haskell-ts-mode 9f450166d8 39/61: better docu

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 9f450166d88c6c50939b3d0bb38eeb3a2da39406
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

better docu
---
 haskell-ts-mode.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index a32d657a32..63857317c5 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -288,14 +288,16 @@
   (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
   ;; Indent 
   (and haskell-ts-use-indent
-   (setq-local treesit-simple-indent-rules haskell-ts-indent-rules))
-  ;; Misc
+   (setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
+   (setq-local indent-tabs-mode nil))
+  ;; Comment
   (setq-local comment-start "-- ")
   (setq-local comment-use-syntax nil)
   (setq-local comment-start-skip "\\(?: \\|^\\)-+")
-  (setq-local indent-tabs-mode nil)
+  ;; Elecric
   (setq-local electric-pair-pairs
  (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))
+  ;; Nav
   (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
   (setq-local treesit-defun-type-regexp "function")
   (setq-local prettify-symbols-alist haskell-ts-prettify-symbols-alits)



[nongnu] elpa/haskell-ts-mode 1525dc1dc7 06/61: ic

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 1525dc1dc76ee403770b6722aa54ba4d7c21c82c
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

ic
---
 haskell.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/haskell.el b/haskell.el
index 259997d0ed..8eaaf2078d 100644
--- a/haskell.el
+++ b/haskell.el
@@ -39,6 +39,13 @@
   :feature 'str
   `((char) @font-lock-string-face
 (string) @font-lock-string-face)))
+
+;; TODO change to defvar
+(setq haskell-ts-indent-rules
+ `((haskell
+((node-is "comment") no-indent 0
+
+
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
   "Major mode for Haskell files using tree-sitter"
@@ -47,6 +54,8 @@
(error "Tree-sitter for Haskell is not available"))
   (treesit-parser-create 'haskell)
   (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
+  ;; Indent 
+  (setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
   ;; Misc
   (setq-local comment-start "--")
   (setq-local indent-tabs-mode nil)



[nongnu] elpa/haskell-ts-mode dccba09b18 29/61: More fixes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit dccba09b18fd81bb16db01afa3cdf0d172a54fbc
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

More fixes
---
 haskell-ts-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 60be2482b0..3f8c86b153 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -48,7 +48,7 @@
   '(("\\" . "λ")
("/=" . "≠")))
 
-(setq haskell-ts-font-lock
+(defvar haskell-ts-font-lock
   (treesit-font-lock-rules
:language 'haskell
:feature 'parens
@@ -106,7 +106,7 @@
 (quasiquote (quoter) @font-lock-type-face)
 (quasiquote (quasiquote_body) @font-lock-preprocessor-face
 
-(setq haskell-ts-indent-rules
+(defvar haskell-ts-indent-rules
   (let ((p-prev-sib
 (lambda (node parent bol)
   (let ((n (treesit-node-prev-sibling node)))
@@ -197,7 +197,7 @@
   
 
 ;; Copied from haskell-tng-mode
-(setq haskell-ts-mode-syntax-table
+(defvar haskell-ts-mode-syntax-table
   (let ((table (make-syntax-table)))
(map-char-table
 (lambda (k v)



[nongnu] elpa/haskell-ts-mode e6ee63c713 10/61: Merge branch 'indent'

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit e6ee63c7134970a943af99da1bf30804f172aa66
Merge: 1c017f310e 44d5bdb92f
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Merge branch 'indent'
---
 README.org |  5 +++--
 haskell.el | 53 ++---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 4c2932d1fb..cd1d5a96e8 100644
--- a/README.org
+++ b/README.org
@@ -1,9 +1,10 @@
 
-A WIP haskell mode that requires treesitter and offers syntax highlighting and 
imenu, and a comint mode.
+A WIP haskell mode that requires treesitter and offers basic
+indentation, syntax highlighting and imenu, and a comint repl.
 
 * TODO
-- Indentation
 - Autoloading
 - Syntax table
 - Fix treesit-font-lock-feature-list
 - Comment problem
+- Better imenu supprt
diff --git a/haskell.el b/haskell.el
index 2881845395..dade0e157a 100644
--- a/haskell.el
+++ b/haskell.el
@@ -10,7 +10,8 @@
   :feature 'keyword
   `(["module" "import" "data" "let" "where" "case"
  "if" "then" "else" "of" "do" "in" "instance"]
-@font-lock-keyword-face)
+ @font-lock-keyword-face
+["(" ")" "[" "]"] @font-lock-operator-face)
   :language 'haskell
   :feature 'type
   `((type) @font-lock-type-face
@@ -40,14 +41,60 @@
   :feature 'str
   `((char) @font-lock-string-face
 (string) @font-lock-string-face)))
+
+;; TODO change to defvar
+(setq haskell-ts-indent-rules
+ `((haskell
+((node-is "comment") column-0 0)
+((parent-is "haskell") column-0 0)
+((parent-is "declarations") column-0 0)
+((parent-is "imports") column-0 0)
+((parent-is "local_binds") prev-sibling 0)
+((parent-is "apply") parent 2)
+;; Match
+((match "match" nil nil 2 2) parent 2)
+((node-is "match") prev-sibling 0)
+;; Do Hg
+((parent-is "do") prev-sibling 0)
+((match nil "do" nil 1 1) great-grand-parent 2)
+((node-is "alternatives") grand-parent 0)
+((parent-is "alternatives") grand-parent 2)
+
+;; Infix
+((node-is "infix") grand-parent 2)
+((parent-is "infix") parent 0)
+;; Where PS  TODO 2nd
+
+((lambda (node parent bol)
+   (string= "where" (treesit-node-type 
(treesit-node-prev-sibling node
+ (lambda (a b c)
+  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
+ 3)
+((parent-is "local_binds") prev-sibling 2)
+((node-is "^where$") parent 2)
+;; If statement
+((node-is "then") parent 2)
+((node-is "else") parent 2)
+
+;; lists
+((node-is "^in$") parent 2)
+((lambda (a b c)
+   (save-excursion
+ (goto-char c)
+ (re-search-forward "^[ \t]*$" (line-end-position) t)))
+ prev-adaptive-prefix 0
+
+
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
-  "Major mode for Haskell files using tree-sitter"
+  "Mjaor mode for Haskell files using tree-sitter"
   :group 'haskell
   (unless (treesit-ready-p 'haskell)
(error "Tree-sitter for Haskell is not available"))
   (treesit-parser-create 'haskell)
   (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
+  ;; Indent 
+  (setq-local treesit-simple-indent-rules haskell-ts-indent-rules)
   ;; Misc
   (setq-local comment-start "--")
   (setq-local indent-tabs-mode nil)
@@ -107,4 +154,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-(add-to-list ' auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



[nongnu] elpa/haskell-ts-mode baf2c373ca 38/61: f

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit baf2c373caa9f03f23ef956b5891f73aa2307226
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

f
---
 ss.png | Bin 76104 -> 75291 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/ss.png b/ss.png
index af195c39cc..70b01bbdf5 100644
Binary files a/ss.png and b/ss.png differ



[nongnu] elpa/haskell-ts-mode 5e58b16de5 08/61: Added indentation

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 5e58b16de5816c27ab19018fc7641510770683ff
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Added indentation
---
 README.org |  1 +
 haskell.el | 46 ++
 2 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 4c2932d1fb..6aa1887d69 100644
--- a/README.org
+++ b/README.org
@@ -7,3 +7,4 @@ A WIP haskell mode that requires treesitter and offers syntax 
highlighting and i
 - Syntax table
 - Fix treesit-font-lock-feature-list
 - Comment problem
+- Better imenu supprt
diff --git a/haskell.el b/haskell.el
index 8eaaf2078d..c46399dbd4 100644
--- a/haskell.el
+++ b/haskell.el
@@ -9,7 +9,8 @@
   :feature 'keyword
   `(["module" "import" "data" "let" "where" "case"
  "if" "then" "else" "of" "do" "in" "instance"]
-@font-lock-keyword-face)
+ @font-lock-keyword-face
+["(" ")" "[" "]"] @font-lock-operator-face)
   :language 'haskell
   :feature 'type
   `((type) @font-lock-type-face
@@ -43,12 +44,49 @@
 ;; TODO change to defvar
 (setq haskell-ts-indent-rules
  `((haskell
-((node-is "comment") no-indent 0
+((node-is "comment") column-0 0)
+((parent-is "haskell") column-0 0)
+((parent-is "declarations") column-0 0)
+((parent-is "imports") column-0 0)
+((parent-is "local_binds") prev-sibling 0)
+((parent-is "apply") parent 2)
+;; Match
+((match "match" nil nil 2 2) parent 2)
+((node-is "match") prev-sibling 0)
+;; Do Hg
+((parent-is "do") prev-sibling 0)
+((match nil "do" nil 1 1) great-grand-parent 2)
+((node-is "alternatives") grand-parent 0)
+((parent-is "alternatives") grand-parent 2)
+
+;; Infix
+((node-is "infix") grand-parent 2)
+((parent-is "infix") parent 0)
+;; Where PS  TODO 2nd
+
+((lambda (node parent bol)
+   (string= "where" (treesit-node-type 
(treesit-node-prev-sibling node
+ (lambda (a b c)
+  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
+ 3)
+((parent-is "local_binds") prev-sibling 2)
+((node-is "^where$") parent 2)
+;; If statement
+((node-is "then") parent 2)
+((node-is "else") parent 2)
+
+;; lists
+((node-is "^in$") parent 2)
+((lambda (a b c)
+   (save-excursion
+ (goto-char c)
+ (re-search-forward "^[ \t]*$" (line-end-position) t)))
+ prev-adaptive-prefix 0
 
 
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
-  "Major mode for Haskell files using tree-sitter"
+  "Mjaor mode for Haskell files using tree-sitter"
   :group 'haskell
   (unless (treesit-ready-p 'haskell)
(error "Tree-sitter for Haskell is not available"))
@@ -115,4 +153,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-(add-to-list ' auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



[nongnu] elpa/haskell-ts-mode eacca94b5c 30/61: Dont indent quasi quote body

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit eacca94b5cd4aa0e28f4b5cb053508dc054fa67f
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Dont indent quasi quote body
---
 haskell-ts-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 3f8c86b153..c524a52c9e 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -106,7 +106,7 @@
 (quasiquote (quoter) @font-lock-type-face)
 (quasiquote (quasiquote_body) @font-lock-preprocessor-face
 
-(defvar haskell-ts-indent-rules
+(setq haskell-ts-indent-rules
   (let ((p-prev-sib
 (lambda (node parent bol)
   (let ((n (treesit-node-prev-sibling node)))
@@ -131,6 +131,7 @@
   ((node-is "^in$") parent 2)
   
   ((parent-is "apply") parent -1)
+  ((parent-is "quasiquote_body") (lambda (a b c) c) 0)
   ;; Do Hg
   ((lambda (node parent bol)
  (let ((n (treesit-node-prev-sibling node)))



[nongnu] elpa/haskell-ts-mode 7acc4e8627 55/61: Colouring for type synonmyms

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 7acc4e8627111befc1bea8116f21ed7a93815312
Author: pranshu 
Commit: pranshu 

Colouring for type synonmyms
---
 haskell-ts-mode.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index c0d3614c37..229a1f8935 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -71,7 +71,7 @@
   (treesit-font-lock-rules
:language 'haskell
:feature 'keyword
-   `(["module" "import" "data" "let" "where" "case"
+   `(["module" "import" "data" "let" "where" "case" "type"
   "if" "then" "else" "of" "do" "in" "instance" "class"]
  @font-lock-keyword-face)
:language 'haskell
@@ -102,6 +102,7 @@
:override t
`((function name: (variable) @font-lock-function-name-face)
  (function (infix (operator)  @font-lock-function-name-face))
+ (declarations (type_synomym (name) @font-lock-function-name-face))
  (bind (variable) @font-lock-function-name-face)
  (function (infix (infix_id (variable) @font-lock-function-name-face)))
  (bind (as (variable) @font-lock-function-name-face)))
@@ -273,7 +274,7 @@
 ;; comments (subsuming pragmas)
 (modify-syntax-entry ?\{  "(}1nb" table)
 (modify-syntax-entry ?\}  "){4nb" table)
-(modify-syntax-entry ?-  "_ 123" table) ;; TODO --> is not a comment
+(modify-syntax-entry ?-  "_ 123" table)
 (mapc
  (lambda (it) (modify-syntax-entry it ">" table))
  (string-to-list "\r\n\f\v"))



[nongnu] elpa/haskell-ts-mode 04971e0c4e 36/61: Updated ss, added more info in readme

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 04971e0c4ee0ab8105c2ef48e1c49ac3253f3018
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Updated ss, added more info in readme
---
 README.org | 106 -
 ss.png | Bin 23881 -> 76449 bytes
 2 files changed, 42 insertions(+), 64 deletions(-)

diff --git a/README.org b/README.org
index 8bca07d764..4d0fab56f0 100644
--- a/README.org
+++ b/README.org
@@ -3,36 +3,41 @@
 
 A haskell mode that uses treesitter.
 
-The package is still in devlopment, please report bugs or email
-them(email found it main .el file).
-
 * Screenshot
 [[ss.png]]
 
+The above screenshot is indented coloured using haskell-ts-mode, with
+prettify-symbols-mode enabled.
+
 * Features
-The basic features are:
+an overview of the features are:
 - Syntax highliting
 - Indentation
 - Imenu support
 - REPL
 - Prettify symbols mode support
 
+* Comparasion with haskell-mode
 The more interesting features are:
 - Logical syntax highlighting:
   - Only arguments that can be used in functions are highlighted, eg
 in `f (_:(a:[])) only 'a' is highlighted
-  - The return type of a function is optionally highlighted, if
-treesit-font-lock-level is set to 4
+  - The return type of a function is highlighted
   - All new variabels are(or should be) highlighted, this includes
 generators, lambda args.
   - highlighting the '=' operaotr in guarded matches correctly, this
 would be stupidly hard in regexp based syntax
 - Unlike haskell-mode, quasi quotes are understood and do not confuse
-  the mode
-- Consistant indentation: haskell-mode's indentation works in a
-  cyclical way, it cycles through where you might want indentation.
-  haskell-ts-mode, meanwhile relies on you to set the parse tree
-  changing whitespace.
+  the mode, thanks to treesitter
+- Predictable (but less powerful) indentation: haskell-mode's
+  indentation works in a cyclical way, it cycles through where you
+  might want indentation.  haskell-ts-mode, meanwhile relies on you to
+  set the concrete syntax tree changing whitespace.
+- More perfomant, this is especially seen in longer files
+- Much much less code, haskell mode has accumlated 30,000 lines of
+  features to do with all things haskell related, this mode just keeps
+  the scope to basic major mode stuff, and leaves other stuff for
+  external packages.
 
 * Motivation
   
@@ -48,58 +53,6 @@ very complex and required a web of dependencies.
 Both these modes ended up practically parsing haskells syntax to
 implement indentation, so I thought why not use tree sitter?
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-However, haskell(-tng)-mode is still a lot more complete than this,
-and is recommended if you have any commercial work to do.
-  
 * Installation
 
 #+BEGIN_SRC: elisp
@@ -114,5 +67,30 @@ treesit-font-lock-level accordingly.
 
 If that is not enough, you can customize haskell-ts-font-lock-feature-list
 
-* TODO
+** how to disable haskell-ts-mode indentation
+
+#+begin_src: emacs-lisp
+(setq haskell-ts-use-indent nil)
+#+end_src
+
+** Pretify symbols mode
+prettify symbols mode can be used to replace common symbols with
+unicode alternatives.
+
+#+begin_src: emacs-lisp
+(add-hook 'haskell-ts-mode 'prettify-symbols-mode)
+#+end_src
+
+** Adjusting font lock level
+set haskell-ts-font-lock-level accordingly.
+
+* TODO and limitations
 - support for customization UI
+- Imenu support for functions with multiple definitions
+
+Limitations: _Proper indenting of multiline signatures_: the
+treesitter grammer does not flatten the signautes, rather leaves them
+to the standard infix interpretatoin. This makes indentation hard, as
+it will mean the only way to check if the the signature node is an
+ancestor of node at point is to perfom a recursive ascent, which is
+horrible for perfomance.
diff --git a/ss.png b/ss.png
index 4d2a168cc7..03ddc1eb48 100644
Binary files a/ss.png and b/ss.png differ



[nongnu] elpa/haskell-ts-mode 1c017f310e 07/61: at

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 1c017f310e0281a56e0f491b982b94d96b397c27
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

at
---
 haskell.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/haskell.el b/haskell.el
index 259997d0ed..2881845395 100644
--- a/haskell.el
+++ b/haskell.el
@@ -3,6 +3,7 @@
 (require 'comint)
 (declare-function treesit-parser-create "treesit.c")
 
+;; TODO change to defvar
 (setq haskell-ts-font-lock
  (treesit-font-lock-rules
   :language 'haskell



[nongnu] elpa/haskell-ts-mode 15c68f9296 23/61: README changed

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 15c68f92965e31b33432dc5c3231ac953412180a
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

README changed
---
 README.org | 23 +++
 haskell-ts-mode.el |  5 +
 2 files changed, 28 insertions(+)

diff --git a/README.org b/README.org
index 129f773f6f..4baf9c8e2b 100644
--- a/README.org
+++ b/README.org
@@ -1,10 +1,30 @@
 
+* Context
+
 A haskell mode that requires treesitter and offers:
 - Syntax highliting
 - Indentation
 - Imenu support
 - REPL
+- Prettify symbols mode support
+
+* Motivation
+  
+haskell-mode contains nearly 30k lines of code, and is
+about 30 years old.  Therefore, a lot of stuff emacs has gained the
+ability to do in those years, haskell-mode already has implemented
+them.
+
+In 2018, a mode called haskell-tng-mode was made to solve some of
+these problems. However because of haskell's syntax, it too became
+very complex and required a web of dependencies.
 
+Both these modes ended up practically parsing haskells syntax to
+implement indentation, so I thought why not use tree sitter?
+
+However, haskell(-tng)-mode is still a lot more complete than this,
+and is recommended if you have any commercial work to do.
+  
 * Installation
 
 #+BEGIN_SRC: elisp
@@ -18,3 +38,6 @@ 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
+
+* TODO
+- support for customization UI
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 3c0dc6e443..917cab35ea 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -44,6 +44,10 @@
 (match keyword)
 (otherwise)))
 
+(defvar haskell-ts-prettify-symbols-alits
+  '(("\\" . "λ")
+   ("/=" . "≠")))
+
 ;; TODO change to defvar
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
@@ -204,6 +208,7 @@
  (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))
   (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
   (setq-local treesit-defun-type-regexp "function")
+  (setq-local prettify-symbols-alist haskell-ts-prettify-symbols-alist)
   ;; Imenu
   (setq-local treesit-simple-imenu-settings
  `((nil haskell-ts-imenu-func-node-p nil



[nongnu] elpa/haskell-ts-mode c87df5d07b 25/61: added kw

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit c87df5d07b1508afc6e6275967b0b9537b8656a0
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

added kw
---
 haskell-ts-mode.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 8a2217c3c1..d31ec5a6ed 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -48,7 +48,6 @@
   '(("\\" . "λ")
("/=" . "≠")))
 
-;; TODO change to defvar
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
:language 'haskell
@@ -58,7 +57,7 @@
:language 'haskell
:feature 'keyword
`(["module" "import" "data" "let" "where" "case"
- "if" "then" "else" "of" "do" "in" "instance"]
+ "if" "then" "else" "of" "do" "in" "instance" "class"]
 @font-lock-keyword-face)
:language 'haskell
:feature 'otherwise



[nongnu] elpa/haskell-ts-mode d9afd84e46 47/61: Linting fixes

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

Linting fixes
---
 README.org | 9 -
 haskell-ts-mode.el | 6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 1a6f405cd7..221985a957 100644
--- a/README.org
+++ b/README.org
@@ -15,7 +15,7 @@ an overview of the features are:
 - Syntax highliting
 - Indentation
 - Imenu support
-- REPL
+- REPL (C-c r in the mode to run)
 - Prettify symbols mode support
 
 * Comparasion with haskell-mode
@@ -86,6 +86,13 @@ unicode alternatives.
 ** Adjusting font lock level
 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
+(eval-when-load 'eglot (haskell-ts-setup-eglot))
+#+end_src
+
 * TODO and limitations
 - support for customization UI
 - Imenu support for functions with multiple definitions
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 27a15c811e..5e63641aee 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -378,9 +378,9 @@
   (get-buffer-process "*haskell*"))
 
 (defun haskell-ts-setup-eglot()
-  (require 'eglot)
-  (add-to-list 'eglot-server-programs
-  '(haskell-ts-mode . ("haskell-language-server-wrapper" 
"--lsp"
+  (when (featurep 'eglot)
+   (add-to-list 'eglot-server-programs
+  '(haskell-ts-mode . ("haskell-language-server-wrapper" 
"--lsp")
 
 (when (treesit-ready-p 'haskell)
   (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)))



[nongnu] elpa/haskell-ts-mode 59c4c2a5a6 40/61: pattern matching docu

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 59c4c2a5a6478920e50f4c85c768825aef642731
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

pattern matching docu
---
 README.org | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 4d0fab56f0..cdfb42cc04 100644
--- a/README.org
+++ b/README.org
@@ -21,7 +21,8 @@ an overview of the features are:
 The more interesting features are:
 - Logical syntax highlighting:
   - Only arguments that can be used in functions are highlighted, eg
-in `f (_:(a:[])) only 'a' is highlighted
+in `f (_:(a:[])) only 'a' is highlighted, as it is the only
+variable that is captured that can be used in body of function
   - The return type of a function is highlighted
   - All new variabels are(or should be) highlighted, this includes
 generators, lambda args.



[nongnu] elpa/haskell-ts-mode 5248e03fc6 21/61: uc and major syntax

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 5248e03fc6979c717f3b3b9750f9acdc8d450808
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

uc and major syntax
---
 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 1b2aefb0b2..3c0dc6e443 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -269,7 +269,7 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-;; (when (treesit-ready-p 'haskell)
-  ;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)))
+(when (treesit-ready-p 'haskell)
+  (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)))
 
 (provide 'haskell-ts-mode)



[nongnu] elpa/haskell-ts-mode 8499f4c29e 11/61: uc

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 8499f4c29eef2ef6f8b1627b1e7d3c172236e61a
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

uc
---
 haskell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haskell.el b/haskell.el
index dade0e157a..9c57f1852f 100644
--- a/haskell.el
+++ b/haskell.el
@@ -154,4 +154,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+(add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



[nongnu] elpa/haskell-ts-mode 994edb715d 22/61: mv filed

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 994edb715dad6cff7d93908e7e6dfb8bf215210d
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

mv filed
---
 haskell.el | 243 -
 1 file changed, 243 deletions(-)

diff --git a/haskell.el b/haskell.el
deleted file mode 100644
index 8ff16a364c..00
--- a/haskell.el
+++ /dev/null
@@ -1,243 +0,0 @@
-;;; haskell.el --- A treesit based major mode for haskell -*- 
lexical-binding:t -*-
-
-;; Copyright (C) 2024  Pranshu Sharma
-
-
-;; Author: Pranshu Sharma 
-;; URL: https://codeberg.org/pranshu/haskell-ts-mode
-;; Keywords: tree-sitter, haskell, emacs
-
-;; 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:
-;; This is a WIP mode that uses treesitter to provide all the basic
-;; major mode stuff, like indentation, font lock, etc...
-
-;;; Code:
-
-(eval-when-compile
- (require 'treesit)
- (require 'comint))
-
-(declare-function treesit-parser-create "treesit.c")
-(declare-function treesit-induce-sparse-tree "treesit.c")
-(declare-function treesit-node-child "treesit.c")
-(declare-function treesit-node-start "treesit.c")
-(declare-function treesit-node-text "treesit.c")
-(declare-function treesit-node-type "treesit.c")
-(declare-function treesit-search-subtree "treesit.c")
-
-;; TODO change to defvar
-(defvar haskell-ts-font-lock
-  (treesit-font-lock-rules
-   :language 'haskell
-   :feature 'keyword
-   `(["module" "import" "data" "let" "where" "case"
- "if" "then" "else" "of" "do" "in" "instance"]
-@font-lock-keyword-face
-["(" ")" "[" "]"] @font-lock-operator-face)
-   :language 'haskell
-   :feature 'type
-   `((type) @font-lock-type-face
-(constructor) @font-lock-type-face)
-   :language 'haskell
-   :feature 'function
-   `((function (variable) @font-lock-function-name-face)
-(function (infix (operator)  @font-lock-function-name-face))
-(bind (variable) @font-lock-function-name-face)
-(function (infix (infix_id (variable) @font-lock-function-name-face
-   :language 'haskell
-   :feature 'args
-   `((function (patterns) @font-lock-variable-name-face)
-(function (infix (variable)  @font-lock-variable-name-face))
-(lambda (patterns (variable) @font-lock-variable-name-face)))
-   :language 'haskell
-   :feature 'match
-   `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
-(match ("->" @font-lock-doc-face)))
-   :language 'haskell
-   :feature 'comment
-   `(((comment) @font-lock-comment-face))
-   :language 'haskell
-   :feature 'pragma
-   `((pragma) @font-lock-preprocessor-face)
-   :language 'haskell
-   :feature 'str
-   `((char) @font-lock-string-face
-(string) @font-lock-string-face)))
-
-(defvar haskell-ts-indent-rules
-  `((haskell
-((node-is "comment") column-0 0)
-((parent-is "imports") column-0 0)
-
-;; list
-((node-is "]") parent 0)
-((parent-is "list") parent 1)
-
-;; If then else
-((node-is "then") parent 2)
-((node-is "^else$") parent 2)
-
-((node-is "^in$") parent 2)
- 
-((parent-is "apply") parent 2)
-
-;; Match
-((match "match" nil nil 2 2) parent 2)
-((node-is "match") prev-sibling 0)
-((parent-is "match") grand-parent 2)
-
-;; Do Hg
-((lambda (node parent bol)
-   (string= "do" (treesit-node-type (treesit-node-prev-sibling node
- grand-parent 0)
-((parent-is "do") prev-sibling 0)
-
-((node-is "alternatives") grand-parent 0)
-((parent-is "alternatives") grand-parent 2)
-
-;; Infix
-((node-is "infix") grand-parent 2)
-((parent-is "infix") parent 0)
-
-((parent-is "data_constructors") parent 0)
-
-;; where
-((lambda (node parent bol)
-   (string= "where" (treesit-node-type (treesit-node-prev-sibling 
node
- (lambda (a b c)
-   (+ 1 (treesit-node-start (treesit-node-prev-sibling b
- 3)
-((parent-is "local_binds") prev-sibling 0)
-((node-is "^where$") parent 2)
-
-(no-node prev-adaptive-prefix 0)
-((parent-is "haskell") column-0 0)
-((parent-is "declarations") column-0 0)
-
-

[nongnu] elpa/haskell-ts-mode a32b73374e 49/61: Added indent para

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

Added indent para
---
 README.org |  8 +++-
 haskell-ts-mode.el | 10 ++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 221985a957..73144c07db 100644
--- a/README.org
+++ b/README.org
@@ -1,5 +1,5 @@
 
-* Context
+* haskell-ts-mode
 
 A haskell mode that uses treesitter.
 
@@ -10,6 +10,12 @@ A haskell mode that uses treesitter.
 The above screenshot is indented coloured using haskell-ts-mode, with
 prettify-symbols-mode enabled.
 
+* Usage
+
+=C-c C-r= to open REPL
+=C-c C-c= to send code to repl
+=C-M-q=   Indent paragraph
+
 * Features
 an overview of the features are:
 - Syntax highliting
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index a0ca3eac42..4ba7f42461 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -280,10 +280,20 @@
  (haskell-ts-defun-name node)
nil)))
 
+(defun haskell-ts-indent-para()
+  "Indent the current paragraph."
+  (interactive)
+  (save-excursion
+(backward-paragraph)
+(let ((p (point)))
+  (forward-paragraph)
+  (indent-region p (point)
+
 (defvar haskell-ts-mode-map
   (let ((km (make-sparse-keymap)))
 (define-key km (kbd "C-c C-c") 'haskell-ts-compile-region-and-go)
 (define-key km (kbd "C-c C-r") 'haskell-ts-run-haskell)
+(define-key km (kbd "C-M-q") 'haskell-ts-indent-para)
 km)
   "Map for haskell-ts-mode")
 



[nongnu] elpa/haskell-ts-mode 2f49fe8e6a 41/61: Fixed ss name

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 2f49fe8e6a7033b8bf632b9f48d5f91da7b59149
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Fixed ss name
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index cdfb42cc04..452a593380 100644
--- a/README.org
+++ b/README.org
@@ -4,7 +4,7 @@
 A haskell mode that uses treesitter.
 
 * Screenshot
-[[ss.png]]
+[[./ss.png]]
 
 The above screenshot is indented coloured using haskell-ts-mode, with
 prettify-symbols-mode enabled.



[nongnu] elpa/haskell-ts-mode 020175db62 16/61: Major changes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 020175db62a3da11548c206cfcc5688b09bb88ac
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major changes

Added changes such as syntax table
---
 README.org |  4 
 haskell.el | 76 +++---
 2 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/README.org b/README.org
index 6e4dfa2618..a1ead68de3 100644
--- a/README.org
+++ b/README.org
@@ -4,7 +4,3 @@ A haskell mode that requires treesitter and offers:
 - Indentation
 - Imenu support
 - REPL
-
-* TODO
-- Autoloading
-- Syntax table
diff --git a/haskell.el b/haskell.el
index 7fd313b013..30a0ba3467 100644
--- a/haskell.el
+++ b/haskell.el
@@ -1,10 +1,18 @@
 
-(require 'treesit)
-(require 'comint)
+(eval-when-compile
+ (require 'treesit)
+ (require 'comint))
+
 (declare-function treesit-parser-create "treesit.c")
+(declare-function treesit-induce-sparse-tree "treesit.c")
+(declare-function treesit-node-child "treesit.c")
+(declare-function treesit-node-start "treesit.c")
+(declare-function treesit-node-text "treesit.c")
+(declare-function treesit-node-type "treesit.c")
+(declare-function treesit-search-subtree "treesit.c")
 
 ;; TODO change to defvar
-(setq haskell-ts-font-lock
+(defvar haskell-ts-font-lock
   (treesit-font-lock-rules
:language 'haskell
:feature 'keyword
@@ -42,12 +50,15 @@
`((char) @font-lock-string-face
 (string) @font-lock-string-face)))
 
-;; TODO change to defvar
-(setq haskell-ts-indent-rules
+(defvar haskell-ts-indent-rules
   `((haskell
 ((node-is "comment") column-0 0)
 ((parent-is "imports") column-0 0)
 
+;; list
+((node-is "]") parent 0)
+((parent-is "list") parent 1)
+
 ;; If then else
 ((node-is "then") parent 2)
 ((node-is "^else$") parent 2)
@@ -61,7 +72,6 @@
 ((node-is "match") prev-sibling 0)
 ((parent-is "match") grand-parent 2)
 
-
 ;; Do Hg
 ((lambda (node parent bol)
(string= "do" (treesit-node-type (treesit-node-prev-sibling node
@@ -89,13 +99,44 @@
 (no-node prev-adaptive-prefix 0)
 ((parent-is "haskell") column-0 0)
 ((parent-is "declarations") column-0 0)
+
+((parent-is "record") grand-parent 0)
+
+;; Backup
+(catch-all parent 2)
 )))
 
+;; Copied from haskell-mode
+(setq haskell-ts-mode-syntax-table
+(let ((table (make-syntax-table)))
+(modify-syntax-entry ?\  " " table)
+(modify-syntax-entry ?\t " " table)
+(modify-syntax-entry ?\" "\"" table)
+(modify-syntax-entry ?\' "_" table)
+(modify-syntax-entry ?_  "_" table)
+(modify-syntax-entry ?\( "()" table)
+(modify-syntax-entry ?\) ")(" table)
+(modify-syntax-entry ?\[  "(]" table)
+(modify-syntax-entry ?\]  ")[" table)
+
+(modify-syntax-entry ?\{  "(}1nb" table)
+(modify-syntax-entry ?\}  "){4nb" table)
+(modify-syntax-entry ?-  "< 123" table)
+(modify-syntax-entry ?\n ">" table)
+
+(modify-syntax-entry ?\` "$`" table)
+
+(mapc (lambda (x)
+(modify-syntax-entry x "." table))
+  "!#$%&*+./:<=>?@^|~,;\\")
+table))
+
 
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
-  "Mjaor mode for Haskell files using tree-sitter"
-  :group 'haskell
+  "major mode for Haskell files using tree-sitter"
+  :syntax-table haskell-ts-mode-syntax-table
+  :interactive t
   (unless (treesit-ready-p 'haskell)
 (error "Tree-sitter for Haskell is not available"))
   (treesit-parser-create 'haskell)
@@ -109,7 +150,7 @@
   (setq-local comment-end-skip "[ \t]*--+}")
   (setq-local indent-tabs-mode nil)
   (setq-local electric-pair-pairs
- (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?' ?') (cons 
?" ?")))
+ (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?")))
   (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
   (setq-local treesit-defun-type-regexp "function")
   ;; Imenu
@@ -126,8 +167,7 @@
   (setq-local treesit-font-lock-feature-list   
  '(( comment  str pragma)
(type definition )
-   (args function match)
-   (keyword)))
+   (args function match keyword)))
   (treesit-major-mode-setup))
 
 (defun haskell-ts-imenu-node-p (regex node)
@@ -150,17 +190,6 @@
 (defun haskell_ts-imenu-data-type-p (node)
   (haskell-ts-imenu-node-p "data_type" node))
 
-;; (defun haskell-ts-imenu-sig-name-function (node) }}-
-;;   (let ((name (treesit-node-text node))) }}-
-;; (if (haskell-ts-imenu-sig-node-p node) }}-
-;; (haskell-ts-defun-name node) }}-
-;;   nil))) }}-
-;; (defun haskell-ts-imenu-name-function (node) }}-
-;;   (let ((name (treesit-node-text node))) }}-
-;; (if (haskell-ts-imenu-func-node-p node) }}-
-;; (haskell-ts-defun-name node) }}-
-;;   nil))) }}-
-
 (defun haskell-ts-defun-name (node)
  

[nongnu] elpa/haskell-ts-mode 09a1d6647f 19/61: Fixed argument indenting

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 09a1d6647f3def9cd3f59d00c7e820749f36b741
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Fixed argument indenting

Indentation of arguments is now on left instead of right
---
 haskell-ts-mode.el | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index f345400d4c..0e0cd6f64e 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -82,6 +82,10 @@
 ((node-is "comment") column-0 0)
 ((parent-is "imports") column-0 0)
 
+;; Infix
+((parent-is "infix") parent 0)
+((node-is "infix") grand-parent 2)
+
 ;; list
 ((node-is "]") parent 0)
 ((parent-is "list") parent 1)
@@ -92,7 +96,7 @@
 
 ((node-is "^in$") parent 2)
  
-((parent-is "apply") parent 2)
+((parent-is "apply") parent -1)
 
 ;; Match
 ((match "match" nil nil 2 2) parent 2)
@@ -108,10 +112,8 @@
 ((node-is "alternatives") grand-parent 0)
 ((parent-is "alternatives") grand-parent 2)
 
-;; Infix
-((node-is "infix") grand-parent 2)
-((parent-is "infix") parent 0)
-
+(no-node prev-adaptive-prefix 0)
+
 ((parent-is "data_constructors") parent 0)
 
 ;; where
@@ -123,7 +125,6 @@
 ((parent-is "local_binds") prev-sibling 0)
 ((node-is "^where$") parent 2)
 
-(no-node prev-adaptive-prefix 0)
 ((parent-is "haskell") column-0 0)
 ((parent-is "declarations") column-0 0)
 
@@ -177,7 +178,7 @@
   (setq-local comment-end-skip "[ \t]*--+}")
   (setq-local indent-tabs-mode nil)
   (setq-local electric-pair-pairs
- (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?")))
+ (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))
   (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
   (setq-local treesit-defun-type-regexp "function")
   ;; Imenu



[nongnu] elpa/haskell-ts-mode 764d8414ef 43/61: fixed image

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 764d8414ef8c9d517dbb712d0ee2974dc983d4bd
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

fixed image

forgot to turn on prettify sybmols in image
---
 ss.png | Bin 75291 -> 73807 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/ss.png b/ss.png
index 70b01bbdf5..deda7480d7 100644
Binary files a/ss.png and b/ss.png differ



[nongnu] elpa/haskell-ts-mode 044c1e54fd 48/61: changed syntax table

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 044c1e54fd17ff8be83a2a91491eb2df4350bd78
Author: pranshu 
Commit: pranshu 

changed syntax table

_ now seperates word
---
 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 5e63641aee..a0ca3eac42 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -230,7 +230,7 @@
   ;; Backup
   (catch-all parent 2)
 
-;; Copied from haskell-tng-mode
+;; Copied from haskell-tng-mode, changed a bit
 (defvar haskell-ts-mode-syntax-table
   (let ((table (make-syntax-table)))
(map-char-table
@@ -248,7 +248,7 @@
(seq-do
 (lambda (it) (modify-syntax-entry it "_" table))
 (string-to-list "!#$%&*+./<=>?\\^|-~:"))
-   (modify-syntax-entry ?_ "w" table)
+   (modify-syntax-entry ?_ "_" table)
;; some special (treated like punctuation)
(seq-do
 (lambda (it) (modify-syntax-entry it "." table))



[nongnu] elpa/haskell-ts-mode c2d4c88738 57/61: run haskell changes

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

run haskell changes

Thanks to Philip Kaludercic
---
 haskell-ts-mode.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index c9ebce9a21..5410ce73bc 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -381,10 +381,10 @@
 
 (defun haskell-ts-run-haskell()
   (interactive)
-  (when (not (comint-check-proc "*haskell*"))
-(set-buffer (apply (function make-comint)
-   "haskell" "ghci" nil `(,buffer-file-name
-  (pop-to-buffer-same-window "*haskell*"))
+  (pop-to-buffer-same-window
+   (if (comint-check-proc "*haskell*")
+   "*haskell*"
+ (make-comint "haskell" "ghci" nil buffer-file-name
 
 (defun haskell-ts-haskell-session ()
   (get-buffer-process "*haskell*"))



[nongnu] elpa/haskell-ts-mode e66403b8e6 59/61: Changes to indentatoin for infix

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

Changes to indentatoin for infix

Before indentation had bug which would cause breaking AST in speicfic
scinaroes such as when infix was in 2 lines with operator in second
line
---
 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 5410ce73bc..ff6ab5572e 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -146,8 +146,8 @@
((parent-is "comment") column-0 0)
((parent-is "imports") column-0 0)
;; Infix
-   ((parent-is "infix") standalone-parent 1)
-   ((node-is "infix") standalone-parent 2)
+   ((node-is "infix") standalone-parent 1)
+   ((parent-is "infix") grand-parent 0)
;; Lambda
((parent-is "lambda") standalone-parent 2)
 



[nongnu] elpa/haskell-ts-mode c0fe26d991 53/61: fixed defgroup error

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

fixed defgroup error
---
 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 37a83b94e1..15ad8e79a9 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -40,7 +40,7 @@
 (declare-function treesit-node-type "treesit.c")
 (declare-function treesit-search-subtree "treesit.c")
 
-(defgroup 'haskell-ts-mode nil
+(defgroup haskell-ts-mode nil
   "Group that contains haskell-ts-mode variables")
 
 (defvar haskell-ts-font-lock-feature-list



[nongnu] elpa/haskell-ts-mode 155bf79867 33/61: more indent fixes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 155bf7986730eefa42abb6640b65b2777a4c117b
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

more indent fixes
---
 README.org | 51 +--
 haskell-ts-mode.el | 17 +
 2 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 4cd1ddc5e8..8bca07d764 100644
--- a/README.org
+++ b/README.org
@@ -33,8 +33,6 @@ The more interesting features are:
   cyclical way, it cycles through where you might want indentation.
   haskell-ts-mode, meanwhile relies on you to set the parse tree
   changing whitespace.
-- Significantly more perfomant than haskell(-tng)-mode, don't have a
-  number on this yet.
 
 * Motivation
   
@@ -50,6 +48,55 @@ very complex and required a web of dependencies.
 Both these modes ended up practically parsing haskells syntax to
 implement indentation, so I thought why not use tree sitter?
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 However, haskell(-tng)-mode is still a lot more complete than this,
 and is recommended if you have any commercial work to do.
   
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 267ca6d70a..ad8beba5f8 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -98,10 +98,12 @@
 (match ("->" @font-lock-doc-face)))
:language 'haskell
:feature 'comment
-   `(((comment) @font-lock-comment-face))
+   `(((comment) @font-lock-comment-face)
+((haddock) @font-lock-doc-face))
:language 'haskell
:feature 'pragma
-   `((pragma) @font-lock-preprocessor-face)
+   `((pragma) @font-lock-preprocessor-face
+(cpp) @font-lock-preprocessor-face)
:language 'haskell
:feature 'str
:override t
@@ -119,10 +121,11 @@
 (treesit-node-start n)
`((haskell
   ((node-is "comment") column-0 0)
+  ((parent-is "comment") column-0 0)
   ((parent-is "imports") column-0 0)
   ;; Infix
   ((parent-is "infix") parent 0)
-  ((node-is "infix") grand-parent 2)
+  ((node-is "infix") standalone-parent 2)
   
   ;; list
   ((node-is "]") parent 0)
@@ -133,8 +136,9 @@
   ((node-is "^else$") parent 2)
 
   ((node-is "^in$") parent 2)
-  
+
   ((parent-is "apply") parent -1)
+  ((node-is "quasiquote") grand-parent 2)
   ((parent-is "quasiquote_body") (lambda (a b c) c) 0)
   ;; Do Hg
   ((lambda (node parent bol)
@@ -196,6 +200,11 @@
   ((parent-is "declarations") column-0 0)
 
   ((parent-is "record") grand-parent 0)
+
+  ((parent-is "exports")
+   (lambda (a b c) (treesit-node-start (treesit-node-prev-sibling b)))
+   0)
+  ((n-p-gp nil "signature" "foreign_import") grand-parent 3)
   
   ;; Backup
   (catch-all parent 2)



[nongnu] elpa/haskell-ts-mode 6a3c2d27e9 52/61: fixed electric pair

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 6a3c2d27e92b74937d197e315fa22e074bcb0475
Author: pranshu 
Commit: pranshu 

fixed electric pair
---
 haskell-ts-mode.el | 404 ++---
 1 file changed, 202 insertions(+), 202 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 0a08f61ab0..37a83b94e1 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -58,146 +58,146 @@
   :group 'haskell-ts-mode)
 
 (defvar haskell-ts-prettify-symbols-alits
-  '(("\\" . "λ")
-   ("/=" . "≠")
-   ("->" . "→")
-   ("=>" . "⇒")
-   ("<-" . "←")
-   ("<=" . "≥")
-   (">=" . "≤")))
+  '(("\\" . "λ")
+("/=" . "≠")
+("->" . "→")
+("=>" . "⇒")
+("<-" . "←")
+("<=" . "≥")
+(">=" . "≤")))
 
 (defun haskell-ts-font-lock ()
   "A function that returns the treesit font lock lock settings for haskell."
-(treesit-font-lock-rules
-   :language 'haskell
-   :feature 'keyword
-   `(["module" "import" "data" "let" "where" "case"
- "if" "then" "else" "of" "do" "in" "instance" "class"]
-@font-lock-keyword-face)
-   :language 'haskell
-   :feature 'otherwise
-   :override t
-   `(((match (guards guard: (boolean (variable) @font-lock-keyword-face)))
-(:match "otherwise" @font-lock-keyword-face)))
-   :language 'haskell
-   :feature 'args
-   :override 'keep
-   (concat
-   "(function (infix left_operand: (_) @haskell-ts-fontify-arg))"
-   "(function (infix right_operand: (_) @haskell-ts-fontify-arg))"
-   "(generator . (_) @haskell-ts-fontify-arg)"
-   "(bind (as (variable) . (_) @haskell-ts-fontify-arg))"
-"(patterns) @haskell-ts-fontify-arg")
-   :language 'haskell
-   :feature 'type
-   `((type) @font-lock-type-face
-(constructor) @font-lock-type-face)
-   :language 'haskell
-   :override t
-   :feature 'signature
-   `((signature (function) @haskell-ts-fontify-type)
-(context (function) @haskell-ts-fontify-type))
-   :language 'haskell
-   :feature 'function
-   :override t
-   `((function name: (variable) @font-lock-function-name-face)
-(function (infix (operator)  @font-lock-function-name-face))
-(bind (variable) @font-lock-function-name-face)
-(function (infix (infix_id (variable) @font-lock-function-name-face)))
-(bind (as (variable) @font-lock-function-name-face)))
-   :language 'haskell
-   :feature 'match
-   `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
-(list_comprehension ("|" @font-lock-doc-face
- (qualifiers (generator "<-" 
@font-lock-doc-face
-(match ("->" @font-lock-doc-face)))
-   :language 'haskell
-   :feature 'comment
-   `(((comment) @font-lock-comment-face)
-((haddock) @font-lock-doc-face))
-   :language 'haskell
-   :feature 'pragma
-   `((pragma) @font-lock-preprocessor-face
-(cpp) @font-lock-preprocessor-face)
-   :language 'haskell
-   :feature 'str
-   :override t
-   `((char) @font-lock-string-face
-(string) @font-lock-string-face
-(quasiquote (quoter) @font-lock-type-face)
-(quasiquote (quasiquote_body) @font-lock-preprocessor-face))
-   :language 'haskell
-   :feature 'parens
-   :override t
-   `(["(" ")" "[" "]"] @font-lock-operator-face
-   (infix operator: (_) @font-lock-operator-face
+  (treesit-font-lock-rules
+   :language 'haskell
+   :feature 'keyword
+   `(["module" "import" "data" "let" "where" "case"
+  "if" "then" "else" "of" "do" "in" "instance" "class"]
+ @font-lock-keyword-face)
+   :language 'haskell
+   :feature 'otherwise
+   :override t
+   `(((match (guards guard: (boolean (variable) @font-lock-keyword-face)))
+  (:match "otherwise" @font-lock-keyword-face)))
+   :language 'haskell
+   :feature 'args
+   :override 'keep
+   (concat
+"(function (infix left_operand: (_) @haskell-ts-fontify-arg))"
+"(function (infix right_operand: (_) @haskell-ts-fontify-arg))"
+"(generator . (_) @haskell-ts-fontify-arg)"
+"(bind (as (variable) . (_) @haskell-ts-fontify-arg))"
+"(patterns) @haskell-ts-fontify-arg")
+   :language 'haskell
+   :feature 'type
+   `((type) @font-lock-type-face
+ (constructor) @font-lock-type-face)
+   :language 'haskell
+   :override t
+   :feature 'signature
+   `((signature (function) @haskell-ts-fontify-type)
+ (context (function) @haskell-ts-fontify-type))
+   :language 'haskell
+   :feature 'function
+   :override t
+   `((function name: (variable) @font-lock-function-name-face)
+ (function (infix (operator)  @font-lock-function-name-face))
+ (bind (variable) @font-lock-function-name-face)
+ (function (infix (infix_id (variable) @font-lock-function-name-face)))
+ (bind (as (variable) @font-lock-function-name-face)))
+   :language 'haskell
+   :featu

[nongnu] elpa/haskell-ts-mode 3e2e2aa769 14/61: fix comment

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 3e2e2aa76903b507b840b90b2a061bf40173f7e0
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

fix comment
---
 haskell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haskell.el b/haskell.el
index b39639d3bf..8edb48a353 100644
--- a/haskell.el
+++ b/haskell.el
@@ -161,4 +161,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+(add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



[nongnu] elpa/haskell-ts-mode 44d5bdb92f 09/61: added intent docu to readme

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 44d5bdb92faf6a7c11737524a520753dc61d4762
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

added intent docu to readme
---
 README.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 6aa1887d69..cd1d5a96e8 100644
--- a/README.org
+++ b/README.org
@@ -1,8 +1,8 @@
 
-A WIP haskell mode that requires treesitter and offers syntax highlighting and 
imenu, and a comint mode.
+A WIP haskell mode that requires treesitter and offers basic
+indentation, syntax highlighting and imenu, and a comint repl.
 
 * TODO
-- Indentation
 - Autoloading
 - Syntax table
 - Fix treesit-font-lock-feature-list



[nongnu] elpa/haskell-ts-mode 4cf9f99d93 51/61: More changes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 4cf9f99d93e344d981819a7ce314b635f914ef92
Author: pranshu 
Commit: pranshu 

More changes
---
 .elpaignore | 3 +++
 README.org  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.elpaignore b/.elpaignore
new file mode 100644
index 00..373c2df8f3
--- /dev/null
+++ b/.elpaignore
@@ -0,0 +1,3 @@
+ss.png
+README.org
+LICENSE
\ No newline at end of file
diff --git a/README.org b/README.org
index 73144c07db..c359be1dc2 100644
--- a/README.org
+++ b/README.org
@@ -96,7 +96,7 @@ set haskell-ts-font-lock-level accordingly.
 haskell-ts-mode is not compatiable with lsp-haskell. To enable eglot
 support, use the following function:
 #+begin_src: emacs-lisp
-(eval-when-load 'eglot (haskell-ts-setup-eglot))
+(with-eval-after-load 'eglot (haskell-ts-setup-eglot))
 #+end_src
 
 * TODO and limitations



[nongnu] elpa/haskell-ts-mode d7554fc2ee 20/61: Major update to font lock

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit d7554fc2ee40a477685d723e80a186b6c4b03e24
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major update to font lock
---
 README.org |  7 +++
 haskell-ts-mode.el | 57 --
 2 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/README.org b/README.org
index 73a80c3f61..129f773f6f 100644
--- a/README.org
+++ b/README.org
@@ -11,3 +11,10 @@ A haskell mode that requires treesitter and offers:
 (add-to-list 'load-path "path/to/haskell-ts-mode")
 (require 'haskell-ts-mode)
 #+END_SRC
+
+* Customization
+
+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
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 0e0cd6f64e..1b2aefb0b2 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -38,33 +38,56 @@
 (declare-function treesit-node-type "treesit.c")
 (declare-function treesit-search-subtree "treesit.c")
 
+(defvar haskell-ts-font-lock-feature-list
+  '((comment str pragma parens)
+(type definition function args)
+(match keyword)
+(otherwise)))
+
 ;; TODO change to defvar
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
+   :language 'haskell
+   :feature 'parens
+   `(["(" ")" "[" "]"] @font-lock-operator-face
+   (infix operator: (_) @font-lock-operator-face))
:language 'haskell
:feature 'keyword
`(["module" "import" "data" "let" "where" "case"
  "if" "then" "else" "of" "do" "in" "instance"]
-@font-lock-keyword-face
-["(" ")" "[" "]"] @font-lock-operator-face)
+@font-lock-keyword-face)
+   :language 'haskell
+   :feature 'otherwise
+   :override t
+   `(((match (guards guard: (boolean (variable) @font-lock-keyword-face)))
+(:match "otherwise" @font-lock-keyword-face)))
+   :language 'haskell
+   :feature 'args
+   :override 'keep
+   (concat
+   "(function (infix left_operand: (_) @haskell-ts-fontify-arg))"
+   "(function (infix right_operand: (_) @haskell-ts-fontify-arg))"
+   "(generator . (_) @haskell-ts-fontify-arg)"
+   "(bind (as (variable) . (_) @haskell-ts-fontify-arg))"
+"(patterns) @haskell-ts-fontify-arg"
+   )
:language 'haskell
:feature 'type
`((type) @font-lock-type-face
 (constructor) @font-lock-type-face)
:language 'haskell
:feature 'function
+   :override t
`((function (variable) @font-lock-function-name-face)
 (function (infix (operator)  @font-lock-function-name-face))
 (bind (variable) @font-lock-function-name-face)
-(function (infix (infix_id (variable) @font-lock-function-name-face
-   :language 'haskell
-   :feature 'args
-   `((function (patterns) @font-lock-variable-name-face)
-(function (infix (variable)  @font-lock-variable-name-face))
-(lambda (patterns (variable) @font-lock-variable-name-face)))
+(function (infix (infix_id (variable) @font-lock-function-name-face)))
+(bind (as (variable) @font-lock-function-name-face)))
:language 'haskell
:feature 'match
`((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
+(list_comprehension ("|" @font-lock-doc-face
+ (qualifiers (generator "<-" 
@font-lock-doc-face
 (match ("->" @font-lock-doc-face)))
:language 'haskell
:feature 'comment
@@ -135,7 +158,7 @@
 )))
 
 ;; Copied from haskell-mode
-(setq haskell-ts-mode-syntax-table
+(defvar haskell-ts-mode-syntax-table
 (let ((table (make-syntax-table)))
 (modify-syntax-entry ?\  " " table)
 (modify-syntax-entry ?\t " " table)
@@ -193,11 +216,17 @@
   ;; font-lock.
   (setq-local treesit-font-lock-settings haskell-ts-font-lock)
   (setq-local treesit-font-lock-feature-list   
- '(( comment  str pragma)
-   (type definition )
-   (args function match keyword)))
+ haskell-ts-font-lock-feature-list)
   (treesit-major-mode-setup))
 
+(defun haskell-ts-fontify-arg (node &optional override start end)
+  (if (string= "variable" (treesit-node-type node))
+  (put-text-property
+   (treesit-node-start node)
+   (treesit-node-end node)
+   'face font-lock-variable-name-face)
+(mapc 'haskell-ts-fontify-arg (treesit-node-children node
+
 (defun haskell-ts-imenu-node-p (regex node)
 (and (string-match-p regex (treesit-node-type node))
 (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
@@ -240,7 +269,7 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-(when (treesit-ready-p 'haskell)
-  (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)))
+;; (when (treesit-ready-

[nongnu] elpa/haskell-ts-mode dd16b23b60 56/61: Fixed comment problems

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

Fixed comment problems
---
 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 229a1f8935..c9ebce9a21 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -314,7 +314,7 @@
 (setq-local indent-tabs-mode nil))
   ;; Comment
   (setq-local comment-start "-- ")
-  (setq-local comment-use-syntax nil)
+  (setq-local comment-use-syntax t)
   (setq-local comment-start-skip "\\(?: \\|^\\)-+")
   ;; Elecric
   (setq-local electric-pair-pairs



[nongnu] elpa/haskell-ts-mode 98660f4cce 28/61: Major changes to comment and indent

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 98660f4cce6822bd67c273033c7c950cc402d5a4
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major changes to comment and indent

modified:   haskell-ts-mode.el
---
 haskell-ts-mode.el | 214 +
 1 file changed, 133 insertions(+), 81 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 07f8b30506..60be2482b0 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -106,87 +106,139 @@
 (quasiquote (quoter) @font-lock-type-face)
 (quasiquote (quasiquote_body) @font-lock-preprocessor-face
 
-(defvar haskell-ts-indent-rules
-  `((haskell
-((node-is "comment") column-0 0)
-((parent-is "imports") column-0 0)
-
-;; Infix
-((parent-is "infix") parent 0)
-((node-is "infix") grand-parent 2)
-
-;; list
-((node-is "]") parent 0)
-((parent-is "list") parent 1)
-
-;; If then else
-((node-is "then") parent 2)
-((node-is "^else$") parent 2)
-
-((node-is "^in$") parent 2)
- 
-((parent-is "apply") parent -1)
-
-;; Match
-((match "match" nil nil 2 2) parent 2)
-((node-is "match") prev-sibling 0)
-((parent-is "match") grand-parent 2)
-
-;; Do Hg
-((lambda (node parent bol)
-   (string= "do" (treesit-node-type (treesit-node-prev-sibling node
- grand-parent 0)
-((parent-is "do") prev-sibling 0)
-
-((node-is "alternatives") grand-parent 0)
-((parent-is "alternatives") grand-parent 2)
-
-(no-node prev-adaptive-prefix 0)
-
-((parent-is "data_constructors") parent 0)
-
-;; where
-((lambda (node parent bol)
-   (string= "where" (treesit-node-type (treesit-node-prev-sibling 
node
- (lambda (a b c)
-   (+ 1 (treesit-node-start (treesit-node-prev-sibling b
- 3)
-((parent-is "local_binds") prev-sibling 0)
-((node-is "^where$") parent 2)
-
-((parent-is "haskell") column-0 0)
-((parent-is "declarations") column-0 0)
-
-((parent-is "record") grand-parent 0)
-
-;; Backup
-(catch-all parent 2)
-)))
-
-;; Copied from haskell-mode
-(defvar haskell-ts-mode-syntax-table
-(let ((table (make-syntax-table)))
-(modify-syntax-entry ?\  " " table)
-(modify-syntax-entry ?\t " " table)
-(modify-syntax-entry ?\" "\"" table)
-(modify-syntax-entry ?\' "_" table)
-(modify-syntax-entry ?_  "_" table)
-(modify-syntax-entry ?\( "()" table)
-(modify-syntax-entry ?\) ")(" table)
-(modify-syntax-entry ?\[  "(]" table)
-(modify-syntax-entry ?\]  ")[" table)
-
-(modify-syntax-entry ?\{  "(}1nb" table)
-(modify-syntax-entry ?\}  "){4nb" table)
-(modify-syntax-entry ?-  "< 123" table)
-(modify-syntax-entry ?\n ">" table)
-
-(modify-syntax-entry ?\` "$`" table)
-
-(mapc (lambda (x)
-(modify-syntax-entry x "." table))
-  "!#$%&*+./:<=>?@^|~,;\\")
-table))
+(setq haskell-ts-indent-rules
+  (let ((p-prev-sib
+(lambda (node parent bol)
+  (let ((n (treesit-node-prev-sibling node)))
+(while (string= "comment" (treesit-node-type n))
+  (setq n (treesit-node-prev-sibling n)))
+(treesit-node-start n)
+   `((haskell
+  ((node-is "comment") column-0 0)
+  ((parent-is "imports") column-0 0)
+  ;; Infix
+  ((parent-is "infix") parent 0)
+  ((node-is "infix") grand-parent 2)
+  
+  ;; list
+  ((node-is "]") parent 0)
+  ((parent-is "list") parent 1)
+  
+  ;; If then else
+  ((node-is "then") parent 2)
+  ((node-is "^else$") parent 2)
+
+  ((node-is "^in$") parent 2)
+  
+  ((parent-is "apply") parent -1)
+  ;; Do Hg
+  ((lambda (node parent bol)
+ (let ((n (treesit-node-prev-sibling node)))
+(while (string= "comment" (treesit-node-type n))
+  (setq n (treesit-node-prev-sibling n)))
+(string= "do" (treesit-node-type n
+   grand-parent 0)
+  ((parent-is "do") ,p-prev-sib 0)
+
+  ((node-is "alternatives") grand-parent 0)
+  ((parent-is "alternatives") grand-parent 2)
+
+  (no-node prev-adaptive-prefix 0)
+  
+  ((parent-is "data_constructors") parent 0)
+
+  ;; where
+  ((lambda (node parent bol)
+ (let ((n (treesit-node-prev-sibling node)))
+(while (string= "comment" (treesit-node-type n))
+  (setq n (treesit-node-prev-sibling n)))
+(string= "where" (treesit-node-type n
+   (lambda (a b c)
+ (+ 1 (treesit-node-start (treesit-node-prev-sibling b

[nongnu] elpa/haskell-ts-mode f798439f8a 35/61: Major indent edits(again)

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit f798439f8ac975f72350ee8e69c9827205e9a44d
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major indent edits(again)

Supports indentation of instance where, and fixed lots of minute parts
of indentation so that it is now able to properly indent most of ghci 
source code properly
---
 haskell-ts-mode.el | 61 +-
 1 file changed, 42 insertions(+), 19 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 436d2891f9..440360252e 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -44,16 +44,22 @@
 (match keyword)
 (otherwise signature)))
 
+(defvar haskell-ts-use-indent t
+  "Set to nil if you don't want to use emacs indent")
+
+(defvar haskell-ts-font-lock-level 4
+  "Level of font lock, 1 for minimum highlghting and 4 for maximum")
+
 (defvar haskell-ts-prettify-symbols-alits
   '(("\\" . "λ")
-   ("/=" . "≠")))
+   ("/=" . "≠")
+   ("->" . "→")
+   ("=>" . "⇒")
+   ("<-" . "←")
+   ("<=" . "⇐")))
 
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
-   :language 'haskell
-   :feature 'parens 
-   `(["(" ")" "[" "]"] @font-lock-operator-face
-   (infix operator: (_) @font-lock-operator-face))
:language 'haskell
:feature 'keyword
`(["module" "import" "data" "let" "where" "case"
@@ -81,7 +87,8 @@
:language 'haskell
:override t
:feature 'signature
-   `((signature (function) @haskell-ts-fontify-type))
+   `((signature (function) @haskell-ts-fontify-type)
+(context (function) @haskell-ts-fontify-type))
:language 'haskell
:feature 'function
:override t
@@ -110,10 +117,16 @@
`((char) @font-lock-string-face
 (string) @font-lock-string-face
 (quasiquote (quoter) @font-lock-type-face)
-(quasiquote (quasiquote_body) @font-lock-preprocessor-face
+(quasiquote (quasiquote_body) @font-lock-preprocessor-face))
+   :language 'haskell
+   :feature 'parens
+   :override t
+   `(["(" ")" "[" "]"] @font-lock-operator-face
+   (infix operator: (_) @font-lock-operator-face
 
 (defvar haskell-ts-indent-rules
-  (let ((p-prev-sib
+  (let ((bind-reg "local_binds\\|instance_declarations")
+   (p-prev-sib
 (lambda (node parent bol)
   (let ((n (treesit-node-prev-sibling node)))
 (while (string= "comment" (treesit-node-type n))
@@ -124,8 +137,14 @@
   ((parent-is "comment") column-0 0)
   ((parent-is "imports") column-0 0)
   ;; Infix
-  ((parent-is "infix") parent 0)
+  ((parent-is "infix") standalone-parent 1)
   ((node-is "infix") standalone-parent 2)
+
+  ;; Lambda
+  ((parent-is "lambda") standalone-parent 2)
+
+  ;; in
+  ((node-is "^in$") parent 0)
   
   ;; list
   ((node-is "]") parent 0)
@@ -135,22 +154,23 @@
   ((node-is "then") parent 2)
   ((node-is "^else$") parent 2)
 
-  ((node-is "^in$") parent 2)
-
   ((parent-is "apply") parent -1)
   ((node-is "quasiquote") grand-parent 2)
   ((parent-is "quasiquote_body") (lambda (a b c) c) 0)
   ;; Do Hg
   ((lambda (node parent bol)
  (let ((n (treesit-node-prev-sibling node)))
-(while (string= "comment" (treesit-node-type n))
+   (while (string= "comment" (treesit-node-type n))
   (setq n (treesit-node-prev-sibling n)))
 (string= "do" (treesit-node-type n
-   grand-parent 0)
+   standalone-parent 3)
   ((parent-is "do") ,p-prev-sib 0)
 
-  ((node-is "alternatives") grand-parent 0)
-  ((parent-is "alternatives") grand-parent 2)
+  ((node-is "alternatives")
+   (lambda (a b c)
+ (treesit-node-start (treesit-node-child b 0)))
+  4)
+  ((parent-is "alternatives") ,p-prev-sib 0)
 
   (no-node prev-adaptive-prefix 0)
   
@@ -165,9 +185,9 @@
(lambda (a b c)
  (+ 1 (treesit-node-start (treesit-node-prev-sibling b
3)
-  ((parent-is "local_binds") ,p-prev-sib 0)
+  ((parent-is "local_binds\\|instance_declarations") ,p-prev-sib 0)
   ((node-is "^where$") parent 2)
-
+  
   ;; Match
   ;; ((match "match" nil 2 2 nil) ,p-prev-sib 0)
   ((lambda (node parent bol)
@@ -195,7 +215,8 @@
 (setq pos (- pos 1
 (eq pos 0
,p-prev-sib 0)
-  
+  ((parent-is "match") standalone-parent 2)
+  
   ((parent-is "haskell") column-0 0)
   ((parent-is "declarations") column-0 0)
 
@@ -265,7 +286,8 @@
   (treesit-parser-create 'haskell)
   (setq-local treesit-defun-type-regexp 
"\\(?

[nongnu] elpa/haskell-ts-mode 834f15a29d 42/61: temp

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 834f15a29dfea697ce6cd88d60867658390b95e2
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

temp
---
 README.org | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.org b/README.org
index 452a593380..1a6f405cd7 100644
--- a/README.org
+++ b/README.org
@@ -4,6 +4,7 @@
 A haskell mode that uses treesitter.
 
 * Screenshot
+
 [[./ss.png]]
 
 The above screenshot is indented coloured using haskell-ts-mode, with



[nongnu] elpa/haskell-ts-mode a0fbb19e80 18/61: Added installation instructions

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit a0fbb19e808d09126c00c3b0eaf93794f16cc671
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Added installation instructions
---
 README.org |   7 ++
 haskell-ts-mode.el | 245 +
 2 files changed, 252 insertions(+)

diff --git a/README.org b/README.org
index a1ead68de3..73a80c3f61 100644
--- a/README.org
+++ b/README.org
@@ -4,3 +4,10 @@ A haskell mode that requires treesitter and offers:
 - Indentation
 - Imenu support
 - REPL
+
+* Installation
+
+#+BEGIN_SRC: elisp
+(add-to-list 'load-path "path/to/haskell-ts-mode")
+(require 'haskell-ts-mode)
+#+END_SRC
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
new file mode 100644
index 00..f345400d4c
--- /dev/null
+++ b/haskell-ts-mode.el
@@ -0,0 +1,245 @@
+;;; haskell-ts-mode.el --- A treesit based major mode for haskell -*- 
lexical-binding:t -*-
+
+;; Copyright (C) 2024  Pranshu Sharma
+
+
+;; Author: Pranshu Sharma 
+;; URL: https://codeberg.org/pranshu/haskell-ts-mode
+;; Keywords: tree-sitter, haskell, emacs
+
+;; 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:
+;; This is a WIP mode that uses treesitter to provide all the basic
+;; major mode stuff, like indentation, font lock, etc...
+
+;;; Code:
+
+(eval-when-compile
+ (require 'treesit)
+ (require 'comint))
+
+(declare-function treesit-parser-create "treesit.c")
+(declare-function treesit-induce-sparse-tree "treesit.c")
+(declare-function treesit-node-child "treesit.c")
+(declare-function treesit-node-start "treesit.c")
+(declare-function treesit-node-text "treesit.c")
+(declare-function treesit-node-type "treesit.c")
+(declare-function treesit-search-subtree "treesit.c")
+
+;; TODO change to defvar
+(defvar haskell-ts-font-lock
+  (treesit-font-lock-rules
+   :language 'haskell
+   :feature 'keyword
+   `(["module" "import" "data" "let" "where" "case"
+ "if" "then" "else" "of" "do" "in" "instance"]
+@font-lock-keyword-face
+["(" ")" "[" "]"] @font-lock-operator-face)
+   :language 'haskell
+   :feature 'type
+   `((type) @font-lock-type-face
+(constructor) @font-lock-type-face)
+   :language 'haskell
+   :feature 'function
+   `((function (variable) @font-lock-function-name-face)
+(function (infix (operator)  @font-lock-function-name-face))
+(bind (variable) @font-lock-function-name-face)
+(function (infix (infix_id (variable) @font-lock-function-name-face
+   :language 'haskell
+   :feature 'args
+   `((function (patterns) @font-lock-variable-name-face)
+(function (infix (variable)  @font-lock-variable-name-face))
+(lambda (patterns (variable) @font-lock-variable-name-face)))
+   :language 'haskell
+   :feature 'match
+   `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
+(match ("->" @font-lock-doc-face)))
+   :language 'haskell
+   :feature 'comment
+   `(((comment) @font-lock-comment-face))
+   :language 'haskell
+   :feature 'pragma
+   `((pragma) @font-lock-preprocessor-face)
+   :language 'haskell
+   :feature 'str
+   `((char) @font-lock-string-face
+(string) @font-lock-string-face)))
+
+(defvar haskell-ts-indent-rules
+  `((haskell
+((node-is "comment") column-0 0)
+((parent-is "imports") column-0 0)
+
+;; list
+((node-is "]") parent 0)
+((parent-is "list") parent 1)
+
+;; If then else
+((node-is "then") parent 2)
+((node-is "^else$") parent 2)
+
+((node-is "^in$") parent 2)
+ 
+((parent-is "apply") parent 2)
+
+;; Match
+((match "match" nil nil 2 2) parent 2)
+((node-is "match") prev-sibling 0)
+((parent-is "match") grand-parent 2)
+
+;; Do Hg
+((lambda (node parent bol)
+   (string= "do" (treesit-node-type (treesit-node-prev-sibling node
+ grand-parent 0)
+((parent-is "do") prev-sibling 0)
+
+((node-is "alternatives") grand-parent 0)
+((parent-is "alternatives") grand-parent 2)
+
+;; Infix
+((node-is "infix") grand-parent 2)
+((parent-is "infix") parent 0)
+
+((parent-is "data_constructors") parent 0)
+
+;; where
+((lambda (node parent bo

[nongnu] elpa/haskell-ts-mode c49a063e9a 61/61: Fixed defcusotm

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

Fixed defcusotm

Now no compile warnings
---
 haskell-ts-mode.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 463e17f3a3..c0cdafd5e8 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -41,7 +41,8 @@
 (declare-function treesit-search-subtree "treesit.c")
 
 (defgroup haskell-ts-mode nil
-  "Group that contains haskell-ts-mode variables")
+  "Group that contains haskell-ts-mode variables"
+  :group 'langs)
 
 (defvar haskell-ts-font-lock-feature-list
   '((comment str pragma parens)
@@ -51,11 +52,13 @@
 
 (defcustom haskell-ts-use-indent t
   "Set to non-nil to use the indentation provided by haskell-ts-mode"
-  :group 'haskell-ts-mode)
+  :group 'haskell-ts-mode
+  :type 'bool)
 
 (defcustom haskell-ts-font-lock-level 4
   "Level of font lock, 1 for minimum highlghting and 4 for maximum."
-  :group 'haskell-ts-mode)
+  :group 'haskell-ts-mode
+  :type 'integer)
 
 (defvar haskell-ts-prettify-symbols-alits
   '(("\\" . "λ")
@@ -133,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)))
@@ -141,7 +144,7 @@
   (setq n (treesit-node-prev-sibling n)))
 (treesit-node-start n)
 `((haskell
-   ((node-is "comment") column-0 0)
+   ((node-is "comment") prev-sibling 0)
((node-is "cpp") column-0 0)
((parent-is "comment") column-0 0)
((parent-is "imports") column-0 0)



[nongnu] elpa/haskell-ts-mode bd85e76757 54/61: Fixed commint mode, as eariler ones did not work

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

Fixed commint mode, as eariler ones did not work
---
 haskell-ts-mode.el | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 15ad8e79a9..c0d3614c37 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -380,10 +380,9 @@
 
 (defun haskell-ts-run-haskell()
   (interactive)
-  (pop-to-buffer-same-window   ;really in the same window?
-   (or
-(comint-check-proc "*haskell*")
-(make-comint "*haskell* repl" "ghci" nil buffer-file-name)))
+  (when (not (comint-check-proc "*haskell*"))
+(set-buffer (apply (function make-comint)
+   "haskell" "ghci" nil `(,buffer-file-name
   (pop-to-buffer-same-window "*haskell*"))
 
 (defun haskell-ts-haskell-session ()



[nongnu] elpa/haskell-ts-mode 6586064122 58/61: Removed a todo item

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 6586064122b5d1cf8726c3a8958b0ee9691942a0
Author: pranshu 
Commit: pranshu 

Removed a todo item
---
 README.org | 1 -
 1 file changed, 1 deletion(-)

diff --git a/README.org b/README.org
index c359be1dc2..abe69bf0a2 100644
--- a/README.org
+++ b/README.org
@@ -100,7 +100,6 @@ support, use the following function:
 #+end_src
 
 * TODO and limitations
-- support for customization UI
 - Imenu support for functions with multiple definitions
 
 Limitations: _Proper indenting of multiline signatures_: the



[nongnu] elpa/haskell-ts-mode 5d3bd04e43 46/61: Better keymap formatting

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 5d3bd04e43066164feaa864953d30e53e0e137e3
Author: pranshu 
Commit: pranshu 

Better keymap formatting
---
 haskell-ts-mode.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index c6937939f1..27a15c811e 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -280,6 +280,13 @@
  (haskell-ts-defun-name node)
nil)))
 
+(defvar haskell-ts-mode-map
+  (let ((km (make-sparse-keymap)))
+(define-key km (kbd "C-c C-c") 'haskell-ts-compile-region-and-go)
+(define-key km (kbd "C-c C-r") 'haskell-ts-run-haskell)
+km)
+  "Map for haskell-ts-mode")
+
 ;;;###autoload
 (define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
   "Major mode for Haskell files using tree-sitter."
@@ -370,9 +377,6 @@
 (defun haskell-ts-haskell-session ()
   (get-buffer-process "*haskell*"))
 
-(define-key haskell-ts-mode-map (kbd "C-c C-c") 
'haskell-ts-compile-region-and-go)
-(define-key haskell-ts-mode-map (kbd "C-c C-r") 'haskell-ts-run-haskell)
-
 (defun haskell-ts-setup-eglot()
   (require 'eglot)
   (add-to-list 'eglot-server-programs



[nongnu] elpa/haskell-ts-mode cc627feca3 05/61: added 'instance' to be highlighted

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit cc627feca3f1e1cf6e2b79af7f296f3e9372
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

added 'instance' to be highlighted
---
 haskell.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/haskell.el b/haskell.el
index cd715c4190..259997d0ed 100644
--- a/haskell.el
+++ b/haskell.el
@@ -8,7 +8,7 @@
   :language 'haskell
   :feature 'keyword
   `(["module" "import" "data" "let" "where" "case"
- "if" "then" "else" "of" "do" "in" ]
+ "if" "then" "else" "of" "do" "in" "instance"]
 @font-lock-keyword-face)
   :language 'haskell
   :feature 'type
@@ -27,8 +27,7 @@
 (lambda (patterns (variable) @font-lock-variable-name-face)))
   :language 'haskell
   :feature 'match
-  `((match ("|" @font-lock-doc-face))
-(match  ("=" @font-lock-doc-face))
+  `((match ("|" @font-lock-doc-face) ("=" @font-lock-doc-face))
 (match ("->" @font-lock-doc-face)))
   :language 'haskell
   :feature 'comment



[nongnu] elpa/haskell-ts-mode c87a208012 02/61: added haskell.el

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit c87a2080124176a128907befe90edca8de5b0f68
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

added haskell.el
---
 README.org |   8 +
 haskell.el | 110 +
 2 files changed, 118 insertions(+)

diff --git a/README.org b/README.org
index e69de29bb2..0f9e1d3549 100644
--- a/README.org
+++ b/README.org
@@ -0,0 +1,8 @@
+
+A WIP haskell mode that requires treesitter and offers syntax highlighting and 
imenu, and a comint mode.
+
+* TODO
+- Indentation
+- Autoloading
+- Syntax table
+- Fix treesit-font-lock-feature-list
diff --git a/haskell.el b/haskell.el
new file mode 100644
index 00..26d66d992b
--- /dev/null
+++ b/haskell.el
@@ -0,0 +1,110 @@
+
+(require 'treesit)
+(require 'comint)
+(declare-function treesit-parser-create "treesit.c")
+
+(setq haskell-ts-mode--treesit-font-lock-settings
+ (treesit-font-lock-rules
+  :language 'haskell
+  :feature 'keyword
+  `(["module" "import" "data" "let" "where" "case"
+ "if" "then" "else" "of" "do" "in" ]
+@font-lock-keyword-face)
+  :language 'haskell
+  :feature 'type
+  `((type) @font-lock-type-face
+(constructor) @font-lock-type-face)
+  :language 'haskell
+  :feature 'function
+  `((function (variable) @font-lock-function-name-face)
+(function (infix (operator)  @font-lock-function-name-face))
+(bind (variable) @font-lock-function-name-face)
+(function (infix (infix_id (variable) 
@font-lock-function-name-face
+  :language 'haskell
+  :feature 'args
+  `((function (patterns) @font-lock-variable-name-face)
+(function (infix (variable)  @font-lock-variable-name-face))
+(lambda (patterns (variable) @font-lock-variable-name-face)))
+  :language 'haskell
+  :feature 'match
+  `((match ("|" @font-lock-doc-face))
+(match  ("=" @font-lock-doc-face))
+(match ("->" @font-lock-doc-face)))
+  :language 'haskell
+  :feature 'comment
+  `(((comment) @font-lock-comment-face))
+  :language 'haskell
+  :feature 'pragma
+  `((pragma) @font-lock-preprocessor-face)
+  :language 'haskell
+  :feature 'str
+  `((char) @font-lock-string-face
+(string) @font-lock-string-face)))
+;;;###autoload
+(define-derived-mode haskell-ts-mode prog-mode "haskell ts mode"
+  "Major mode for Haskell files using tree-sitter"
+  :group 'haskell
+  (unless (treesit-ready-p 'haskell)
+   (error "Tree-sitter for Haskell is not available"))
+  (treesit-parser-create 'haskell)
+  (setq-local treesit-defun-type-regexp 
"\\(?:\\(?:function\\|struct\\)_definition\\)")
+  ;; Misc
+  (setq-local comment-start "--")
+  (setq-local indent-tabs-mode nil)
+  (setq-local electric-pair-pairs
+ (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?' 
?') (cons ?" ?")))
+  (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
+  (setq-local treesit-defun-type-regexp "function")
+  ;; Imenu
+  (setq-local treesit-simple-imenu-settings
+ `((nil haskell-ts-imenu-func-node-p nil 
haskell-ts-imenu-name-function)
+   ("Signatures.." haskell-ts-imenu-sig-node-p nil 
haskell-ts-imenu-sig-name-function)))
+  ;; font-lock.
+  (setq-local treesit-font-lock-settings haskell-ts-font-lock)
+  (setq-local treesit-font-lock-feature-list
+ '(( comment  str pragma type keyword definition 
function args match)))
+  (treesit-major-mode-setup))
+
+(defun haskell-ts-imenu-func-node-p (node)
+  (and (string-match-p "function\\|bind" (treesit-node-type node))
+  (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
+
+(defun haskell-ts-imenu-sig-node-p (node)
+  (and (string-match-p "signature" (treesit-node-type node))
+  (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
+
+(defun haskell-ts-imenu-sig-name-function (node)
+  (let ((name (treesit-node-text node)))
+   (if (haskell-ts-imenu-sig-node-p node)
+   (haskell-ts-defun-name node)
+ nil)))
+
+(defun haskell-ts-imenu-name-function (node)
+  (let ((name (treesit-node-text node)))
+   (if (haskell-ts-imenu-func-node-p node)
+   (haskell-ts-defun-name node)
+ nil)))
+
+(defun haskell-ts-defun-name (node)
+  (treesit-node-text (treesit-node-child node 0)))
+
+(defun haskell-compile-region-and-go (start end)
+  "compile the current region in the haskell proc, and switch to its buffer."
+  (interactive "r")
+  (comint-send-region (haskellsession) start end)
+  (comint-send-string (haskellsession) "\n"))
+
+(defun run-haskell()
+  (interactive)
+  (when (not (comint-check-proc "*haskell*"))
+   (set

[nongnu] elpa/haskell-ts-mode 113e443752 26/61: Fix quasiquotes

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 113e443752e5352dfafbe7aead8b3a20c4fdbdd5
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Fix quasiquotes
---
 haskell-ts-mode.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index d31ec5a6ed..65d3bed6fa 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -48,7 +48,7 @@
   '(("\\" . "λ")
("/=" . "≠")))
 
-(defvar haskell-ts-font-lock
+(setq haskell-ts-font-lock
   (treesit-font-lock-rules
:language 'haskell
:feature 'parens
@@ -100,8 +100,11 @@
`((pragma) @font-lock-preprocessor-face)
:language 'haskell
:feature 'str
+   :override t
`((char) @font-lock-string-face
-(string) @font-lock-string-face)))
+(string) @font-lock-string-face
+(quasiquote (quoter) @font-lock-type-face)
+(quasiquote (quasiquote_body) @font-lock-preprocessor-face
 
 (defvar haskell-ts-indent-rules
   `((haskell



[nongnu] elpa/haskell-ts-mode ebc222940f 24/61: typo

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit ebc222940f108fb9004ecf23c5ca52274f1b32e8
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

typo
---
 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 917cab35ea..8a2217c3c1 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -208,7 +208,7 @@
  (list (cons ?` ?`) (cons ?( ?)) (cons ?{ ?}) (cons ?" ?") (cons 
?[ ?])))
   (setq-local treesit-defun-name-function 'haskell-ts-defun-name)
   (setq-local treesit-defun-type-regexp "function")
-  (setq-local prettify-symbols-alist haskell-ts-prettify-symbols-alist)
+  (setq-local prettify-symbols-alist haskell-ts-prettify-symbols-alits)
   ;; Imenu
   (setq-local treesit-simple-imenu-settings
  `((nil haskell-ts-imenu-func-node-p nil



[nongnu] elpa/haskell-ts-mode 00a397204d 32/61: Major changed, to indentation, font lock

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 00a397204d31dd59660b0e56a63356591f61f3a7
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

Major changed, to indentation, font lock
---
 README.org |  30 +-
 haskell-ts-mode.el |  19 ---
 ss.png | Bin 0 -> 23881 bytes
 3 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 4baf9c8e2b..4cd1ddc5e8 100644
--- a/README.org
+++ b/README.org
@@ -1,13 +1,41 @@
 
 * Context
 
-A haskell mode that requires treesitter and offers:
+A haskell mode that uses treesitter.
+
+The package is still in devlopment, please report bugs or email
+them(email found it main .el file).
+
+* Screenshot
+[[ss.png]]
+
+* Features
+The basic features are:
 - Syntax highliting
 - Indentation
 - Imenu support
 - REPL
 - Prettify symbols mode support
 
+The more interesting features are:
+- Logical syntax highlighting:
+  - Only arguments that can be used in functions are highlighted, eg
+in `f (_:(a:[])) only 'a' is highlighted
+  - The return type of a function is optionally highlighted, if
+treesit-font-lock-level is set to 4
+  - All new variabels are(or should be) highlighted, this includes
+generators, lambda args.
+  - highlighting the '=' operaotr in guarded matches correctly, this
+would be stupidly hard in regexp based syntax
+- Unlike haskell-mode, quasi quotes are understood and do not confuse
+  the mode
+- Consistant indentation: haskell-mode's indentation works in a
+  cyclical way, it cycles through where you might want indentation.
+  haskell-ts-mode, meanwhile relies on you to set the parse tree
+  changing whitespace.
+- Significantly more perfomant than haskell(-tng)-mode, don't have a
+  number on this yet.
+
 * Motivation
   
 haskell-mode contains nearly 30k lines of code, and is
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index e5d4777cbc..267ca6d70a 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -42,7 +42,7 @@
   '((comment str pragma parens)
 (type definition function args)
 (match keyword)
-(otherwise)))
+(otherwise signature)))
 
 (defvar haskell-ts-prettify-symbols-alits
   '(("\\" . "λ")
@@ -51,7 +51,7 @@
 (defvar haskell-ts-font-lock
   (treesit-font-lock-rules
:language 'haskell
-   :feature 'parens
+   :feature 'parens 
`(["(" ")" "[" "]"] @font-lock-operator-face
(infix operator: (_) @font-lock-operator-face))
:language 'haskell
@@ -79,9 +79,13 @@
`((type) @font-lock-type-face
 (constructor) @font-lock-type-face)
:language 'haskell
+   :override t
+   :feature 'signature
+   `((signature (function) @haskell-ts-fontify-type))
+   :language 'haskell
:feature 'function
:override t
-   `((function (variable) @font-lock-function-name-face)
+   `((function name: (variable) @font-lock-function-name-face)
 (function (infix (operator)  @font-lock-function-name-face))
 (bind (variable) @font-lock-function-name-face)
 (function (infix (infix_id (variable) @font-lock-function-name-face)))
@@ -286,6 +290,15 @@
'face font-lock-variable-name-face)
 (mapc 'haskell-ts-fontify-arg (treesit-node-children node
 
+(defun haskell-ts-fontify-type (node &optional override start end)
+  (let ((last-child (treesit-node-child node -1)))
+(if (string= (treesit-node-type last-child) "function")
+   (haskell-ts-fontify-type last-child)
+  (put-text-property
+   (treesit-node-start last-child)
+   (treesit-node-end last-child)
+   'face font-lock-variable-name-face
+
 (defun haskell-ts-imenu-node-p (regex node)
 (and (string-match-p regex (treesit-node-type node))
 (string= (treesit-node-type (treesit-node-parent node)) 
"declarations")))
diff --git a/ss.png b/ss.png
new file mode 100644
index 00..4d2a168cc7
Binary files /dev/null and b/ss.png differ



[nongnu] elpa/haskell-ts-mode 5178ff240f 13/61: nl indent fix

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 5178ff240f56a152a4419db85d7b7ca8e4557f7c
Author: Pranshu Sharma 
Commit: Pranshu Sharma 

nl indent fix
---
 haskell.el | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/haskell.el b/haskell.el
index 6b594aa5f7..b39639d3bf 100644
--- a/haskell.el
+++ b/haskell.el
@@ -46,27 +46,28 @@
 (setq haskell-ts-indent-rules
   `((haskell
 ((node-is "comment") column-0 0)
-((parent-is "haskell") column-0 0)
-((parent-is "declarations") column-0 0)
 ((parent-is "imports") column-0 0)
 
 ;; If then else
 ((node-is "then") parent 2)
 ((node-is "^else$") parent 2)
 
-;; lists
 ((node-is "^in$") parent 2)
  
 ((parent-is "apply") parent 2)
+
 ;; Match
 ((match "match" nil nil 2 2) parent 2)
 ((node-is "match") prev-sibling 0)
+((parent-is "match") grand-parent 2)
+
+
 ;; Do Hg
 ((lambda (node parent bol)
(string= "do" (treesit-node-type (treesit-node-prev-sibling node
  grand-parent 0)
 ((parent-is "do") prev-sibling 0)
-
+
 ((node-is "alternatives") grand-parent 0)
 ((parent-is "alternatives") grand-parent 2)
 
@@ -75,7 +76,7 @@
 ((parent-is "infix") parent 0)
 
 ((parent-is "data_constructors") parent 0)
-
+
 ;; where
 ((lambda (node parent bol)
(string= "where" (treesit-node-type (treesit-node-prev-sibling 
node
@@ -85,13 +86,10 @@
 ((parent-is "local_binds") prev-sibling 0)
 ((node-is "^where$") parent 2)
 
-;; Backup
-((lambda (a b c)
-   (save-excursion
- (goto-char c)
- (message "ee")
- (re-search-forward "^[ \t]*$" (line-end-position) t)))
- prev-adaptive-prefix 0
+(no-node prev-adaptive-prefix 0)
+((parent-is "haskell") column-0 0)
+((parent-is "declarations") column-0 0)
+)))
 
 
 ;;;###autoload
@@ -163,4 +161,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-(add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



[elpa] externals/denote 3bb05f212c: Update to Denote version 3.1.0

2024-09-04 Thread ELPA Syncer
branch: externals/denote
commit 3bb05f212cc29fa6953e6d703e5e0c2e982882a9
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update to Denote version 3.1.0
---
 CHANGELOG.org | 516 ++
 README.org|  71 +++-
 denote.el |   2 +-
 3 files changed, 541 insertions(+), 48 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index 59481009cb..bba76b 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -13,6 +13,522 @@ the manual: .
 
 #+toc: headlines 1 insert TOC here, with one headline level
 
+* Version 3.1.0 on 2024-09-04
+:PROPERTIES:
+:CUSTOM_ID: h:f089ab11-4ad7-4fd9-9bf3-2deb2e070297
+:END:
+
+Denote is stable and reliable though we keep adding minor refinements
+to it. Remember that many---if not all---of these are intended for
+experienced users who have developed their own workflow and want to
+adapt Denote to its particularities. We may call them "power users".
+
+New users do not need to know about every single feature. A basic
+configuration is enough and is why the original video I did about
+Denote (from even before I published version =0.1.0=) is still relevant.
+For example:
+
+#+begin_src emacs-lisp
+;; Start with something like this.
+(use-package denote
+  :ensure t
+  :bind
+  (("C-c n n" . denote)
+   ("C-c n r" . denote-rename-file)
+   ("C-c n i" . denote-link) ; "insert" mnemonic
+   ("C-c n b" . denote-backlinks))
+  :config
+  (setq denote-directory (expand-file-name "~/Documents/notes/")))
+#+end_src
+
+And here is the same idea with a little bit more convenience:
+
+#+begin_src emacs-lisp
+;; Another basic setup with a little more to it.
+(use-package denote
+  :ensure t
+  :hook (dired-mode . denote-dired-mode)
+  :bind
+  (("C-c n n" . denote)
+   ("C-c n r" . denote-rename-file)
+   ("C-c n l" . denote-link)
+   ("C-c n b" . denote-backlinks))
+  :config
+  (setq denote-directory (expand-file-name "~/Documents/notes/"))
+
+  ;; Automatically rename Denote buffers when opening them so that
+  ;; instead of their long file name they have a literal "[D]"
+  ;; followed by the file's title.  Read the doc string of
+  ;; `denote-rename-buffer-format' for how to modify this.
+  (denote-rename-buffer-mode 1))
+#+end_src
+
+** The ~denote-sort-dired~ command is more configurable
+:PROPERTIES:
+:CUSTOM_ID: h:717765ae-f76f-4b41-96c0-895fe131a83d
+:END:
+
+The ~denote-sort-dired~ command asks for a literal string or regular
+expression and then produces a fully fledged Dired listing of matching
+files in the ~denote-directory~. Combined with the efficient Denote
+file-naming scheme, this is a killer feature to collect your relevant
+files in a consolidated view and have the full power of Dired available.
+
+By default ~denote-sort-dired~ prompts for the file name component to
+sort by and then asks whether to reverse the sorting or not. Users who
+want a more streamlined experience can configure the user option
+~denote-sort-dired-extra-prompts~.
+
+It is possible to skip the prompts altogether and use the default
+values for (i) which component to sort by and (ii) whether to reverse
+the sort. To this end, users can have something like this in their
+configuration:
+
+#+begin_src emacs-lisp
+;; Do not issue any extra prompts.  Always sort by the `title' file
+;; name component and never do a reverse sort.
+(setq denote-sort-dired-extra-prompts nil)
+(setq denote-sort-dired-default-sort-component 'title)
+(setq denote-sort-dired-default-reverse-sort nil)
+#+end_src
+
+For me, Dired is one of the best things about Emacs and I like how it
+combines so nicely with Denote file names (this is the cornerstone of
+Denote, after all).
+
+** The ~denote-sort-dired~ sorting functions are customisable
+:PROPERTIES:
+:CUSTOM_ID: h:7c4824c0-7f9b-46f5-98ea-4ebbab092193
+:END:
+
+Power users may want to control how the sorting works and what it is
+matching on a per file-name-component basis. The user options are
+these:
+
+- ~denote-sort-title-comparison-function~.
+- ~denote-sort-keywords-comparison-function~.
+- ~denote-sort-signature-comparison-function~.
+
+One use-case is to match specific patterns inside of file names, such
+as Luhmann-style signatures. I wrote about this in the manual as well
+as on my blog (with screenshots):
+.
+
+Thanks to Riccardo Giannitrapani for discussing this with me and
+helping me understand the use-case better. This was done via a private
+channel and I am sharing it with permission.
+
+** Show the date of each linked file in Org dynamic blocks
+:PROPERTIES:
+:CUSTOM_ID: h:ad222eb0-06db-4416-820c-c60f31169f66
+:END:
+
+All our Org dynamic blocks that produce links to files now read the
+parameter =:include-date=. When it is set to =t=, the listed files
+will include their corresponding date inside of parentheses after the
+file's title.
+
+Thanks to Sergio Rey for describi

[elpa] externals/eev fb9877bc92: New intro: (find-try-sly-intro).

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

New intro: (find-try-sly-intro).
---
 ChangeLog |  23 ++
 VERSION   |   4 +-
 eev-intro.el  | 221 ++
 eev-plinks.el |  33 +++-
 eev-rstdoc.el |   7 +-
 eev-tlinks.el |  13 +++-
 eev-videolinks.el |  22 +-
 7 files changed, 299 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a265c41508..40ec52fa6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2024-09-04  Eduardo Ochs  
+
+   * eev-tlinks.el (ee-dot-emacs-sly): new function.
+
+2024-09-01  Eduardo Ochs  
+
+   * eev-plinks.el (find-clhsdoci, ee-clhs-lookup-index): new
+   functions.
+
+   * eev-rstdoc.el (ee-rstdoc-default-defuns): added `:clhs'.
+
+   * eev-intro.el (find-try-sly-intro): new function.
+
+   * eev-tlinks.el (find-try-sly-links): point to
+   `find-try-sly-intro'.
+
+   * eev-plinks.el (find-wget-org): new function.
+
+2024-08-18  Eduardo Ochs  
+
+   * eev-videolinks.el (ee-1stclassvideos-info): new video:
+   "2024lean4of0a2".
+
 2024-08-11  Eduardo Ochs  
 
* eev-edit.el (ee-copy-this-line-to-kill-ring): fixed a bug/typo -
diff --git a/VERSION b/VERSION
index 99b69fe32d..daaa9d41a3 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Mon Aug 12 01:00:49 GMT 2024
-Sun Aug 11 22:00:49 -03 2024
+Wed Sep  4 08:04:37 GMT 2024
+Wed Sep  4 05:04:37 -03 2024
diff --git a/eev-intro.el b/eev-intro.el
index bb8c8ab635..c937d1120e 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author: Eduardo Ochs 
 ;; Maintainer: Eduardo Ochs 
-;; Version:20240810
+;; Version:20240904
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -105,6 +105,7 @@
 ;; «.find-dot-emacs-intro» (to "find-dot-emacs-intro")
 ;; «.find-debootstrap-intro»   (to "find-debootstrap-intro")
 ;; «.find-lean4-intro» (to "find-lean4-intro")
+;; «.find-try-sly-intro»   (to "find-try-sly-intro")
 
 ;; Videos:
 ;; «.find-three-main-keys-intro»   (to "find-three-main-keys-intro")
@@ -1479,7 +1480,7 @@ all the index anchors together. For an example, see:
 One way to type the chars `«' and `»' is with `C-x 8 <' and
 `C-x 8 >'. Try:
 
-  (eek \"RET C-x 8 < t a g C-x 8 >\")
+  (eek \"RET C-x 8 < t a g C-x 8 > \")
 
 
 
@@ -3119,18 +3120,16 @@ These ones explain advanced features that require extra 
setup:
   39. (find-lua-tutorial-intro)
   40. (find-debootstrap-intro)
   41. (find-lean4-intro)
-  42. (find-prepared-intro)
-  43. (find-bounded-intro)
-  44. (find-channels-intro)
-
-This one was used in a video:
-
-  45. (find-three-main-keys-intro)
+  42. (find-try-sly-intro)
+  43. (find-prepared-intro)
+  44. (find-bounded-intro)
+  45. (find-channels-intro)
 
 These ones are obsolete:
 
   46. (find-emacs-intro)
-  47. (find-defun-intro)
+  47. (find-three-main-keys-intro)
+  48. (find-defun-intro)
 
 For an index of the videos, run:
 
@@ -18139,11 +18138,204 @@ Here is the link:
 
   (find-es \"lean\" \"Std.Format\")
 
+" pos-spec-list)))
+
+;; (find-lean4-intro)
+
+
+
+
+;;;  __   
+;;; | |_ _ __ _   _   ___| |_   _ 
+;;; | __| '__| | | |_/ __| | | | |
+;;; | |_| |  | |_| |_\__ \ | |_| |
+;;;  \__|_|   \__, | |___/_|\__, |
+;;;   |___/ |___/ 
+;;
+;; «find-try-sly-intro»  (to ".find-try-sly-intro")
+;; Skel: (find-intro-links "try-sly")
+;; Test: (find-try-sly-intro)
+
+(defun find-try-sly-intro (&rest pos-spec-list) (interactive)
+  (let ((ee-buffer-name "*(find-try-sly-intro)*"))
+(apply 'find-eintro "\
+\(Re)generate: (find-try-sly-intro)
+Source code:  (find-efunction 'find-try-sly-intro)
+More intros:  (find-eev-quick-intro)
+  (find-eev-intro)
+  (find-eepitch-intro)
+This buffer is _temporary_ and _editable_.
+It is meant as both a tutorial and a sandbox.
+
+Prerequisites:
+  (find-windows-beginner-intro \"7. Test Maxima\")
+and a Maxima compiled with SBCL. The Maxima in Debian uses GCL, that is
+not supported by quicklisp...
+
+This is a PARTIAL rewrite of:
+  (find-try-sly-links)
+
+At some point in the future this intro will show how to install Sly on
+Debian and how to use it with Maxima - but this is in a very preliminary
+stage...
+
+
+
+
+1. Install the Common Lisp Hyperspec
+
+Run this with s:
+
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+  sudo apt-get install -y hyperspec
+
+Note that the package \"hyperspec\" will install
+a local copy of the CLHS here:
+
+  (find-fline \"/usr

[elpa] externals/debbugs 993f85df2b: Make revert buffer thread-safe

2024-09-04 Thread Michael Albinus via
branch: externals/debbugs
commit 993f85df2b6306389cb8d63588a4ae0680e5216a
Author: Michael Albinus 
Commit: Michael Albinus 

Make revert buffer thread-safe

* debbugs-gnu.el (debbugs-gnu-current-id): New defvar.
(debbugs-gnu): Set it.
(debbugs-gnu-rescan): Make it thread-safe.
(debbugs-gnu-mode): Reset `tabulated-list-entries'.

* debbugs-ug.texi (Searching Bugs): Move items.
---
 debbugs-gnu.el  | 28 +++-
 debbugs-ug.texi | 15 ---
 2 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 744ec0bc9c..f15fbb43ee 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -464,6 +464,9 @@ The specification which bugs shall be suppressed is taken 
from
 (defvar debbugs-gnu-current-buffer nil
   "The current buffer results are presented in.")
 
+(defvar debbugs-gnu-current-id nil
+  "The saved position in a debbugs buffer.")
+
 (defvar debbugs-gnu-current-message nil
   "The message to be shown after getting the bugs.")
 
@@ -891,6 +894,8 @@ value, like in `debbugs-gnu-get-bugs' or 
`debbubgs-gnu-tagged'."
  (let (debbugs-show-progress)
(unwind-protect
   (funcall debbugs-gnu-show-reports-function)
+ (when debbugs-gnu-current-id
+   (debbugs-gnu-goto debbugs-gnu-current-id))
  ;; Indicate result.
  (if debbugs-gnu-current-message
  (message
@@ -904,18 +909,22 @@ value, like in `debbugs-gnu-get-bugs' or 
`debbubgs-gnu-tagged'."
  (setq debbugs-gnu-current-query nil
   debbugs-gnu-current-filter nil
   debbugs-gnu-current-suppress nil
+   debbugs-gnu-current-id nil
debbugs-gnu-current-message nil
debbugs-gnu-show-reports-function
debbugs-gnu-default-show-reports-function)
 
 (unwind-protect
(funcall debbugs-gnu-show-reports-function)
+  (when debbugs-gnu-current-id
+(debbugs-gnu-goto debbugs-gnu-current-id))
   (when debbugs-gnu-current-message
 (message "%s" debbugs-gnu-current-message))
   ;; Reset query, filter, suppress and message.
   (setq debbugs-gnu-current-query nil
debbugs-gnu-current-filter nil
debbugs-gnu-current-suppress nil
+debbugs-gnu-current-id nil
 debbugs-gnu-current-message nil
 debbugs-gnu-show-reports-function
 debbugs-gnu-default-show-reports-function
@@ -1308,15 +1317,15 @@ If NOCACHE is non-nil, bug information is retrieved 
from the debbugs server.
 Interactively, it is non-nil with the prefix argument."
   (interactive
(list current-prefix-arg))
-  (let ((id (debbugs-gnu-current-id t))
-   (debbugs-gnu-current-query debbugs-gnu-local-query)
-   (debbugs-gnu-current-filter debbugs-gnu-local-filter)
-   (debbugs-gnu-current-suppress debbugs-gnu-local-suppress)
-   (debbugs-gnu-current-print-function debbugs-gnu-local-print-function)
-   (debbugs-cache-expiry (if nocache t debbugs-cache-expiry)))
-(funcall debbugs-gnu-show-reports-function)
-(when id
-  (debbugs-gnu-goto id
+  (setq debbugs-gnu-current-query debbugs-gnu-local-query
+   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")
+  (message "Reverting buffer")
+  (debbugs-gnu nil))
 
 (define-derived-mode debbugs-gnu-mode tabulated-list-mode "Debbugs"
   "Major mode for listing bug reports.
@@ -1335,6 +1344,7 @@ modified on the debbugs server, consider typing \\`C-u g'.
debbugs-gnu-current-suppress)
   (set (make-local-variable 'debbugs-gnu-local-print-function)
debbugs-gnu-current-print-function)
+  (set (make-local-variable 'tabulated-list-entries) nil)
   (setq tabulated-list-format [("Id" 5 debbugs-gnu-sort-id)
   ("State" 10 debbugs-gnu-sort-state)
   ("Submitter" 18 debbugs-gnu-sort-submitter)
diff --git a/debbugs-ug.texi b/debbugs-ug.texi
index 5dc6ccbfc9..269b6d3fb5 100644
--- a/debbugs-ug.texi
+++ b/debbugs-ug.texi
@@ -340,12 +340,6 @@ attribute-value pairs, until an empty attribute is 
returned.  Possible
 attributes are
 
 @table @samp
-@item skip
-How many hits are skipped (default 0).
-
-@item max
-How many maximal hits are returned.
-
 @item severity
 A comma-separated list of bug severities, @xref{Retrieving Bugs}.
 
@@ -366,10 +360,17 @@ modified.
 @item subject
 Word(s) contained in the subject of the bug report.
 
+@c This is queried with the attribute "pending".
 @item status
 The status of the bug report.  Valid values are "pending

[elpa] externals/modus-themes 32c50cd4f6: Add explicit support for 'forge' package

2024-09-04 Thread ELPA Syncer
branch: externals/modus-themes
commit 32c50cd4f66a1a912b1209100d52af068aae9cce
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add explicit support for 'forge' package
---
 doc/modus-themes.info | 556 +-
 doc/modus-themes.org  |   2 +-
 modus-themes.el   |  16 ++
 3 files changed, 295 insertions(+), 279 deletions(-)

diff --git a/doc/modus-themes.info b/doc/modus-themes.info
index 64eed9487a..941b766439 100644
--- a/doc/modus-themes.info
+++ b/doc/modus-themes.info
@@ -1,4 +1,4 @@
-This is modus-themes.info, produced by makeinfo version 6.8 from
+This is modus-themes.info, produced by makeinfo version 7.1 from
 modus-themes.texi.
 
 Copyright (C) 2020-2024 Free Software Foundation, Inc.
@@ -77,7 +77,7 @@ as such.
 * GNU Free Documentation License::
 * Indices::
 
-— The Detailed Node Listing —
+-- The Detailed Node Listing --
 
 Overview
 
@@ -243,11 +243,11 @@ distance in relative luminance of 7:1.
 subgroups.
 
 Main themes
- ‘modus-operandi’ is the project’s main light theme, while
+ ‘modus-operandi’ is the project's main light theme, while
  ‘modus-vivendi’ is its dark counterpart.  These two themes are part
  of the project since its inception.  They are designed to cover a
  broad range of needs and are, in the opinion of the author, the
- reference for what a highly legible “default” theme should look
+ reference for what a highly legible "default" theme should look
  like.
 
 Tinted themes
@@ -322,7 +322,7 @@ File: modus-themes.info,  Node: Installation,  Next: Enable 
and load,  Prev: Ove
 **
 
 The Modus themes are distributed with Emacs starting with version 28.1.
-On older versions of Emacs, they can be installed using Emacs’ package
+On older versions of Emacs, they can be installed using Emacs' package
 manager or manually from their code repository.  There also exist
 packages for distributions of GNU/Linux.
 
@@ -330,7 +330,7 @@ packages for distributions of GNU/Linux.
 includes version ‘3.0.0’.  Emacs 30 provides a newer, refactored version
 that thoroughly refashions how the themes are implemented and
 customized.  Such major versions are not backward-compatible due to the
-limited resources at the maintainer’s disposal to support multiple
+limited resources at the maintainer's disposal to support multiple
 versions of Emacs and of the themes across the years.
 
 * Menu:
@@ -355,7 +355,7 @@ stored in ‘~/.emacs.d’ and that you want to place the Modus 
themes in
 
  $ git clone https://gitlab.com/protesilaos/modus-themes.git 
~/.emacs.d/modus-themes
 
-  1. Add that path to your known Elisp libraries’ list, by placing this
+  1. Add that path to your known Elisp libraries' list, by placing this
  snippet of Emacs Lisp in your init file (e.g.  ‘init.el’):
 
  (add-to-list 'load-path "~/.emacs.d/modus-themes")
@@ -387,7 +387,7 @@ File: modus-themes.info,  Node: Install on GNU/Linux,  
Next: Dealing with byte c
 The themes are also available from the archives of some distributions of
 GNU/Linux.  These should correspond to a tagged release rather than
 building directly from the latest Git commit.  It all depends on the
-distro’s packaging policies.
+distro's packaging policies.
 
 * Menu:
 
@@ -406,7 +406,7 @@ The themes are part of Debian 11 Bullseye.  Get them with:
 
They are now ready to be used: *note Enable and load::.
 
-   NOTE that Debian’s package is severely out-of-date as of this writing
+   NOTE that Debian's package is severely out-of-date as of this writing
 2022-07-24 09:57 +0300.
 
 
@@ -649,7 +649,7 @@ package configurations in their setup.  We use this as an 
example:
*note Differences between loading and enabling::.
 
Note: make sure not to customize the variable
-‘custom-theme-load-path’ or ‘custom-theme-directory’ after the themes’
+‘custom-theme-load-path’ or ‘custom-theme-directory’ after the themes'
 package declaration.  That will lead to failures in loading the files.
 If either or both of those variables need to be changed, their values
 should be defined before the package declaration of the themes.
@@ -661,7 +661,7 @@ File: modus-themes.info,  Node: Differences between loading 
and enabling,  Prev:
 
 
 The reason we recommend ‘load-theme’ instead of the other option of
-‘enable-theme’ is that the former does a kind of “reset” on the face
+‘enable-theme’ is that the former does a kind of "reset" on the face
 specs.  It quite literally loads (or reloads) the theme.  Whereas the
 ‘enable-theme’ function simply puts an already loaded theme to the top
 of the list of enabled items, reusing whatever state was last loaded.
@@ -677,7 +677,7 @@ so it might appear to the unsuspecting user that the themes 
are somehow
 broken whenever they try to assign a new value to a customization option
 or some face.
 
-   This “reset” that ‘load-theme’ brings about does, however, come at
+   This "reset" th

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

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

  from  c49a063e9a Fixed defcusotm
   new  27b4246cc6 Added alt installation way
   new  fc13907947 Fix byte-compile warnings
   new  0be6d1c39b Merge pull request 'Fix byte-compile warnings' (#1) from 
syohex/haskell-ts-mode:fix-byte-compile-warnings into main


Summary of changes:
 README.org | 3 +++
 haskell-ts-mode.el | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)



[nongnu] elpa/haskell-ts-mode fc13907947 2/3: Fix byte-compile warnings

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit fc139079479752c88cfae5b8adbffdcc0f7330d2
Author: Shohei YOSHIDA 
Commit: Shohei YOSHIDA 

Fix byte-compile warnings

- correct `:type` attribute
- use defvar for global variable
---
 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 c0cdafd5e8..1703dd0f56 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -53,7 +53,7 @@
 (defcustom haskell-ts-use-indent t
   "Set to non-nil to use the indentation provided by haskell-ts-mode"
   :group 'haskell-ts-mode
-  :type 'bool)
+  :type 'boolean)
 
 (defcustom haskell-ts-font-lock-level 4
   "Level of font lock, 1 for minimum highlghting and 4 for maximum."
@@ -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)))



[nongnu] elpa/haskell-ts-mode 0be6d1c39b 3/3: Merge pull request 'Fix byte-compile warnings' (#1) from syohex/haskell-ts-mode:fix-byte-compile-warnings into main

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 0be6d1c39b40637dc464105c821dc9ef7acf26f0
Merge: 27b4246cc6 fc13907947
Author: pranshu 
Commit: pranshu 

Merge pull request 'Fix byte-compile warnings' (#1) from 
syohex/haskell-ts-mode:fix-byte-compile-warnings into main

Reviewed-on: https://codeberg.org/pranshu/haskell-ts-mode/pulls/1
---
 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 c0cdafd5e8..1703dd0f56 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -53,7 +53,7 @@
 (defcustom haskell-ts-use-indent t
   "Set to non-nil to use the indentation provided by haskell-ts-mode"
   :group 'haskell-ts-mode
-  :type 'bool)
+  :type 'boolean)
 
 (defcustom haskell-ts-font-lock-level 4
   "Level of font lock, 1 for minimum highlghting and 4 for maximum."
@@ -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)))



[nongnu] elpa/haskell-ts-mode 27b4246cc6 1/3: Added alt installation way

2024-09-04 Thread ELPA Syncer
branch: elpa/haskell-ts-mode
commit 27b4246cc6e9a1d205893412decf504c42f62c72
Author: pranshu 
Commit: pranshu 

Added alt installation way
---
 README.org | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.org b/README.org
index abe69bf0a2..6910ee9fac 100644
--- a/README.org
+++ b/README.org
@@ -63,6 +63,9 @@ implement indentation, so I thought why not use tree sitter?
 
 * Installation
 
+The package is avaiable on elpa, you can install it using:
+M-x package-install RET haskell-ts-mode RET
+
 #+BEGIN_SRC: elisp
 (add-to-list 'load-path "path/to/haskell-ts-mode")
 (require 'haskell-ts-mode)



[elpa] externals/corfu 0a616caedf: corfu--minibuffer-on: Minor cleanup

2024-09-04 Thread ELPA Syncer
branch: externals/corfu
commit 0a616caedf10ebba812a87de3adacd24cd46522b
Author: Daniel Mendler 
Commit: Daniel Mendler 

corfu--minibuffer-on: Minor cleanup
---
 corfu.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/corfu.el b/corfu.el
index 9c0ba57f8d..e96c569af7 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1386,7 +1386,7 @@ local `completion-at-point-functions'."
 
 (defun corfu--minibuffer-on ()
   "Enable `corfu-mode' in the minibuffer respecting `global-corfu-minibuffer'."
-  (when (and global-corfu-minibuffer (not noninteractive) (minibufferp)
+  (when (and global-corfu-minibuffer (not noninteractive)
  (if (functionp global-corfu-minibuffer)
  (funcall global-corfu-minibuffer)
(local-variable-p 'completion-at-point-functions)))



[elpa] externals/auctex 9f758c32c7: ; Unify license notice header.

2024-09-04 Thread ELPA Syncer
branch: externals/auctex
commit 9f758c32c7cff0681bcced2ffaf20057ee56d6b1
Author: Arash Esbati 
Commit: Arash Esbati 

; Unify license notice header.
---
 bib-cite.el   | 20 ++--
 font-latex.el | 22 +++---
 multi-prompt.el   | 22 --
 preview.el| 20 +++-
 style/amsbook.el  | 17 +
 style/amsbsy.el   | 21 +++--
 style/amsrefs.el  |  4 ++--
 style/amstext.el  | 21 +++--
 style/article.el  | 17 +
 style/backref.el  |  4 ++--
 style/book.el | 17 +
 style/cancel.el   |  4 ++--
 style/changes.el  |  6 +++---
 style/comment.el  |  6 +++---
 style/czech.el| 17 +
 style/danish.el   | 17 +
 style/dk-bib.el   |  6 +++---
 style/dk.el   | 17 +
 style/dutch.el| 17 +
 style/emp.el  | 22 --
 style/english.el  | 17 +
 style/epsf.el | 21 +++--
 style/foils.el| 20 +++-
 style/footnotehyper.el|  6 +++---
 style/german.el   | 19 ++-
 style/graphics.el | 17 +
 style/graphicx.el | 22 --
 style/inputenc.el |  6 +++---
 style/j-article.el| 17 +
 style/j-book.el   | 17 +
 style/j-report.el | 17 +
 style/jarticle.el | 17 +
 style/jbook.el| 17 +
 style/jreport.el  | 17 +
 style/jsarticle.el| 17 +
 style/jsbook.el   | 17 +
 style/lstautogobble.el|  4 ++--
 style/lstlinebgrd.el  |  4 ++--
 style/luatextra.el| 19 ++-
 style/microtype.el|  4 ++--
 style/multibib.el |  4 ++--
 style/ngerman.el  | 19 ++-
 style/plfonts.el  | 21 +++--
 style/plhb.el | 21 +++--
 style/proc.el |  4 ++--
 style/prosper.el  | 14 +-
 style/psfig.el| 23 ---
 style/report.el   | 17 +
 style/scrartcl.el | 20 ++--
 style/slovak.el   | 17 +
 style/swedish.el  | 19 ++-
 style/truncate.el |  4 ++--
 style/unicodefonttable.el |  6 +++---
 style/virtex.el   | 18 ++
 style/xr-hyper.el |  4 ++--
 style/xr.el   |  4 ++--
 tex-bar.el| 35 ++-
 tex-font.el   | 18 +-
 tex-ispell.el | 20 +++-
 tex-style.el  | 20 +++-
 tex-wizard.el | 20 +++-
 toolbar-x.el  | 33 ++---
 62 files changed, 748 insertions(+), 205 deletions(-)

diff --git a/bib-cite.el b/bib-cite.el
index fe5ae9e343..76cecfbacd 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -8,22 +8,22 @@
 ;; Version:   3.28  (Feb 23 2005)
 ;; Keywords:  bibtex, cite, auctex, emacs
 
-;;; This file is not part of GNU Emacs.
+;; This file is part of AUCTeX.
 
-;; This package is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; AUCTeX 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, or (at your option)
 ;; any later version.
 
-;; This package 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.
+;; AUCTeX 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 GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
 
 ;; LCD Archive Entry:
 ;; bib-cite|Peter Galbraith|galbrai...@dfo-mpo.gc.ca|
diff --git a/font-latex.el b/font-latex.el
index 3a14b5849d..6ced228d6f 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -8,25 +8,25 @@
 ;; C

[nongnu] elpa/buttercup df7f98e110 03/16: Do not collect backtraces for failed specs

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit df7f98e1102ee28f1f428caf7edb3576e1ddc0b3
Author: Ola Nilsson 
Commit: Ola Nilsson 

Do not collect backtraces for failed specs

There is no reason to collect backtraces for expect form where the
matcher detects a mismatch.  It's all buttercup infrastructure at that
point.
---
 buttercup.el|  6 +++---
 tests/test-buttercup.el | 37 +
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index d9c5a99d93..7f30f2c38d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2107,8 +2107,9 @@ ARGS according to `debugger'."
;; args is (error (signal . data) ) where the tail
;; may be empty
(cl-destructuring-bind (signal-type . data) (cl-second args)
- (unless (eq signal-type 'buttercup-pending)
-   (buttercup--backtrace))
+ (cl-case signal-type
+   ((buttercup-pending buttercup-failed))
+   (otherwise (buttercup--backtrace)))
 
 (defalias 'buttercup--mark-stackframe #'ignore
   "Marker to find where the backtrace start.")
@@ -2129,7 +2130,6 @@ ARGS according to `debugger'."
;; wrapped expressions of an expect.
(buttercup--wrapper-fun-p (cadr frame))
;; TODO: error in `it' but outside `expect'
-   ;; TODO: matchers that do not match should not collect backtrace
;; TODO: What about an error in a matcher?
;; TODO: What about :to-throw?
;; TODO: What about signals in before and after blocks?
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 31a9fbbd4f..e2ab163725 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -1969,22 +1969,27 @@ before it's processed by other functions."
(fmakunbound 'bc-bt-foo)
(fmakunbound 'bc-bt-bar)
(fmakunbound 'bc-bt-baz))
-  (it "should be printed for each failed spec"
-(with-local-buttercup
-  :reporter #'backtrace-reporter
-  (describe "suite"
-(it "expect 2" (expect (+ 1 2) :to-equal 2))
-(it "expect nil" (expect nil)))
-  (buttercup-run :noerror))
-(expect (buttercup-output) :to-match
-(rx string-start
-(= 2 (seq (= 40 ?=) "\n"
-  "suite expect " (or "2" "nil") "\n"
-  "\n"
-  "Traceback (most recent call last):\n"
-  (* (seq "  " (+ not-newline) "\n"))
-  (or "FAILED" "error") ": " (+ not-newline) "\n\n"))
-string-end)))
+  (it "should not be collected or printed for failed specs"
+(let (test-suites)
+  (spy-on 'buttercup--backtrace :and-call-through)
+  (with-local-buttercup
+   :reporter #'backtrace-reporter
+   (describe "suite"
+ (it "expect 2" (expect (+ 1 2) :to-equal 2))
+ (it "expect nil" (expect nil)))
+   (buttercup-run :noerror)
+   (setq test-suites buttercup-suites))
+  (expect 'buttercup--backtrace :not :to-have-been-called)
+  ;; Checking both if buttercup--backtrace have been called and
+  ;; the failure-stack value might be overkill
+  (expect (cl-every #'null
+(mapcar #'buttercup-spec-failure-stack
+(buttercup-suite-children (car test-suites)
+  (expect (buttercup-output) :to-match
+  (rx string-start
+  (= 40 ?=) "\nsuite expect " "2"   "\nFAILED: " (+ 
not-newline) "\n\n"
+  (= 40 ?=) "\nsuite expect " "nil" "\nFAILED: " (+ 
not-newline) "\n\n"
+  string-end
   (describe "with style"
 :var (test-suites long-string)
 ;; Set up tests to test



[nongnu] elpa/buttercup 45d53515da 02/16: Stop adding frames to backtrace once a buttercup wrap func is found

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 45d53515da379ddb621b7fc14d1860604b149d54
Author: Ola Nilsson 
Commit: Ola Nilsson 

Stop adding frames to backtrace once a buttercup wrap func is found

This will limit the backtrace for errors signalled from within a
wrapped expression.  There is still a set of other conditions that
have to be handled in buttercup--backtrace.
---
 buttercup.el | 40 +++-
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 7e562aebf4..d9c5a99d93 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -89,7 +89,6 @@ forms:
 and the return value will be EXPR, unevaluated. The quoted EXPR
 is useful if EXPR is a macro call, in which case the `quote'
 ensures access to the un-expanded form."
-  (cl-assert (functionp fun) t "Expected FUN to be a function")
   (if (buttercup--thunk-p fun)
   (buttercup--thunk--expr fun)
   (pcase fun
@@ -2122,30 +2121,21 @@ ARGS according to `debugger'."
   (backtrace-frame n #'buttercup--debugger))
(frame-list nil))
   ((not frame) frame-list)
-(push frame frame-list)
-  ;; keep frames until one of the known functions are found, after
-  ;; this is just the buttercup framework and not interesting for
-  ;; users (incorrect for testing buttercup). Some frames before the
-  ;; function also have to be discarded
-  (cl-labels ((tree-find (key tree)
- (cl-block tree-find
-   (while (consp tree)
- (let ((elem (pop tree)))
-   (when (or (and (consp elem)
-  (tree-find key elem))
- (and (buttercup--thunk-p elem)
-  (tree-find key (aref elem 
1)))
- (eql key elem))
- (cl-return-from tree-find t
-   (cl-return-from tree-find
- (and tree (eql tree key))
-;; TODO: Only check the cadr of frame, that is where the function is.
-;;   The buttercup--mark-stackframe should only be in wrapped 
expressions,
-;;   optimize by checking if it is a wrapped expression?
-;;   Will we even need the marker if we can check that?
-(when (tree-find 'buttercup--mark-stackframe frame)
-  (pop frame-list)
-  (cl-return frame-list)
+;; Keep frames until one if the end conditions is met. After
+;; this is just the buttercup framework and not interesting for
+;; users - except for testing buttercup.
+(when (or
+   ;; When the error occurs in the calling of one of the
+   ;; wrapped expressions of an expect.
+   (buttercup--wrapper-fun-p (cadr frame))
+   ;; TODO: error in `it' but outside `expect'
+   ;; TODO: matchers that do not match should not collect backtrace
+   ;; TODO: What about an error in a matcher?
+   ;; TODO: What about :to-throw?
+   ;; TODO: What about signals in before and after blocks?
+   )
+  (cl-return frame-list))
+(push frame frame-list)))
 
 (defun buttercup--format-stack-frame (frame &optional style)
   "Format stack FRAME according to STYLE.



[nongnu] elpa/buttercup 0552fe4d5b 12/16: Add :to-be-close-to docstring

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 0552fe4d5bf800130f3950ce95aa23854362df10
Author: Ola Nilsson 
Commit: Ola Nilsson 

Add :to-be-close-to docstring
---
 buttercup.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index 82a1dd80d8..64b16ae526 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -614,6 +614,8 @@ See also `buttercup-define-matcher'."
   :expect-mismatch-phrase "Expected `%A' < %b, but `%A' was %a.")
 
 (buttercup-define-matcher :to-be-close-to (a b precision)
+  "Verify that |A-B| < 10^-PRECISION.
+\(expect A :to-be-close-to B PRECISION)"
   (cl-destructuring-bind
   (precision (a-expr . a) (_b-expr . b))
   (cons (funcall precision)



[nongnu] elpa/buttercup be72aa872c 06/16: tests: Verify that backtraces are not collected for passed specs

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit be72aa872c3f940aa4f1f89162e916e09ae7a765
Author: Ola Nilsson 
Commit: Ola Nilsson 

tests: Verify that backtraces are not collected for passed specs
---
 tests/test-buttercup.el | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 42948a4a34..c8b332d084 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -1970,9 +1970,13 @@ before it's processed by other functions."
(fmakunbound 'bc-bt-foo)
(fmakunbound 'bc-bt-bar)
(fmakunbound 'bc-bt-baz))
-  (it "should not be collected or printed for failed specs"
-(let (test-suites)
+  (describe "should not be collected or printed for"
+:var (test-suites)
+(before-each
+  (setq test-suites nil)
   (spy-on 'buttercup--backtrace :and-call-through)
+  )
+(it "failed specs"
   (with-local-buttercup
:reporter #'backtrace-reporter
(describe "suite"
@@ -1990,7 +1994,22 @@ before it's processed by other functions."
   (rx string-start
   (= 40 ?=) "\nsuite expect " "2"   "\nFAILED: " (+ 
not-newline) "\n\n"
   (= 40 ?=) "\nsuite expect " "nil" "\nFAILED: " (+ 
not-newline) "\n\n"
-  string-end
+  string-end)))
+(it "passed specs"
+  (with-local-buttercup
+   :reporter #'backtrace-reporter
+   (describe "suite"
+ (it "expect 2" (expect (+ 1 1) :to-equal 2))
+ (it "expect t" (expect t)))
+   (buttercup-run :noerror)
+   (setq test-suites buttercup-suites))
+  (expect 'buttercup--backtrace :not :to-have-been-called)
+  ;; Checking both if buttercup--backtrace have been called and
+  ;; the failure-stack value might be overkill
+  (expect (cl-every #'null
+(mapcar #'buttercup-spec-failure-stack
+(buttercup-suite-children (car test-suites)
+  (expect (buttercup-output) :to-equal "")))
   (describe "with style"
 :var (test-suites long-string)
 ;; Set up tests to test



[nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `buttercup--mark-stackframe'

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit f577efc524f0dca38282a242898983d18fc6c960
Author: Ola Nilsson 
Commit: Ola Nilsson 

Remove remaining uses of `buttercup--mark-stackframe'

Recent changes in the backtrace code has made
`buttercup--mark-stackframe' redundant.  Remove all uses and mentions
in code and tests.
---
 buttercup.el| 14 --
 tests/test-buttercup.el | 17 -
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 1558ef749d..3fc51db26a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -83,8 +83,8 @@ For Emacs < 29:
 The function MUST be byte-compiled or have one of the following
 forms:
 
-\(closure (ENVLIST) () (quote EXPR) (buttercup--mark-stackframe) EXPANDED)
-\(lambda () (quote EXPR) (buttercup--mark-stackframe) EXPR)
+\(closure (ENVLIST) () (quote EXPR) EXPANDED)
+\(lambda () (quote EXPR) EXPR)
 
 and the return value will be EXPR, unevaluated. The quoted EXPR
 is useful if EXPR is a macro call, in which case the `quote'
@@ -98,7 +98,7 @@ ensures access to the un-expanded form."
 ;; * the stackframe marker
 ;; * the macroexpanded original expression
 (`(closure ,(pred listp) nil
-(quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+(quote ,expr) ,_expanded)
  expr)
 ;; This a when FUN has not been evaluated.
 ;; Why does that happen?
@@ -107,7 +107,7 @@ ensures access to the un-expanded form."
 ;; * the stackframe marker
 ;; * the expanded expression
 (`(lambda nil
-(quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+(quote ,expr) ,_expanded)
  expr)
 ;; This is when FUN has been byte compiled, as when the entire
 ;; test file has been byte compiled. Check that it has an empty
@@ -188,11 +188,9 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
   "Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'."
   (if (fboundp 'oclosure-lambda);Emacs≥29
   `(oclosure-lambda (buttercup--thunk (expr ',expr)) ()
- (buttercup--mark-stackframe)
  ,expr)
 `(lambda ()
(quote ,expr)
-   (buttercup--mark-stackframe)
,expr)))
 
 (defmacro expect (arg &optional matcher &rest args)
@@ -1015,7 +1013,6 @@ most probably including one or more calls to `expect'."
   `(buttercup-it ,description
  (lambda ()
(buttercup-with-converted-ert-signals
- (buttercup--mark-stackframe)
  ,@body)))
 `(buttercup-xit ,description)))
 
@@ -2111,9 +2108,6 @@ ARGS according to `debugger'."
((buttercup-pending buttercup-failed))
(otherwise (buttercup--backtrace)))
 
-(defalias 'buttercup--mark-stackframe #'ignore
-  "Marker to find where the backtrace start.")
-
 (defun buttercup--backtrace ()
   "Create a backtrace, a list of frames returned from `backtrace-frame'."
   ;; Read the backtrace frames from `buttercup--debugger' + 1  upward.
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 6aa4cf35c7..08be241c33 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -180,18 +180,18 @@ before it's processed by other functions."
   "Not testable on Emacs 30+, not relevant for Emacs 29+")
   (expect (buttercup--enclosed-expr
(let ((_foo 1))
- (lambda () '(ignore) (buttercup--mark-stackframe) (ignore
+ (lambda () '(ignore) (ignore
   :to-equal '(ignore)))
 (it "a lambda with expression copy?"
   ;; I suspect there is nothing to make sure that the quoted
   ;; expression matches the actual expression
   (expect (buttercup--enclosed-expr
-   '(lambda () (quote (ignore)) (buttercup--mark-stackframe) 
(ignore
+   '(lambda () (quote (ignore)) (ignore
   :to-equal '(ignore))
 (describe "byte compiled"
   (it "lambda objects"
 (expect (buttercup--enclosed-expr
- (byte-compile-sexp '(lambda () '(ignore) 
(buttercup--mark-stackframe) (ignore))
+ (byte-compile-sexp '(lambda () '(ignore) (ignore))
   (it "wrapped expression"
 (assume (not (fboundp 'buttercup--thunk-p)) "Not with Oclosures")
 (expect (buttercup--enclosed-expr (byte-compile-sexp 
(buttercup--wrap-expr '(ignore
@@ -202,15 +202,15 @@ before it's processed by other functions."
:to-throw 'buttercup-enclosed-expression-error))
 (it "on a closure with stackframe marker but no quoted expression"
   (expect
-   (buttercup--enclosed-expr (let ((_foo 1)) (lambda () 
(buttercup--mark-stackframe) (ignore
+   (buttercup--enclosed-expr (let ((_foo 1)) (lambda () (ignore
:to-throw 'buttercup-enclosed-expression-error))
 (it "for multi-statement closures"
   (expect (buttercup--enclosed-expr
-   (lambda () '(+ 1 2) (buttercup--mark-stackframe) (+ 1 2) 

[nongnu] elpa/buttercup 925af155be 15/16: tests: Add backtrace tests for function matchers

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 925af155be43261608e90f3057e14d65380d5efe
Author: Ola Nilsson 
Commit: Ola Nilsson 

tests: Add backtrace tests for function matchers

Function matchers (expect A (lambda (x y z) (< x y z)) B C) is an
obscure feature of buttercup. An interesting fact is that the wrapped
arguments are evaluated _before_ the matcher is called in contrast to
matchers defined with buttercup-define-matcher where the matcher is
assumed to do that itself.
---
 tests/test-buttercup.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 08be241c33..18e245e853 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -2198,7 +2198,9 @@ before it's processed by other functions."
   (matcher-spec ":to-have-been-called-with" :to-have-been-called-with 2)
   (matcher-spec ":not :to-have-been-called-with" :not 
:to-have-been-called-with 2)
   (matcher-spec ":to-have-been-called-times" :to-have-been-called-times 2)
-  (matcher-spec ":not :to-have-been-called-times" :not 
:to-have-been-called-times 2
+  (matcher-spec ":not :to-have-been-called-times" :not 
:to-have-been-called-times 2)
+  (matcher-spec "function matcher" (lambda (_) t))
+  (matcher-spec ":not function matcher" :not (lambda (_) nil)
 
 
 (describe "When using quiet specs in the batch reporter"



[nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backtrace-frame

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 4b1682ec98a1c0303736feb4e003848a368293d1
Author: Ola Nilsson 
Commit: Ola Nilsson 

Use the base argument of backtrace-frame

Instead of discarding all frames before `buttercup--debugger', use the
base argument of `backtrace-frame' to start at the frame after
`buttercup--debugger'.
---
 buttercup.el | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index cf6019d65f..7e562aebf4 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2116,19 +2116,13 @@ ARGS according to `debugger'."
 
 (defun buttercup--backtrace ()
   "Create a backtrace, a list of frames returned from `backtrace-frame'."
-  ;; Read the backtrace frames from 0 (the closest) upward.
-  (cl-do* ((n 0 (1+ n))
-   (frame (backtrace-frame n) (backtrace-frame n))
-   (frame-list nil)
-   (in-program-stack nil))
+  ;; Read the backtrace frames from `buttercup--debugger' + 1  upward.
+  (cl-do* ((n 1 (1+ n))
+   (frame (backtrace-frame n #'buttercup--debugger)
+  (backtrace-frame n #'buttercup--debugger))
+   (frame-list nil))
   ((not frame) frame-list)
-  ;; discard frames until (and including) `buttercup--debugger', they
-  ;; only contain buttercup code
-  (when in-program-stack
-(push frame frame-list))
-  (when (eq (elt frame 1)
-'buttercup--debugger)
-(setq in-program-stack t))
+(push frame frame-list)
   ;; keep frames until one of the known functions are found, after
   ;; this is just the buttercup framework and not interesting for
   ;; users (incorrect for testing buttercup). Some frames before the
@@ -2149,7 +2143,7 @@ ARGS according to `debugger'."
 ;;   The buttercup--mark-stackframe should only be in wrapped 
expressions,
 ;;   optimize by checking if it is a wrapped expression?
 ;;   Will we even need the marker if we can check that?
-(when (and in-program-stack (tree-find 'buttercup--mark-stackframe 
frame))
+(when (tree-find 'buttercup--mark-stackframe frame)
   (pop frame-list)
   (cl-return frame-list)
 



[nongnu] elpa/buttercup ee000fabd1 04/16: tests: Cleanup and comments

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit ee000fabd1cf1e9bca8a0a0026054e1d903b18a0
Author: Ola Nilsson 
Commit: Ola Nilsson 

tests: Cleanup and comments
---
 tests/test-buttercup.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index e2ab163725..42948a4a34 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -1947,7 +1947,7 @@ before it's processed by other functions."
 (kill-buffer print-buffer)
 (setq print-buffer nil))
   ;; define a buttercup-reporter-batch variant that only outputs on
-  ;; buttercup-done
+  ;; buttercup-done, because that is where backtraces are printed
   (before-each
 (spy-on 'backtrace-reporter :and-call-fake
 (lambda (event arg)
@@ -1960,11 +1960,12 @@ before it's processed by other functions."
 (spy-on 'buttercup-reporter-batch--print-summary))
   ;; define a known backtrace with a typical error
   (before-all
-   (defun bc-bt-foo (a) (bc-bt-bar a))
-   (defun bc-bt-bar (a) (bc-bt-baz a))
-   (defun bc-bt-baz (a)
+(defun bc-bt-baz (a)
   (or (number-or-marker-p a)
-(signal 'wrong-type-argument `(number-or-marker-p ,a)
+  (signal 'wrong-type-argument `(number-or-marker-p ,a
+(with-no-warnings
+  (defun bc-bt-bar (a) (bc-bt-baz a))
+  (defun bc-bt-foo (a) (bc-bt-bar a
   (after-all
(fmakunbound 'bc-bt-foo)
(fmakunbound 'bc-bt-bar)
@@ -2007,6 +2008,8 @@ before it's processed by other functions."
 (bc-bt-foo long-string)
 :to-be-truthy)))
(setq test-suites buttercup-suites)))
+(after-each
+  (setq test-suites nil))
 (it "`crop' should print truncated lines"
   (with-local-buttercup
:suites test-suites :reporter #'backtrace-reporter



[nongnu] elpa/buttercup 8408579758 16/16: Rewrite buttercup-expect with pcase

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 8408579758d79829170583b30e46aee1de9deb2b
Author: Ola Nilsson 
Commit: Ola Nilsson 

Rewrite buttercup-expect with pcase

Replace the special case of (null matcher) with using the
:to-be-truthy matcher.  buttercup-expect is probably never called
without a matcher as the expect macro will pass the :to-be-truthy
matcher if none is given.
---
 buttercup.el | 26 --
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 702192a7ef..4c9b74fd65 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -220,24 +220,14 @@ the arguments is delayed until the containing spec is 
executed."
 See the macro documentation for details and the definition of
 ARG, MATCHER and ARGS."
   (cl-assert (cl-every #'buttercup--wrapper-fun-p (cons arg args)) t)
-  (if (not matcher)
-  (progn
-(cl-assert (not args) t)
-(when (not (funcall arg))
-  (buttercup-fail "Expected %S to be non-nil"
-  (buttercup--enclosed-expr arg
-(let ((result (buttercup--apply-matcher matcher (cons arg args
-  (if (consp result)
-  (when (not (car result))
-(buttercup-fail "%s" (cdr result)))
-(when (not result)
-  (buttercup-fail "Expected %S %S %s"
-  (buttercup--enclosed-expr arg)
-  matcher
-  (mapconcat (lambda (obj)
-   (format "%S" (funcall obj)))
- args
- " ")))
+  (pcase (buttercup--apply-matcher (or matcher :to-be-truthy) (cons arg args))
+(`(,result . ,message) (unless result (buttercup-fail message)))
+(result (unless result (buttercup-fail "Expected %S %S %s"
+   (buttercup--enclosed-expr arg)
+   matcher
+   (mapconcat (lambda (obj)
+(format "%S" (funcall 
obj)))
+  args " "))
 
 (defun buttercup-fail (format &rest args)
   "Fail the current test with the given description.



[nongnu] elpa/buttercup a1d0d73999 11/16: Improve docstring of buttercup-define-matcher

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit a1d0d739992daf61fa91b02fd46ce814af0d3467
Author: Ola Nilsson 
Commit: Ola Nilsson 

Improve docstring of buttercup-define-matcher
---
 buttercup.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 3fc51db26a..82a1dd80d8 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -263,16 +263,16 @@ MESSAGE is omitted or nil show the condition form 
instead."
 
 (defmacro buttercup-define-matcher (matcher args &rest body)
   "Define a matcher named MATCHER to be used in `expect'.
-
+MATCHER is a keyword, for instance `:to-be'.
 ARGS is a list of the elements to match together.
-
 The BODY will receive ARGS as functions that can be called (using
 `funcall') to get their values. BODY should return either a
 simple boolean, or a cons cell of the form (RESULT . MESSAGE). If
 RESULT is nil, MESSAGE should describe why the matcher failed. If
 RESULT is non-nil, MESSAGE should describe why a negated matcher
 failed.
-BODY may start with a docstring."
+
+\(fn MATCHER ARGS [DOCSTRING] BODY...)"
   (declare (indent defun))
   `(put ,matcher 'buttercup-matcher
 (lambda ,args



[nongnu] elpa/buttercup 19e1a86626 14/16: Clarify that buttercup--wrap-expr is only meant for expect

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 19e1a866265517104ff402bf27fb73f73ebfc627
Author: Ola Nilsson 
Commit: Ola Nilsson 

Clarify that buttercup--wrap-expr is only meant for expect

The butercup--wrap-expr function was extracted from the expect macro
to reduce code repetition in that macro definition.  It will not
produce a function when used outside that - or possibly other - macros.
---
 buttercup.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 68f4e6d083..702192a7ef 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -185,7 +185,8 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
 (define-error 'buttercup-pending "Buttercup test is pending" 
'buttercup-error-base)
 
 (defun buttercup--wrap-expr (expr)
-  "Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'."
+  "Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'.
+This function is only usable from within the buttercup `expect' macro."
   (if (fboundp 'oclosure-lambda);Emacs≥29
   `(oclosure-lambda (buttercup--thunk (expr ',expr)) ()
  ,expr)



[nongnu] elpa/buttercup 0444816a60 07/16: tests: Refactor test that no backtraces are collected for skipped specs

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 0444816a60b33acf8d23699cb53c9feb2fdc6ebb
Author: Ola Nilsson 
Commit: Ola Nilsson 

tests: Refactor test that no backtraces are collected for skipped specs

The "should not generate backtraces for skipped specs" had a lot of
similarties to the two specs in the "should not be collected or
printed for" suite.  Move it into that suite, not only for shared code
but also because they belong together.
---
 tests/test-buttercup.el | 31 +++
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index c8b332d084..17d2da7602 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -2006,6 +2006,24 @@ before it's processed by other functions."
   (expect 'buttercup--backtrace :not :to-have-been-called)
   ;; Checking both if buttercup--backtrace have been called and
   ;; the failure-stack value might be overkill
+  (expect (cl-every #'null
+(mapcar #'buttercup-spec-failure-stack
+(buttercup-suite-children (car test-suites)
+  (expect (buttercup-output) :to-equal ""))
+(it "skipped specs"
+  (with-local-buttercup
+   :reporter #'backtrace-reporter
+(describe "one description with"
+  (it "one skipped spec"
+(buttercup-skip "skip"))
+  (xit "one empty spec")
+  (it "one un-assumed spec"
+(assume nil "A very unassuming spec")))
+(buttercup-run :noerror)
+(setq test-suites buttercup-suites))
+  (expect 'buttercup--backtrace :not :to-have-been-called)
+  ;; Checking both if buttercup--backtrace have been called and
+  ;; the failure-stack value might be overkill
   (expect (cl-every #'null
 (mapcar #'buttercup-spec-failure-stack
 (buttercup-suite-children (car test-suites)
@@ -2159,18 +2177,7 @@ before it's processed by other functions."
   (matcher-spec ":to-have-been-called-with" :to-have-been-called-with 2)
   (matcher-spec ":not :to-have-been-called-with" :not 
:to-have-been-called-with 2)
   (matcher-spec ":to-have-been-called-times" :to-have-been-called-times 2)
-  (matcher-spec ":not :to-have-been-called-times" :not 
:to-have-been-called-times 2)))
-  (it "should not generate backtraces for skipped specs"
-(let (test-spec)
-  (spy-on 'buttercup--backtrace :and-call-through)
-  (with-local-buttercup
-(describe "one description"
-  (it "with a pending spec")
-  (buttercup-skip "skip"))
-(buttercup-run :noerror)
-(setq test-spec (car (buttercup-suite-children (car 
buttercup-suites)
-  (expect 'buttercup--backtrace :not :to-have-been-called)
-  (expect (buttercup-spec-failure-stack test-spec) :to-be nil
+  (matcher-spec ":not :to-have-been-called-times" :not 
:to-have-been-called-times 2
 
 
 (describe "When using quiet specs in the batch reporter"



[nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exceptions outside expect

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit c8f34ae3edda96f1dab7b7d9e9ed2692c0ee7263
Author: Ola Nilsson 
Commit: Ola Nilsson 

Limit backtraces for spec exceptions outside expect

The first uninteresting frame is identified by a new
`buttercup--stackframe-marker' in a let statement:

   (let ((buttercup--stackframe-marker 1)) ...

This let-form is added to the buttercup-with-converted-ert-signals
macro, not because it has anything to do with ert signal conversion,
but because it is the last wrapper around the spec code given by the
user.
---
 buttercup.el | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 7f30f2c38d..b1107a9df1 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2129,7 +2129,20 @@ ARGS according to `debugger'."
;; When the error occurs in the calling of one of the
;; wrapped expressions of an expect.
(buttercup--wrapper-fun-p (cadr frame))
-   ;; TODO: error in `it' but outside `expect'
+   ;; When an error happens in spec code but outside an expect
+   ;; statement
+   ;; buttercup--update-with-funcall
+   ;;  apply buttercup--funcall
+   ;;   buttercup--funcall   -   sets debugger
+   ;;apply FUNCTION
+   ;; FUNCTION  -- spec body function
+   ;;  condition-case   -- from 
buttercup-with-converted-ert-signals
+   ;;   (let ((buttercup--stackframe-marker 1))  -- the same
+   ;;ACTUAL CODE
+   (and (null (car frame))
+(eq 'let (cadr frame))
+(equal '((buttercup--stackframe-marker 1)) (car (cddr frame)))
+)
;; TODO: What about an error in a matcher?
;; TODO: What about :to-throw?
;; TODO: What about signals in before and after blocks?
@@ -2184,7 +2197,9 @@ Specifically, `ert-test-failed' is converted to
 `buttercup-pending'."
   (declare (indent 0))
   `(condition-case err
-   (progn ,@body)
+   (let ((buttercup--stackframe-marker 1))
+ (ignore buttercup--stackframe-marker)
+ ,@body)
  (ert-test-failed
   (buttercup-fail "%S" err))
  (ert-test-skipped



[nongnu] elpa/buttercup add32f8cbf 08/16: Collect stacktraces for errors in matchers

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit add32f8cbf34373644f55da99ef990f285b80451
Author: Ola Nilsson 
Commit: Ola Nilsson 

Collect stacktraces for errors in matchers

Fake the last frame to show the matchers name.
---
 buttercup.el| 44 +++-
 tests/test-buttercup.el | 22 ++
 2 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index b1107a9df1..1558ef749d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2143,9 +2143,51 @@ ARGS according to `debugger'."
 (eq 'let (cadr frame))
 (equal '((buttercup--stackframe-marker 1)) (car (cddr frame)))
 )
-   ;; TODO: What about an error in a matcher?
;; TODO: What about :to-throw?
+   ;; buttercup--update-with-funcall (spec ...
+   ;;  apply buttercup--funcall
+   ;;   buttercup--funcall   -- sets the debugger
+   ;;apply FUNCTION
+   ;; FUNCTION -- spec body function
+   ;;  condition-case -- from buttercup-with-converted-ert-signals
+   ;;   (let ((buttercup--stackframe-marker 1))
+   ;;(buttercup-expect
+   ;; (buttercup--apply-matcher
+   ;;  (apply to-throw-matcher
+   ;;   (to-throw-matcher
+   ;; We need a new debugger here, the
+   ;; condition-case can not be used to collect
+   ;; backtrace.
+   ;; When the error happens in the matcher function
+   ;;  (buttercup-expect
+   ;;   (buttercup--apply-matcher
+   ;;(apply some-kind-of-function
+   ;; (matcher
+   ;;  ACTUAL CODE
+   (and (eq 'buttercup--apply-matcher (cadr frame))
+;; The two preceeding frames are not of user interest
+(pop frame-list) (pop frame-list)
+;; Add a fake frame for the matcher function
+(push (cons t
+(cons (car (cddr frame))
+  (mapcar (lambda (x)
+(if (buttercup--wrapper-fun-p x)
+(buttercup--enclosed-expr x)
+  x))
+  (cadr (cddr frame)
+  frame-list))
;; TODO: What about signals in before and after blocks?
+   ;; BEFORE-EACH:
+   ;; buttercup--run-suite
+   ;;  (let* ...
+   ;;   (dolist (f (buttercup-suite-before-all ...
+   ;;(buttercup--update-with-funcall suite f
+   ;; (apply buttercup--funcall
+   ;;  (buttercup-funcall f
+   ;;   (f)
+   ;; Currently, buttercup silently ignores error in
+   ;; (before|after)-(all|each). As long as that is the case,
+   ;; there is nothing we can do about stacktraces.
)
   (cl-return frame-list))
 (push frame frame-list)))
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 17d2da7602..6aa4cf35c7 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -2028,6 +2028,28 @@ before it's processed by other functions."
 (mapcar #'buttercup-spec-failure-stack
 (buttercup-suite-children (car test-suites)
   (expect (buttercup-output) :to-equal "")))
+  (describe "should be collected for errors in"
+(it "matchers"
+  (put :--failing-matcher 'buttercup-matcher
+   (lambda (&rest _) (/ 1 0)))
+  (with-local-buttercup
+   :reporter #'backtrace-reporter
+   (describe "One suite with"
+ (it "a bad matcher"
+   (expect 1 :--failing-matcher 1)))
+   (buttercup-run :no-error))
+  (put :--failing-matcher 'buttercup-matcher nil)
+  (expect (buttercup-output) :to-equal
+  (concat
+(make-string 40 ?=) "\n"
+"One suite with a bad matcher\n"
+"\n"
+"Traceback (most recent call last):\n"
+"  :--failing-matcher(1 1)\n"
+"  /(1 0)\n"
+"error: (arith-error)\n\n"
+)))
+)
   (describe "with style"
 :var (test-suites long-string)
 ;; Set up tests to test



[nongnu] elpa/buttercup updated (dfbef21772 -> 8408579758)

2024-09-04 Thread ELPA Syncer
elpasync pushed a change to branch elpa/buttercup.

  from  dfbef21772 Find the stackframe marker in interpreted-function 
objects
   new  4b1682ec98 Use the base argument of backtrace-frame
   new  45d53515da Stop adding frames to backtrace once a buttercup wrap 
func is found
   new  df7f98e110 Do not collect backtraces for failed specs
   new  ee000fabd1 tests: Cleanup and comments
   new  c8f34ae3ed Limit backtraces for spec exceptions outside expect
   new  be72aa872c tests: Verify that backtraces are not collected for 
passed specs
   new  0444816a60 tests: Refactor test that no backtraces are collected 
for skipped specs
   new  add32f8cbf Collect stacktraces for errors in matchers
   new  f577efc524 Remove remaining uses of `buttercup--mark-stackframe'
   new  789570cf7d Merge pull request #249 from snogge/fix-247
   new  a1d0d73999 Improve docstring of buttercup-define-matcher
   new  0552fe4d5b Add :to-be-close-to docstring
   new  9bb00a269d Improve the docstring of the expect macro
   new  19e1a86626 Clarify that buttercup--wrap-expr is only meant for 
expect
   new  925af155be tests: Add backtrace tests for function matchers
   new  8408579758 Rewrite buttercup-expect with pcase


Summary of changes:
 buttercup.el| 186 
 tests/test-buttercup.el | 141 +---
 2 files changed, 207 insertions(+), 120 deletions(-)



[nongnu] elpa/buttercup 789570cf7d 10/16: Merge pull request #249 from snogge/fix-247

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 789570cf7d4b7e84c2787aceebab33a55ec812b4
Merge: dfbef21772 f577efc524
Author: Ola Nilsson 
Commit: GitHub 

Merge pull request #249 from snogge/fix-247

Improve backtrace looks and performance
---
 buttercup.el| 133 -
 tests/test-buttercup.el | 139 +---
 2 files changed, 181 insertions(+), 91 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index cf6019d65f..3fc51db26a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -83,13 +83,12 @@ For Emacs < 29:
 The function MUST be byte-compiled or have one of the following
 forms:
 
-\(closure (ENVLIST) () (quote EXPR) (buttercup--mark-stackframe) EXPANDED)
-\(lambda () (quote EXPR) (buttercup--mark-stackframe) EXPR)
+\(closure (ENVLIST) () (quote EXPR) EXPANDED)
+\(lambda () (quote EXPR) EXPR)
 
 and the return value will be EXPR, unevaluated. The quoted EXPR
 is useful if EXPR is a macro call, in which case the `quote'
 ensures access to the un-expanded form."
-  (cl-assert (functionp fun) t "Expected FUN to be a function")
   (if (buttercup--thunk-p fun)
   (buttercup--thunk--expr fun)
   (pcase fun
@@ -99,7 +98,7 @@ ensures access to the un-expanded form."
 ;; * the stackframe marker
 ;; * the macroexpanded original expression
 (`(closure ,(pred listp) nil
-(quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+(quote ,expr) ,_expanded)
  expr)
 ;; This a when FUN has not been evaluated.
 ;; Why does that happen?
@@ -108,7 +107,7 @@ ensures access to the un-expanded form."
 ;; * the stackframe marker
 ;; * the expanded expression
 (`(lambda nil
-(quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+(quote ,expr) ,_expanded)
  expr)
 ;; This is when FUN has been byte compiled, as when the entire
 ;; test file has been byte compiled. Check that it has an empty
@@ -189,11 +188,9 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
   "Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'."
   (if (fboundp 'oclosure-lambda);Emacs≥29
   `(oclosure-lambda (buttercup--thunk (expr ',expr)) ()
- (buttercup--mark-stackframe)
  ,expr)
 `(lambda ()
(quote ,expr)
-   (buttercup--mark-stackframe)
,expr)))
 
 (defmacro expect (arg &optional matcher &rest args)
@@ -1016,7 +1013,6 @@ most probably including one or more calls to `expect'."
   `(buttercup-it ,description
  (lambda ()
(buttercup-with-converted-ert-signals
- (buttercup--mark-stackframe)
  ,@body)))
 `(buttercup-xit ,description)))
 
@@ -2108,50 +2104,87 @@ ARGS according to `debugger'."
;; args is (error (signal . data) ) where the tail
;; may be empty
(cl-destructuring-bind (signal-type . data) (cl-second args)
- (unless (eq signal-type 'buttercup-pending)
-   (buttercup--backtrace))
-
-(defalias 'buttercup--mark-stackframe #'ignore
-  "Marker to find where the backtrace start.")
+ (cl-case signal-type
+   ((buttercup-pending buttercup-failed))
+   (otherwise (buttercup--backtrace)))
 
 (defun buttercup--backtrace ()
   "Create a backtrace, a list of frames returned from `backtrace-frame'."
-  ;; Read the backtrace frames from 0 (the closest) upward.
-  (cl-do* ((n 0 (1+ n))
-   (frame (backtrace-frame n) (backtrace-frame n))
-   (frame-list nil)
-   (in-program-stack nil))
+  ;; Read the backtrace frames from `buttercup--debugger' + 1  upward.
+  (cl-do* ((n 1 (1+ n))
+   (frame (backtrace-frame n #'buttercup--debugger)
+  (backtrace-frame n #'buttercup--debugger))
+   (frame-list nil))
   ((not frame) frame-list)
-  ;; discard frames until (and including) `buttercup--debugger', they
-  ;; only contain buttercup code
-  (when in-program-stack
-(push frame frame-list))
-  (when (eq (elt frame 1)
-'buttercup--debugger)
-(setq in-program-stack t))
-  ;; keep frames until one of the known functions are found, after
-  ;; this is just the buttercup framework and not interesting for
-  ;; users (incorrect for testing buttercup). Some frames before the
-  ;; function also have to be discarded
-  (cl-labels ((tree-find (key tree)
- (cl-block tree-find
-   (while (consp tree)
- (let ((elem (pop tree)))
-   (when (or (and (consp elem)
-  (tree-find key elem))
- (and (buttercup--thunk-p elem)
-  (tree-find key (aref elem 
1)))
- 

[nongnu] elpa/buttercup 9bb00a269d 13/16: Improve the docstring of the expect macro

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit 9bb00a269db87575735f5e49ab125ff7f5c8b3df
Author: Ola Nilsson 
Commit: Ola Nilsson 

Improve the docstring of the expect macro
---
 buttercup.el | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 64b16ae526..68f4e6d083 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -196,17 +196,19 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
 (defmacro expect (arg &optional matcher &rest args)
   "Expect a condition to be true.
 
-This macro knows three forms:
+This macro knows two forms:
 
-\(expect ARG :MATCHER ARGS...)
-  Fail the current test if the matcher does not match these arguments.
+\(expect ARG :MATCHER [ARGS...])
+  Fail the current test if the MATCHER does not match these arguments.
+  The correct number of arguments depend on the MATCHER.
   See `buttercup-define-matcher' for more information on matchers.
 
-\(expect (function ARG...))
-  Fail the current test if the function call does not return a true value.
-
 \(expect ARG)
-  Fail the current test if ARG is not true."
+  Fail the current test if ARG is not true.
+  This is the same as (expect ARG :to-be-truthy).
+
+All arguments can be a value or a single Lisp form. The evaluation of
+the arguments is delayed until the containing spec is executed."
   `(buttercup-expect ,(buttercup--wrap-expr arg)
  ,(or matcher :to-be-truthy)
  ,@(mapcar #'buttercup--wrap-expr args)))



[nongnu] elpa/buttercup bf01a33f8b: Bump version: 1.35 → 1.36

2024-09-04 Thread ELPA Syncer
branch: elpa/buttercup
commit bf01a33f8bc2d3664121d3b20f7496e67ce55e6a
Author: Ola Nilsson 
Commit: Ola Nilsson 

Bump version: 1.35 → 1.36
---
 .bumpversion.cfg | 2 +-
 buttercup.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index fce9240a11..8ec2bb9cf3 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.35
+current_version = 1.36
 parse = (?P\d+)\.(?P.*)
 serialize = {major}.{minor}
 files = buttercup.el
diff --git a/buttercup.el b/buttercup.el
index 4c9b74fd65..8f8f2613bd 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2015-2017  Jorgen Schaefer 
 ;; Copyright (C) 2018-2024  Ola Nilsson 
 
-;; Version: 1.35
+;; Version: 1.36
 ;; Author: Jorgen Schaefer 
 ;; Maintainer: Ola Nilsson 
 ;; Package-Requires: ((emacs "24.4"))



[elpa] externals/corfu bc989504a5: README: Simplify Orderless-related documentation

2024-09-04 Thread ELPA Syncer
branch: externals/corfu
commit bc989504a5660429dce9949799aafd9c313d752c
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Simplify Orderless-related documentation

See https://github.com/oantolin/orderless/pull/179
---
 README.org | 29 +++--
 1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/README.org b/README.org
index 8674147745..1e68ec8d8d 100644
--- a/README.org
+++ b/README.org
@@ -172,9 +172,9 @@ completion at point function provided by my 
[[https://github.com/minad/cape][Cap
 #+end_src
 
 If you start to configure Corfu more deeply, I recommend to give the Orderless
-completion style a try for filtering. Orderless completion is different from 
the
-familiar prefix TAB completion. Note that Orderless is not a necessity; Corfu
-can be used as well with the default completion styles.
+completion style a try for filtering. Orderless completion offers more flexible
+filtering than the default completion styles. Note that Orderless is not a
+necessity; Corfu can be used just as well with the default completion styles.
 
 #+begin_src emacs-lisp
 ;; Optionally use the `orderless' completion style.
@@ -445,29 +445,6 @@ force snippet expansion, confirm a candidate explicitly 
with ~RET~.
   (global-corfu-mode))
 #+end_src
 
-** Expanding to the common candidate prefix with TAB
-
-If you leave the default configuration of the completion styles, such that the
-~basic~ completion style is still present, then pressing ~M-TAB~ 
(~corfu-expand~) will
-expand the current input to the common prefix of all completion candidates. In
-contrast, ~TAB~ (~corfu-complete~) behaves differently and expands input to the
-currently selected candidate.
-
-If you use the ~orderless~ completion style, then expansion works differently 
by
-default. Orderless only expands to single matching candidates, since due to its
-multi-component input, there does not necessarily exist an expansion to a 
common
-candidate prefix. However it is possible to define a separate ~tab~ completion
-style. The ~tab~ completion style will only take over ~TAB~ completion (if 
prefix
-expansion is possible), but besides that won't affect Orderless candidate
-filtering.
-
-#+begin_src emacs-lisp
-(add-to-list 'completion-styles-alist
- '(tab completion-basic-try-completion ignore
-   "Completion style which provides TAB completion only."))
-(setq completion-styles '(tab orderless basic)))
-#+end_src
-
 ** Transfer completion to the minibuffer
 
 Sometimes it is useful to transfer the Corfu completion session to the



[elpa] externals/orderless a2eaed8f46: Add `orderless-expand-substring` for literal substring expansion

2024-09-04 Thread ELPA Syncer
branch: externals/orderless
commit a2eaed8f465a329c61421668f8168d6aaa2a5ebd
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add `orderless-expand-substring` for literal substring expansion

If the customization option `orderless-expand-substring` is set to
t, `orderless-try-completion` first tries to treat the input as
literal substring and tries to expand it. If literal substring
expansion fails, Orderless falls back to its regular behavior, and
checks if there exists a single unique match to expand to. The
option `orderless-expand-substring` is effective in the default
completion UI and Corfu when pressing TAB, but does not affect
Vertico. It makes the transition to Orderless a little friendlier
for users accustomed to the Emacs built-in `basic` and `substring`
completion styles.

As an alternative to `orderless-expand-substring` one could define
an alternative completion style `tab` as follows.

(add-to-list 'completion-styles-alist
 '(tab completion-substring-try-completion ignore
 "Completion style which provides only TAB completion."))

I've used this `tab` configuration style for a long time in my
personal configuration, but the goal is to improve out of the box
behavior of Orderless and related packages. The following two
configurations are equivalent:

;; NEW: Use orderless-expand-substring
(setq completion-styles '(orderless basic)
  orderless-expand-substring t)
;; OLD: Use the tab style from above.
(setq completion-styles '(tab orderless basic)
  orderless-expand-substring nil)
---
 orderless.el | 75 ++--
 1 file changed, 43 insertions(+), 32 deletions(-)

diff --git a/orderless.el b/orderless.el
index 97911be704..187fd38d37 100644
--- a/orderless.el
+++ b/orderless.el
@@ -212,6 +212,15 @@ 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
+  "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)
+
 ;;; Matching styles
 
 (defun orderless-regexp (component)
@@ -554,38 +563,40 @@ 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."
-  (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 (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
+   pre

[elpa] externals/vertico 9cb6f7ef77: README: Simplify Orderless-related documentation

2024-09-04 Thread ELPA Syncer
branch: externals/vertico
commit 9cb6f7ef77ba2583f01de5725607d1a4351a00cc
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Simplify Orderless-related documentation

See https://github.com/oantolin/orderless/pull/179
---
 README.org | 31 ---
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/README.org b/README.org
index 0cf1a45148..ce342504b2 100644
--- a/README.org
+++ b/README.org
@@ -125,8 +125,8 @@ to take advantage of ~use-package~. Here is an example 
configuration:
   (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
 #+end_src
 
-I recommend to give Orderless completion a try, which is different from the
-prefix TAB completion used by the basic default completion system or in shells.
+I recommend to give Orderless completion a try, which is more flexible and
+powerful than the default completion styles.
 
 #+begin_src emacs-lisp
 ;; Optionally use the `orderless' completion style.
@@ -165,7 +165,7 @@ the currently selected candidate.
 If you prefer to have the default completion commands available you can add new
 bindings or even replace the Vertico bindings. For example you can use =M-TAB= 
to
 expand the prefix of candidates (TAB complete) or cycle between candidates if
-~completion-cycle-threshold~ is non-nil.
+~completion-cycle-threshold~ is non-nil, with the following configuration.
 
 #+begin_src emacs-lisp
 ;; Option 1: Additional bindings
@@ -177,21 +177,14 @@ expand the prefix of candidates (TAB complete) or cycle 
between candidates if
 ;; (keymap-set vertico-map "TAB" #'minibuffer-complete)
 #+end_src
 
-The ~orderless~ completion style does not support expansion of a common 
candidate
-prefix, as supported by shells or the basic default completion system. The
-reason is that the Orderless input string is usually not a prefix. In order to
-support completing prefixes, combine ~orderless~ with ~substring~ in your
-=completion-styles= configuration.
-
-#+begin_src emacs-lisp
-(setq completion-styles '(substring orderless basic))
-#+end_src
-
-Alternatively you can use the built-in completion-styles, e.g.,
-=partial-completion=, =flex= or =initials=. The =partial-completion= style is 
important
-if you want to open multiple files at once with ~find-file~ using wildcards. In
-order to open multiple files with a wildcard at once, you have to submit the
-prompt with =M-RET=. Alternative first move to the prompt and then press =RET=.
+The command ~minibuffer-complete~ performs prefix expansion for the ~basic~
+completion style, while the ~orderless~ and ~substring~ completion styles 
expand to
+the longest candidate substring. Alternatively you can use completion-styles
+like ~partial-completion~, ~flex~ or ~initials~, which perform different 
expansion and
+filtering. The ~partial-completion~ style is important if you want to open
+multiple files at once with ~find-file~ using wildcards. In order to open 
multiple
+files with a wildcard at once, you have to submit the prompt with =M-RET=.
+Alternative first move to the prompt and then press =RET=.
 
 #+begin_src emacs-lisp
 (setq completion-styles '(basic substring partial-completion flex))
@@ -201,7 +194,7 @@ Because Vertico is fully compatible with Emacs default 
completion system,
 further customization of completion behavior can be achieved by setting the
 designated Emacs variables. For example, one may wish to disable
 case-sensitivity for file and buffer matching when built-in completion styles
-are used instead of ~orderless~:
+are used:
 
 #+begin_src emacs-lisp
 (setq read-file-name-completion-ignore-case t



[nongnu] elpa/gptel defe48bb8c: gptel-transient: Tweak directive overlay location

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

gptel-transient: Tweak directive overlay location

gptel-transient.el (gptel--instructions-make-overlay): Tweak the
location of the "additional directive" overlay to try to keep it
visible when a region is selected.
---
 gptel-transient.el | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/gptel-transient.el b/gptel-transient.el
index 272ed0368d..98f5d093d9 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -59,13 +59,19 @@ Meant to be called when `gptel-menu' is active."
   args))
 
 (defun gptel--instructions-make-overlay (text &optional ov)
-  "TODO"
+  "Make or move overlay OV with TEXT."
   (save-excursion
+;; Move point to overlay position
 (cond
- ((use-region-p) (goto-char (region-beginning)))
- ((gptel--in-response-p) (gptel-beginning-of-response))
- (t (text-property-search-backward 'gptel 'response)))
-(skip-chars-forward "\n \t")
+ ((use-region-p)
+  (if (pos-visible-in-window-p (region-beginning))
+  (goto-char (region-beginning
+ ((gptel--in-response-p)
+  (gptel-beginning-of-response)
+  (skip-chars-forward "\n \t"))
+ (t (text-property-search-backward 'gptel 'response)
+(skip-chars-forward "\n \t")))
+;; Make overlay
 (if (and ov (overlayp ov))
 (move-overlay ov (point) (point) (current-buffer))
   (setq ov (make-overlay (point) (point) nil t)))
@@ -75,9 +81,8 @@ Meant to be called when `gptel-menu' is active."
 (overlay-put ov 'category 'gptel)
 (overlay-put
  ov 'after-string
- (concat
-  (propertize (concat "GPTEL: " text)
-  'font-lock-face '(:inherit shadow :box t))
+ (concat (propertize (concat "DIRECTIVE: " text)
+ 'font-lock-face '(:inherit shadow :weight bold  :box 
t))
   "\n"))
 ov))