emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tag search broken
@ 2012-09-21  0:28 Marcelo de Moraes Serpa
  2012-09-21  3:28 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-09-21  0:28 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 12766 bytes --]

Hello guys,

My tag search is broken, for some reason. When I search for "tag1" for
example, the search breaks and I get the following message in the
*Messages* buffer:

if: Wrong type argument: stringp, ("tag0" "tag1" "tag3" "tag4")

Here's the backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp ("haxe" "ruby"
> "blog" "coffeinthevein"))
>   string-match("\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" ("haxe"
> "ruby" "blog" "coffeinthevein"))
>   (if (string-match org-bracket-link-regexp category) (progn (setq l ...)
> (when ... ... ...)) (if (and org-prefix-category-max-length ...) (setq
> category ...)))
>   (let* ((category ...) (category-icon ...) (category-icon ...) (tag ...)
> time effort neffort (ts ...) (time-of-day ...) stamp plain s0 s1 s2 rtn srp
> l duration thecategory) (and (derived-mode-p ...) buffer-file-name
> (add-to-list ... buffer-file-name)) (when (and dotime time-of-day) (when
> ... ... ...) (if s1 ...) (if s2 ...) (when ... ...) (when s2 ...)) (when
> (string-match ... txt) (if ... ... ...)) (when (derived-mode-p ...) (setq
> effort ...) (when effort ...)) (or effort (setq effort "")) (when remove-re
> (while ... ...)) (add-text-properties 0 (length txt) (quote ...) txt) (setq
> time (cond ... ... ...) extra (or ... "") category (if ... ... category)
> thecategory (copy-sequence category)) (if (string-match
> org-bracket-link-regexp category) (progn ... ...) (if ... ...)) (setq rtn
> (concat ... txt)) (remove-text-properties 0 (length rtn) (quote ...) rtn)
> (org-add-props rtn nil (quote org-category) (if thecategory ... category)
> (quote tags) (mapcar ... tags) (quote org-highest-priority)
> org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote
> time-of-day) time-of-day (quote duration) duration (quote effort) effort
> (quote effort-minutes) neffort (quote txt) txt (quote time) time (quote
> extra) extra (quote format) org-prefix-format-compiled (quote dotime)
> dotime))
>   (progn (setq txt (org-trim txt)) (setq txt
> (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags
> org-agenda-hide-tags-regexp)) (let* (... ... ... ... time effort neffort
> ... ... stamp plain s0 s1 s2 rtn srp l duration thecategory) (and ...
> buffer-file-name ...) (when ... ... ... ... ... ...) (when ... ...) (when
> ... ... ...) (or effort ...) (when remove-re ...) (add-text-properties 0
> ... ... txt) (setq time ... extra ... category ... thecategory ...) (if ...
> ... ...) (setq rtn ...) (remove-text-properties 0 ... ... rtn)
> (org-add-props rtn nil ... ... ... ... ... org-highest-priority ...
> org-lowest-priority ... time-of-day ... duration ... effort ... neffort ...
> txt ... time ... extra ... org-prefix-format-compiled ... dotime)))
>   (unwind-protect (progn (setq txt ...) (setq txt ...) (let* ... ... ...
> ... ... ... ... ... ... ... ... ... ...)) (set-match-data
> save-match-data-internal (quote evaporate)))
>   (let ((save-match-data-internal ...)) (unwind-protect (progn ... ...
> ...) (set-match-data save-match-data-internal ...)))
>   (save-match-data (setq txt (org-trim txt)) (setq txt
> (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags
> org-agenda-hide-tags-regexp)) (let* (... ... ... ... time effort neffort
> ... ... stamp plain s0 s1 s2 rtn srp l duration thecategory) (and ...
> buffer-file-name ...) (when ... ... ... ... ... ...) (when ... ...) (when
> ... ... ...) (or effort ...) (when remove-re ...) (add-text-properties 0
> ... ... txt) (setq time ... extra ... category ... thecategory ...) (if ...
> ... ...) (setq rtn ...) (remove-text-properties 0 ... ... rtn)
> (org-add-props rtn nil ... ... ... ... ... org-highest-priority ...
> org-lowest-priority ... time-of-day ... duration ... effort ... neffort ...
> txt ... time ... extra ... org-prefix-format-compiled ... dotime)))
>   (let* ((bindings ...) (formatter ...)) (loop for (var value) in bindings
> do (set var value)) (save-match-data (setq txt ...) (setq txt ...) (let*
> ... ... ... ... ... ... ... ... ... ... ... ... ...)))
>   org-agenda-format-item("" #("cyberchrist haxe engine vs jekyll -- a nice
> way to see what's haxe is capable of and what is missing from ruby
> :haxe:ruby:blog:coffeinthevein:" 0 142 (org-category "someday_maybe"
> fontified nil)) "someday_maybe" ("haxe" "ruby" "blog" "coffeinthevein"))
>   (setq txt (org-agenda-format-item "" (concat ... ...) category
> tags-list) priority (org-get-priority txt))
>   (cond ((eq action ...) (and org-highlight-sparse-tree-matches ... ...
> ...) (org-show-context ...)) ((eq action ...) (setq txt ... priority ...)
> (goto-char lspos) (setq marker ...) (org-add-props txt props ... marker ...
> marker ... category ... todo ... priority ... "tagsmatch") (push txt rtn))
> ((functionp action) (setq org-map-continue-from nil) (save-excursion ...
> ...)) (t (error "Invalid action")))
>   (progn (cond (... ... ...) (... ... ... ... ... ...) (... ... ...) (t
> ...)) (unless org-tags-match-list-sublevels (org-end-of-subtree t)
> (backward-char 1)))
>   (if (and (and ... ...) (progn ... t) (or ... ...) (or ... ...)) (progn
> (cond ... ... ... ...) (unless org-tags-match-list-sublevels ... ...)))
>   (when (and (and ... ...) (progn ... t) (or ... ...) (or ... ...)) (cond
> (... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...)) (unless
> org-tags-match-list-sublevels (org-end-of-subtree t) (backward-char 1)))
>   (catch :skip (setq todo (if ... ...) tags (if ... ...)) (goto-char (setq
> lspos ...)) (setq level (org-reduced-level ...) category
> (org-get-category)) (setq i llast llast level) (while (>= i level) (when
> ... ...) (setq i ...)) (when tags (setq tags ... tags-alist ...)) (setq
> tags-list (if org-use-tag-inheritance ... tags) org-scanner-tags tags-list)
> (when org-use-tag-inheritance (setcdr ... ...)) (when (and tags
> org-use-tag-inheritance ...) (setcdr ... ...)) (when (and ... ... ... ...)
> (cond ... ... ... ...) (unless org-tags-match-list-sublevels ... ...)))
>   (while (re-search-forward re nil t) (setq org-map-continue-from nil)
> (catch :skip (setq todo ... tags ...) (goto-char ...) (setq level ...
> category ...) (setq i llast llast level) (while ... ... ...) (when tags
> ...) (setq tags-list ... org-scanner-tags tags-list) (when
> org-use-tag-inheritance ...) (when ... ...) (when ... ... ...)) (if
> org-map-continue-from (goto-char org-map-continue-from) (and ... ...)))
>   (save-excursion (goto-char (point-min)) (when (eq action ...)
> (org-overview) (org-remove-occur-highlights)) (while (re-search-forward re
> nil t) (setq org-map-continue-from nil) (catch :skip ... ... ... ... ...
> ... ... ... ... ...) (if org-map-continue-from ... ...)))
>   (let* ((re ...) (props ...) (case-fold-search nil)
> (org-map-continue-from nil) lspos tags tags-list (tags-alist ...) (llast 0)
> rtn rtn1 level category i txt todo marker entry priority) (when (not ...)
> (setq action ...)) (save-excursion (goto-char ...) (when ... ... ...)
> (while ... ... ... ...)) (when (and ... ...) (org-hide-archived-subtrees
> ... ...)) (nreverse rtn))
>   org-scan-tags(agenda (and (progn (setq org-cached-props nil) (member
> "ruby" tags-list)) t) nil)
>   (setq rtn (org-scan-tags (quote agenda) matcher todo-only))
>   (save-restriction (if org-agenda-restrict (narrow-to-region
> org-agenda-restrict-begin org-agenda-restrict-end) (widen)) (setq rtn
> (org-scan-tags ... matcher todo-only)) (setq rtnall (append rtnall rtn)))
>   (save-excursion (save-restriction (if org-agenda-restrict ... ...) (setq
> rtn ...) (setq rtnall ...)))
>   (save-current-buffer (set-buffer buffer) (unless (derived-mode-p ...)
> (error "Agenda file %s is not in `org-mode'" file)) (save-excursion
> (save-restriction ... ... ...)))
>   (with-current-buffer buffer (unless (derived-mode-p ...) (error "Agenda
> file %s is not in `org-mode'" file)) (save-excursion (save-restriction ...
> ... ...)))
>   (if (not buffer) (setq rtn (list ...) rtnall (append rtnall rtn))
> (with-current-buffer buffer (unless ... ...) (save-excursion ...)))
>   (catch (quote nextfile) (org-check-agenda-file file) (setq buffer (if
> ... ... ...)) (if (not buffer) (setq rtn ... rtnall ...)
> (with-current-buffer buffer ... ...)))
>   (while (setq file (pop files)) (catch (quote nextfile)
> (org-check-agenda-file file) (setq buffer ...) (if ... ... ...)))
>   (catch (quote exit) (if org-agenda-sticky (setq org-agenda-buffer-name
> ...)) (org-agenda-prepare (concat "TAGS " match))
> (org-compile-prefix-format (quote tags)) (org-set-sorting-strategy (quote
> tags)) (setq org-agenda-query-string match) (setq org-agenda-redo-command
> (list ... ... ...)) (setq files (org-agenda-files nil ...) rtnall nil)
> (while (setq file ...) (catch ... ... ... ...)) (if
> org-agenda-overriding-header (insert ... "\n") (insert "Headlines with TAGS
> match: ") (add-text-properties ... ... ...) (setq pos ...) (insert match
> "\n") (add-text-properties pos ... ...) (setq pos ...) (unless
> org-agenda-multi ...) (add-text-properties pos ... ...))
> (org-agenda-mark-header-line (point-min)) (when rtnall (insert ... "\n"))
> (goto-char (point-min)) (or org-agenda-multi
> (org-agenda-fit-window-to-buffer)) (add-text-properties (point-min)
> (point-max) (\` ...)) (org-agenda-finalize) (setq buffer-read-only t))
>   (let* ((org-tags-match-list-sublevels org-tags-match-list-sublevels)
> (completion-ignore-case t) rtn rtnall files file pos matcher buffer) (when
> (and ... ...) (setq match nil)) (setq matcher (org-make-tags-matcher match)
> match (car matcher) matcher (cdr matcher)) (catch (quote exit) (if
> org-agenda-sticky ...) (org-agenda-prepare ...) (org-compile-prefix-format
> ...) (org-set-sorting-strategy ...) (setq org-agenda-query-string match)
> (setq org-agenda-redo-command ...) (setq files ... rtnall nil) (while ...
> ...) (if org-agenda-overriding-header ... ... ... ... ... ... ... ... ...)
> (org-agenda-mark-header-line ...) (when rtnall ...) (goto-char ...) (or
> org-agenda-multi ...) (add-text-properties ... ... ...)
> (org-agenda-finalize) (setq buffer-read-only t)))
>   org-tags-view(nil)
>   call-interactively(org-tags-view)
>   (cond ((setq entry ...) (if ... ... ...)) ((equal org-keys "C") (setq
> org-agenda-custom-commands org-agenda-custom-commands-orig)
> (customize-variable ...)) ((equal org-keys "a") (call-interactively ...))
> ((equal org-keys "s") (call-interactively ...)) ((equal org-keys "S")
> (org-call-with-arg ... ...)) ((equal org-keys "t") (call-interactively
> ...)) ((equal org-keys "T") (org-call-with-arg ... ...)) ((equal org-keys
> "m") (call-interactively ...)) ((equal org-keys "M") (org-call-with-arg ...
> ...)) ((equal org-keys "e") (call-interactively ...)) ((equal org-keys "?")
> (org-tags-view nil "+FLAGGED") (org-add-hook ... ... t t)) ((equal org-keys
> "L") (unless ... ...) (unless restriction ... ...)) ((equal org-keys "#")
> (call-interactively ...)) ((equal org-keys "/") (call-interactively ...))
> ((equal org-keys "!") (customize-variable ...)) (t (error "Invalid agenda
> key")))
>   (let* ((prefix-descriptions nil) (org-agenda-buffer-name
> org-agenda-buffer-name) (org-agenda-window-setup ...)
> (org-agenda-custom-commands-orig org-agenda-custom-commands)
> (org-agenda-custom-commands ...) (org-agenda-custom-commands ...) (buf ...)
> (bfn ...) entry key type org-match lprops ans) (unless
> org-agenda-overriding-restriction (unless ... ...) (setq
> org-agenda-restrict nil) (move-marker org-agenda-restrict-begin nil)
> (move-marker org-agenda-restrict-end nil)) (put (quote
> org-agenda-redo-command) (quote org-lprops) nil) (put (quote
> org-agenda-redo-command) (quote last-args) nil) (setq
> org-agenda-last-dispatch-buffer (current-buffer)) (unless org-keys (setq
> ans ... org-keys ... restriction ...)) (if org-agenda-sticky (setq
> org-agenda-buffer-name ...)) (when (and ... restriction) (put ... ... ...)
> (cond ... ...)) (cond (... ...) (... ... ...) (... ...) (... ...) (... ...)
> (... ...) (... ...) (... ...) (... ...) (... ...) (... ... ...) (... ...
> ...) (... ...) (... ...) (... ...) (t ...)))
>   (catch (quote exit) (let* (... ... ... ... ... ... ... ... entry key
> type org-match lprops ans) (unless org-agenda-overriding-restriction ...
> ... ... ...) (put ... ... nil) (put ... ... nil) (setq
> org-agenda-last-dispatch-buffer ...) (unless org-keys ...) (if
> org-agenda-sticky ...) (when ... ... ...) (cond ... ... ... ... ... ... ...
> ... ... ... ... ... ... ... ... ...)))
>   org-agenda(nil)
>   call-interactively(org-agenda nil nil)



I can't remember exactly when it started, but I don't remember messing with
org sources or installing additional elisp pacakges in the last days.

Does anyone know what could be wrong?

Thanks in advance,

[-- Attachment #2: Type: text/html, Size: 13546 bytes --]

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

* Re: tag search broken
  2012-09-21  0:28 tag search broken Marcelo de Moraes Serpa
@ 2012-09-21  3:28 ` Nick Dokos
  2012-09-21  3:36   ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2012-09-21  3:28 UTC (permalink / raw)
  To: Marcelo de Moraes Serpa; +Cc: Org Mode

Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:

> Hello guys,
> 
> My tag search is broken, for some reason. When I search for "tag1" for example, the search breaks
> and I get the following message in the *Messages* buffer:
> 
> if: Wrong type argument: stringp, ("tag0" "tag1" "tag3" "tag4")
> 
> Here's the backtrace:
> 
>     Debugger entered--Lisp error: (wrong-type-argument stringp ("haxe" "ruby" "blog"
>     "coffeinthevein"))
>       string-match("\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" ("haxe" "ruby" "blog"
>     "coffeinthevein"))
>       (if (string-match org-bracket-link-regexp category) (progn (setq l ...) (when ... ... ...))
>     (if (and org-prefix-category-max-length ...) (setq category ...)))
>     ....
>       org-agenda-format-item("" #("cyberchrist haxe engine vs jekyll -- a nice way to see what's
>     haxe is capable of and what is missing from ruby :haxe:ruby:blog:coffeinthevein:" 0 142
>     (org-category "someday_maybe" fontified nil)) "someday_maybe" ("haxe" "ruby" "blog"
>     "coffeinthevein"))
                                                   ^level argument missing

>       (setq txt (org-agenda-format-item "" (concat ... ...) category tags-list) priority
>     (org-get-priority txt))
>     ....
> I can't remember exactly when it started, but I don't remember messing with org sources or
> installing additional elisp pacakges in the last days. 
> 
> Does anyone know what could be wrong?
> 

There is a mismatch between the call and the definition of org-agend-format-item:
it recently acquired an extra argument "level" and apparently it is expecting it:

,----
| (defun org-agenda-format-item (extra txt &optional level category tags dotime
| 				     remove-re habitp)
`----

but the call in org-scan-tags does not pass it. So everything got shifted and
when it gets to

,----
| 	(if (string-match org-bracket-link-regexp category)
`----

instead of the category, it tries to do the match on the tags list with
predictable results.

What causes this is not clear however: check org.el:org-scan-tags to make
sure that the call to org-agenda-format-item includes the level argument.
That sounds unlikely however.

My guess is that you missed a step after some update: a remake and
starting with a fresh emacs will probably cure it.

Nick

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

* Re: tag search broken
  2012-09-21  3:28 ` Nick Dokos
@ 2012-09-21  3:36   ` Nick Dokos
  2012-09-21  5:52     ` Marcelo de Moraes Serpa
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2012-09-21  3:36 UTC (permalink / raw)
  To: Marcelo de Moraes Serpa, Org Mode

Nick Dokos <nicholas.dokos@hp.com> wrote:

> What causes this is not clear however: check org.el:org-scan-tags to make
> sure that the call to org-agenda-format-item includes the level argument.
> That sounds unlikely however.
> 

Geez - I'm doing a hash of things today. The scenario I was envisaging
was that org-agenda.el was updated (so org-agenda-format-item needs the
new level arg) but org.el was not (so org-scan-tags calls it *without*
the level argument). That's what sounded unlikely to me.

But it might not be that far-fetched: there *were* some problems in this
area and you might have updated at the "wrong" time. So do check, and if
necessary, update to latest before rebuilding and starting with a fresh
emacs.

Nick

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

* Re: tag search broken
  2012-09-21  3:36   ` Nick Dokos
@ 2012-09-21  5:52     ` Marcelo de Moraes Serpa
  0 siblings, 0 replies; 4+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-09-21  5:52 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

Updating to git HEAD solved the problem.

Thanks!

- Marcelo.

On Thu, Sep 20, 2012 at 10:36 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
> > What causes this is not clear however: check org.el:org-scan-tags to make
> > sure that the call to org-agenda-format-item includes the level argument.
> > That sounds unlikely however.
> >
>
> Geez - I'm doing a hash of things today. The scenario I was envisaging
> was that org-agenda.el was updated (so org-agenda-format-item needs the
> new level arg) but org.el was not (so org-scan-tags calls it *without*
> the level argument). That's what sounded unlikely to me.
>
> But it might not be that far-fetched: there *were* some problems in this
> area and you might have updated at the "wrong" time. So do check, and if
> necessary, update to latest before rebuilding and starting with a fresh
> emacs.
>
> Nick
>
>

[-- Attachment #2: Type: text/html, Size: 1425 bytes --]

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

end of thread, other threads:[~2012-09-21  5:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21  0:28 tag search broken Marcelo de Moraes Serpa
2012-09-21  3:28 ` Nick Dokos
2012-09-21  3:36   ` Nick Dokos
2012-09-21  5:52     ` Marcelo de Moraes Serpa

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).