emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 02/02: [gnugo sgf] Fix bug: Preser ve whitespace for ‘text’ value


From: Thien-Thi Nguyen
Subject: [elpa] 02/02: [gnugo sgf] Fix bug: Preser ve whitespace for ‘text’ values.
Date: Thu, 10 Apr 2014 11:58:25 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 3f354d43822e2edd7bb5a2d8fb1d62bb2e70d8ee
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu Apr 10 12:22:54 2014 +0200

    [gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values.
    
    * packages/gnugo/gnugo.el (gnugo/sgf-create x):
    Take arg PRESERVE-WHITESPACE; when set, don't squeeze whitespace.
    (gnugo/sgf-create one): Specify PRESERVE-WHITESPACE
    to ‘x’ when ‘type’ is ‘text’.
---
 packages/gnugo/NEWS     |    1 +
 packages/gnugo/gnugo.el |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index e813c77..8bd3b75 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -7,6 +7,7 @@ NB: "RCS: X..Y " means that the particular release includes
 
 - next | NOT YET RELEASED
   - bugfixes
+    - preserve whitespace for value type ‘text’
     - don't special-case property value type ‘none’
     - handle subtrees on write
     - display "resign" as "resign" in move history (amazing!)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 7c28831..66af605 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -2595,7 +2595,7 @@ A collection is a list of gametrees, each a vector of 
four elements:
         SZ)
     (cl-labels
         ((sw () (skip-chars-forward " \t\n"))
-         (x (end)
+         (x (end preserve-whitespace)
             (let ((beg (point))
                   (endp (case end
                           (:end (lambda (char) (= ?\] char)))
@@ -2609,14 +2609,15 @@ A collection is a list of gametrees, each a vector of 
four elements:
                        (if (eolp)
                            (kill-line 1)
                          (forward-char 1)))
-                      ((looking-at "\\s-+")
+                      ((unless preserve-whitespace
+                         (looking-at "\\s-+"))
                        (delete-region (point) (match-end 0))
                        (insert " "))
                       (t (forward-char 1))))
               (buffer-substring-no-properties beg (point))))
          (one (type end) (let ((s (progn
                                     (forward-char 1)
-                                    (x end))))
+                                    (x end (eq 'text type)))))
                            (case type
                              ((stone point move)
                               ;; blech, begone bu"tt"-ugly blatherings



reply via email to

[Prev in Thread] Current Thread [Next in Thread]