You are not logged in.

#176 2013-06-22 11:39:01

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Ha! I just came to the same conclusion. Seems to be working well now smile

Thanks for your help!

Offline

#177 2013-06-29 23:16:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

I just added a companion tool to interrobang that I've called percontation.  A percontation point is an 'irony mark', and it fits as bash's completion ironically does not complete well in some cases.

Previously we threw together a workaround for appending the trailing slash to directory names (which bash completion is supposed to do according to the manual  page, but it doesn't).  More recently there was an issue with bash keywords and functions coming up in completion options.  There are parameters for bash completion in the man page that should prevent these from being produced - but this does not work as advertised.

So rather than scripting yet uglier workarounds, I started from scratch and wrote my own completion tool.  Good news for users of other shells, if 'percontation' works as it should, there will be no need to have bash installed to get completion.

Percontation, though, is hot off the keyboard and will need some real testing.  It's in the default rc file on github now, but it is commented out.  It should be a 'opt-in' activation until it gets at least a little testing.  If it seems to work well, then it will become the default and bash completion will be an optional choice for users who want to write other creative completion bits.  (EDIT: these have now been swapped.  Percontation seems to work well enough, so it has become the default, but compgen can easily be substituted in).

On that note, though, as I wrote percontation it will be very easy for me to customize it to meet any needs that were previously out of reach as bash couldn't do it.

But this also means I can no longer blame things on bash! neutral

Last edited by Trilby (2013-07-07 17:33:50)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#178 2013-06-30 14:42:02

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Hmm. I just tried it out on the command-line (e.g. "percontation le"), and so far I am not getting any results; only an return code 1.

Should it work when invoked directly from the command-line?

Offline

#179 2013-06-30 15:24:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Yes, but it needs to be given two parameters as in the example in the rc.  Try `percontation "" le`.

The first parameter is the prefix, or everything except for the last word to be completed, the second parameter is the item to actually complete.

So if you wanted to open a pdf with mupdf and you already had typed "mupdf docs/pdfs/Ma" you'd want it to look for files in that path starting with Ma... not for programs actually named "mupdf docs..." as there is no such thing.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#180 2013-06-30 17:45:21

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Interrobang: a tiny menu packing a big bang (syntax)

Thx for the new updates will try it today

is there any news on the remember most used items and queue them up in completion?

another thing i think would be super cool is a C-r like bash function where it would go through history, IE if i have 'firefox' in the history and press C-r 'f' firefox comes up and then then next C-r 'fXXX' etc, just a thought

thx again for Interrobang , just love it

Best

Z

Offline

#181 2013-06-30 18:16:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

I believe the completion line that was a few posts up works for history - this is also (commented out) in the interrobangrc on github.  I don't use history like this, so I haven't done much testing with it except to check that it works under typical settings.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#182 2013-07-01 03:13:04

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

@Trilby Got it. Working much better now! I'll let you know if I run into any issues.

@zeltek Here is how I set up my configuration to keep track of history:

run_hook     cmd="%s"; ($cmd && echo $cmd >> ~/.interrobang_history) || (notify-send "Error: command not found"; interrobang)
TAB() pre="%s"; str="%s"; [[ -z "$pre" ]] && (grep "$str" ~/.interrobang_history | sort | uniq -c | sort -r | awk '{print $2}'; percontation "$pre" $str) | awk ' !x[$0]++' | head -5

You can leave out the "|| ..." part in the first command: that is something I added to deal with invalid commands.

Cheers,

Offline

#183 2013-07-01 06:31:55

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Trilby, the new completion engine works like a charm for command completion. Nice work!

All the best,

-HG

Last edited by HalosGhost (2013-07-05 16:11:15)

Offline

#184 2013-07-05 16:12:02

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Hey Trilby, I have a question to ask of you regarding percontation. For starters my completion setup appears as so:

run_hook        cmd="%s"; ($cmd && echo $cmd >> $XDG_CONFIG_HOME/interrobang/history) || (notify-send "Error: command not found")
TAB()           pre="%s"; str="%s"; [[ -z "$pre" ]] && (grep "$str" $XDG_CONFIG_HOME/interrobang/history | sort | uniq -c | sort -r | awk '{print $2}'; percontation "$pre" $str) | awk ' !x[$0]++' | head -7

I also have autocomp and show options enabled. Furthermore, I have your recommended "calc" bang set up. However, when I run it, the bang appears with my entered formula still intact, and the right-hand completion zone shows the answer to my formula along with the bang. To illustrate, the following formula remains on the left-hand side of interrobang, unchanged after it is typed in:

:calc 4*(84+9)

Then, on the right-hand side of interrobang, I see the following:

:calc 372>

Unfortunately, this removes the nice ability we had previously of being able to use the answer from the entered formula to begin a new formula. And, though this loss of functionality isn't really so terrible, the output on the completion zone isn't really that pretty (ideally, the bang wouldn't show, just the answer).

Thoughts?

All the best,

-HG

Offline

#185 2013-07-05 16:41:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

So you want to have your cake and eat it to?

Good news, you can ... and I thought I had already done this, but the code wasn't on github - I just redid it (quickly, so could be buggy) and pushed to github.

To "calculate" just hit tab.  Also this makes tab in autocomplete mode a 'fill' button, meaning it takes the first completion option and puts it on the input line.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#186 2013-07-05 16:44:16

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Trilby wrote:

So you want to have your cake and eat it to?

Yes, please smile

Good news, you can

Awesome!

... and I thought I had already done this, but the code wasn't on github - I just redid it (quickly, so could be buggy) and pushed to github.

To "calculate" just hit tab.  Also this makes tab in autocomplete mode a 'fill' button, meaning it takes the first completion option and puts it on the input line.

That works great! Is there any chance of cleaning up the auto-comp zone? (Just having a way to make the ":calc" go away would be awesome) I recognize that this is completely 100 percent cosmetic, so I understand if that's not a priority.

All the best,

-HG

Offline

#187 2013-07-05 16:53:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Oh, so now you want icing on that cake too ...

I don't think this is possible.  The completion options are what will replace the input line.  Certainly you could change it so that "!calc" was not included, that would actually be very easy.  But then you would not be able to use it iteratively.  You'd type "!calc 5+3" and the answer "8" would show in the options, but then if you hit tab, your input line would just be "8".

I suppose I could put a "last word" option into interrobang to track the full line, but only display the end.  I'll have to think about that.

Pull the last changes, and enjoy your icing.

Last edited by Trilby (2013-07-05 17:05:05)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#188 2013-07-05 17:30:08

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Trilby wrote:

Oh, so now you want icing on that cake too ...

Icing is wonderful!

I don't think this is possible.

I believe in you!

Pull the last changes, and enjoy your icing.

Woo! Iced cake! Seriously, though, this is wonderful. Thank you for your awesome work, as always!

All the best,

-HG

Offline

#189 2013-07-06 01:46:46

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Here's an extra idea for the last word option. How difficult would it be for it to take a list of items where each item is the name of a bang (without the bangchar?) for which "last word" will be applied in the auto-comp zone?

If that's too difficult, then so be it. If not, it may allow for a more modular approach to the completion options.

All the best,

-HG

Offline

#190 2013-07-06 17:08:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

I've just rewritten interrobang's configuration code.  There is a completely new format for the config file - make sure you revise (or just rewrite) your own config.

The old format started when there were only a couple items to be set, and it was getting uglier and uglier as new options were added.

The new configuration mechanism also allows for a much nicer solution for the above problem: any option that can be set in a config file can be overriden on the command line with the option -opt followed by the line that would go in a different config.

So, for example, if you have all your config stuff set up just the way you want it including last = true (formerly last_word) but you need to call interrobang *without* using the last word setting, you don't need a whole new config file, just invoke as follows:

interrobang -opt "set last = false"

These settings are flexible with 'whitespace' - it can be one space, many spaces, or tab(s), but the tokens must be separated by whitespace of some sort.  The following would not work:

interrobang -opt "set last=false"

Anyone who has followed the need for this (from alopex) can use the following line in their alopex key binding for windowlist:

 ...,    windowlist,    "interrobang -opt \"set last = false\" alopex" },

Last edited by Trilby (2013-07-06 17:09:56)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#191 2013-07-06 17:48:48

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,095
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Okay, I have a list of reactions about this:

  1. The new format is gorgeous

  2. I now have all the cake and I'm eating most of it

  3. I must away to go test this new windowlist feature

TL;DR: awesome work!

All the best,

-HG

Offline

#192 2013-07-07 01:24:40

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Interrobang: a tiny menu packing a big bang (syntax)

Hey Trilby can you explain the six colors in the new configuration? The former config only had three (including the border).

edit: BTW I noticed that when you get multiple choices you can navigate using the arrow keys but the left key does nothing. So there are two keys to go forward (up and right) and only one for backwards (down).

edit 2: Now I realized why the previous behavior occurs. The left and right arrows also control the cursor position for what you're typing.

Last edited by anonymous_user (2013-07-07 01:31:17)

Offline

#193 2013-07-07 01:55:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Sure, documentation is the biggest todo on the list before a real versioned release could be ready.  The colors are default foreground and background for each of normal text, completion options, and the selected completion option.  The last four are only relevant (or needed) if you use list=true.

I'll double check the keys too, something is funny.  Only the up and down arrows should selection completion options, but left and right seem to be pulling double duty at the moment.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#194 2013-07-07 12:22:05

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

I realize the key movement is under development right now but, if I may request, can the "Tab/Shift-Tab" keys be used to navigate list selections and "Right/Left" keys be used to navigate cursor position on input text?  I'm just really missing the tab feature for cycling completion -- such as pressing tab once gets closest value and pressing tab again cycles to next value, etc.

Thanks for the great work, by the way.

Last edited by milomouse (2013-07-07 12:24:08)

Offline

#195 2013-07-07 14:25:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

I just read that and was confused - that is the way it should be, but I see something is quite broken.  That should be back up and running soon.

I think I broke it in allowing the list=true or show_options setting.  I set tab to fill in the current selected item, but that conflicts with the previous behavior when there is no list.

The intended behavior that should be back soon is tab/shift-tab or up/down will cycle through completition options, left/right will move the cursor only, and I'll need a new key for filling in in the selected item for when list=true (that tab is currently doing).  I'll probably make that a control-key (Ctrl-A perhaps).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#196 2013-07-07 16:42:34

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Yeah, I thought so since I updated and had to redo the config and noticed that the keys were acting strange.  I thought perhaps you were making other changes so I voiced a request to keep things the way they were.  Glad to know it's just a glitch and previous functionality will return soon.  smile   Thanks

Edit:
By the way, what is "percontation" in interrobangrc?  When I use that for 'tab default' and press 'tab' the bar closes.  If I use 'compgen' instead I will get tab completions.

Last edited by milomouse (2013-07-07 16:44:29)

Offline

#197 2013-07-07 17:05:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

https://bbs.archlinux.org/viewtopic.php … 4#p1294204

Are you building from the PKGBUILD and/or makefile?  I just tied with a default completer of a program that doesn't exist, and the bar closed when I hit tab too.  So it looks like percontation didn't get installed with interrobang on your system.  There is no need for it - but as I wrote it, I can continue to improve it as needed, while compgen will just keep doing what it does for better or worse.

EDIT: I just pushed an update that should have the keys back in working order, though I still need to do some testing of it.

Last edited by Trilby (2013-07-07 17:31:26)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#198 2013-07-07 17:31:10

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Trilby wrote:

Are you building from the PKGBUILD and/or makefile?  I just tied with a default completer of a program that doesn't exist, and the bar closed when I hit tab too.  So it looks like percontation didn't get installed with interrobang on your system.  There is no need for it - but as I wrote it, I can continue to improve it as needed, while compgen will just keep doing what it does for better or worse.

*facepalm*  It's my fault -- I didn't build 'percontation' from your sources; only 'interrobang'.  percontation is working in the interrobangrc now.  Sorry for the static.

Offline

#199 2013-07-07 17:34:44

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Interrobang: a tiny menu packing a big bang (syntax)

Trilby wrote:

EDIT: I just pushed an update that should have the keys back in working order, though I still need to do some testing of it.

Aha!  It works great so far.  Thanks smile

Offline

#200 2013-07-07 19:12:06

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Interrobang: a tiny menu packing a big bang (syntax)

Hi again guys

wow a long 4th of july weekend , and then coming back and a shitload of interroband updates/changes , nice smile

i am (as usual smile) a bit confused now and have a few question if you guys done mind

1)how does one use other fonts? i tried using this line with no sucess

#set font      = Source Code Pro-12

2)im still struggling with getting history and "remember most used items and present them first" to work, and now with the new config im completly lost.
do i need to put this:

run_hook        cmd="%s"; ($cmd && echo $cmd >> $XDG_CONFIG_HOME/interrobang/history) || (notify-send "Error: command not found")
TAB()           pre="%s"; str="%s"; [[ -z "$pre" ]] && (grep "$str" $XDG_CONFIG_HOME/interrobang/history | sort | uniq -c | sort -r | awk '{print $2}'; percontation "$pre" $str) | awk ' !x[$0]++' | head -7

somwhere in my new config? i know these are probably idiotic questions but im not a programmer just a simple user who really likes the idea of interrobang

thx alot in advance

Offline

Board footer

Powered by FluxBB