emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 6c54541: Fix some folding issues in read-multiple-c


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 6c54541: Fix some folding issues in read-multiple-choice
Date: Wed, 10 Feb 2016 00:15:00 +0000

branch: master
commit 6c54541fcc4cb4b57a476234f385aebdc3292a25
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix some folding issues in read-multiple-choice
    
    * lisp/subr.el (read-multiple-choice): Fix folding when you
    have many items.
---
 lisp/subr.el |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index f70f3ed..447c3eb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2340,9 +2340,10 @@ Usage example:
                         ;; Add padding.
                         (while (not (eobp))
                           (end-of-line)
-                          (insert (make-string (- (* (mod times columns)
-                                                     (+ fill-column 4))
-                                                  (current-column))
+                          (insert (make-string (max (- (* (mod times columns)
+                                                          (+ fill-column 4))
+                                                       (current-column))
+                                                    0)
                                                ?\s))
                           (forward-line 1))))
                     (setq times (1+ times))
@@ -2354,10 +2355,11 @@ Usage example:
                                       (cdr (assq (car elem) altered-names))))
                              (fill-region (point-min) (point-max))
                              (when (nth 2 elem)
-                               (insert (nth 2 elem))
-                               (unless (bolp)
-                                 (insert "\n"))
-                               (fill-region start (point-max)))
+                               (let ((start (point)))
+                                 (insert (nth 2 elem))
+                                 (unless (bolp)
+                                   (insert "\n"))
+                                 (fill-region start (point-max))))
                              (buffer-string))))
                       (goto-char start)
                       (dolist (line (split-string text "\n"))



reply via email to

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