Fwd: vimoutliner patch

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: vimoutliner patch

Steve Litt
Hi all,

I just got this. I don't understand what a quiet execution is, or how it
differs from normal executable lines. Any ideas?

SteveT

----------  Forwarded Message  ----------

Subject: vimoutliner patch
Date: Wednesday 30 August 2006 08:05 pm
From: Brian Lewis <[hidden email]>
To: [hidden email]

I submitted something like this a long time ago, but it didn't get
accepted. It adds _exeq_ (quiet execution) support.

--- vo_base.vim.backup  2006-08-30 19:01:28.000000000 -0500
+++ vo_base.vim 2006-08-30 17:03:22.000000000 -0500
@@ -528,12 +528,19 @@
 function Spawn()
                let theline=getline(line("."))
                let idx=matchend(theline, "_exe_\\s*")
-               if idx == -1
-                       echo "Not an executable line"
-               else
+               if idx != -1
                        let command=strpart(theline, idx)
                        let command="!".command
                        exec command
+               else
+                       let idx=matchend(theline, "_exeq_\\s*")
+                       if idx != -1
+                               let command=strpart(theline, idx)
+                               let command="silent !".command
+                               exec command
+                       else
+                               echo "Not an executable line"
+                       endif
                endif
 endfunction
 endif

-------------------------------------------------------

--
Steve Litt
Author:
   * Universal Troubleshooting Process courseware
   * Troubleshooting Techniques of the Successful Technologist
   * Manager's Guide to Technical Troubleshooting
   * Twenty Eight Tales of Troubleshooting
   * Rapid Learning: Secret Weapon of the Successful Technologist

http://www.troubleshooters.com/bookstore
http://www.troubleshooters.com/utp/tcourses.htm

(Legal Disclaimer) Follow these suggestions at your own risk.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: vimoutliner patch

Peter Princz
On 31/08/06, Steve Litt <[hidden email]> wrote:

> Hi all,
>
> I just got this. I don't understand what a quiet execution is, or how it
> differs from normal executable lines. Any ideas?
>
> SteveT
>
> ----------  Forwarded Message  ----------
>
> Subject: vimoutliner patch
> Date: Wednesday 30 August 2006 08:05 pm
> From: Brian Lewis <[hidden email]>
> To: [hidden email]
>
> I submitted something like this a long time ago, but it didn't get
> accepted. It adds _exeq_ (quiet execution) support.
>
> --- vo_base.vim.backup  2006-08-30 19:01:28.000000000 -0500
> +++ vo_base.vim 2006-08-30 17:03:22.000000000 -0500
> @@ -528,12 +528,19 @@
>  function Spawn()
>                 let theline=getline(line("."))
>                 let idx=matchend(theline, "_exe_\\s*")
> -               if idx == -1
> -                       echo "Not an executable line"
> -               else
> +               if idx != -1
>                         let command=strpart(theline, idx)
>                         let command="!".command
>                         exec command
> +               else
> +                       let idx=matchend(theline, "_exeq_\\s*")
> +                       if idx != -1
> +                               let command=strpart(theline, idx)
> +                               let command="silent !".command
> +                               exec command
> +                       else
> +                               echo "Not an executable line"
> +                       endif
>                 endif
>  endfunction
>  endif
>
> -------------------------------------------------------
>
> --
> Steve Litt

Hi Steve,

I got it.
It prepends :silent before the !, when recognises the _exeq_ token
instead of _exe_.

This is the key:
original: let command="!".command
patch:  let command="silent !".command

Consult  :help :silent to see what exactly it does.
Makes sense on Windows at least when you don't want windows to bubble
up just to be closed. :)

Have a nice day,
  Peter

--
Keep cool. Develop in total darkness.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: vimoutliner patch

Peter Princz
On 31/08/06, Peter Princz <[hidden email]> wrote:

> On 31/08/06, Steve Litt <[hidden email]> wrote:
> > Hi all,
> >
> > I just got this. I don't understand what a quiet execution is, or how it
> > differs from normal executable lines. Any ideas?
> >
> > SteveT
> >
> > ----------  Forwarded Message  ----------
> >
> > Subject: vimoutliner patch
> > Date: Wednesday 30 August 2006 08:05 pm
> > From: Brian Lewis <[hidden email]>
> > To: [hidden email]
> >
> > I submitted something like this a long time ago, but it didn't get
> > accepted. It adds _exeq_ (quiet execution) support.
>
> ...

> Hi Steve,
>
> I got it.
> It prepends :silent before the !, when recognises the _exeq_ token
> instead of _exe_.
>
> This is the key:
> original: let command="!".command
> patch:  let command="silent !".command
>
> Consult  :help :silent to see what exactly it does.
> Makes sense on Windows at least when you don't want windows to bubble
> up just to be closed. :)
>
> Have a nice day,
>   Peter
>

Steve and list,

I just applied the patch (had to do it by hand, because I already did
some tinkering on the file), and it works fine. Now I have _exe_ and
_exeq_.

To Brian, the OP: good idea, thank you!

Have a nice day,
  Peter

--
Keep cool. Develop in total darkness.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: vimoutliner patch

Steve Litt
On Thursday 31 August 2006 05:04 am, Peter Princz wrote:

> On 31/08/06, Peter Princz <[hidden email]> wrote:
> > On 31/08/06, Steve Litt <[hidden email]> wrote:
> > > Hi all,
> > >
> > > I just got this. I don't understand what a quiet execution is, or how
> > > it differs from normal executable lines. Any ideas?
> > >
> > > SteveT
> > >
> > > ----------  Forwarded Message  ----------
> > >
> > > Subject: vimoutliner patch
> > > Date: Wednesday 30 August 2006 08:05 pm
> > > From: Brian Lewis <[hidden email]>
> > > To: [hidden email]
> > >
> > > I submitted something like this a long time ago, but it didn't get
> > > accepted. It adds _exeq_ (quiet execution) support.
> >
> > ...
> >
> > Hi Steve,
> >
> > I got it.
> > It prepends :silent before the !, when recognises the _exeq_ token
> > instead of _exe_.
> >
> > This is the key:
> > original: let command="!".command
> > patch:  let command="silent !".command
> >
> > Consult  :help :silent to see what exactly it does.
> > Makes sense on Windows at least when you don't want windows to bubble
> > up just to be closed. :)
> >
> > Have a nice day,
> >   Peter
>
> Steve and list,
>
> I just applied the patch (had to do it by hand, because I already did
> some tinkering on the file), and it works fine. Now I have _exe_ and
> _exeq_.
>
> To Brian, the OP: good idea, thank you!
>
> Have a nice day,
>   Peter

Hi Peter,

Did you use it on Windows, or Linux? On my Mandriva 2006 machine, I get no
popup OK box, but instead get a little message at the bottom of the graphical
Vim window.

I assume Brian's idea is to have ,,e work on either _exe_ or _exeq_. I like
the idea that it doesn't require another comma comma command.

If we include it, one thing we need to be sure of is that, on Windows, Linux
graphical (gvim) and Linux CLI (vim),  that _exeq_ does the right thing when
confronted with ,,e.

I implemented the patch on my machine, and tested both an _exe_ and an _exeq_.
They both appeared to work just right in gvim and vim in a gui terminal when
spawning a graphical program. When spawning a CLI program (umenu or ls |
less), gvim hung (looked like an infinite loop from the way it was blinking)
on gvim, and worked reasonably well with vim in a gui terminal, but upon
exiting the CLI program, it looked like you hadn't exited -- you need to know
to press Ctrl+L to refresh the screen.

In pure CLI mode (no X), obviously spawning a gui program didn't work, but
spawning a CLI program didn't infinite loop. The lack of feedback after
exiting the CLI program was still an issue.

If we implement this, I think it should be as an option, with the default
option being to treat _exeq_ exactly like _exe_, and only if someone flips a
bit does it behave quietly. This will prevent a lot of confusion when people
pass outlines back and forth. Of course, on the other hand, if we do that
people might think of _exe_ and _exeq_ as synonomous, which we REALLY don't
want.

Having never used VO in Windows, I haven't gotten to see this patch in the
environment where it really does good.

Other feedback?

Thanks

SteveT

Steve Litt
Author:
   * Universal Troubleshooting Process courseware
   * Troubleshooting Techniques of the Successful Technologist
   * Manager's Guide to Technical Troubleshooting
   * Twenty Eight Tales of Troubleshooting
   * Rapid Learning: Secret Weapon of the Successful Technologist

http://www.troubleshooters.com/bookstore
http://www.troubleshooters.com/utp/tcourses.htm
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: vimoutliner patch

Peter Princz
Hi Steve,

see my answers and comments inline.

>
> Hi Peter,
>
> Did you use it on Windows, or Linux? On my Mandriva 2006 machine, I get no
> popup OK box, but instead get a little message at the bottom of the graphical
> Vim window.

I was referring strictly to Windows. Currently I use vimoutliner on
Windows only and there is a window bubbling up with every shell
invocation. Sometimes it's desired to see it and close it manually,
but sometimes it's annoying.

>
> I assume Brian's idea is to have ,,e work on either _exe_ or _exeq_. I like
> the idea that it doesn't require another comma comma command.

Exactly. It just changes your "if" construct, and ,,e will recognise
both _exe_ and _exeq_. Simple and elegant.

Now your spawn() looks like this on my computer, after appying the patch:

"...
function Spawn()
        let theline=getline(line("."))
        let idx=matchend(theline, "_exe_\\s*")

        " was:
        " if idx == -1
        " echo "Not an executable line"
        " else
        " let command=strpart(theline, idx)
        " let command="!".command
        " exec command
        " endif
       
        " patch:
        if idx != -1
                let command=strpart(theline, idx)
                let command="!".command
                exec command
        else
                let idx=matchend(theline, "_exeq_\\s*")
                if idx != -1
                        let command=strpart(theline, idx)
                        let command="silent !".command
                        exec command
                else
                        echo "Not an executable line"
                endif
        endif
endfunction
..."

>
> If we include it, one thing we need to be sure of is that, on Windows, Linux
> graphical (gvim) and Linux CLI (vim),  that _exeq_ does the right thing when
> confronted with ,,e.

Yes, your standard testing procedures shall be applied before
releasing it to the public. But I can't do that. I can only comment it
works as expected on windows2000sp4, vo over gvim7 that I have.

Have a nice day,
  Peter

--
Keep cool. Develop in total darkness.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner