Subject: bug#16265: 24.3.50; re-search-forward (error "Invalid search bound (wrong side of point)")

From: Keith David Bershatsky <[email-masked]>
Date: Thu, 26 Dec 2013 21:57:14 -0800

I initially thought it was related to org-element.el from version 8.2.3a, but it's not.  I replaced the entire org folder with a working version from a few months ago -- org version 7.9.3f, but that didn't change the error.  So my best guess is that the problem is with `re-search-forward` or a function that it relies upon -- however it's written in "C" which is out of my league.

The error comes about when calling `org-capture` a second time after creating the first todo.

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("^\\(?:\\*+ \\|\\[\\(?:[0-9]+\\|fn:[-_[:word:]]+\\)\\]\\|[ 	]*\\(?:$\\|\\(?:|\\|\\+-[-+]\\)\\|[#:]\\|-\\{5,\\}[ 	]*$\\|\\\\begin{\\([A-Za-z0-9]+\\*?\\)}\\|\\(?:\\(?:CLO\\(?:CK\\|SED\\)\\|DEADLINE\\|SCHEDULED\\):\\)\\|\\(?:[-+*]\\|\\(?:[0-9]+\\)[.)]\\)\\(?:[ 	]\\|$\\)\\)\\)" 40674 m)
  org-element-paragraph-parser(40674)
  org-element--current-element(40674 element nil nil)
  byte-code("\306\303	\n$\211@\307
\211:\203$A\310A@#\240\210+\210\2032B\311\312A@\"*\211W\204XU\205[U?\205[b)\204\f >\204x\313\314\203r\202s\"\210\202\315\312A@\"*\316\312A@\"*!\211\"\203\313!\203\313\"V\204\313!W\204\313\"U\203\275\f\317>\204\313!U\203\335\f\320>\203\335\313\314\203\327\202\330\"\210\202,\321\f\322\"\203\371\323\324\312A@\"*\202%\321\f\323\"\203\325\202%\321\f\326\"\203\327\325\202%\321\f\330\"\203!\331\325\202%\325\211!\"b\210*\202" [end special-flag struct element type parent org-element--current-element :parent plist-put :end plist-get throw exit :contents-begin :contents-end (plain-list table) (center-block drawer dynamic-block inlinetask item plain-list quote-block special-block) eql plain-list item :structure nil property-drawer node-property table table-row value property keep-trail trail elem-end origin org-element-greater-elements cend cbeg] 6)
  org-element-at-point()

Thanks,

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

In GNU Emacs 24.3.50.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
 of 2013-12-23 on MP.local
Bzr revision: 115720 [email-masked]
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure --with-ns'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Debugger

Minor modes in effect:
  delete-selection-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  desktop-save-mode: t
  tabbar-mode: t
  global-highlight-parentheses-mode: t
  highlight-parentheses-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
s-k n 0 SPC @ SPC t e s t <return> <backspace> C-c 
C-c s-q s-q s-q s-k n <f12> s-a s-c <escape> x o r 
<backspace> <backspace> e m a c s - <return> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
r e p o r t - <return> <return> b u g <return>

Recent messages:
Clipboard pasted as level 2 subtree
Wrote /Users/HOME/.0.data/.0.emacs/.todo
Mark set [6 times]
Saving file /Users/HOME/.0.data/.0.emacs/.todo...
Wrote /Users/HOME/.0.data/.0.emacs/.todo
Template key: 
Clipboard pasted as level 2 subtree
Entering debugger...
Mark set [2 times]
Making completion list... [2 times]

Load-path shadows:
/Users/HOME/.0.data/.0.emacs/elpa/flim/md4 hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/md4
/Users/HOME/.0.data/.0.emacs/elpa/flim/hex-util hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/hex-util
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/sasl
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/sasl-ntlm
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-digest hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/sasl-digest
/Users/HOME/.0.data/.0.emacs/elpa/flim/sasl-cram hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/sasl-cram
/Users/HOME/.0.data/.0.emacs/elpa/flim/ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/ntlm
/Users/HOME/.0.data/.0.emacs/elpa/flim/hmac-md5 hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/hmac-md5
/Users/HOME/.0.data/.0.emacs/elpa/flim/hmac-def hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/net/hmac-def
/Users/HOME/.0.data/.0.emacs/elpa/wanderlust/rfc2368 hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/mail/rfc2368
/Users/HOME/.0.data/.0.emacs/elpa/wanderlust/utf7 hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/gnus/utf7
/Users/HOME/.0.data/.0.emacs/elpa/semi/smime hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/gnus/smime
/Users/HOME/.0.data/.0.emacs/elpa/el-get/.dir-locals hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/gnus/.dir-locals
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-pgp5 hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg-pgp5
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-pgp hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg-pgp
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-parse hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg-parse
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-gpg hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg-gpg
/Users/HOME/.0.data/.0.emacs/elpa/semi/pgg-def hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/pgg-def
/Users/HOME/.0.data/.0.emacs/elpa/utilities/longlines hides /Users/HOME/.0.data/.0.emacs/Emacs_12_23_2013.app/Contents/Resources/lisp/obsolete/longlines

Features:
(shadow wl-mime mime-edit pgg-parse pccl pccl-20 signature mime-setup
mail-mime-setup semi-setup mime-pgp pgg-def mime-play filename
mime-image modb-legacy modb-standard elmo-imap4 time-stamp emacsbug
message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader sort bookmark parse-time org-element mule-util
cal-move tabify image-file org-wl org-w3m org-vm org-rmail org-mhe
org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp
org-exp-blocks org-info org-gnus org-docview org-bibtex bibtex
org-bbdb server disp-table whitespace hl-line linum init-wl wl-demo
wl-draft eword-encode wl-template sendmail mail-utils elmo-net
elmo-cache elmo-map elmo-dop wl-news wl-address wl-thread wl-folder wl
wl-e21 wl-spam wl-action wl-summary wl-refile wl-util pp elmo-flag
elmo-localdir wl-message elmo-mime mmelmo-buffer mmelmo-imap mime-view
mime-conf calist semi-def mmimap mime-parse mmbuffer mmgeneric
elmo-multi elmo-spam elsp-header elsp-generic elmo elmo-signal
wl-highlight wl-vars wl-version epg-config elmo-msgdb modb
modb-generic modb-entity luna mime elmo-util emu invisible inv-23 poem
poem-e20 poem-e20_3 utf7 eword-decode mel mime-def alist std11
mcharset mcs-20 mcs-e20 pces pces-e20 pces-20 broken pcustom elmo-date
elmo-vars elmo-version path-util poe pym static apel-ver product
w3m-load mime-w3m w3m browse-url doc-view jka-compr image-mode
w3m-hist w3m-fb bookmark-w3m w3m-ems wid-edit w3m-ccl ccl w3m-favicon
w3m-image w3m-proc w3m-util multiple-cursors-autoloads package
ps-print ps-def lpr bbdb-autoloads bbdb timezone flyspell ispell
auto-save-buffers-enhanced delsel savehist fill-column-indicator
highlight-indentation column-marker col-highlight vline
centered-cursor-mode dired-aux dired yasnippet help-mode debug
multiple-cursors mc-separate-operations rectangular-region-mode
mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines
multiple-cursors-core edmacro kmacro rect saveplace init-auctex
tex-site desktop frameset init-tabbar tabbar init-org derived cl-macs
gv holidays hol-loaddefs org-capture org-mks org-agenda org-toodledo
mailcap-toodledo lawlist-tls http-post-simple cl cl-loaddefs cl-lib
url-http tls url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
url-gw url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util url-parse auth-source eieio eieio-core
gnus-util mm-util mail-prsvr password-cache url-vars mailcap json xml
w3mexcerpt org byte-opt bytecomp byte-compile cconv advice help-fns
ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint
ob-keys org-pcomplete pcomplete comint ansi-color ring org-list
org-faces org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs format-spec
find-func cal-menu calendar cal-loaddefs hideshow easymenu
highlight-parentheses redo time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)