diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/fileio.c | 30 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7ec6980bd08..8d05ec13295 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2015-01-13 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2015-01-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Don't say Fnext_read_file_uses_dialog_p is const | ||
| 4 | It's const only if a windowing system is not used; don't say it's | ||
| 5 | const otherwise. See: | ||
| 6 | http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00310.html | ||
| 7 | * fileio.c (next_read_file_uses_dialog_p): Remove. | ||
| 8 | Move guts back to ... | ||
| 9 | (Fnext_read_file_uses_dialog_p): ... here. | ||
| 10 | Don't declare as const, as make-docfile.c now has a special case | ||
| 11 | for this function. This is an ugly hack, but it's better than | ||
| 12 | lying to the compiler. | ||
| 13 | |||
| 3 | Remove now-unnecessary forward XTYPE decl | 14 | Remove now-unnecessary forward XTYPE decl |
| 4 | * lisp.h (XTYPE): Remove forward declaration. The recent merge | 15 | * lisp.h (XTYPE): Remove forward declaration. The recent merge |
| 5 | from emacs-24 fixed the problem in a better way, by moving XPNTR's | 16 | from emacs-24 fixed the problem in a better way, by moving XPNTR's |
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 | |||
| 5741 | static bool | ||
| 5742 | next_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 | ||
| 5756 | DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, | 5739 | DEFUN ("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. |
| 5759 | The return value is only relevant for a call to `read-file-name' that happens | 5742 | The return value is only relevant for a call to `read-file-name' that happens |
| 5760 | before any other event (mouse or keypress) is handled. */ | 5743 | before 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 | ||
| 5767 | void | 5757 | void |