From: Tom Tromey <tom@tromey.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 1/4] Add previous_saved_command_line to allow a command to repeat a previous command.
Date: Wed, 24 Apr 2019 20:51:00 -0000 [thread overview]
Message-ID: <87wojjdt3t.fsf@tromey.com> (raw)
In-Reply-To: <20190420212153.30934-2-philippe.waroquiers@skynet.be> (Philippe Waroquiers's message of "Sat, 20 Apr 2019 23:21:50 +0200")
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> +/* The previous last command line executed on the console. Used for command
Philippe> + repetitions when a command want to relaunch the previously launched
Philippe> + command. We need this as when a command is running, saved_command_line
Philippe> + already contains the line of the currently executing command. */
Philippe> +char *previous_saved_command_line;
Is there a way to make this static? Like have repeat_previous return
the desired value or something like that?
Philippe> +void
Philippe> +repeat_previous (void)
You can use () instead of (void) in C++.
Philippe> + /* We cannot free saved_command_line, as this line is being executed,
Philippe> + so swap it with previous_saved_command_line. */
Philippe> + previous_saved_command_line = saved_command_line;
Philippe> + saved_command_line = tmp;
Just use std::swap here.
Tom
next prev parent reply other threads:[~2019-04-24 20:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-20 21:22 [RFA 0/4] Implement | (pipe) command Philippe Waroquiers
2019-04-20 21:22 ` [RFA 2/4] " Philippe Waroquiers
2019-04-21 5:19 ` Eli Zaretskii
2019-04-21 9:40 ` Philippe Waroquiers
2019-04-21 10:18 ` Eli Zaretskii
2019-04-22 10:30 ` Philippe Waroquiers
2019-04-22 11:08 ` Eli Zaretskii
2019-04-22 13:15 ` Philippe Waroquiers
2019-04-22 13:21 ` Eli Zaretskii
2019-04-24 20:50 ` Tom Tromey
2019-04-25 5:58 ` Eli Zaretskii
2019-04-20 21:22 ` [RFA 3/4] Test the " Philippe Waroquiers
2019-04-24 20:52 ` Tom Tromey
2019-04-20 21:22 ` [RFA 4/4] NEWS and documentation for " Philippe Waroquiers
2019-04-21 5:22 ` Eli Zaretskii
2019-04-20 21:22 ` [RFA 1/4] Add previous_saved_command_line to allow a command to repeat a previous command Philippe Waroquiers
2019-04-24 20:51 ` Tom Tromey [this message]
2019-04-22 20:45 ` [RFA 0/4] Implement | (pipe) command Abhijit Halder
2019-04-22 21:14 ` Philippe Waroquiers
2019-04-24 20:53 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wojjdt3t.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox