summaryrefslogtreecommitdiff
path: root/src/callint.c
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-04-15 00:08:23 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-04-15 00:08:23 +0000
commitd65859c36e21f1e9c44655c19f3d8e34acc3a5cb (patch)
tree2960e4ba9f68bfe748d3e2d213e700d9e7ebcef4 /src/callint.c
parentade29c44f68b80ac67b1f767c8069bff941c772c (diff)
downloademacs-d65859c36e21f1e9c44655c19f3d8e34acc3a5cb.tar.gz
* fileio.c (history_delete_duplicates): Remove unused declaration.
* callint.c (history_delete_duplicates): New declaration. (Fcall_interactively): Remove command history duplicates when history_delete_duplicates is true.
Diffstat (limited to 'src/callint.c')
-rw-r--r--src/callint.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/callint.c b/src/callint.c
index 3641fbc5b77..074f9c0fc5b 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -42,6 +42,7 @@ Lisp_Object Vcommand_history;
extern Lisp_Object Vhistory_length;
extern Lisp_Object Vthis_original_command, real_this_command;
+extern int history_delete_duplicates;
Lisp_Object Vcommand_debug_status, Qcommand_debug_status;
Lisp_Object Qenable_recursive_minibuffers;
@@ -366,12 +367,15 @@ invoke it. If KEYS is omitted or nil, the return value of
{
/* We should record this command on the command history. */
Lisp_Object values;
+ Lisp_Object this_cmd;
/* Make a copy of the list of values, for the command history,
and turn them into things we can eval. */
values = quotify_args (Fcopy_sequence (specs));
fix_command (input, values);
- Vcommand_history
- = Fcons (Fcons (function, values), Vcommand_history);
+ this_cmd = Fcons (function, values);
+ if (history_delete_duplicates)
+ Vcommand_history = Fdelete (this_cmd, Vcommand_history);
+ Vcommand_history = Fcons (this_cmd, Vcommand_history);
/* Don't keep command history around forever. */
if (INTEGERP (Vhistory_length) && XINT (Vhistory_length) > 0)