[Top][All Lists]

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

[PATCH] poke: copy-pasteable prompt

From: apache2
Subject: [PATCH] poke: copy-pasteable prompt
Date: Wed, 16 Mar 2022 18:51:49 +0100
User-agent: Mutt/1.9.3 (2018-01-21)

Here are my two patches for the poke prompt.

1) The first fixes a perceived bug: The '.editor' command
does not use pk_prompt() to display the user's prompt;
instead it emits a hardcoded "(poke) " string.

   We already have some customization in pk_prompt() to
   print something related to maps/io spaces (I must admit
   the exacty details are a bit fuzzy to me right now).

   Anyway, with this patch, .editor prints the same as all
   the other commands.

   To do this I had to export the pk_prompt() function
   by removing the 'static' attribute.
   This patch seems fairly uncontroversial to me.

2) "Commented prompt" mode.
   I found it very neat to be able to copy-paste entire lines
   from poke REPL by double-clicking, and I found it awkward to
   have to take care to remove the "(poke)" from each line.

   This patch adds a boolean setting "prompt-commented" which,
   when set, prints "#!" and "!#" instead of "(poke" and ")".

   The #!!# are parsed/tokenized as "shebang comments" which
   are ignored by the parser. The ultra-brief example is:

     #!!# .file foo.o
     #![dwarf,elf]!# 1+2;

   Which when copy-pasted in it's entirety is equivalent to:

     .file foo.o

   Thus saving the user some mouse acrobatics.

   I've had this enabled in my ~/.pokerc for some weeks with
   no issues and lots of joy.


reply via email to

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