Menu

#113 e_menu question

3.x
closed
nobody
None
2019-05-23
2019-05-17
No

today I tried your e_menu on geany, I wanted to ask you something but I found only this way to contact you.
I wanted to try e_menu because I wanted to see if I could handle fossil scm.
I downloaded the source from the geany page https://wiki.geany.org/howtos/using_with_tcl_tk but I didn't find the fossil menus inside, so I downloaded the tke pack from here and take the fossil.mnu fro this package.
it seems that e_menu works (I use this command for contextual action "wish /home/vinnie/.config/geany/plugins/emenu/e_menu.tcl "s=%s" "m=/home/vinnie/.config/geany/plugins/emenu/menus/menu.mnu" "fs=20" "c=1"" ) .
Put the path used by fossil (wildcard %PD) is always the one corresponding to the path where geany is launched (in my case /home/vinnie).
I tried to use the wildcard %d both in the command of the contextual action (with "PD=%d" as an option), and directly within fossil.mnu but in both cases I always get my home as a path.
I have also tried with the wildcard %w but this is taken literally without any expansion in a directory.

I understand that this is a problem of geany and not of tke, but I did not know where to ask :)
Thanks!

Discussion

  • vinnie costante

    vinnie costante - 2019-05-17

    P.s. my attempt is to have the path of the source currently edited as a context for fossil commands

     
  • Alex Plotnikov

    Alex Plotnikov - 2019-05-19

    Hi,

    As for Geany, its standard context menu has only %s wildcard to supply for e_menu. Though, I overcome this restriction with some modifications described here:
    https://wiki.tcl-lang.org/page/mulster%2C+multi-line+replacements+in+text

    These changes allow to have the following Geany context menu command:

    wish ~/SOMEDIR/e_menu/e_menu.tcl md=~/SOMEDIR/e_menu/menus m=menu.mnu "f=%d/%f" "F=%f" "d=%d" PD=~/SOMEDIR/e_menu_PD.txt "s0=%f" "s1=%d" s=%s ed=geany z1=~/.tke/e_menu/e_menu "z2=%f" z5=~

    i.e. f= (file name), d= (file's directory) arguments are available now. It's mostly interesting. Also, the Geany's restriction of non-called context when nothing selected is overcome as well.

    The results are seen in the attachments.

    The above mentioned ~/SOMEDIR/e_menu_PD.txt has the following contents:

    /home/apl/PG/Tcl-Tk/projects
    /home/apl/TKE-clone/TKE-clone
    /home/apl/.tke
    

    It's in fact a list of directories under fossil/mercurial control. So any file/directory located in or under these directories is available for fossil/mercurial processing.

    Well, I should update e_menu's help, as the page https://wiki.geany.org/howtos/using_with_tcl_tk is obsolete - as well as its attached rar, so you acted absolutely properly when downloaded e_menu from TKE code page.

    I would make the help updated, probably in this week.

     
  • vinnie costante

    vinnie costante - 2019-05-19

    Okay, thanks for the intervention. I'd like to ask you a few more things about this:

    How will it be possible to overcome the limit of geany of non-called context when nothing selected (you need to make some changes to geany?)

    I don't know if I understand well (maybe not!) but I can't directly run the tke editor scripts, the only thing I did was steal the fossil menus but all the rest is the package downloaded from the geany site: This is the detailed error when i try to direcly run e_menu.tcl of tke in geany :

    can't read "silent": no such variable
    can't read "silent": no such variable
        while executing
    "if {$silent < 0} {
            em_message "ERROR of running\n\n$sel\n\n$e"
            set ret false
          }"
        (procedure "shell0" line 27)
        invoked from within
    "shell0 $sel $amp"
        (procedure "shell1" line 6)
        invoked from within
    "$c1 $typ "$seltd" $amp $silent "
        (procedure "shell_run" line 39)
        invoked from within
    "shell_run $from $typ shell1 $s1 $amp"
        (procedure "shell" line 2)
        invoked from within
    "shell $typ $s1 $amp "button""
        (procedure "::em::shell_button" line 2)
        invoked from within
    "{*}$comm"
        (procedure "::em::pr_button" line 7)
        invoked from within
    "::em::pr_button 3 ::em::shell RE: s= & "
        invoked from within
    ".frame.butt3 invoke"
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 [list $w invoke]"
        (procedure "tk::ButtonUp" line 22)
        invoked from within
    "tk::ButtonUp .frame.butt3"
        (command bound to event)
    

    So, maybe you already know (you are the developer!) but even if the plugin version here on sourceforge is the latest one, it doesn't work directly as it is on geany!

    for the rest I attend the update, thank you very much!

     

    Last edit: vinnie costante 2019-05-19
  • Alex Plotnikov

    Alex Plotnikov - 2019-05-20

    The issue with 'silent' was fixed in the last version of e_menu, as seen here: https://sourceforge.net/p/tke/code/ci/7145179d78b93ac0724b581ef5e64b590eab8cc5/

    Please try and download the last version of e_menu, e.g. from:
    https://sourceforge.net/p/tke/code/ci/default/tree/plugins/e_menu/e_menu/
    ...or you can download a current snapshot of TKE by 'Download Snapshot' button from:
    https://sourceforge.net/p/tke/code/ci/default/tree/
    ...after some minutes waiting:( and pull out 'e_menu' from it.

    (the 'Download' page of TKE provides only TKE 3.6 stable release with the issue not fixed else)

    As for Geany's context menu, yes , all fixes described in
    https://wiki.tcl-lang.org/page/mulster%2C+multi-line+replacements+in+text
    should be introduced to Geany manually (or with the described 'mulster', effortless).

    The fixes include:
    1) using %f, %e, %d wildcards of Geany to supply a current (edited in Geany) file name and its directory to the context command (e.g. to e_menu:)
    2) enabling the context command while there is no selection (the cursor is set on spaces)

    Perhaps, I could help you with those changes to Geany. Though, TKE tickets doesn't well fit for this stuff, so you might contact with me through 'gmail' where my mail-box is 'aplsimple'.

     

    Last edit: Alex Plotnikov 2019-05-20
  • vinnie costante

    vinnie costante - 2019-05-20

    Okay, I didn't understand very well the last time, so I do that, I try to understand well the procedure in the text you passed me and if I can not solve, I try to ask for help in private.
    Thank you very much :)

     
  • Alex Plotnikov

    Alex Plotnikov - 2019-05-23
    • status: open --> closed
     

Log in to post a comment.