[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/fountain-mode 5fe797e 4/4: Fix infinite loop when readi
From: |
Paul W. Rankin |
Subject: |
[elpa] externals/fountain-mode 5fe797e 4/4: Fix infinite loop when reading metadata in some cases |
Date: |
Mon, 5 Aug 2019 00:25:36 -0400 (EDT) |
branch: externals/fountain-mode
commit 5fe797ebea7544749bc212c77780942329a1ff70
Author: Paul W. Rankin <address@hidden>
Commit: Paul W. Rankin <address@hidden>
Fix infinite loop when reading metadata in some cases
Buffer with only metadata (e.g. no newline) will loop
fountain-read-metadata
---
fountain-mode.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fountain-mode.el b/fountain-mode.el
index d01910f..5e0e1b3 100644
--- a/fountain-mode.el
+++ b/fountain-mode.el
@@ -4,7 +4,7 @@
;; Author: Paul W. Rankin <address@hidden>
;; Keywords: wp, text
-;; Version: 2.7.2
+;; Version: 2.7.3
;; Package-Requires: ((emacs "24.5"))
;; URL: https://fountain-mode.org
@@ -643,9 +643,9 @@ Set with `fountain-init-trans-regexp'. Requires
"Regular expression for matching comments.")
(defconst fountain-metadata-regexp
- (concat "^\\(?1:\\(?2:[^[{:\n]+\\):[\s\t]*\\(?3:.+\\)?\\)"
+ (concat "^\\(?1:\\(?2:[^:\n]+\\):[\s\t]*\\(?3:.+\\)?\\)[\s\t]*"
"\\|"
- "^[\s\t]+\\(?1:\\(?3:.+\\)\\)")
+ "^[\s\t]+\\(?1:\\(?3:.+\\)\\)[\s\t]*")
"Regular expression for matching multi-line metadata values.
Requires `fountain-match-metadata' for `bobp'.")
@@ -1799,8 +1799,9 @@ Value string remains a string. e.g.
(widen)
(goto-char (point-min))
(let (list)
- (while (fountain-match-metadata)
- (let ((key (match-string 2))
+ (while (and (bolp)
+ (fountain-match-metadata))
+ (let ((key (match-string-no-properties 2))
(value (match-string-no-properties 3)))
(forward-line)
(while (and (fountain-match-metadata)