texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] In function "edit_dynamic_rep::make_hybrid": why "if (


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] In function "edit_dynamic_rep::make_hybrid": why "if (selection_active_small ())"?
Date: Thu, 3 Nov 2005 17:20:14 +0100
User-agent: Mutt/1.5.9i

On Thu, Nov 03, 2005 at 04:31:23PM +0100, Norbert Nemec wrote:
> I often wonder about the behavior of the "\" key that seems to have
> changed over the past few versions.
> 
> In TeXmacs-1.0.5.11-R2/src/Edit/Modify/edit_dynamic.cpp, I read:
> 
> ---------------------
> void
> edit_dynamic_rep::make_hybrid () {
>   tree t (HYBRID, "");
>   if (selection_active_small ())
>     t[0]= selection_get_cut ();
>   if (is_func (t, HYBRID, 1) && (t[0] != "") &&
>       (!(is_atomic (t[0]) && drd->contains (t[0]->label))))
>     t= tree (HYBRID, "", t[0]);
>   path p= end (t, path (0));
>   if (in_source ()) insert_tree (t, p);
>   else insert_tree (tree (INACTIVE, t), path (0, p));
>   set_message ("return: activate symbol or macro", "hybrid");
> }
> -------------------
> 
> The first if-query seems to suggest, that it is intended that small
> selections are included inside the hybrid while larger selections are
> ignored. Effectively that means, that I can easily add markup to single
> lines, but not to multiple lines, even though many markup tags (e.g.
> <bf|...>) work very well even for multiple paragraphs.
> 
> Is the "if (selection_active_small ())" necessary by principle or could
> it be relaxed?

It is not really "necessary", but significant modifications in the typesetter
would be needed in order to make it possible to deal with multi-paragraph 
content.
Since one of my next projects for TeXmacs (next year) is to thoroughly rewrite
the typesetter, this change would be easier to make later on.

Best wishes, Joris




reply via email to

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