summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2015-01-13 13:08:32 +0300
committerDmitry Antipov <dmantipov@yandex.ru>2015-01-13 13:08:32 +0300
commit0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414 (patch)
treed940eede8c48e1324f52eae2ca7ef6b39df0c982 /src/fileio.c
parent233dcf127dfccea422d9d75e18d5b1383d4c2c62 (diff)
downloademacs-0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414.tar.gz
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.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/fileio.c b/src/fileio.c
index cd3c485da0f..45a31c0e573 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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