branch: externals/literate-scratch
commit d3fcd76d214f93fbd430f913717c27a731bffdc4
Author: Sean Whitton <spwhit...@spwhitton.name>
Commit: Sean Whitton <spwhit...@spwhitton.name>

    * literate-scratch: Import version 2.1.
---
 literate-scratch.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/literate-scratch.el b/literate-scratch.el
index ddc2458216..e869e0fd94 100644
--- a/literate-scratch.el
+++ b/literate-scratch.el
@@ -5,7 +5,7 @@
 ;; Author: Sean Whitton <spwhit...@spwhitton.name>
 ;; Maintainer: Sean Whitton <spwhit...@spwhitton.name>
 ;; Package-Requires: ((emacs "29.1"))
-;; Version: 2.0
+;; Version: 2.1
 ;; URL: 
https://git.spwhitton.name/dotfiles/tree/.emacs.d/site-lisp/literate-scratch.el
 ;; Keywords: lisp text
 
@@ -49,6 +49,10 @@
 
 ;;; News:
 
+;; Ver 2.1 2025/04/19 Sean Whitton
+;;     Bug fix: before adding whitespace syntax to the newline character
+;;     following a block comment line, check we're not on the last line of a
+;;     buffer with no final newline character.
 ;; Ver 2.0 2025/04/18 Sean Whitton
 ;;     Rewrite core algorithm to use comment starters not comment fences,
 ;;     and therefore no `syntax-propertize-extend-region-functions' entry.
@@ -128,8 +132,9 @@ comment line.  Moves point to POS if it is not already 
there."
     ;; the two newlines, i.e. at the beginning of an empty line right after
     ;; the text paragraph, `paredit-in-comment-p' still returns t, and so
     ;; \\`(' and \\`[' insert only single characters.
-    (put-text-property (pos-eol) (1+ (pos-eol)) 'syntax-table
-                      (eval-when-compile (string-to-syntax "-")))))
+    (unless (eq (pos-eol) (point-max))
+     (put-text-property (pos-eol) (1+ (pos-eol)) 'syntax-table
+                       (eval-when-compile (string-to-syntax "-"))))))
 
 (defun literate-scratch--comment-start-p (pos)
   (equal (get-text-property pos 'syntax-table)

Reply via email to