emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102757: Reconcile with changes in li


From: Ken Manheimer
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102757: Reconcile with changes in line movement behavior for long text lines
Date: Tue, 04 Jan 2011 14:44:10 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102757
committer: Ken Manheimer <address@hidden>
branch nick: trunk
timestamp: Tue 2011-01-04 14:44:10 -0500
message:
  Reconcile with changes in line movement behavior for long text lines
  that cross more than a single physical window line, ie when truncate-lines
  is nil.
  
  (allout-next-visible-heading): Provide for change in line-move behavior on
  long lines when truncate-lines is nil.  In that case, line-move can wind up
  on the same textual line when it moves to the next window line, and moving
  to the bullet position after the move yields zero advancement.  Add logic
  to detect and compensate for the lack of progress.
  
  (allout-current-topic-collapsed-p): move-end-of-line respect for field
  boundaries is different when operating with body lines shorter than window
  width versus ones greater than window width, which can yield false
  negatives in this function.  Avoid difference by applying move-end-of-line
  while field-text-motion is inhibited.
modified:
  lisp/allout.el
=== modified file 'lisp/allout.el'
--- a/lisp/allout.el    2011-01-02 00:35:15 +0000
+++ b/lisp/allout.el    2011-01-04 19:44:10 +0000
@@ -3327,6 +3327,7 @@
   (let* ((inhibit-field-text-motion t)
          (backward (if (< arg 0) (setq arg (* -1 arg))))
         (step (if backward -1 1))
+         (progress (allout-current-bullet-pos))
         prev got)
 
     (while (> arg 0)
@@ -3336,7 +3337,17 @@
               ;; Move, skipping over all concealed lines in one fell swoop:
               (prog1 (condition-case nil (or (line-move step) t)
                        (error nil))
-                (allout-beginning-of-current-line))
+                (allout-beginning-of-current-line)
+                ;; line-move can wind up on the same line if long.
+                ;; when moving forward, that would yield no-progress
+                (when (and (not backward)
+                           (<= (point) progress))
+                  ;; ensure progress by doing line-move from end-of-line:
+                  (end-of-line)
+                  (condition-case nil (or (line-move step) t)
+                    (error nil))
+                  (allout-beginning-of-current-line)
+                  (setq progress (point))))
               ;; Deal with apparent header line:
               (save-match-data
                 (if (not (looking-at allout-regexp))
@@ -5074,7 +5085,8 @@
       (and
        ;; Is the topic all on one line (allowing for trailing blank line)?
        (>= (progn (allout-back-to-current-heading)
-                  (move-end-of-line 1)
+                  (let ((inhibit-field-text-motion t))
+                    (move-end-of-line 1))
                   (point))
            (allout-end-of-current-subtree (not (looking-at "\n\n"))))
 


reply via email to

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