emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115745: Further shr quotation mark fill fixes


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r115745: Further shr quotation mark fill fixes
Date: Wed, 25 Dec 2013 18:20:49 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115745
revision-id: address@hidden
parent: address@hidden
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Wed 2013-12-25 19:14:49 +0100
message:
  Further shr quotation mark fill fixes
  
  (shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char.
  (shr-find-fill-point): Remove the special checks for the quotation
  mark, since `shr-char-kinsoku-bol-p' should now return the right
  thing.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/shr.el                shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-25 18:07:31 +0000
+++ b/lisp/ChangeLog    2013-12-25 18:14:49 +0000
@@ -17,6 +17,10 @@
 
        * net/shr.el (shr-find-fill-point): Don't break lines before a
        quotation mark.
+       (shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char.
+       (shr-find-fill-point): Remove the special checks for the quotation
+       mark, since `shr-char-kinsoku-bol-p' should now return the right
+       thing.
 
 2013-12-25  Kenjiro NAKAYAMA  <address@hidden>
 

=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el   2013-12-25 17:31:39 +0000
+++ b/lisp/net/shr.el   2013-12-25 18:14:49 +0000
@@ -414,7 +414,9 @@
 ;; of a line or the end of a line.
 (defmacro shr-char-kinsoku-bol-p (char)
   "Return non-nil if a line ought not to begin with CHAR."
-  `(aref (char-category-set ,char) ?>))
+  `(let ((char ,char))
+     (and (not (eq char ?'))
+         (aref (char-category-set char) ?>))))
 (defmacro shr-char-kinsoku-eol-p (char)
   "Return non-nil if a line ought not to end with CHAR."
   `(aref (char-category-set ,char) ?<))
@@ -489,30 +491,19 @@
                    (eq (following-char) ? )
                    (shr-char-breakable-p (preceding-char))
                    (shr-char-breakable-p (following-char))
-                   (if (eq (preceding-char) ?')
-                       (not (memq (char-after (- (point) 2))
-                                  (list nil ?\n ? )))
-                     (and (shr-char-kinsoku-bol-p (preceding-char))
-                          (shr-char-breakable-p (following-char))
-                          (not (shr-char-kinsoku-bol-p (following-char)))))
+                   (and (shr-char-kinsoku-bol-p (preceding-char))
+                        (shr-char-breakable-p (following-char))
+                        (not (shr-char-kinsoku-bol-p (following-char))))
                    (shr-char-kinsoku-eol-p (following-char))))
       (backward-char 1))
-    (if (and (not (or failed (eolp)))
-            (eq (preceding-char) ?'))
-       (while (not (or (setq failed (eolp))
-                       (eq (following-char) ? )
-                       (shr-char-breakable-p (following-char))
-                       (shr-char-kinsoku-eol-p (following-char))))
-         (forward-char 1)))
     (if failed
        ;; There's no breakable point, so we give it up.
        (let (found)
          (goto-char bp)
          (unless shr-kinsoku-shorten
-           (while (and (setq found (re-search-forward
-                                    "\\(\\c>\\)\\| \\|\\c<\\|\\c|"
-                                    (line-end-position) 'move))
-                       (eq (preceding-char) ?')))
+           (while (setq found (re-search-forward
+                               "\\(\\c>\\)\\| \\|\\c<\\|\\c|"
+                               (line-end-position) 'move)))
            (if (and found (not (match-beginning 1)))
                (goto-char (match-beginning 0)))))
       (or
@@ -550,8 +541,7 @@
             (if (looking-at "\\(\\c<+\\)\\c<")
                 (goto-char (match-end 1))
               (forward-char 1))))
-       ((and (shr-char-kinsoku-bol-p (following-char))
-             (not (eq (following-char) ?')))
+       ((shr-char-kinsoku-bol-p (following-char))
         ;; Find forward the point where kinsoku-bol characters end.
         (let ((count 4))
           (while (progn


reply via email to

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