emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Lockup in org-get-tags-at (4.32)
@ 2006-05-24  4:29 Todd Neal
  2006-05-24  7:02 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Todd Neal @ 2006-05-24  4:29 UTC (permalink / raw)
  To: emacs-orgmode



I was trying to archive a TODO item and org-mode locked up.  I've
traced it down to org-get-tags-at which never returns. Below is a
stack trace with the "looping" portion marked.

--- End Loop
  org-outline-level()
  outline-up-heading(1 t)
  org-up-heading-all(1)
--- Loop
  org-get-tags-at()
  org-set-tags(nil t)
  org-promote()
  org-map-region(org-promote 1426 1480)
  org-paste-subtree(1)
  org-archive-subtree()


Hopefully, these lines won't get wrapped:

     1	(defun org-get-tags-at (&optional pos)
     2	  "Get a list of all headline tags applicable at POS.
     3	POS defaults to point.  If tags are inherited, the list contains
     4	the targets in the same sequence as the headlines appear, i.e.
     5	the tags of the current headline come last."
     6	  (interactive)
     7	  (let (tags)
     8	    (save-excursion
     9	      (goto-char (or pos (point)))
    10	      (save-match-data
    11		(org-back-to-heading t)
    12		(condition-case nil
    13		    (while t
    14		      (if (looking-at "[^\r\n]+?:\\([a-zA-Z_@0-9:]+\\):[ \t]*\\([\n\r]\\|\\'\\)")
    15			  (setq tags (append (org-split-string 
    16					      (org-match-string-no-properties 1) ":")
    17					     tags)))
    18		      (or org-use-tag-inheritance (error ""))
    19		      (org-up-heading-all 1))
    20		  (error nil))))
    21	    (message "%s" tags)
    22	    tags))


It is clearly stuck in the while loop between lines 13-19 but I'm not
sure why.  Does anyone else experience this behavior?

Todd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lockup in org-get-tags-at (4.32)
  2006-05-24  4:29 Lockup in org-get-tags-at (4.32) Todd Neal
@ 2006-05-24  7:02 ` Carsten Dominik
  2006-05-24 22:38   ` Todd Neal
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2006-05-24  7:02 UTC (permalink / raw)
  To: Todd Neal; +Cc: emacs-orgmode

Hi Todd,

thanks for the report:

I can only reproduce the error if I have a level 2 entry in the first 
line of the archive file.  I am guessing:

- You had this problem only with 4.32, not before?

Normally, when Org-mode creates the archive file, it makes sure that 
there are a level-one entry, so I guess you made this file in some 
other way?

4.32 calls org-get-tags-at during archiving, that is a mistake, will be 
fixed in 4.33.

Let me know if 4.33 does not fix the problem.  In that case, can you 
make example files of your Org-mode file and the corresponding archive 
file to help me reproducing the problem?

- Carsten


On May 24, 2006, at 6:29, Todd Neal wrote:

>
>
> I was trying to archive a TODO item and org-mode locked up.  I've
> traced it down to org-get-tags-at which never returns. Below is a
> stack trace with the "looping" portion marked.
>
> --- End Loop
>   org-outline-level()
>   outline-up-heading(1 t)
>   org-up-heading-all(1)
> --- Loop
>   org-get-tags-at()
>   org-set-tags(nil t)
>   org-promote()
>   org-map-region(org-promote 1426 1480)
>   org-paste-subtree(1)
>   org-archive-subtree()
>
>
> Hopefully, these lines won't get wrapped:
>
>      1	(defun org-get-tags-at (&optional pos)
>      2	  "Get a list of all headline tags applicable at POS.
>      3	POS defaults to point.  If tags are inherited, the list contains
>      4	the targets in the same sequence as the headlines appear, i.e.
>      5	the tags of the current headline come last."
>      6	  (interactive)
>      7	  (let (tags)
>      8	    (save-excursion
>      9	      (goto-char (or pos (point)))
>     10	      (save-match-data
>     11		(org-back-to-heading t)
>     12		(condition-case nil
>     13		    (while t
>     14		      (if (looking-at "[^\r\n]+?:\\([a-zA-Z_@0-9:]+\\):[ 
> \t]*\\([\n\r]\\|\\'\\)")
>     15			  (setq tags (append (org-split-string
>     16					      (org-match-string-no-properties 1) ":")
>     17					     tags)))
>     18		      (or org-use-tag-inheritance (error ""))
>     19		      (org-up-heading-all 1))
>     20		  (error nil))))
>     21	    (message "%s" tags)
>     22	    tags))
>
>
> It is clearly stuck in the while loop between lines 13-19 but I'm not
> sure why.  Does anyone else experience this behavior?
>
> Todd
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lockup in org-get-tags-at (4.32)
  2006-05-24  7:02 ` Carsten Dominik
@ 2006-05-24 22:38   ` Todd Neal
  0 siblings, 0 replies; 3+ messages in thread
From: Todd Neal @ 2006-05-24 22:38 UTC (permalink / raw)
  To: emacs-orgmode


Carsten Dominik <dominik@science.uva.nl> writes:

> Hi Todd,
>
> thanks for the report:
>
> I can only reproduce the error if I have a level 2 entry in the first
> line of the archive file.  I am guessing:
>
> - You had this problem only with 4.32, not before?

Correct.

>
> Normally, when Org-mode creates the archive file, it makes sure that
> there are a level-one entry, so I guess you made this file in some
> other way?
>
I cleared the archive file after org created it.  This is probably
what caused the problem.

> 4.32 calls org-get-tags-at during archiving, that is a mistake, will
> be fixed in 4.33.
>
> Let me know if 4.33 does not fix the problem.  In that case, can you
> make example files of your Org-mode file and the corresponding archive
> file to help me reproducing the problem?
>

I've tried 4.33 and it works fine for me.

Thanks,
Todd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-24 22:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-24  4:29 Lockup in org-get-tags-at (4.32) Todd Neal
2006-05-24  7:02 ` Carsten Dominik
2006-05-24 22:38   ` Todd Neal

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).