bug#3000: 23.0.60; outline.el/(hide-sublevels): Invalid search bound (wrong side of point)

William Xu <[email protected]>
Newsgroups gmane.emacs.bugs,gmane.emacs.pretest.bugs
Message-ID <[email protected]>
Steps to reproduce:

1. emacs -Q
2. open any text buffers, like this mail buffer (without any outline
markers, outline-regexp)
3. M-: (hide-sublevels 1)

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of
point)")
  re-search-forward("^\\(?:[*\f]+\\)" #<marker at 886 in *mail to
[email protected]*> t)
  outline-map-region((lambda nil (if (<= ... levels)
(outline-show-heading))) 887 886)
  (let* (outline-view-change-hook (beg ...) (end ...)) (outline-flag-region
beg end t) (outline-map-region (lambda nil ...) beg end))
  (save-excursion (let* (outline-view-change-hook ... ...)
(outline-flag-region beg end t) (outline-map-region ... beg end)))
  hide-sublevels(1)
  eval((hide-sublevels 1))
  eval-expression((hide-sublevels 1) nil)
  call-interactively(eval-expression nil nil)

The following patch seems fixing it:

--- outline.el.orig    2008-12-14 10:47:40.000000000 +0800
+++ outline.el    2009-04-15 12:28:37.642828900 +0800
@@ -905,6 +905,8 @@
                   (goto-char (point-max))
                   ;; Keep empty last line, if available.
                   (if (bolp) (1- (point)) (point)))))
+      (if (< end beg)
+          (setq beg (prog1 end (setq end beg))))
       ;; First hide everything.
       (outline-flag-region beg end t)
       ;; Then unhide the top level headers.


In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-12-14 on BREPNB
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

-- 
William

http://xwl.appspot.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.