From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#16265: 24.3.50; re-search-forward (error "Invalid search bound (wrong side of point)") Date: Sat, 28 Dec 2013 00:00:36 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1388218750 12717 80.91.229.3 (28 Dec 2013 08:19:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Dec 2013 08:19:10 +0000 (UTC) Cc: 16265@debbugs.gnu.org To: Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 28 09:19:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vwp73-0008NI-3i for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Dec 2013 09:19:13 +0100 Original-Received: from localhost ([::1]:51430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vwopi-0002JO-8T for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Dec 2013 03:01:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwopZ-0002JF-9N for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2013 03:01:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwopT-0000J1-2h for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2013 03:01:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwopS-0000Iw-Qd for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2013 03:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VwopR-0008Dx-UR for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2013 03:01:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2013 08:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16265 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 16265-submit@debbugs.gnu.org id=B16265.138821764931586 (code B ref 16265); Sat, 28 Dec 2013 08:01:01 +0000 Original-Received: (at 16265) by debbugs.gnu.org; 28 Dec 2013 08:00:49 +0000 Original-Received: from localhost ([127.0.0.1]:47728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwopC-0008DL-6S for submit@debbugs.gnu.org; Sat, 28 Dec 2013 03:00:49 -0500 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:52700) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwop4-0008D2-Kv for 16265@debbugs.gnu.org; Sat, 28 Dec 2013 03:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=aJP7h+53mzvMNGZUYDtaf+AMWj3uOFXeNDnx7dL9sZ8=; b=DDrrzAPZNxvQQ9kNXdVJScoc+0Om6UCDgUrL+5THXSSgXLXZF95WIhOmiKqtObALRxBUmFFbOvwEQ1MThqdmq7lbtzEbdWq4HZS27BUgS66QMM0ddRPQ1Tk1dE6IfPHZ; Original-Received: from cpe-75-85-5-102.socal.res.rr.com ([75.85.5.102]:51000 helo=MP.local) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1Vwop1-0002iG-91; Sat, 28 Dec 2013 03:00:35 -0500 User-Agent: / () / () APEL/10.8 Emacs/24.3.50 (x86_64-apple-darwin10.8.0) MULE/6.0 (HANACHIRUSATO) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82677 Archived-At: Nicolas: I'm still working on narrowing down the issue. A likely suspect is a failed `org-sort-entries` before running the *second* round of org-capture. The `org-sort-entries` kicks in `recursive-edit`, which does not go back to the top level after an error. re-search-forward and re-search-backward apparently throw errors when the org buffer is in `recursive-edit`. Last night I had to create a work-around to search the org buffer to update my calendar while org-capture was in use because I couldn't search the buffer either. So it may not be only recursive edit that causes re-search-forward / backward to throw errors -- it may be linked to whatever org-capture is doing to the main org file buffer -- e.g., narrowing. The org-sort-entries worked fine in the Emacs Trunk version from October 5, 2 013, but not the recent version of Emacs Trunk built a few days ago. Keith Debugger entered--Lisp error: (error "Nothing to sort") signal(error ("Nothing to sort")) error("Nothing to sort") (if (>= beg end) (error "Nothing to sort")) (let ((case-func (if with-case (quote identity) (quote downcase))) (cmstr (if (equal (marker-buffer org-clock-marker) (current-buffer)) (progn (save-excursion (goto-char org-clock-marker) (looking-back "^.*") (match-string-no-properties 0))))) start beg end stars re re2 txt what tmp) (cond ((org-region-active-p) (setq end (region-end) what "region") (goto-char (region-beginning)) (if (not (org-at-heading-p)) (outline-next-heading)) (setq start (point))) ((or (org-at-heading-p) (condition-case nil (progn (org-back-to-heading t) t) (error nil))) (org-back-to-heading t) (setq start (point) end (progn (org-end-of-subtree t t) (or (bolp) (insert "\n")) (org-back-over-empty-lines) (point)) what "children") (goto-char start) (show-subtree) (outline-next-heading)) (t (goto-char (point-min)) (or (org-at-heading-p) (outline-next-heading)) (setq start (point)) (goto-char (point-max)) (beginning-of-line 1) (if (looking-at ".*?\\S-") (progn (end-of-line 1) (insert "\n"))) (setq end (point-max)) (setq what "top-level") (goto-char start) (show-all))) (setq beg (point)) (if (>= beg end) (error "Nothing to sort")) (looking-at "\\(\\*+\\)") (setq stars (match-string 1) re (concat "^" (regexp-quote stars) " +") re2 (concat "^" (regexp-quote (substring stars 0 -1)) "[ \n]") txt (buffer-substring beg end)) (if (not (equal (substring txt -1) "\n")) (setq txt (concat txt "\n"))) (if (and (not (equal stars "*")) (string-match re2 txt)) (error "Region to sort contains a level above the first entry")) (if sorting-type nil (message "Sort %s: [a]lpha [n]umeric [p]riority p[r]operty todo[o]rde r [f]unc\n [t]ime [s]cheduled [d]eadline [c]reated\n A/N/P/R/O/F/T/S/D/C means reversed:" what) (setq sorting-type (read-char-exclusive)) (and (= (downcase sorting-type) 102) (setq getkey-func (org-icompleting-read "Sort using function: " obarray (quote fboundp) t nil nil)) (setq getkey-func (intern getkey-func))) (and (= (downcase sorting-type) 114) (setq property (org-icompleting-read "Property: " (mapcar (quote list) (org-buffer-property-keys t)) nil t)))) (save-restriction (narrow-to-region start end) (let ((dcst (downcase sorting-type)) (case-fold-search nil) (now (current-time))) (sort-subr (/= dcst sorting-type) (function (lambda nil (if (re-search-forward re nil t) (goto-char ...) (goto-char ...)))) (function (lambda nil (let (...) (unwind-protect . .. ...)))) (function (lambda nil (cond (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (t ...)))) nil (cond ((= dcst 97) (quote string<)) ((= dcst 102) compare-func) ((member dcst (quote ...)) (quote <)))))) (run-hooks (quote org-after-sorting-entries-or-items-hook)) (if cmstr (progn (save-excursion (goto-char start) (search-forward cmstr nil t) (move-marker org-clock-marker (point)))))) org-sort-entries(t 97) (while (re-search-backward "^* " nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112) (org-sort-entries t 116)) (let (lawlist-item-old) (switch-to-buffer (get-file-buffer lawlist-todo-file)) (setq lawlist-item-old (lawlist-org-get-heading)) (goto-char (point-max)) (while (re-search-backward "^* " nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112) (org-sort-entries t 116)) (goto-char (point-max)) (while (re-search-backward "^* DONE" nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112)) (lawlist-org-cleanup) (org-cycle-hide-drawers (quote all)) (hs-hide-all) (re-search-backward (regexp-quote lawlist-item-new) nil t) (setq beg (point)) (re-search-forward (regexp-quote lawlist-item-new) nil t) (setq end (point)) (isearch-highlight beg end) (recenter) (sit-for 2) (isearch-dehighlight) (goto-char (point-max)) (re-search-backward (regexp-quote law list-item-old) nil t) (save-buffer) (setq buffer-read-only t) (recenter)) (progn (let (lawlist-item-old) (switch-to-buffer (get-file-buffer lawlist-todo-file)) (setq lawlist-item-old (lawlist-org-get-heading)) (goto-char (point-max)) (while (re-search-backward "^* " nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112) (org-sort-entries t 116)) (goto-char (point-max)) (while (re-search-backward "^* DONE" nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112)) (lawlist-org-cleanup) (org-cycle-hide-drawers (quote all)) (hs-hide-all) (re-search-backward (regexp-quote lawlist-item-new) nil t) (setq beg (point)) (re-search-forward (regexp-quote lawlist-item-new) nil t) (setq end (point)) (isearch-highlight beg end) (recenter) (sit-for 2) (isearch-dehighlight) (goto-char (point-max)) (re-search-backward (regexp-qu ote lawlist-item-old) nil t) (save-buffer) (setq buffer-read-only t) (recenter))) (if (not (get-buffer-window "*Org Agenda*" (selected-frame))) (progn (let (lawlist-item-old) (switch-to-buffer (get-file-buffer lawlist-todo-file)) (setq lawlist-item-old (lawlist-org-get-heading)) (goto-char (point-max)) (while (re-search-backward "^* " nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112) (org-sort-entries t 116)) (goto-char (point-max)) (while (re-search-backward "^* DONE" nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112)) (lawlist-org-cleanup) (org-cycle-hide-drawers (quote all)) (hs-hide-all) (re-search-backward (regexp-quote lawlist-item-new) nil t) (setq beg (point)) (re-search-forward (regexp-quote lawlist-item-new) nil t) (setq end (point)) (isearch-highlight beg end) (recenter) (sit-for 2) (isearch-dehig hlight) (goto-char (point-max)) (re-search-backward (regexp-quote lawlist-item-old) nil t) (save-buffer) (setq buffer-read-only t) (recenter)))) (let* (beg end (lawlist-item-new (lawlist-org-get-heading)) (month-regexp "January\\|February\\|March\\|April\\|May\\|June\\|July\\|August\\|September\\|October\\|November\\|December")) (org-capture-finalize) (if (get-buffer-window "*Org Agenda*" (selected-frame)) (progn (set-buffer "*Org Agenda*") (goto-char (point-min)) (cond ((save-excursion (re-search-forward "tags: " nil t)) (re-search-forward "tags: " nil t) (let ((tag-beg ...)) (end-of-line) (let* (tag-match ...) (setq tag-match ...) (switch-to-buffer ...) (let ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (tag nil tag-match) (if ... ...)))) ((save-excursion (re-search-forward month-regexp nil t)) (let ((date-beg ...)) (end-of-line) (let* (date-match ...) (setq date-match ...) (let* ... ... ... ... ... ... ...))))))) (if (not (get-buffer-window "*Org Agenda*" (selected-frame))) (progn (let (lawlist-item-old) (switch-to-buffer (get-file-buffer lawlist-todo-file)) (setq lawlist-item-old (lawlist-org-get-heading)) (goto-char (point-max)) (while (re-search-backward "^* " nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112) (org-sort-entries t 116)) (goto-char (point-max)) (while (re-search-backward "^* DONE" nil t) (org-sort-entries t 97) (org-sort-entries t 111) (org-sort-entries t 112)) (lawlist-org-cleanup) (org-cycle-hide-drawers (quote all)) (hs-hide-all) (re-search-backward (regexp-quote lawlist-item-new) nil t) (setq beg (point)) (re-search-forward (regexp-quote lawlist-item-new) nil t) (setq end (point)) (isearch-highlight beg end) (recenter ) (sit-for 2) (isearch-dehighlight) (goto-char (point-max)) (re-search-backward (regexp-quote lawlist-item-old) nil t) (save-buffer) (setq buffer-read-only t) (recenter))))) lawlist-org-capture-finalize() call-interactively(lawlist-org-capture-finalize nil nil) command-execute(lawlist-org-capture-finalize)