changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/organ/element/lesser/horizontal-rule.lisp

changeset 698: 96958d3eb5b0
parent: 7ca4cdbd52c2
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 (in-package :organ)
2 
3 (define-org-element horizontal-rule () :lesser t)
4 
5 (defvar *org-horizontal-rule-min* 5
6  "Minimum number of #\- chars in sequence which will be parsed as ORG-HORIZONTAL-RULE.")
7 
8 (defvar *org-horizontal-rule-char* #\-)
9 
10 (define-org-parser (horizontal-rule :from string)
11  (unless (< (length input) *org-horizontal-rule-min*)
12  (with-input-from-string (in input)
13  (catch 'bail
14  (loop repeat *org-horizontal-rule-min*
15  for c = (read-char in nil)
16  when (not (char-equal c *org-horizontal-rule-char*))
17  do (throw 'bail nil))
18  (org-create :horizontal-rule)))))