#include "charset.h"
#include "coding.h"
#include "window.h"
+#include "frame.h"
+#include "dispextern.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
extern int minibuffer_auto_raise;
+extern int history_delete_duplicates;
+
/* These variables describe handlers that have "already" had a chance
to handle the current operation.
int i, nbytes;
struct gcpro gcpro1;
- ring_bell ();
+ ring_bell (XFRAME (selected_frame));
args[0] = build_string ("Auto-saving %s: %s");
args[1] = current_buffer->name;
before any other event (mouse or keypress) is handeled. */)
()
{
-#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON)
+#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (HAVE_CARBON)
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box
&& use_file_dialog
GCPRO2 (insdef, default_filename);
-#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON)
+#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (HAVE_CARBON)
if (! NILP (Fnext_read_file_uses_dialog_p ()))
{
/* If DIR contains a file name, split it. */
if (replace_in_history)
/* Replace what Fcompleting_read added to the history
with what we will actually return. */
- XSETCAR (Fsymbol_value (Qfile_name_history), double_dollars (val));
+ {
+ Lisp_Object val1 = double_dollars (val);
+ tem = Fsymbol_value (Qfile_name_history);
+ if (history_delete_duplicates)
+ XSETCDR (tem, Fdelete (val1, XCDR(tem)));
+ XSETCAR (tem, val1);
+ }
else if (add_to_history)
{
/* Add the value to the history--but not if it matches
Lisp_Object val1 = double_dollars (val);
tem = Fsymbol_value (Qfile_name_history);
if (! CONSP (tem) || NILP (Fequal (XCAR (tem), val1)))
- Fset (Qfile_name_history,
- Fcons (val1, tem));
+ {
+ if (history_delete_duplicates) tem = Fdelete (val1, tem);
+ Fset (Qfile_name_history, Fcons (val1, tem));
+ }
}
return val;