Commit 0064e36f authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

Make Fnext_read_file_uses_dialog_p compatible with recent DEFUN change.

* fileio.c (next_read_file_uses_dialog_p): New workaround ...
(Fnext_read_file_uses_dialog_p): ... called from here to avoid
ATTRIBUTE_CONST dependency from #ifdefs.  For details, see
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html.
parent 233dcf12
......@@ -32,6 +32,11 @@
(fast_string_match_internal): Add prototype.
* dired.c (file_name_completion): Use fast_string_match_internal.
 
* fileio.c (next_read_file_uses_dialog_p): New workaround ...
(Fnext_read_file_uses_dialog_p): ... called from here to avoid
ATTRIBUTE_CONST dependency from #ifdefs. For details, see
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html.
2015-01-12 Paul Eggert <eggert@cs.ucla.edu>
 
Port to 32-bit MingGW --with-wide-int
......
......@@ -5733,25 +5733,35 @@ then any auto-save counts as "recent". */)
they're never autosaved. */
return (SAVE_MODIFF < BUF_AUTOSAVE_MODIFF (current_buffer) ? Qt : Qnil);
}
/* Reading and completing file names */
/* We want Fnext_read_file_uses_dialog_p to have ATTRIBUTE_CONST
regardless of #ifdefs, so there is a trivial workaround. See
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html. */
static bool
next_read_file_uses_dialog_p (void)
{
#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) \
|| defined (HAVE_NS)
return ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box
&& use_file_dialog
&& window_system_available (SELECTED_FRAME ()));
#endif
return false;
}
/* Reading and completing file names. */
DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p,
Snext_read_file_uses_dialog_p, 0, 0, 0,
doc: /* Return t if a call to `read-file-name' will use a dialog.
The return value is only relevant for a call to `read-file-name' that happens
before any other event (mouse or keypress) is handled. */)
before any other event (mouse or keypress) is handled. */
attributes: const)
(void)
{
#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) \
|| defined (HAVE_NS)
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box
&& use_file_dialog
&& window_system_available (SELECTED_FRAME ()))
return Qt;
#endif
return Qnil;
return next_read_file_uses_dialog_p () ? Qt : Qnil;
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment