From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: bug#16265: 24.3.50; re-search-forward (error "Invalid search bound (wrong side of point)") Date: Tue, 31 Dec 2013 13:07:24 +0100 Message-ID: <52C2B37C.6060107@yahoo.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vxy6G-0007Tx-Tn for emacs-orgmode@gnu.org; Tue, 31 Dec 2013 07:07:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vxy6A-0002Bo-Ng for emacs-orgmode@gnu.org; Tue, 31 Dec 2013 07:07:08 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:40115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vxy6A-0002Bk-K4 for emacs-orgmode@gnu.org; Tue, 31 Dec 2013 07:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vxy6A-00040r-9L for emacs-orgmode@gnu.org; Tue, 31 Dec 2013 07:07:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Keith David Bershatsky Cc: 16265@debbugs.gnu.org Le 28/12/2013 21:44, Keith David Bershatsky a écrit : > This example demonstrates the problem caused when `org-capture` > damages the line numbers in the `org-agenda-files`, making it > impossible to go to the bottom of the buffer with (goto-char > (point-max)) -- consequently, re-search-backward fails -- other > functions fail also, e.g., `org-sort-entries`. Thanks for the recipe, I can indeed reproduce problems, but they are different from what you describe. I suspect they are tied, but I'm not sure because I don't understand them. Here is a reduced version of your recipe which shows what I see. Run the following snippet using emacs -Q --batch -l filenamehere : ,---- this is filenamehere.el | (setq test-file "/tmp/foo.org") | (setq capture-todo (mapconcat | #'identity | (list "** whatever" | ":PROPERTIES:" | ":ToodledoFolder: TASKS" | ":END:") | "\n")) | (when (file-exists-p test-file) (delete-file test-file) (message "Deleted file %s" test-file)) | (find-file test-file) | (org-mode) | (setq org-agenda-files (list test-file)) | (setq org-capture-templates `(("n" "NextAction" entry (file+headline test-file "TASKS") | ,capture-todo))) | (org-capture nil "n") | (org-capture-finalize) | (goto-char (point-min)) | (insert "It's important to insert something ; I guess it triggers something\n") | (search-forward "Toodledo") | (end-of-line) ; this should land us before "\n:END:" not after it | (if (looking-at "\n:END:") | (message "Great!") | (error "Problem here.")) `---- fun facts : if you remove the (insert ...) form, it works. Also, if you do it interactively, then the problem appears too, but not if you clone the buffer. I'll bisect this (I tested 24.3, it works there) and post the result unless someone understands what's going on before the bisect finishes (it does take quite some time to rebuild each version of emacs on my machine). -- Nicolas.