bugGNU TeXmacs - Bugs: bug #58346, A macro OR tree-at-end? function...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58346: A macro OR tree-at-end? function bug

Submitter:  chai xx <susoren>
Submitted:  Mon 11 May 2020 01:54:15 AM UTC
   
 
Category:  Editor Priority:  5 - Normal
Item Group:  Error Status:  Works For Me
Privacy:  Public Assigned to:  vdhoeven
Originator Name:  Open/Closed:  Closed
Release:  None Release: 
Fixed Release:  None Fixed Release: 
Keywords: 

Sat 24 Oct 2020 04:47:53 PM UTC, comment #2: 

I think that (tree-at-end? t) will test whether you are just behind your demo tag (since this cursor position is available). You probably wish to check whether the cursor is inside the last child of the demo tag, which is not the same thing.

Note that you may look at the structured-left/right/etc. macros in order to see how to implement this kind of thing.

Joris van der Hoeven <vdhoeven>
Group administrator
Mon 11 May 2020 11:48:53 AM UTC, comment #1: 

Are you sure that the focus-tree is on 'demo and not on 'arg? 'traverse-next seems to look for the next similar tag, which would be an arg. So it seems to me that you would have to check the parent maybe, instead of t itself.

Massimiliano Gubinelli <mgubi>
Group administrator
Mon 11 May 2020 01:54:15 AM UTC, original submission:  

I start to play with macros in texmacs. I encounter a problem:
I have this macro defined
  <assign|demo|<macro|w|x|y|z|R<rsub|<arg|w> <arg|x> <arg|y> <arg|z>>>>
which basically assign \demo to the math $R_{i j k l}$ with $i j k l$ being inserted by me when macro expands.
I want to have a shortcut to move from one parameter to the next parameter, so I defined the following:
(kbd-map
  (:mode in-math?)
  ("C-h"
   (let ((t (focus-tree)))
     (if
      (and (tree-in? t '(demo))
           (not (tree-at-end? t)))
      (traverse-next)
      (set-message "Tree is end" "Tree is end")))))
I noticed that when I moved to the second argument using C-h key, it already displays an “Tree is end” message.
This may be a bug!

chai xx <susoren>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #49055:  macro-upload.tm added by susoren (874B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by vdhoeven (Updated the item)
  • -email is unavailable- added by mgubi (Posted a comment)
  • -email is unavailable- added by susoren (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-24 vdhoeven StatusNone Works For Me
        Assigned toNone vdhoeven
        Open/ClosedOpen Closed
    2020-10-23 vdhoeven Item GroupNone Error
    2020-05-11 susoren Attached File- Added macro-upload.tm, #49055

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code