Re: concatenation of two elements not working

Hussein Shafie <[email protected]> Mon, 18 Oct 2021 15:43:54 +0200
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
Monika M. wrote:
> 
> I tried to write two commands. One for "DELETE" and one for "BACK_SPACE".
> 
> These are my commands:
> <cfg:binding>
> <cfg:keyPressed code="BACK_SPACE"/>
> <cfg:command name="deleteSelectionOrJoinBlockOrDeleteChar" 
> parameter="backwards"/>
> </cfg:binding>

Correct.



> and
> <cfg:binding>
> <cfg:keyPressed code="BACK_SPACE"/>
> <cfg:command name="deleteSelectionOrJoinBlockOrDeleteChar"/>
> </cfg:binding>

It's code="DELETE", not code="BACK_SPACE" for this one.

(This is the only specification which is consistent with the DeleteChar 
part of the command.)




> 
> I expected that these command will delete characters, which they do.
> 
> But I also expected them to join elements like paragraphs, which they 
> don't do.
> I.e. I wanted to join the elements <para> to one <para> with all the 
> text, when I set the cursor to the beginning of the second para and 
> press the delete-button:

Press the BACK_SPACE key at the *beginning* of *second* para, not the 
DELETE key.

Alternatively move the caret to the *end* of *first* para and press the 
DELETE key.




> <para>abc</para>
> <para>def</para>
> -> should be <para>abcdef</para>
> 
> Also in this case both para-elements should be joined after setting the 
> cursor at the beginning of the second para and pressing the delete-button.
> <list>
> <point>
> <para>Part 1</para>
> <para>Part 2</para>
> </point>
> </list>
> 
> Could you please tell me why joining to paragraphs is not working in my 
> case?
> 

Moreover, for block-related commands like 
"deleteSelectionOrJoinBlockOrDeleteChar" to work, your configuration 
file must contain a <cfg:property> called "$c blockList" (where $c is 
automatically replaced by the name of the configuration):

DocBook v5 example:
---
   <property name="$c blockList">
     {http://docbook.org/ns/docbook}bridgehead=heading
     {http://docbook.org/ns/docbook}simpara
     {http://docbook.org/ns/docbook}term
     {http://docbook.org/ns/docbook}para=paragraph

{http://docbook.org/ns/docbook}itemizedlist/{http://docbook.org/ns/docbook}listitem

{http://docbook.org/ns/docbook}orderedlist/{http://docbook.org/ns/docbook}listitem
     {http://docbook.org/ns/docbook}callout
     {http://docbook.org/ns/docbook}step
   </property>

   <binding>
     <keyPressed code="DELETE" />
     <command name="deleteSelectionOrJoinBlockOrDeleteChar" />
   </binding>

   <binding>
     <keyPressed code="BACK_SPACE" />
     <command name="deleteSelectionOrJoinBlockOrDeleteChar"
              parameter="backwards" />
   </binding>
---

This is documented.

See "24. deleteSelectionOrJoinBlockOrDeleteChar", 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/deleteSelectionOrJoinBlockOrDeleteChar.html

See "50.1. Specifying splittable blocks", 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/splittable_blocks_spec.html



--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support