------------------------------------------------------------ revno: 117265 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-06-05 01:03:22 -0700 message: Try harder to find GNU Make when configuring. * configure.ac (AC_PROG_MAKE_SET): Define a dummy. (MAKE): Set it to GNU Make, if one can be found. Search PATH for 'make', 'gmake', 'gnumake'. This works better on platforms like AIX, where GNU Make might be in /opt/freeware/bin/make, and reside behind /usr/bin/make in the PATH. diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-05 06:24:54 +0000 +++ ChangeLog 2014-06-05 08:03:22 +0000 @@ -1,3 +1,13 @@ +2014-06-05 Paul Eggert + + Try harder to find GNU Make when configuring. + * configure.ac (AC_PROG_MAKE_SET): Define a dummy. + (MAKE): Set it to GNU Make, if one can be found. + Search PATH for 'make', 'gmake', 'gnumake'. + This works better on platforms like AIX, where GNU Make + might be in /opt/freeware/bin/make, and reside + behind /usr/bin/make in the PATH. + 2014-06-05 Dmitry Antipov * configure.ac (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM. === modified file 'configure.ac' --- configure.ac 2014-06-05 06:24:54 +0000 +++ configure.ac 2014-06-05 08:03:22 +0000 @@ -92,7 +92,7 @@ if test -n "$XCRUN"; then if test -z "$MAKE"; then dnl Call the variable MAKE_PROG, not MAKE, to avoid confusion with - dnl SET_MAKE and with the usual MAKE variable that 'make' itself uses. + dnl the usual MAKE variable that 'make' itself uses. AC_CHECK_PROG([MAKE_PROG], [make], [yes]) if test -z "$MAKE_PROG"; then MAKE="$XCRUN MAKE" @@ -102,6 +102,47 @@ fi fi +dnl GNU Make is required, so don't test for its individual features. +am_cv_make_support_nested_variables=yes +AC_DEFUN([AC_PROG_MAKE_SET], + [SET_MAKE= + AC_SUBST([SET_MAKE])]) + +dnl Check for GNU Make and possibly set MAKE before running AM_INIT_AUTOMAKE. +AC_CACHE_CHECK([for GNU Make], [ac_cv_path_MAKE], + [ac_path_MAKE_found=false + if test -n "$MAKE"; then + emacs_makeout=`($MAKE --version) 2>/dev/null` && + case $emacs_makeout in + 'GNU Make '*) + ac_path_MAKE_found=:;; + esac + ac_cv_path_MAKE=$MAKE + else + emacs_tried_make=false + emacs_tried_gmake=false + emacs_tried_gnumake=false + AC_PATH_PROGS_FEATURE_CHECK([MAKE], [make gmake gnumake], + [[emacs_makeout=`($ac_path_MAKE --version) 2>/dev/null` && + case $emacs_makeout in + 'GNU Make '*) + # Use the fully-qualified program name only if the basename + # would not resolve to it. + if eval \$emacs_tried_$ac_prog; then + ac_cv_path_MAKE=$ac_path_MAKE + else + ac_cv_path_MAKE=$ac_prog + fi + ac_path_MAKE_found=:;; + esac + eval emacs_tried_$ac_prog=:]]) + fi]) +$ac_path_MAKE_found || { AC_MSG_ERROR([[Building Emacs requires GNU Make. +If you have it installed under another name, configure with 'MAKE=...'. +For example, run '$0 MAKE=gnu-make'.]]) +} +MAKE=$ac_cv_path_MAKE + dnl Fairly arbitrary, older versions might work too. AM_INIT_AUTOMAKE(1.11) @@ -659,18 +700,6 @@ fi -AC_MSG_CHECKING([whether we are using GNU Make]) -testval=`${MAKE-make} --version 2>/dev/null | grep 'GNU Make'` -if test "x$testval" != x; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Building Emacs requires GNU make. -If you have it installed under another name, configure with 'MAKE=...'. -For example, run './configure MAKE=gmake'.]) -fi - - #### Choose a compiler. dnl Don't bother to test for C89. @@ -1531,7 +1560,6 @@ dnl AC_C_BIGENDIAN is done by gnulib. dnl check for Make feature -dnl AC_PROG_MAKE_SET is done by Automake. DEPFLAGS= MKDEPDIR=":" @@ -5090,3 +5118,5 @@ ]) AC_OUTPUT + +test "$MAKE" = make || AC_MSG_NOTICE([Now you can run '$MAKE'.]) ------------------------------------------------------------ revno: 117264 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-06-05 10:24:54 +0400 message: * configure.ac (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM. * nt/inc/ms-w32.h (POLL_FOR_INPUT): Likewise. * src/keyboard.c, src/process.c: Do not define POLL_FOR_INPUT here because it will be defined in generated config.h if needed. diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-05 00:34:34 +0000 +++ ChangeLog 2014-06-05 06:24:54 +0000 @@ -1,3 +1,7 @@ +2014-06-05 Dmitry Antipov + + * configure.ac (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM. + 2014-06-05 Paul Eggert * configure.ac: --without-all now implies --without-xft, --disable-acl. === modified file 'configure.ac' --- configure.ac 2014-06-05 00:34:34 +0000 +++ configure.ac 2014-06-05 06:24:54 +0000 @@ -4847,6 +4847,7 @@ ## Common for all window systems if test "$window_system" != "none"; then AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) + AC_DEFINE(POLL_FOR_INPUT, 1, [Define if you poll periodically to detect C-g.]) WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o" fi === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-05-29 19:19:18 +0000 +++ nt/ChangeLog 2014-06-05 06:24:54 +0000 @@ -1,3 +1,7 @@ +2014-06-05 Dmitry Antipov + + * inc/ms-w32.h (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM. + 2014-05-29 Eli Zaretskii * Makefile.in (DONT_INSTALL): Now empty. === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2014-05-27 17:31:17 +0000 +++ nt/inc/ms-w32.h 2014-06-05 06:24:54 +0000 @@ -159,6 +159,7 @@ #ifdef HAVE_NTGUI # ifndef HAVE_WINDOW_SYSTEM # define HAVE_WINDOW_SYSTEM 1 +# define POLL_FOR_INPUT 1 # endif #endif === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-04 14:59:09 +0000 +++ src/ChangeLog 2014-06-05 06:24:54 +0000 @@ -1,3 +1,8 @@ +2014-06-05 Dmitry Antipov + + * keyboard.c, process.c: Do not define POLL_FOR_INPUT here + because it will be defined in generated config.h if needed. + 2014-06-04 Dmitry Antipov Use terminal-specific hooks to display popup dialogs. === modified file 'src/keyboard.c' --- src/keyboard.c 2014-05-30 04:12:08 +0000 +++ src/keyboard.c 2014-06-05 06:24:54 +0000 @@ -377,12 +377,6 @@ /* Nonzero while interrupts are temporarily deferred during redisplay. */ bool interrupts_deferred; -/* If we support a window system, turn on the code to poll periodically - to detect C-g. It isn't actually used when doing interrupt input. */ -#ifdef HAVE_WINDOW_SYSTEM -#define POLL_FOR_INPUT -#endif - /* The time when Emacs started being idle. */ static struct timespec timer_idleness_start_time; === modified file 'src/process.c' --- src/process.c 2014-06-03 16:15:43 +0000 +++ src/process.c 2014-06-05 06:24:54 +0000 @@ -286,12 +286,6 @@ static void handle_child_signal (int); static void create_pty (Lisp_Object); -/* If we support a window system, turn on the code to poll periodically - to detect C-g. It isn't actually used when doing interrupt input. */ -#ifdef HAVE_WINDOW_SYSTEM -#define POLL_FOR_INPUT -#endif - static Lisp_Object get_process (register Lisp_Object name); static void exec_sentinel (Lisp_Object proc, Lisp_Object reason); ------------------------------------------------------------ revno: 117263 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2014-06-05 04:31:36 +0000 message: Gnus: fix last change * gnus-art.el (gnus-article-edit-part): Don't modifiy markers. (gnus-article-read-summary-keys): Don't bug out when there is no article in the summary buffer. * gnus-art.el (gnus-mm-display-part): * mm-decode.el (mm-shr): * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text) (mm-insert-inline): Revert last changes. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-06-05 01:38:42 +0000 +++ lisp/gnus/ChangeLog 2014-06-05 04:31:36 +0000 @@ -1,5 +1,16 @@ 2014-06-05 Katsumi Yamaoka + * gnus-art.el (gnus-article-edit-part): Don't modifiy markers. + (gnus-article-read-summary-keys): + Don't bug out when there is no article in the summary buffer. + + * gnus-art.el (gnus-mm-display-part): + * mm-decode.el (mm-shr): + * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text) + (mm-insert-inline): Revert last changes. + +2014-06-05 Katsumi Yamaoka + * gnus-art.el (gnus-mm-display-part): * mm-decode.el (mm-shr): * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-06-05 01:38:42 +0000 +++ lisp/gnus/gnus-art.el 2014-06-05 04:31:36 +0000 @@ -4987,7 +4987,6 @@ (gnus-article-edit-article `(lambda () (buffer-disable-undo) - (erase-buffer) (let ((mail-parse-charset (or gnus-article-charset ',gnus-newsgroup-charset)) (mail-parse-ignored-charsets @@ -4995,7 +4994,11 @@ ',gnus-newsgroup-ignored-charsets)) (mbl mml-buffer-list)) (setq mml-buffer-list nil) - (insert-buffer-substring gnus-original-article-buffer) + (delete-region + (point-min) + (prog1 + (goto-char (point-max)) + (insert-buffer-substring gnus-original-article-buffer))) (mime-to-mml ',handles) (setq gnus-article-mime-handles nil) (let ((mbl1 mml-buffer-list)) @@ -5736,7 +5739,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(copy-marker (point-max) t))))))) + ,(point-max-marker))))))) (part (mm-display-inline handle)))))) (goto-char point) @@ -6790,7 +6793,7 @@ (when (eq obuf (current-buffer)) (set-buffer in-buffer) t)) - (setq selected (gnus-summary-select-article)) + (setq selected (ignore-errors (gnus-summary-select-article))) (set-buffer obuf) (unless not-restore-window (set-window-configuration owin)) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2014-06-05 01:38:42 +0000 +++ lisp/gnus/mm-decode.el 2014-06-05 04:31:36 +0000 @@ -1868,7 +1868,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(copy-marker (point-max) t)))))))) + ,(point-max-marker)))))))) (defvar shr-map) === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2014-06-05 01:38:42 +0000 +++ lisp/gnus/mm-view.el 2014-06-05 04:31:36 +0000 @@ -218,7 +218,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(copy-marker (point-max) t))))))))) + ,(point-max-marker))))))))) (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided) "*T means the w3m command supports the m17n feature.") @@ -392,7 +392,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(copy-marker (point-max) t)))))))) + ,(point-max-marker)))))))) (defun mm-insert-inline (handle text) "Insert TEXT inline from HANDLE." @@ -405,7 +405,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker b t) - ,(copy-marker (point) t))))))) + ,(point-marker))))))) (defun mm-inline-audio (handle) (message "Not implemented")) ------------------------------------------------------------ revno: 117262 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2014-06-05 01:38:42 +0000 message: Gnus: bugfixes to make `gnus-mime-save-part-and-strip' work again * gnus-art.el (gnus-mm-display-part): * mm-decode.el (mm-shr): * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text) (mm-insert-inline): Set insertion type of end-marker, not only start-marker, of undisplayer so as to stay after inserted text. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-06-02 00:18:22 +0000 +++ lisp/gnus/ChangeLog 2014-06-05 01:38:42 +0000 @@ -1,3 +1,11 @@ +2014-06-05 Katsumi Yamaoka + + * gnus-art.el (gnus-mm-display-part): + * mm-decode.el (mm-shr): + * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text) + (mm-insert-inline): Set insertion type of end-marker, not only + start-marker, of undisplayer so as to stay after inserted text. + 2014-06-02 Andreas Schwab * html2text.el (html2text-get-attr): Fix typo when splitting value from === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-05-15 23:31:30 +0000 +++ lisp/gnus/gnus-art.el 2014-06-05 01:38:42 +0000 @@ -5736,7 +5736,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(point-max-marker))))))) + ,(copy-marker (point-max) t))))))) (part (mm-display-inline handle)))))) (goto-char point) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2014-05-02 09:44:34 +0000 +++ lisp/gnus/mm-decode.el 2014-06-05 01:38:42 +0000 @@ -1868,7 +1868,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(point-max-marker)))))))) + ,(copy-marker (point-max) t)))))))) (defvar shr-map) === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2014-05-29 03:45:29 +0000 +++ lisp/gnus/mm-view.el 2014-06-05 01:38:42 +0000 @@ -218,7 +218,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(point-max-marker))))))))) + ,(copy-marker (point-max) t))))))))) (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided) "*T means the w3m command supports the m17n feature.") @@ -392,7 +392,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker (point-min) t) - ,(point-max-marker)))))))) + ,(copy-marker (point-max) t)))))))) (defun mm-insert-inline (handle text) "Insert TEXT inline from HANDLE." @@ -405,7 +405,7 @@ `(lambda () (let ((inhibit-read-only t)) (delete-region ,(copy-marker b t) - ,(copy-marker (point)))))))) + ,(copy-marker (point) t))))))) (defun mm-inline-audio (handle) (message "Not implemented")) ------------------------------------------------------------ revno: 117261 committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-06-04 17:34:34 -0700 message: * configure.ac: --without-all now implies --without-xft, --disable-acl. * INSTALL: Remove apparently unmaintained documentation about what --without-all exactly means. diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-03 07:28:07 +0000 +++ ChangeLog 2014-06-05 00:34:34 +0000 @@ -1,3 +1,9 @@ +2014-06-05 Paul Eggert + + * configure.ac: --without-all now implies --without-xft, --disable-acl. + * INSTALL: Remove apparently unmaintained documentation about what + --without-all exactly means. + 2014-06-03 Eli Zaretskii * configure.ac (C_HEAP_SWITCH): Remove. === modified file 'INSTALL' --- INSTALL 2014-05-16 15:49:13 +0000 +++ INSTALL 2014-06-05 00:34:34 +0000 @@ -304,22 +304,17 @@ Use --without-sound to disable sound support. -Use --without-all if you want to build a small executable with the minimal -dependencies on external libraries, at the cost of disabling most of the -features that are normally enabled by default. Using --without-all is -equivalent to --without-sound --without-dbus --without-libotf ---without-selinux --without-xft --without-gsettings --without-gnutls ---without-rsvg --without-xml2 --without-gconf --without-imagemagick ---without-m17n-flt --without-jpeg --without-tiff --without-gif ---without-png --without-gpm --without-file-notification. Note that ---without-all leaves X support enabled, and using the GTK2 or GTK3 +Use --without-all for a smaller executable with fewer dependencies on +external libraries, at the cost of disabling many features. Although +--without-all disables libraries not needed for ordinary Emacs +operation, it does enable X support, and using the GTK2 or GTK3 toolkit creates a lot of library dependencies. So if you want to build a small executable with very basic X support, use --without-all --with-x-toolkit=no. For the smallest possible executable without X, use --without-all --without-x. If you want to build with just a few features enabled, you can combine --without-all with --with-FEATURE. -For example, you can use --without-all --with-dbus to build with DBus -support and nothing more. +For example, you can use --without-all --without-x --with-dbus to +build with DBus support and nothing more. Use --with-wide-int to implement Emacs values with the type 'long long', even on hosts where a narrower type would do. With this option, on a === modified file 'configure.ac' --- configure.ac 2014-06-03 07:28:07 +0000 +++ configure.ac 2014-06-05 00:34:34 +0000 @@ -2817,14 +2817,17 @@ ### Start of font-backend (under X11) section. if test "${HAVE_X11}" = "yes"; then - EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0], - [HAVE_FC=yes], [HAVE_FC=no]) - - ## Use -lXft if available, unless `--with-xft=no'. - HAVE_XFT=maybe - if test "${HAVE_FC}" = "no" || test "x${with_x}" = "xno"; then + ## Use -lXft if available, unless `--with-xft=no'. + HAVE_XFT=maybe + if test "x${with_x}" = "xno"; then with_xft="no"; fi + + if test "$with_xft" != no; then + EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0]) + with_xft=$HAVE_FONTCONFIG + fi + if test "x${with_xft}" != "xno"; then EMACS_CHECK_MODULES([XFT], [xft >= 0.13.0], [], [HAVE_XFT=no]) @@ -4751,6 +4754,12 @@ #endif ]) +# If user asks to omit features, disable optional features that gnulib +# might otherwise enable. +if test "$with_features" = no && test "$enable_acl" != yes; then + enable_acl=no +fi + # Configure gnulib. Although this does not affect CFLAGS or LIBS permanently. # it temporarily reverts them to their pre-pkg-config values, # because gnulib needs to work with both src (which uses the ------------------------------------------------------------ revno: 117260 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-06-04 18:16:54 +0300 message: src/menu.c (Fx_popup_dialog): Comment the use of Qunsupported__w32_dialog. diff: === modified file 'src/menu.c' --- src/menu.c 2014-06-04 14:59:09 +0000 +++ src/menu.c 2014-06-04 15:16:54 +0000 @@ -1434,7 +1434,7 @@ return selection; } -/* If F's terminal is not capable to display popup dialog, +/* If F's terminal is not capable of displaying a popup dialog, emulate it with a menu. */ static Lisp_Object @@ -1457,7 +1457,7 @@ x_coord -= SCHARS (prompt); y_coord = FRAME_LINES (f); } - + XSETFRAME (frame, f); XSETINT (x, x_coord / 2); XSETINT (y, y_coord / 2); @@ -1546,9 +1546,12 @@ Lisp_Object selection = FRAME_TERMINAL (f)->popup_dialog_hook (f, header, contents); #ifdef HAVE_NTGUI + /* NTGUI supports only simple dialogs with Yes/No choices. For + other dialogs, it returns the symbol 'unsupported--w32-dialog', + as a signal for the caller to fall back to the emulation code. */ if (!EQ (selection, Qunsupported__w32_dialog)) -#endif - return selection; +#endif + return selection; } /* ... or emulate it with a menu. */ return emulate_dialog_with_menu (f, contents); ------------------------------------------------------------ revno: 117259 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2014-06-04 18:59:09 +0400 message: Use terminal-specific hooks to display popup dialogs. * termhooks.h (struct terminal): New field popup_dialog_hook. * menu.c (emulate_dialog_with_menu): New function, refactored from ... (Fx_popup_dialog): ... adjusted user. Also remove old #if 0 code and use popup_dialog_hook. * nsmenu.m (ns_popup_dialog): Make hook-compatible. * nsterm.h (ns_popup_dialog): Adjust prototype. * nsterm.m (ns_create_terminal): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal) [USE_X_TOOLKIT || USE_GTK]: Setup popup_dialog_hook. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-04 11:46:51 +0000 +++ src/ChangeLog 2014-06-04 14:59:09 +0000 @@ -1,3 +1,17 @@ +2014-06-04 Dmitry Antipov + + Use terminal-specific hooks to display popup dialogs. + * termhooks.h (struct terminal): New field popup_dialog_hook. + * menu.c (emulate_dialog_with_menu): New function, refactored from ... + (Fx_popup_dialog): ... adjusted user. Also remove old #if 0 + code and use popup_dialog_hook. + * nsmenu.m (ns_popup_dialog): Make hook-compatible. + * nsterm.h (ns_popup_dialog): Adjust prototype. + * nsterm.m (ns_create_terminal): + * w32term.c (w32_create_terminal): + * xterm.c (x_create_terminal) [USE_X_TOOLKIT || USE_GTK]: Setup + popup_dialog_hook. + 2014-06-04 Eli Zaretskii * w32heap.c (report_temacs_memory_usage): Improve the report by === modified file 'src/menu.c' --- src/menu.c 2014-06-04 04:58:31 +0000 +++ src/menu.c 2014-06-04 14:59:09 +0000 @@ -1434,6 +1434,38 @@ return selection; } +/* If F's terminal is not capable to display popup dialog, + emulate it with a menu. */ + +static Lisp_Object +emulate_dialog_with_menu (struct frame *f, Lisp_Object contents) +{ + Lisp_Object x, y, frame, newpos, prompt = Fcar (contents); + int x_coord, y_coord; + + if (FRAME_WINDOW_P (f)) + { + x_coord = FRAME_PIXEL_WIDTH (f); + y_coord = FRAME_PIXEL_HEIGHT (f); + } + else + { + x_coord = FRAME_COLS (f); + /* Center the title at frame middle. (TTY menus have + their upper-left corner at the given position.) */ + if (STRINGP (prompt)) + x_coord -= SCHARS (prompt); + y_coord = FRAME_LINES (f); + } + + XSETFRAME (frame, f); + XSETINT (x, x_coord / 2); + XSETINT (y, y_coord / 2); + newpos = list2 (list2 (x, y), frame); + + return Fx_popup_menu (newpos, list2 (prompt, contents)); +} + DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, doc: /* Pop up a dialog box and return user's selection. POSITION specifies which frame to use. @@ -1466,24 +1498,7 @@ if (EQ (position, Qt) || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar) || EQ (XCAR (position), Qtool_bar)))) - { -#if 0 /* Using the frame the mouse is on may not be right. */ - /* Use the mouse's current position. */ - struct frame *new_f = SELECTED_FRAME (); - Lisp_Object bar_window; - enum scroll_bar_part part; - Time time; - Lisp_Object x, y; - - (*mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time); - - if (new_f != 0) - XSETFRAME (window, new_f); - else - window = selected_window; -#endif - window = selected_window; - } + window = selected_window; else if (CONSP (position)) { Lisp_Object tem = XCAR (position); @@ -1525,51 +1540,18 @@ string contents, because Fredisplay may GC and relocate them. */ Fredisplay (Qt); -#if defined USE_X_TOOLKIT || defined USE_GTK - if (FRAME_WINDOW_P (f)) - return xw_popup_dialog (f, header, contents); -#endif + /* Display the popup dialog by a terminal-specific hook ... */ + if (FRAME_TERMINAL (f)->popup_dialog_hook) + { + Lisp_Object selection + = FRAME_TERMINAL (f)->popup_dialog_hook (f, header, contents); #ifdef HAVE_NTGUI - if (FRAME_W32_P (f)) - { - Lisp_Object selection = w32_popup_dialog (f, header, contents); - if (!EQ (selection, Qunsupported__w32_dialog)) - return selection; +#endif + return selection; } -#endif -#ifdef HAVE_NS - if (FRAME_NS_P (f)) - return ns_popup_dialog (position, header, contents); -#endif - /* Display a menu with these alternatives - in the middle of frame F. */ - { - Lisp_Object x, y, frame, newpos, prompt; - int x_coord, y_coord; - - prompt = Fcar (contents); - if (FRAME_WINDOW_P (f)) - { - x_coord = FRAME_PIXEL_WIDTH (f); - y_coord = FRAME_PIXEL_HEIGHT (f); - } - else - { - x_coord = FRAME_COLS (f); - /* Center the title at frame middle. (TTY menus have their - upper-left corner at the given position.) */ - if (STRINGP (prompt)) - x_coord -= SCHARS (prompt); - y_coord = FRAME_LINES (f); - } - XSETFRAME (frame, f); - XSETINT (x, x_coord / 2); - XSETINT (y, y_coord / 2); - newpos = list2 (list2 (x, y), frame); - - return Fx_popup_menu (newpos, list2 (prompt, contents)); - } + /* ... or emulate it with a menu. */ + return emulate_dialog_with_menu (f, contents); } void === modified file 'src/nsmenu.m' --- src/nsmenu.m 2014-06-04 04:58:31 +0000 +++ src/nsmenu.m 2014-06-04 14:59:09 +0000 @@ -1428,11 +1428,10 @@ Lisp_Object -ns_popup_dialog (Lisp_Object position, Lisp_Object header, Lisp_Object contents) +ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) { id dialog; Lisp_Object window, tem, title; - struct frame *f; NSPoint p; BOOL isQ; NSAutoreleasePool *pool; @@ -1441,41 +1440,6 @@ isQ = NILP (header); - if (EQ (position, Qt) - || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar) - || EQ (XCAR (position), Qtool_bar)))) - { - window = selected_window; - } - else if (CONSP (position)) - { - Lisp_Object tem; - tem = Fcar (position); - if (XTYPE (tem) == Lisp_Cons) - window = Fcar (Fcdr (position)); - else - { - tem = Fcar (Fcdr (position)); /* EVENT_START (position) */ - window = Fcar (tem); /* POSN_WINDOW (tem) */ - } - } - else if (WINDOWP (position) || FRAMEP (position)) - { - window = position; - } - else - window = Qnil; - - if (FRAMEP (window)) - f = XFRAME (window); - else if (WINDOWP (window)) - { - CHECK_LIVE_WINDOW (window); - f = XFRAME (WINDOW_FRAME (XWINDOW (window))); - } - else - CHECK_WINDOW (window); - check_window_system (f); p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; === modified file 'src/nsterm.h' --- src/nsterm.h 2014-05-26 11:16:47 +0000 +++ src/nsterm.h 2014-06-04 14:59:09 +0000 @@ -855,7 +855,7 @@ extern Lisp_Object find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data); -extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object header, +extern Lisp_Object ns_popup_dialog (struct frame *, Lisp_Object header, Lisp_Object contents); #define NSAPP_DATA2_RUNASSCRIPT 10 === modified file 'src/nsterm.m' --- src/nsterm.m 2014-06-04 04:58:31 +0000 +++ src/nsterm.m 2014-06-04 14:59:09 +0000 @@ -4165,6 +4165,7 @@ terminal->frame_raise_lower_hook = ns_frame_raise_lower; terminal->fullscreen_hook = ns_fullscreen_hook; terminal->menu_show_hook = ns_menu_show; + terminal->popup_dialog_hook = ns_popup_dialog; terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar; terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar; === modified file 'src/termhooks.h' --- src/termhooks.h 2014-06-04 04:58:31 +0000 +++ src/termhooks.h 2014-06-04 14:59:09 +0000 @@ -482,6 +482,10 @@ Lisp_Object (*menu_show_hook) (struct frame *f, int x, int y, int menuflags, Lisp_Object title, const char **error_name); + /* This hook is called to display popup dialog. */ + Lisp_Object (*popup_dialog_hook) (struct frame *f, Lisp_Object header, + Lisp_Object contents); + /* Scroll bar hooks. */ /* The representation of scroll bars is determined by the code which === modified file 'src/w32term.c' --- src/w32term.c 2014-06-04 04:58:31 +0000 +++ src/w32term.c 2014-06-04 14:59:09 +0000 @@ -6274,6 +6274,7 @@ terminal->frame_raise_lower_hook = w32_frame_raise_lower; terminal->fullscreen_hook = w32fullscreen_hook; terminal->menu_show_hook = w32_menu_show; + terminal->popup_dialog_hook = w32_popup_dialog; terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; === modified file 'src/xterm.c' --- src/xterm.c 2014-06-04 04:58:31 +0000 +++ src/xterm.c 2014-06-04 14:59:09 +0000 @@ -10533,6 +10533,9 @@ terminal->frame_raise_lower_hook = XTframe_raise_lower; terminal->fullscreen_hook = XTfullscreen_hook; terminal->menu_show_hook = x_menu_show; +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) + terminal->popup_dialog_hook = xw_popup_dialog; +#endif terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars; terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar; ------------------------------------------------------------ revno: 117258 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-06-04 15:00:34 +0300 message: Fix last commit. diff: === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-04 11:46:51 +0000 +++ src/w32heap.c 2014-06-04 12:00:34 +0000 @@ -498,7 +498,8 @@ void report_temacs_memory_usage (void) { - DWORD blocks_used = 0, large_mem_used = 0; + DWORD blocks_used = 0; + size_t large_mem_used = 0; int i; for (i = 0; i < blocks_number; i++) ------------------------------------------------------------ revno: 117257 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-06-04 14:46:51 +0300 message: Improve dumped memory report on MS-Windows. src/w32heap.c (report_temacs_memory_usage): Improve the report by reporting the large blocks that are actually occupied at dump time. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-04 07:54:16 +0000 +++ src/ChangeLog 2014-06-04 11:46:51 +0000 @@ -1,5 +1,9 @@ 2014-06-04 Eli Zaretskii + * w32heap.c (report_temacs_memory_usage): Improve the report by + reporting the large blocks that are actually occupied at dump + time. + * w32console.c (initialize_w32_display): Set the console menu_show_hook, otherwise TTY menus are broken on w32. === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-03 22:13:17 +0000 +++ src/w32heap.c 2014-06-04 11:46:51 +0000 @@ -479,7 +479,7 @@ /* Look for the big chunk. */ int i; - for(i = 0; i < blocks_number; i++) + for (i = 0; i < blocks_number; i++) { if (blocks[i].address == ptr) { @@ -498,11 +498,22 @@ void report_temacs_memory_usage (void) { + DWORD blocks_used = 0, large_mem_used = 0; + int i; + + for (i = 0; i < blocks_number; i++) + if (blocks[i].occupied) + { + blocks_used++; + large_mem_used += blocks[i].size; + } + /* Emulate 'message', which writes to stderr in non-interactive sessions. */ fprintf (stderr, - "Dump memory usage: Heap: %" PRIu64 " Large blocks(%lu): %" PRIu64 "\n", - (unsigned long long)committed, blocks_number, + "Dump memory usage: Heap: %" PRIu64 " Large blocks(%lu/%lu): %" PRIu64 "/%" PRIu64 "\n", + (unsigned long long)committed, blocks_used, blocks_number, + (unsigned long long)large_mem_used, (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit)); } #endif ------------------------------------------------------------ revno: 117256 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-06-04 10:54:16 +0300 message: Fix TTY menus on MS-Windows broken by last commit. src/w32console.c (initialize_w32_display): Set the console menu_show_hook, otherwise TTY menus on w32 crash and burn. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-04 04:58:31 +0000 +++ src/ChangeLog 2014-06-04 07:54:16 +0000 @@ -1,3 +1,8 @@ +2014-06-04 Eli Zaretskii + + * w32console.c (initialize_w32_display): Set the console + menu_show_hook, otherwise TTY menus are broken on w32. + 2014-06-04 Dmitry Antipov Use terminal-specific hooks to display menus. === modified file 'src/w32console.c' --- src/w32console.c 2014-01-01 07:43:34 +0000 +++ src/w32console.c 2014-06-04 07:54:16 +0000 @@ -36,8 +36,9 @@ #include "termhooks.h" #include "termchar.h" #include "dispextern.h" +#include "menu.h" /* for tty_menu_show */ #include "w32term.h" -#include "w32common.h" /* for os_subtype */ +#include "w32common.h" /* for os_subtype */ #include "w32inevt.h" /* from window.c */ @@ -650,6 +651,7 @@ term->read_socket_hook = w32_console_read_socket; term->mouse_position_hook = w32_console_mouse_position; + term->menu_show_hook = tty_menu_show; /* The following are not used on the console. */ term->frame_rehighlight_hook = 0;