emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100963: * lisp/textmodes/fill.el (ju


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100963: * lisp/textmodes/fill.el (justify-current-line): Don't add 1 to nspaces
Date: Mon, 02 Aug 2010 12:25:27 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100963
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2010-08-02 12:25:27 +0200
message:
  * lisp/textmodes/fill.el (justify-current-line): Don't add 1 to nspaces
  when justifying.  It seems useless and harmful for ncols=1.
modified:
  lisp/ChangeLog
  lisp/textmodes/fill.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-08-02 09:00:46 +0000
+++ b/lisp/ChangeLog    2010-08-02 10:25:27 +0000
@@ -1,5 +1,8 @@
 2010-08-02  Stefan Monnier  <address@hidden>
 
+       * textmodes/fill.el (justify-current-line): Don't add 1 to nspaces
+       when justifying.  It seems useless and harmful for ncols=1 (bug#6738).
+
        * emacs-lisp/timer.el (timer-event-handler): Protect against timers
        that change current buffer.
 

=== modified file 'lisp/textmodes/fill.el'
--- a/lisp/textmodes/fill.el    2010-05-25 02:11:08 +0000
+++ b/lisp/textmodes/fill.el    2010-08-02 10:25:27 +0000
@@ -1289,18 +1289,16 @@
                     (skip-chars-backward " "))
                   (setq ncols (- fc endcol))
                   ;; Ncols is number of additional space chars needed
-                  (if (and (> ncols 0) (> nspaces 0) (not eop))
-                      (progn
-                        (setq curr-fracspace (+ ncols (/ (1+ nspaces) 2))
-                              count nspaces)
-                        (while (> count 0)
-                          (skip-chars-forward " ")
-                          (insert-and-inherit
-                           (make-string (/ curr-fracspace nspaces) ?\s))
-                          (search-forward " " nil t)
-                          (setq count (1- count)
-                                curr-fracspace
-                                  (+ (% curr-fracspace nspaces) ncols)))))))
+                  (when (and (> ncols 0) (> nspaces 0) (not eop))
+                     (setq curr-fracspace (+ ncols (/ nspaces 2))
+                           count nspaces)
+                     (while (> count 0)
+                       (skip-chars-forward " ")
+                       (insert-char ?\s (/ curr-fracspace nspaces) t)
+                       (search-forward " " nil t)
+                       (setq count (1- count)
+                             curr-fracspace
+                             (+ (% curr-fracspace nspaces) ncols))))))
                (t (error "Unknown justification value"))))
        (goto-char pos)
        (move-marker pos nil)))


reply via email to

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