poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] .editor: Do nothing if not running from the repl


From: Jose E. Marchesi
Subject: Re: [PATCH] .editor: Do nothing if not running from the repl
Date: Sat, 29 Feb 2020 14:26:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi John.
OK for master.
Thanks!

    ---
     ChangeLog       | 5 +++++
     doc/poke.texi   | 1 +
     src/pk-editor.c | 5 +++++
     3 files changed, 11 insertions(+)
    
    diff --git a/ChangeLog b/ChangeLog
    index c3d305ef..5ce99a73 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,3 +1,8 @@
    +2020-02-29  John Darrington <address@hidden>
    +
    +   * src/pk-editor.c (pk_cmd_editor): Do nothing if not
    +   running interactively.
    +
     2020-02-29  John Darrington <address@hidden>
     
        * src/poke.c (parse_args): Move assignment of poke_interactive_p
    diff --git a/doc/poke.texi b/doc/poke.texi
    index 6951db15..aa50ff28 100644
    --- a/doc/poke.texi
    +++ b/doc/poke.texi
    @@ -590,6 +590,7 @@ invokes an external text editor on a temporary file.  
You can then
     put contents on that file, save it and exit the editor.  At that point
     poke will read the file contents, turn them into a single line and
     execute them in the repl.
    +If poke is not running interactively, then @command{.editor} does nothing.
     
     The editor used is identified by the @code{EDITOR} environment
     variable.
    diff --git a/src/pk-editor.c b/src/pk-editor.c
    index 79232ae0..fd7664c4 100644
    --- a/src/pk-editor.c
    +++ b/src/pk-editor.c
    @@ -22,6 +22,7 @@
     #include <stdlib.h>
     #include <tmpdir.h>
     
    +#include "poke.h"
     #include "pk-cmd.h"
     
     #include "findprog.h"
    @@ -35,6 +36,10 @@ pk_cmd_editor (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
       int des;
       FILE *f;
     
    +  /* Do nothing (succesfully) if not in interactive mode.  */
    +  if (!poke_interactive_p)
    +    return 1;
    +
       /* editor */
       assert (argc == 0);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]