Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2026-05-11 Bob Weiner <rsw@gnu.org>

* kotl/kotl-mode (kotl-mode:just-one-space): Fix param name from 'N' to 'n'.

* kotl/kotl-mode.el (kotl-mode:yank): Narrow to current cell's text region.
hypb.el (hypb:in-string-p): Fix kotl-mode yank error by ensuring 'str-start'
and 'str-end' fall within the presently visible buffer range even when
pulled from the cache.

2026-05-11 Mats Lidell <matsl@gnu.org>

* test/hyrolo-tests.el: Verify all return values for hyrolo-grep and
Expand Down Expand Up @@ -46,17 +55,17 @@
"stripmode" package does not delete trailing whitespace from cells whose
first line is blank or editing will not start at the proper column.

* kotl/kotl-mode.el (kotl-mode:just-one-space): Add optional N arg of how
many spaces to leave that 'just-one-space supports and update doc string.
Since works for a single line only, does not support -N for removing
* kotl/kotl-mode.el (kotl-mode:just-one-space): Add optional 'n' arg of how
many spaces to leave that 'just-one-space' supports and update doc string.
Since works for a single line only, does not support -n for removing
newlines as 'just-one-space' does.

2026-04-29 Bob Weiner <rsw@gnu.org>

* kotl/kfile.el (kfile:insert-attributes-v3): When reading in an exising
* kotl/kfile.el (kfile:insert-attributes-v3): When reading in an existing
Koutline, repair any cells that start with a blank line and have had
the label separator removed or where lines of just whitespace have been
remove due to packages that delete trailing spaces. Also ensure search
removed due to packages that delete trailing spaces. Also ensure search
for relative ids that only start with a digit, not alpha chars.

2026-04-21 Mats Lidell <matsl@gnu.org>
Expand Down
8 changes: 4 additions & 4 deletions hypb.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6-Oct-91 at 03:42:38
;; Last-Mod: 12-Apr-26 at 15:07:51 by Bob Weiner
;; Last-Mod: 11-May-26 at 10:56:26 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -771,7 +771,7 @@ Quoting conventions recognized are:
(puthash buf cache-entry hypb:in-string-cache))

;; Check for a cache match range. The cdr of `cache-entry' is a list of
;; (in-str start end) ranges.
;; (in-str-flag start end) ranges.
(let ((match (cl-find-if (lambda (r)
(and (>= pos (or (nth 1 r) (point-max)))
(<= pos (or (nth 2 r) (point-min)))))
Expand All @@ -797,8 +797,8 @@ Quoting conventions recognized are:
;; (hypb:narrow-to-max-lines max-lines #'hypb:in-string-check t)
(hypb:in-string-check t)))
(in-str (nth 0 entry))
(str-start (nth 1 entry))
(str-end (nth 2 entry)))
(str-start (max (point-min) (or (nth 1 entry) 0)))
(str-end (min (point-max) (or (nth 2 entry) 0))))
(cond ((and (not match) (not hypb:in-string-cache-disable))
;; Add the new range into the buffer's cache
(setcdr cache-entry (cons entry (cdr cache-entry))))
Expand Down
8 changes: 4 additions & 4 deletions kotl/EXAMPLE.kotl
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@
{C-c C-a} - Show (expand) all cells in the outline.
{C-x $} - Show all cells down to a particular level. The
user is prompted for the level or a prefix
argument may be given.
{C-M-h} - Hide subtree at point, excluding root.
argument may be given.

{C-M-h} - Hide subtree at point, excluding root.
{M-x kotl-mode:show-subtree RET} - Show subtree at point.

{C-c C-o} - Overview, show only first line of outline
Expand Down Expand Up @@ -389,7 +389,7 @@
| {C-c C-,} | {C-c C-.} |
| {C-c C-<} | {C-c C->} |
|----------------------------+---------------------------|

|-----------------------------+----------------------------|
| Promotion Outside Org Table | Demotion Outside Org Table |
|-----------------------------+----------------------------|
Expand Down
28 changes: 18 additions & 10 deletions kotl/kotl-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6/30/93
;; Last-Mod: 30-Apr-26 at 13:34:27 by Bob Weiner
;; Last-Mod: 11-May-26 at 11:17:30 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -139,8 +139,11 @@ It provides the following keys:
(when (bound-and-true-p delete-trailing-whitespace-mode)
(delete-trailing-whitespace-mode 0))
;; Prevent "stripspace" package from deleting trailing whitespace from the
;; first line of cells which are blank. These need to maintain spaces after
;; the relative identifier to ensure proper editing of the first line.
;; first line of cells which are blank and between paragraphs within a
;; cell. The first line of the cell needs to maintain spaces after the
;; relative identifier to ensure proper editing. Similarly, blank lines
;; between paragraphs within a single cell must have an indent so that
;; editing is always within a valid context.
(when (bound-and-true-p stripspace-local-mode)
(stripspace-local-mode 0))
;; Fix any wrong label separators and line indents.
Expand Down Expand Up @@ -731,7 +734,7 @@ With optional prefix argument TOP-P non-nil, refill all cells in the outline."
;; Temporarily expand, then refill cells lacking no-fill property.
(kview:map-expanded-tree (lambda (_kview) (kotl-mode:fill-cell)) kotl-kview top-p))

(defun kotl-mode:just-one-space (&optional N)
(defun kotl-mode:just-one-space (&optional n)
"Delete all spaces and tabs around point, leaving one or optional N spaces.
Does not remove any newlines as `just-one-space' does when given a negative N."
(interactive "*")
Expand Down Expand Up @@ -1448,13 +1451,18 @@ See also the command `yank-pop' (\\[yank-pop])."
(t (1- arg)))))
(indent (kcell-view:indent))
(indent-str (make-string indent ?\ )))
;; Convert all occurrences of newline to newline + cell indent.
;; Then insert into buffer.
(insert-for-yank (replace-regexp-in-string
"[\n\r]" (lambda (match) (concat match indent-str)) yank-text)))
(save-restriction
(narrow-to-region (kcell-view:start) (kcell-view:end-contents))
;; Convert all occurrences of newline to newline + cell indent.
;; Then insert into buffer.
(insert-for-yank (replace-regexp-in-string
"[\n\r]" (lambda (match)
(concat match indent-str))
yank-text))))
(when (consp arg) (kotl-mode:exchange-point-and-mark))
;; If we do get all the way thru, make this-command indicate that.
(when (eq this-command t) (setq this-command 'kotl-mode:yank))
;; If we do get all the way thru, make `this-command' indicate that.
(when (eq this-command t)
(setq this-command 'kotl-mode:yank))
nil)

(defun kotl-mode:yank-pop (arg)
Expand Down