org-table: Fix thinko

* lisp/org-table.el (org-table-line-to-dline): Do not assume dichotomy
  failed.

Reported-by: Lem Ming <ramboman777@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-09/msg00035.html>
This commit is contained in:
Nicolas Goaziou 2018-09-05 18:50:03 +02:00
parent f1269e4c14
commit c475cc2886
1 changed files with 5 additions and 2 deletions

View File

@ -1429,7 +1429,7 @@ non-nil, the one above is used."
(cond ((or (> (aref org-table-dlines min) line)
(< (aref org-table-dlines max) line))
nil)
((= (aref org-table-dlines max) line) max)
((= line (aref org-table-dlines max)) max)
(t (catch 'exit
(while (> (- max min) 1)
(let* ((mean (/ (+ max min) 2))
@ -1437,7 +1437,10 @@ non-nil, the one above is used."
(cond ((= v line) (throw 'exit mean))
((> v line) (setq max mean))
(t (setq min mean)))))
(if above min max))))))
(cond ((= line (aref org-table-dlines max)) max)
((= line (aref org-table-dlines min)) min)
(above min)
(t max)))))))
;;;###autoload
(defun org-table-delete-column ()