I think the answer is that the scope of $()$ variables (actually
placeholders) is *Lexical*, which is a fancy way of saying "I don't have a
clue what I'm saying, but that sounded good".
My workaround was to wikify the output of $(searchTiddler)$ so it could be
used directly as a variable in the list filter.
Also, note that in <$wikify> the attribute is *name*, not *$name*.
Have fun
-- Mark
\define getValue(tid) {{$tid$}}
\define wikifyMe() <$list filter="[enlist<searchUs>removeprefix[#]]"/>
\define searchResultList()
Search tiddler: $(searchTiddler)$
Search tiddler: <<searchTiddler>>
Searched text: {{$(searchTiddler)$}}
Tags without wikification: <<wikifyMe>>
<$wikify name="searchUs" text="<$macrocall $name='getValue'
tid=<<searchTiddler>>/>">
<$wikify name="wikified" text=<<wikifyMe>> >
Tags with wikification: <<wikified>>
Search for tags with wikification:
<$list filter="""[search:tags<wikified>]"""/>
</$wikify>
</$wikify>
Standard search:
<$list filter="""[search{$(searchTiddler)$}]"""/>
\end
<<searchResultList>>
On Tuesday, November 27, 2018 at 12:27:09 AM UTC-8, bimlas wrote:
>
> Hi!
>
> I would like to change the standard search text, or more specifically to
> grab texts starting with # so that I can find them among the tags. Add the
> `$:/tags/SearchResults` tag to this tiddler and watch the results only in
> standard search (where $(searchTiddler)$ is exists).
>
> \define wikifyMe() <$list
> filter="[enlist{$(searchTiddler)$}removeprefix[#]]"/>
>
> \define searchResultList()
> Search tiddler: $(searchTiddler)$
>
> Searched text: {{$(searchTiddler)$}}
>
> Tags without wikification: <<wikifyMe>>
>
> <$wikify $name="wikified" text=<<wikifyMe>> >
>
> Tags with wikification: <<wikified>>
>
> Search for tags with wikification:
> <$list filter="""[search:tags<wikified>]"""/>
>
> </$wikify>
>
> Standard search:
> <$list filter="""[search{$(searchTiddler)$}]"""/>
>
> \end
> <<searchResultList>>
>
> The wikifyMe works only without wikification, when it's wikified, the
> output is empty, thus the searching not works as expected. As I look at,
> transclusion does not work for the term, but I can not determine exactly
> what's wrong.
>
> I attached the tiddler.
>
> PS.: $(searchTiddler)$ only exists if the whole stuff is encapsulated in
> to a macro (searchResultList), but without it it's not defined - is this
> intended?
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/c3473a39-d3bd-4849-969b-4fd1bb1a1064%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.