From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Bug when cycling Date: Wed, 27 Nov 2013 00:24:16 +0100 Message-ID: <87wqjusq5b.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlRzk-00052w-Do for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 18:24:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlRzd-000761-12 for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 18:24:40 -0500 Received: from plane.gmane.org ([80.91.229.3]:51011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlRzc-00075v-FM for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 18:24:32 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VlRzb-0004Zs-77 for emacs-orgmode@gnu.org; Wed, 27 Nov 2013 00:24:31 +0100 Received: from aaubervilliers-651-1-269-148.w86-212.abo.wanadoo.fr ([86.212.204.148]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Nov 2013 00:24:31 +0100 Received: from bzg by aaubervilliers-651-1-269-148.w86-212.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Nov 2013 00:24:31 +0100 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: emacs-orgmode@gnu.org Hi, with latest master and the file below, hitting TAB at the beginning of the headline will produce the attached backtrace. * Test SCHEDULED: <2013-11-25 lun.> :PROPERTIES: :CAPTURED: [2013-11-08 ven. 18:13] :END: Debugger entered--Lisp error: (error "Invalid search bound (wrong side of p= oint)") re-search-forward("^[ ]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ ]*$" 2256 t) (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-cas= e (match-string 1) exceptions) nil (let ((drawer (org-element-at-point))) (= if (memq (org-element-type drawer) (quote (drawer property-drawer))) (progn= (org-flag-drawer t drawer) (goto-char (org-element-property :end drawer)))= )))) (let* ((globalp (memq state (quote (contents all)))) (beg (if globalp (po= int-min) (point))) (end (if globalp (point-max) (if (eq state (quote childr= en)) (save-excursion (outline-next-heading) (point)) (org-end-of-subtree t)= )))) (goto-char beg) (while (re-search-forward org-drawer-regexp end t) (if= (member-ignore-case (match-string 1) exceptions) nil (let ((drawer (org-el= ement-at-point))) (if (memq (org-element-type drawer) (quote (drawer proper= ty-drawer))) (progn (org-flag-drawer t drawer) (goto-char (org-element-prop= erty :end drawer)))))))) (save-excursion (let* ((globalp (memq state (quote (contents all)))) (beg= (if globalp (point-min) (point))) (end (if globalp (point-max) (if (eq sta= te (quote children)) (save-excursion (outline-next-heading) (point)) (org-e= nd-of-subtree t))))) (goto-char beg) (while (re-search-forward org-drawer-r= egexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let = ((drawer (org-element-at-point))) (if (memq (org-element-type drawer) (quot= e ...)) (progn (org-flag-drawer t drawer) (goto-char ...)))))))) (progn (save-excursion (let* ((globalp (memq state (quote (contents all))= )) (beg (if globalp (point-min) (point))) (end (if globalp (point-max) (if = (eq state ...) (save-excursion ... ...) (org-end-of-subtree t))))) (goto-ch= ar beg) (while (re-search-forward org-drawer-regexp end t) (if (member-igno= re-case (match-string 1) exceptions) nil (let ((drawer ...)) (if (memq ... = ...) (progn ... ...)))))))) (if (and (derived-mode-p (quote org-mode)) (not (memq state (quote (overv= iew folded contents))))) (progn (save-excursion (let* ((globalp (memq state= (quote ...))) (beg (if globalp (point-min) (point))) (end (if globalp (poi= nt-max) (if ... ... ...)))) (goto-char beg) (while (re-search-forward org-d= rawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) ni= l (let (...) (if ... ...)))))))) org-cycle-hide-drawers(subtree) run-hook-with-args(org-cycle-hide-drawers subtree) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle= -hook) (quote subtree))) (cond ((=3D eos eoh) (if (org-before-first-heading-p) nil (run-hook-with-= args (quote org-pre-cycle-hook) (quote empty))) (org-unlogged-message "EMPT= Y ENTRY") (setq org-cycle-subtree-status nil) (save-excursion (goto-char eo= s) (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))= )) ((and (or (>=3D eol eos) (not (string-match "\\S-" (buffer-substring eol= eos)))) (or has-children (not (setq children-skipped org-cycle-skip-childr= en-state-if-no-children)))) (if (org-before-first-heading-p) nil (run-hook-= with-args (quote org-pre-cycle-hook) (quote children))) (if (org-at-item-p)= (org-list-set-item-visibility (point-at-bol) struct (quote children)) (org= -show-entry) (let* ((org-called-with-limited-levels t) (org-outline-regexp = (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-= outline-regexp-bol (concat "^" org-outline-regexp))) (show-children)) (if (= eq org-cycle-include-plain-lists (quote integrate)) (progn (save-excursion = (org-back-to-heading) (while (org-list-search-forward ... eos t) (beginning= -of-line 1) (let* ... ... ...)))))) (org-unlogged-message "CHILDREN") (save= -excursion (goto-char eos) (outline-next-heading) (if (outline-invisible-p)= (org-flag-heading nil))) (setq org-cycle-subtree-status (quote children)) = (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-h= ook) (quote children)))) ((or children-skipped (and (eq last-command this-c= ommand) (eq org-cycle-subtree-status (quote children)))) (if (org-before-fi= rst-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote su= btree))) (outline-flag-region eoh eos nil) (org-unlogged-message (if childr= en-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-stat= us (quote subtree)) (if (org-before-first-heading-p) nil (run-hook-with-arg= s (quote org-cycle-hook) (quote subtree)))) (t (run-hook-with-args (quote o= rg-pre-cycle-hook) (quote folded)) (outline-flag-region eoh eos t) (org-unl= ogged-message "FOLDED") (setq org-cycle-subtree-status (quote folded)) (if = (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook)= (quote folded))))) (let ((goal-column 0) eoh eol eos has-children children-skipped struct) (= save-excursion (if (org-at-item-p) (progn (beginning-of-line) (setq struct = (org-list-struct)) (setq eoh (point-at-eol)) (setq eos (org-list-get-item-e= nd-before-blank (point) struct)) (setq has-children (org-list-has-child-p (= point) struct))) (org-back-to-heading) (setq eoh (save-excursion (outline-e= nd-of-heading) (point))) (setq eos (save-excursion (1- (org-end-of-subtree = t t)))) (setq has-children (or (save-excursion (let (...) (outline-next-hea= ding) (and ... ...))) (save-excursion (org-list-search-forward (org-item-be= ginning-re) eos t))))) (beginning-of-line 2) (if nil (while (and (not (eobp= )) (get-char-property (1- (point)) (quote invisible))) (beginning-of-line 2= )) (while (and (not (eobp)) (get-char-property (1- (point)) (quote invisibl= e))) (goto-char (next-single-char-property-change (point) (quote invisible)= )) (and (eolp) (beginning-of-line 2)))) (setq eol (point))) (cond ((=3D eos= eoh) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-p= re-cycle-hook) (quote empty))) (org-unlogged-message "EMPTY ENTRY") (setq o= rg-cycle-subtree-status nil) (save-excursion (goto-char eos) (outline-next-= heading) (if (outline-invisible-p) (org-flag-heading nil)))) ((and (or (>= =3D eol eos) (not (string-match "\\S-" (buffer-substring eol eos)))) (or ha= s-children (not (setq children-skipped org-cycle-skip-children-state-if-no-= children)))) (if (org-before-first-heading-p) nil (run-hook-with-args (quot= e org-pre-cycle-hook) (quote children))) (if (org-at-item-p) (org-list-set-= item-visibility (point-at-bol) struct (quote children)) (org-show-entry) (l= et* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limite= d-outline-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-= bol (concat "^" org-outline-regexp))) (show-children)) (if (eq org-cycle-in= clude-plain-lists (quote integrate)) (progn (save-excursion (org-back-to-he= ading) (while ... ... ...))))) (org-unlogged-message "CHILDREN") (save-excu= rsion (goto-char eos) (outline-next-heading) (if (outline-invisible-p) (org= -flag-heading nil))) (setq org-cycle-subtree-status (quote children)) (if (= org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) = (quote children)))) ((or children-skipped (and (eq last-command this-comman= d) (eq org-cycle-subtree-status (quote children)))) (if (org-before-first-h= eading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote subtree= ))) (outline-flag-region eoh eos nil) (org-unlogged-message (if children-sk= ipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status (q= uote subtree)) (if (org-before-first-heading-p) nil (run-hook-with-args (qu= ote org-cycle-hook) (quote subtree)))) (t (run-hook-with-args (quote org-pr= e-cycle-hook) (quote folded)) (outline-flag-region eoh eos t) (org-unlogged= -message "FOLDED") (setq org-cycle-subtree-status (quote folded)) (if (org-= before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quo= te folded)))))) org-cycle-internal-local() (cond ((equal arg (quote (16))) (setq last-command (quote dummy)) (org-se= t-startup-visibility) (org-unlogged-message "Startup visibility, plus VISIB= ILITY properties")) ((equal arg (quote (64))) (show-all) (org-unlogged-mess= age "Entire buffer visible, including drawers")) ((org-at-table-p (quote an= y)) (if (org-at-table\.el-p) (message "Use C-c ' to edit table.el tables") = (if arg (org-table-edit-field t) (org-table-justify-field-maybe) (call-inte= ractively (quote org-table-next-field))))) ((run-hook-with-args-until-succe= ss (quote org-tab-after-check-for-table-hook))) ((eq arg t) (org-cycle-inte= rnal-global)) ((save-excursion (beginning-of-line 1) (looking-at org-drawer= -regexp)) (org-flag-drawer (not (get-char-property (match-end 0) (quote inv= isible))))) ((integerp arg) (save-excursion (org-back-to-heading) (outline-= up-heading (if (< arg 0) (- arg) (- (funcall outline-level) arg))) (org-sho= w-subtree))) ((and (featurep (quote org-inlinetask)) (org-inlinetask-at-tas= k-p) (or (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-= inlinetask-toggle-visibility)) ((org-try-cdlatex-tab)) ((and (or (and org-c= ycle-include-plain-lists (org-at-item-p)) (save-excursion (beginning-of-lin= e 1) (looking-at org-outline-regexp))) (or (bolp) (not (eq org-cycle-emulat= e-tab (quote exc-hl-bol))))) (org-cycle-internal-local)) (buffer-read-only = (org-back-to-heading)) ((run-hook-with-args-until-success (quote org-tab-af= ter-check-for-cycling-hook))) ((org-try-structure-completion)) ((run-hook-w= ith-args-until-success (quote org-tab-before-tab-emulation-hook))) ((and (e= q org-cycle-emulate-tab (quote exc-hl-bol)) (or (not (bolp)) (not (looking-= at org-outline-regexp)))) (call-interactively (global-key-binding " "))) ((= if (and (memq org-cycle-emulate-tab (quote (white whitestart))) (save-excur= sion (beginning-of-line 1) (looking-at "[ ]*")) (or (and (eq org-cycle-emu= late-tab (quote white)) (=3D (match-end 0) (point-at-eol))) (and (eq org-cy= cle-emulate-tab (quote whitestart)) (>=3D (match-end 0) pos)))) t (eq org-c= ycle-emulate-tab t)) (call-interactively (global-key-binding " "))) (t (sav= e-excursion (org-back-to-heading) (org-cycle)))) (let* ((limit-level (or org-cycle-max-level (and (boundp (quote org-inlin= etask-min-level)) org-inlinetask-min-level (1- org-inlinetask-min-level))))= (nstars (and limit-level (if org-odd-levels-only (and limit-level (1- (* l= imit-level 2))) limit-level))) (org-outline-regexp (if (not (derived-mode-p= (quote org-mode))) outline-regexp (concat "\\*" (if nstars (format "\\{1,%= d\\} " nstars) "+ ")))) (bob-special (and org-cycle-global-at-bob (not arg)= (bobp) (not (looking-at org-outline-regexp)))) (org-cycle-hook (if bob-spe= cial (delq (quote org-optimize-window-after-visibility-change) (copy-sequen= ce org-cycle-hook)) org-cycle-hook)) (pos (point))) (if (or bob-special (eq= ual arg (quote (4)))) (setq arg t)) (cond ((equal arg (quote (16))) (setq l= ast-command (quote dummy)) (org-set-startup-visibility) (org-unlogged-messa= ge "Startup visibility, plus VISIBILITY properties")) ((equal arg (quote (6= 4))) (show-all) (org-unlogged-message "Entire buffer visible, including dra= wers")) ((org-at-table-p (quote any)) (if (org-at-table\.el-p) (message "Us= e C-c ' to edit table.el tables") (if arg (org-table-edit-field t) (org-tab= le-justify-field-maybe) (call-interactively (quote org-table-next-field))))= ) ((run-hook-with-args-until-success (quote org-tab-after-check-for-table-h= ook))) ((eq arg t) (org-cycle-internal-global)) ((save-excursion (beginning= -of-line 1) (looking-at org-drawer-regexp)) (org-flag-drawer (not (get-char= -property (match-end 0) (quote invisible))))) ((integerp arg) (save-excursi= on (org-back-to-heading) (outline-up-heading (if (< arg 0) (- arg) (- (func= all outline-level) arg))) (org-show-subtree))) ((and (featurep (quote org-i= nlinetask)) (org-inlinetask-at-task-p) (or (bolp) (not (eq org-cycle-emulat= e-tab (quote exc-hl-bol))))) (org-inlinetask-toggle-visibility)) ((org-try-= cdlatex-tab)) ((and (or (and org-cycle-include-plain-lists (org-at-item-p))= (save-excursion (beginning-of-line 1) (looking-at org-outline-regexp))) (o= r (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-cycle-i= nternal-local)) (buffer-read-only (org-back-to-heading)) ((run-hook-with-ar= gs-until-success (quote org-tab-after-check-for-cycling-hook))) ((org-try-s= tructure-completion)) ((run-hook-with-args-until-success (quote org-tab-bef= ore-tab-emulation-hook))) ((and (eq org-cycle-emulate-tab (quote exc-hl-bol= )) (or (not (bolp)) (not (looking-at org-outline-regexp)))) (call-interacti= vely (global-key-binding " "))) ((if (and (memq org-cycle-emulate-tab (quot= e (white whitestart))) (save-excursion (beginning-of-line 1) (looking-at "[= ]*")) (or (and (eq org-cycle-emulate-tab ...) (=3D ... ...)) (and (eq org= -cycle-emulate-tab ...) (>=3D ... pos)))) t (eq org-cycle-emulate-tab t)) (= call-interactively (global-key-binding " "))) (t (save-excursion (org-back-= to-heading) (org-cycle))))) (if (or (run-hook-with-args-until-success (quote org-tab-first-hook)) (an= d org-cycle-level-after-item/entry-creation (or (org-cycle-level) (org-cycl= e-item-indentation)))) nil (let* ((limit-level (or org-cycle-max-level (and= (boundp (quote org-inlinetask-min-level)) org-inlinetask-min-level (1- org= -inlinetask-min-level)))) (nstars (and limit-level (if org-odd-levels-only = (and limit-level (1- ...)) limit-level))) (org-outline-regexp (if (not (der= ived-mode-p (quote org-mode))) outline-regexp (concat "\\*" (if nstars (for= mat "\\{1,%d\\} " nstars) "+ ")))) (bob-special (and org-cycle-global-at-bo= b (not arg) (bobp) (not (looking-at org-outline-regexp)))) (org-cycle-hook = (if bob-special (delq (quote org-optimize-window-after-visibility-change) (= copy-sequence org-cycle-hook)) org-cycle-hook)) (pos (point))) (if (or bob-= special (equal arg (quote (4)))) (setq arg t)) (cond ((equal arg (quote (16= ))) (setq last-command (quote dummy)) (org-set-startup-visibility) (org-unl= ogged-message "Startup visibility, plus VISIBILITY properties")) ((equal ar= g (quote (64))) (show-all) (org-unlogged-message "Entire buffer visible, in= cluding drawers")) ((org-at-table-p (quote any)) (if (org-at-table\.el-p) (= message "Use C-c ' to edit table.el tables") (if arg (org-table-edit-field = t) (org-table-justify-field-maybe) (call-interactively (quote org-table-nex= t-field))))) ((run-hook-with-args-until-success (quote org-tab-after-check-= for-table-hook))) ((eq arg t) (org-cycle-internal-global)) ((save-excursion= (beginning-of-line 1) (looking-at org-drawer-regexp)) (org-flag-drawer (no= t (get-char-property (match-end 0) (quote invisible))))) ((integerp arg) (s= ave-excursion (org-back-to-heading) (outline-up-heading (if (< arg 0) (- ar= g) (- ... arg))) (org-show-subtree))) ((and (featurep (quote org-inlinetask= )) (org-inlinetask-at-task-p) (or (bolp) (not (eq org-cycle-emulate-tab ...= )))) (org-inlinetask-toggle-visibility)) ((org-try-cdlatex-tab)) ((and (or = (and org-cycle-include-plain-lists (org-at-item-p)) (save-excursion (beginn= ing-of-line 1) (looking-at org-outline-regexp))) (or (bolp) (not (eq org-cy= cle-emulate-tab ...)))) (org-cycle-internal-local)) (buffer-read-only (org-= back-to-heading)) ((run-hook-with-args-until-success (quote org-tab-after-c= heck-for-cycling-hook))) ((org-try-structure-completion)) ((run-hook-with-a= rgs-until-success (quote org-tab-before-tab-emulation-hook))) ((and (eq org= -cycle-emulate-tab (quote exc-hl-bol)) (or (not (bolp)) (not (looking-at or= g-outline-regexp)))) (call-interactively (global-key-binding " "))) ((if (a= nd (memq org-cycle-emulate-tab (quote ...)) (save-excursion (beginning-of-l= ine 1) (looking-at "[ ]*")) (or (and ... ...) (and ... ...))) t (eq org-cy= cle-emulate-tab t)) (call-interactively (global-key-binding " "))) (t (save= -excursion (org-back-to-heading) (org-cycle)))))) org-cycle(nil) call-interactively(org-cycle nil nil) command-execute(org-cycle) --=20 Bastien