aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert2015-01-13 15:22:19 -0800
committerPaul Eggert2015-01-13 15:23:03 -0800
commit785adfcc8dee02ac544f80e4f7f8d3d5b2965981 (patch)
tree459b4653c384bd48ea961dbc5da46461a72d90fa /src/fileio.c
parent564784766297a6f2e06434e2baa7a1d851672a36 (diff)
downloademacs-785adfcc8dee02ac544f80e4f7f8d3d5b2965981.tar.gz
emacs-785adfcc8dee02ac544f80e4f7f8d3d5b2965981.zip
Don't say Fnext_read_file_uses_dialog_p is const
It's const only if a windowing system is not used; don't say it's const otherwise. See: http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00310.html * lib-src/make-docfile.c (write_globals): Add a special hack for Fnext_read_file_uses_dialog_p. * src/fileio.c (next_read_file_uses_dialog_p): Remove. Move guts back to ... (Fnext_read_file_uses_dialog_p): ... here. Don't declare as const, as make-docfile.c now has a special case for this function. This is an ugly hack, but it's better than lying to the compiler.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 45a31c0e573..6c443c91db7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5734,34 +5734,24 @@ then any auto-save counts as "recent". */)
5734 return (SAVE_MODIFF < BUF_AUTOSAVE_MODIFF (current_buffer) ? Qt : Qnil); 5734 return (SAVE_MODIFF < BUF_AUTOSAVE_MODIFF (current_buffer) ? Qt : Qnil);
5735} 5735}
5736 5736
5737/* We want Fnext_read_file_uses_dialog_p to have ATTRIBUTE_CONST
5738 regardless of #ifdefs, so there is a trivial workaround. See
5739 http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html. */
5740
5741static bool
5742next_read_file_uses_dialog_p (void)
5743{
5744#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) \
5745 || defined (HAVE_NS)
5746 return ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
5747 && use_dialog_box
5748 && use_file_dialog
5749 && window_system_available (SELECTED_FRAME ()));
5750#endif
5751 return false;
5752}
5753
5754/* Reading and completing file names. */ 5737/* Reading and completing file names. */
5755 5738
5756DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, 5739DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p,
5757 Snext_read_file_uses_dialog_p, 0, 0, 0, 5740 Snext_read_file_uses_dialog_p, 0, 0, 0,
5758 doc: /* Return t if a call to `read-file-name' will use a dialog. 5741 doc: /* Return t if a call to `read-file-name' will use a dialog.
5759The return value is only relevant for a call to `read-file-name' that happens 5742The return value is only relevant for a call to `read-file-name' that happens
5760before any other event (mouse or keypress) is handled. */ 5743before any other event (mouse or keypress) is handled. */)
5761 attributes: const)
5762 (void) 5744 (void)
5763{ 5745{
5764 return next_read_file_uses_dialog_p () ? Qt : Qnil; 5746#if (defined USE_GTK || defined USE_MOTIF \
5747 || defined HAVE_NS || defined HAVE_NTGUI)
5748 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
5749 && use_dialog_box
5750 && use_file_dialog
5751 && window_system_available (SELECTED_FRAME ()))
5752 return Qt;
5753#endif
5754 return Qnil;
5765} 5755}
5766 5756
5767void 5757void