diff options
| author | Dmitry Antipov | 2015-01-13 13:08:32 +0300 |
|---|---|---|
| committer | Dmitry Antipov | 2015-01-13 13:08:32 +0300 |
| commit | 0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414 (patch) | |
| tree | d940eede8c48e1324f52eae2ca7ef6b39df0c982 /src | |
| parent | 233dcf127dfccea422d9d75e18d5b1383d4c2c62 (diff) | |
| download | emacs-0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414.tar.gz emacs-0064e36f4fc76b0e8d2fc8d3e6f63da6e579a414.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 34 |
2 files changed, 27 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 00068d4330c..81d6772bc23 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -32,6 +32,11 @@ | |||
| 32 | (fast_string_match_internal): Add prototype. | 32 | (fast_string_match_internal): Add prototype. |
| 33 | * dired.c (file_name_completion): Use fast_string_match_internal. | 33 | * dired.c (file_name_completion): Use fast_string_match_internal. |
| 34 | 34 | ||
| 35 | * fileio.c (next_read_file_uses_dialog_p): New workaround ... | ||
| 36 | (Fnext_read_file_uses_dialog_p): ... called from here to avoid | ||
| 37 | ATTRIBUTE_CONST dependency from #ifdefs. For details, see | ||
| 38 | http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html. | ||
| 39 | |||
| 35 | 2015-01-12 Paul Eggert <eggert@cs.ucla.edu> | 40 | 2015-01-12 Paul Eggert <eggert@cs.ucla.edu> |
| 36 | 41 | ||
| 37 | Port to 32-bit MingGW --with-wide-int | 42 | Port to 32-bit MingGW --with-wide-int |
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". */) | |||
| 5733 | they're never autosaved. */ | 5733 | they're never autosaved. */ |
| 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 | /* Reading and completing file names */ | 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. */ | ||
| 5738 | 5755 | ||
| 5739 | DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, | 5756 | DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, |
| 5740 | Snext_read_file_uses_dialog_p, 0, 0, 0, | 5757 | Snext_read_file_uses_dialog_p, 0, 0, 0, |
| 5741 | doc: /* Return t if a call to `read-file-name' will use a dialog. | 5758 | doc: /* Return t if a call to `read-file-name' will use a dialog. |
| 5742 | The return value is only relevant for a call to `read-file-name' that happens | 5759 | The return value is only relevant for a call to `read-file-name' that happens |
| 5743 | before any other event (mouse or keypress) is handled. */) | 5760 | before any other event (mouse or keypress) is handled. */ |
| 5761 | attributes: const) | ||
| 5744 | (void) | 5762 | (void) |
| 5745 | { | 5763 | { |
| 5746 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) \ | 5764 | return next_read_file_uses_dialog_p () ? Qt : Qnil; |
| 5747 | || defined (HAVE_NS) | ||
| 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; | ||
| 5755 | } | 5765 | } |
| 5756 | 5766 | ||
| 5757 | void | 5767 | void |