From 3908b4c33f5d7d6d9d335f6e8656823d88afb6ad Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Fri, 14 Dec 2007 15:40:14 +0000 Subject: Fix matching of quoted regions with empty lines --- lib/texi-docstring-magic.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/texi-docstring-magic.el b/lib/texi-docstring-magic.el index 46d38abe..e42b4ebf 100644 --- a/lib/texi-docstring-magic.el +++ b/lib/texi-docstring-magic.el @@ -103,17 +103,18 @@ ("\\({\\)" t "@{") ("\\(}\\)" t "@}") ;; 1. Indented lines are gathered into @lisp environment. - ("\\(^.*\\S-.*$\\)" + ("^\\(\n\\|.+\\)$" t (let ((line (match-string 0 docstring))) - (if (eq (char-syntax (string-to-char line)) ?\ ) + (if (save-match-data (string-match "^[ \t]" line)) ;; whitespace (if in-quoted-region line (setq in-quoted-region t) + (message "%s" line) (concat "@lisp\n" line)) - ;; non-white space + ;; non-white space/carriage return (if in-quoted-region (progn (setq in-quoted-region nil) -- cgit v1.2.3