poke-devel
[Top][All Lists]
Advanced

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

[PATCH] pk-repl: inform the inputrc parser of the program name


From: Arsen Arsenović
Subject: [PATCH] pk-repl: inform the inputrc parser of the program name
Date: Tue, 18 Oct 2022 17:07:20 +0200

This allows users to conditionally adjust their readline preferences
based on whether they're using Poke.

2022-04-08  Arsen Arsenović  <arsen@aarsen.me>

        * poke/pk-repl.c: Set rl_readline_name to "Poke", to inform the
        inputrc parser about who we are.
---
Afternoon,

This patch should permit the use of the $if construct in .inputrc to create
Poke-specific readline adjustments, for example:

        set editing-mode vi
        set show-mode-in-prompt on

        $if Poke
        set editing-mode emacs
        set show-mode-in-prompt off
        $endif

Thanks.

 poke/pk-repl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/poke/pk-repl.c b/poke/pk-repl.c
index 351a04ac..31feb4a7 100644
--- a/poke/pk-repl.c
+++ b/poke/pk-repl.c
@@ -329,6 +329,9 @@ pk_repl (void)
   rl_completer_quote_characters = "\"";
   rl_completer_word_break_characters = " \t\n\"\\`@$><=;|&{("; /* }) */
 
+  /* Let the inputrc parser know who we are.  */
+  rl_readline_name = "Poke";
+
   /* Arrange for the current line to be cancelled on SIGINT.
      Since some library code is also interested in SIGINT
      (GNU libtextstyle, via gnulib module fatal-signal), it is better
-- 
2.38.0




reply via email to

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