[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] BUG: searching and functions

From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] BUG: searching and functions
Date: Sat, 10 May 2003 10:58:26 +0200 (CEST)

On Fri, 9 May 2003, Leo wrote:
> On Friday May 09 2003 18:16, Joris van der Hoeven wrote:
> > > Hi developers,
> > >
> > > TeXmacs-1.0.1 search algorithm (invoked by C-s) skips over the portions
> > > of the text coming from the functions.
> > >
> > > Here is a smiple but illustrative example:
> > >
> > >   <assign|foo|<func|text|<value|text>>>
> > >
> > >   <apply|foo|hello world!>
> > >
> > >
> > > Now try to search for 'world':  C-s world
> > > The search fails even though "hello world" is displayed on the screen.
> > > It looks as though the text strings returned from the functions
> > > are not visited by the search algorithm.
> > >
> > > Is it a bug or feature??
> >
> > Yes, that is normal, because functions are really scripts.
> > When you compute 1+1 --> 2 and search 1, you don't expect
> > to find "1" inside "2".
> I think you misunderstood what I mean. I am searching for "2"
> (not for "1") and TeXmacs-1.0.1 completely ignores all instances of
> "2" if they are returned from functions!!
> >From the user prespective, all displayed text should be searchable no
> matter whether a string comes from literal text directly, from
> macros or from functions. BTW, text stings returned by *macros* are
> perfectly searchable in TeXmacs-1.0.1. It is only functions that have a
> problem.

The "2" should not be searchable either, because you can't edit it.

One day, we might provide a function "full expand", which replaces
all functions applications by their return values. Then you might
search "2" in the result. We might also provide a read-only search,
so that you would find the "2"'s but such that you can't do anything
with it except copying it to the clipboard. In any case, these two
functionalities will not be implemented before the rewriter stuff
(in about six months at least).

> Probably I have to explain what I am doing. I wrote few scheme
> functions and a *.ts style file to cross link pdf, ps, ps.gz, ps.bz2,
> etc. files from any TeXmacs document. The user visible function
> 'link2' takes two arguments: the link-location and the
> link-text. Something like
> <link2|Files/radarmath.pdf|Bill Moran "Mathematics of Radar">
> The second argument is displayed in blue color, while the first is
> hidden. It is used by "action" primitive to open the link in an
> external viewer.  Recently, I realised that searching (C-s) ignores
> the link-text which, in my case, skips through authors and titles of
> my bibliography texmacs file rendering it virtually useless. I tried
> to redefine link2 as a macro. The link-text becomes searchable, but
> macro with a hidden first argument gives me terrible headache each
> time I want to edit link-location.

The point is that searchable text should be visible and editable.
If not, you indeed get a headache when you want to edit
the link location. I rather think that you would need two
different styles for your text: one with invisible link-text and
one with visible link-text.

> As I said earlier, a user would expect to search through all the text
> he/she sees on the screen. The text returned by functions is visually
> indistinguishable from the text entered directly.

In a structured editor, the user should expect to find matching
structure rather than matching visible text. For instance,
you don't expect to find a match for "Hi there" in the text
"<em|Hi> <em|there>", even though this text visually looks
similar to "<em|Hi there>".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]