diff options
| author | Joakim Verona | 2011-11-07 10:03:00 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-07 10:03:00 +0100 |
| commit | c649990b73768c7a024e111d8c63246030647b53 (patch) | |
| tree | e5b47169dfc679b53fed30bbd66e2df98de2f02c | |
| parent | c823c667cd00b9d8036ce06b943f58f3f4efd7d9 (diff) | |
| parent | ca78dc431fff3bc2a4f33f2a0fc1449608568d23 (diff) | |
| download | emacs-c649990b73768c7a024e111d8c63246030647b53.tar.gz emacs-c649990b73768c7a024e111d8c63246030647b53.zip | |
upstream
45 files changed, 1284 insertions, 826 deletions
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * lib/makefile.w32-in (FRC): New dummy target. | ||
| 4 | (TAGS): Depend on FRC. | ||
| 5 | |||
| 6 | 2011-11-04 Glenn Morris <rgm@gnu.org> | ||
| 7 | |||
| 8 | * configure.in: Increase minimum GnuTLS version to 2.6.6. (Bug#9929) | ||
| 9 | Do not include GnuTLS version info in final summary message. | ||
| 10 | |||
| 1 | 2011-10-31 Eli Zaretskii <eliz@gnu.org> | 11 | 2011-10-31 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * config.bat: Use config.in and Makefile.in from src/ and lib/, if | 13 | * config.bat: Use config.in and Makefile.in from src/ and lib/, if |
diff --git a/autogen/configure b/autogen/configure index b265133759e..b22541d8b22 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -11830,23 +11830,23 @@ fi | |||
| 11830 | else | 11830 | else |
| 11831 | PKG_CONFIG_MIN_VERSION=0.9.0 | 11831 | PKG_CONFIG_MIN_VERSION=0.9.0 |
| 11832 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then | 11832 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
| 11833 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 2.6.0" >&5 | 11833 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 2.6.6" >&5 |
| 11834 | $as_echo_n "checking for gnutls >= 2.6.0... " >&6; } | 11834 | $as_echo_n "checking for gnutls >= 2.6.6... " >&6; } |
| 11835 | 11835 | ||
| 11836 | if $PKG_CONFIG --exists "gnutls >= 2.6.0" 2>&5; then | 11836 | if $PKG_CONFIG --exists "gnutls >= 2.6.6" 2>&5; then |
| 11837 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | 11837 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
| 11838 | $as_echo "yes" >&6; } | 11838 | $as_echo "yes" >&6; } |
| 11839 | succeeded=yes | 11839 | succeeded=yes |
| 11840 | 11840 | ||
| 11841 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_CFLAGS" >&5 | 11841 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_CFLAGS" >&5 |
| 11842 | $as_echo_n "checking LIBGNUTLS_CFLAGS... " >&6; } | 11842 | $as_echo_n "checking LIBGNUTLS_CFLAGS... " >&6; } |
| 11843 | LIBGNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.6.0"|sed -e 's,///*,/,g'` | 11843 | LIBGNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.6.6"|sed -e 's,///*,/,g'` |
| 11844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_CFLAGS" >&5 | 11844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_CFLAGS" >&5 |
| 11845 | $as_echo "$LIBGNUTLS_CFLAGS" >&6; } | 11845 | $as_echo "$LIBGNUTLS_CFLAGS" >&6; } |
| 11846 | 11846 | ||
| 11847 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_LIBS" >&5 | 11847 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_LIBS" >&5 |
| 11848 | $as_echo_n "checking LIBGNUTLS_LIBS... " >&6; } | 11848 | $as_echo_n "checking LIBGNUTLS_LIBS... " >&6; } |
| 11849 | LIBGNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.6.0"|sed -e 's,///*,/,g'` | 11849 | LIBGNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.6.6"|sed -e 's,///*,/,g'` |
| 11850 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_LIBS" >&5 | 11850 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_LIBS" >&5 |
| 11851 | $as_echo "$LIBGNUTLS_LIBS" >&6; } | 11851 | $as_echo "$LIBGNUTLS_LIBS" >&6; } |
| 11852 | else | 11852 | else |
| @@ -11856,7 +11856,7 @@ $as_echo "no" >&6; } | |||
| 11856 | LIBGNUTLS_LIBS="" | 11856 | LIBGNUTLS_LIBS="" |
| 11857 | ## If we have a custom action on failure, don't print errors, but | 11857 | ## If we have a custom action on failure, don't print errors, but |
| 11858 | ## do set a variable so people can do so. | 11858 | ## do set a variable so people can do so. |
| 11859 | LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= 2.6.0"` | 11859 | LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= 2.6.6"` |
| 11860 | 11860 | ||
| 11861 | fi | 11861 | fi |
| 11862 | 11862 | ||
| @@ -24283,7 +24283,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}" | |||
| 24283 | echo " Does Emacs use -ldbus? ${HAVE_DBUS}" | 24283 | echo " Does Emacs use -ldbus? ${HAVE_DBUS}" |
| 24284 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" | 24284 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" |
| 24285 | echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" | 24285 | echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" |
| 24286 | echo " Does Emacs use -lgnutls (2.6.x or higher)? ${HAVE_GNUTLS}" | 24286 | echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" |
| 24287 | echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" | 24287 | echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" |
| 24288 | 24288 | ||
| 24289 | echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" | 24289 | echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" |
diff --git a/configure.in b/configure.in index db3e2b7ade1..e301b142fe4 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -2113,7 +2113,7 @@ AC_SUBST(LIBSELINUX_LIBS) | |||
| 2113 | HAVE_GNUTLS=no | 2113 | HAVE_GNUTLS=no |
| 2114 | HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=no | 2114 | HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=no |
| 2115 | if test "${with_gnutls}" = "yes" ; then | 2115 | if test "${with_gnutls}" = "yes" ; then |
| 2116 | PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.0], HAVE_GNUTLS=yes, HAVE_GNUTLS=no) | 2116 | PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6], HAVE_GNUTLS=yes, HAVE_GNUTLS=no) |
| 2117 | if test "${HAVE_GNUTLS}" = "yes"; then | 2117 | if test "${HAVE_GNUTLS}" = "yes"; then |
| 2118 | AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.]) | 2118 | AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.]) |
| 2119 | fi | 2119 | fi |
| @@ -3770,7 +3770,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" | |||
| 3770 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" | 3770 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" |
| 3771 | echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" | 3771 | echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" |
| 3772 | echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" | 3772 | echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" |
| 3773 | echo " Does Emacs use -lgnutls (2.6.x or higher)? ${HAVE_GNUTLS}" | 3773 | echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" |
| 3774 | echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" | 3774 | echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" |
| 3775 | 3775 | ||
| 3776 | echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" | 3776 | echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 9a501d38375..a808a96b444 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2011-11-06 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * windows.texi (Basic Window): Add xref to Cursor Display. | ||
| 4 | (Split Window): Document negative arg for splitting commands. | ||
| 5 | (Other Window): Document mouse-1 in text area of window. | ||
| 6 | (Change Window): Don't mention window attributes, since they | ||
| 7 | aren't defined. C-x 1 can't be used with minibuffer windows. | ||
| 8 | Windows are no longer auto-deleted. | ||
| 9 | (Window Choice): Add xref to Choosing Window in Lisp manual. | ||
| 10 | (Window Convenience): Note that windmove disables shift-selection. | ||
| 11 | Move M-x compare-windows here from Other Window node. | ||
| 12 | |||
| 13 | * custom.texi (Mouse Buttons): | ||
| 14 | * search.texi (Isearch Scroll): | ||
| 15 | * windows.texi (Split Window): Use new names split-window-below | ||
| 16 | and split-window-right. | ||
| 17 | |||
| 1 | 2011-10-26 Juanma Barranquero <lekktu@gmail.com> | 18 | 2011-10-26 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 19 | ||
| 3 | * emacs.texi (Top): Fix typo. | 20 | * emacs.texi (Top): Fix typo. |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index d87c22ec28e..fd680576b4e 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -1774,7 +1774,7 @@ button, @code{mouse-2} for the next, and so on. Here is how you can | |||
| 1774 | redefine the second mouse button to split the current window: | 1774 | redefine the second mouse button to split the current window: |
| 1775 | 1775 | ||
| 1776 | @example | 1776 | @example |
| 1777 | (global-set-key [mouse-2] 'split-window-vertically) | 1777 | (global-set-key [mouse-2] 'split-window-below) |
| 1778 | @end example | 1778 | @end example |
| 1779 | 1779 | ||
| 1780 | The symbols for drag events are similar, but have the prefix | 1780 | The symbols for drag events are similar, but have the prefix |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index a8bd1cdf18d..0b68373d47c 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -328,12 +328,11 @@ prefix arguments to these commands in the usual way. This feature | |||
| 328 | won't let you scroll the current match out of visibility, however. | 328 | won't let you scroll the current match out of visibility, however. |
| 329 | 329 | ||
| 330 | The @code{isearch-allow-scroll} feature also affects some other | 330 | The @code{isearch-allow-scroll} feature also affects some other |
| 331 | commands, such as @kbd{C-x 2} (@code{split-window-vertically}) and | 331 | commands, such as @kbd{C-x 2} (@code{split-window-below}) and @kbd{C-x |
| 332 | @kbd{C-x ^} (@code{enlarge-window}), which don't exactly scroll but do | 332 | ^} (@code{enlarge-window}), which don't exactly scroll but do affect |
| 333 | affect where the text appears on the screen. It applies to any | 333 | where the text appears on the screen. It applies to any command whose |
| 334 | command whose name has a non-@code{nil} @code{isearch-scroll} | 334 | name has a non-@code{nil} @code{isearch-scroll} property. So you can |
| 335 | property. So you can control which commands are affected by changing | 335 | control which commands are affected by changing these properties. |
| 336 | these properties. | ||
| 337 | 336 | ||
| 338 | For example, to make @kbd{C-h l} usable within an incremental search | 337 | For example, to make @kbd{C-h l} usable within an incremental search |
| 339 | in all future Emacs sessions, use @kbd{C-h c} to find what command it | 338 | in all future Emacs sessions, use @kbd{C-h c} to find what command it |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 600d0b07818..ad2040c9047 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -34,24 +34,22 @@ has its own value of point. | |||
| 34 | 34 | ||
| 35 | @cindex selected window | 35 | @cindex selected window |
| 36 | At any time, one Emacs window is the @dfn{selected window}; the | 36 | At any time, one Emacs window is the @dfn{selected window}; the |
| 37 | buffer this window is displaying is the current buffer. The terminal's | 37 | buffer this window is displaying is the current buffer. Each window |
| 38 | cursor shows the location of point in this window. Each other window | 38 | has its own value of point. On graphical displays, the point is |
| 39 | has a location of point as well. On text-only terminals, there is no | 39 | indicated by a solid blinking cursor in the selected window, and by a |
| 40 | way to show where those locations are, since the terminal has only one | 40 | hollow box in non-selected windows. On text-only terminals, the |
| 41 | cursor. On a graphical display, the location of point in a | 41 | cursor is drawn only in the selected window. @xref{Cursor Display}. |
| 42 | non-selected window is indicated by a hollow box; the cursor in the | 42 | |
| 43 | selected window is blinking or solid. | 43 | Commands to move point affect the value of point for the selected |
| 44 | 44 | Emacs window only. They do not change the value of point in other | |
| 45 | Commands to move point affect the value of point for the selected Emacs | 45 | Emacs windows, even those showing the same buffer. The same is true |
| 46 | window only. They do not change the value of point in other Emacs | 46 | for buffer-switching commands such as @kbd{C-x b}; they do not affect |
| 47 | windows, even those showing the same buffer. The same is true for commands | 47 | other windows at all. However, there are other commands such as |
| 48 | such as @kbd{C-x b} to switch buffers in the selected window; | 48 | @kbd{C-x 4 b} that select a different window and switch buffers in it. |
| 49 | they do not affect other windows at all. However, there are other commands | 49 | Also, all commands that display information in a window, including |
| 50 | such as @kbd{C-x 4 b} that select a different window and switch buffers in | ||
| 51 | it. Also, all commands that display information in a window, including | ||
| 52 | (for example) @kbd{C-h f} (@code{describe-function}) and @kbd{C-x C-b} | 50 | (for example) @kbd{C-h f} (@code{describe-function}) and @kbd{C-x C-b} |
| 53 | (@code{list-buffers}), work by switching buffers in a nonselected window | 51 | (@code{list-buffers}), work by switching buffers in a nonselected |
| 54 | without affecting the selected window. | 52 | window without affecting the selected window. |
| 55 | 53 | ||
| 56 | When multiple windows show the same buffer, they can have different | 54 | When multiple windows show the same buffer, they can have different |
| 57 | regions, because they can have different values of point. However, | 55 | regions, because they can have different values of point. However, |
| @@ -61,7 +59,7 @@ only one mark position. | |||
| 61 | Each window has its own mode line, which displays the buffer name, | 59 | Each window has its own mode line, which displays the buffer name, |
| 62 | modification status and major and minor modes of the buffer that is | 60 | modification status and major and minor modes of the buffer that is |
| 63 | displayed in the window. The selected window's mode line appears in a | 61 | displayed in the window. The selected window's mode line appears in a |
| 64 | different color. @xref{Mode Line}, for full details on the mode line. | 62 | different color. @xref{Mode Line}, for details. |
| 65 | 63 | ||
| 66 | @node Split Window | 64 | @node Split Window |
| 67 | @section Splitting Windows | 65 | @section Splitting Windows |
| @@ -69,91 +67,87 @@ different color. @xref{Mode Line}, for full details on the mode line. | |||
| 69 | @table @kbd | 67 | @table @kbd |
| 70 | @item C-x 2 | 68 | @item C-x 2 |
| 71 | Split the selected window into two windows, one above the other | 69 | Split the selected window into two windows, one above the other |
| 72 | (@code{split-window-vertically}). | 70 | (@code{split-window-below}). |
| 73 | @item C-x 3 | 71 | @item C-x 3 |
| 74 | Split the selected window into two windows positioned side by side | 72 | Split the selected window into two windows, positioned side by side |
| 75 | (@code{split-window-horizontally}). | 73 | (@code{split-window-right}). |
| 76 | @item C-Mouse-2 | 74 | @item C-Mouse-2 |
| 77 | In the mode line or scroll bar of a window, split that window. | 75 | In the mode line or scroll bar of a window, split that window. |
| 78 | @end table | 76 | @end table |
| 79 | 77 | ||
| 80 | @kindex C-x 2 | 78 | @kindex C-x 2 |
| 81 | @findex split-window-vertically | 79 | @findex split-window-below |
| 82 | The command @kbd{C-x 2} (@code{split-window-vertically}) breaks the | 80 | @kbd{C-x 2} (@code{split-window-below}) splits the selected window |
| 83 | selected window into two windows, one above the other. Both windows start | 81 | into two windows, one above the other. After splitting, the selected |
| 84 | out displaying the same buffer, with the same value of point. By default | 82 | window is the upper one, and the newly split-off window is below. |
| 85 | the two windows each get half the height of the window that was split; a | 83 | Both windows have the same value of point as before, and display the |
| 86 | numeric argument specifies how many lines to give to the top window. | 84 | same portion of the buffer (or as close to it as possible). If |
| 85 | necessary, the windows are scrolled to keep point on-screen. By | ||
| 86 | default, the two windows each get half the height of the original | ||
| 87 | window. A positive numeric argument specifies how many lines to give | ||
| 88 | to the top window; a negative numeric argument specifies how many | ||
| 89 | lines to give to the bottom window. | ||
| 87 | 90 | ||
| 88 | @kindex C-x 3 | 91 | @vindex split-window-keep-point |
| 89 | @findex split-window-horizontally | 92 | If you change the variable @code{split-window-keep-point} to |
| 90 | @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected | 93 | @code{nil}, @kbd{C-x 2} instead adjusts the portion of the buffer |
| 91 | window into two side-by-side windows. A numeric argument specifies how | 94 | displayed by the two windows, as well as the value of point in each |
| 92 | many columns to give the one on the left. If you are not using | 95 | window, in order to keep the text on the screen as close as possible |
| 93 | scrollbars, a vertical line separates the two windows. | 96 | to what it was before; furthermore, if point was in the lower half of |
| 94 | You can customize its color with the face @code{vertical-border}. | 97 | the original window, the bottom window is selected instead of the |
| 95 | Windows that are not the full width of the screen have mode lines, but | 98 | upper one. |
| 96 | they are truncated. On terminals where Emacs does not support | ||
| 97 | highlighting, truncated mode lines sometimes do not appear in inverse | ||
| 98 | video. | ||
| 99 | 99 | ||
| 100 | @kindex C-Mouse-2 @r{(scroll bar)} | 100 | @kindex C-x 3 |
| 101 | You can split a window horizontally or vertically by clicking | 101 | @findex split-window-right |
| 102 | @kbd{C-Mouse-2} in the mode line or the scroll bar. The line of | 102 | @kbd{C-x 3} (@code{split-window-right}) splits the selected window |
| 103 | splitting goes through the place where you click: if you click on the | 103 | into two side-by-side windows. The left window is the selected one; |
| 104 | mode line, the new scroll bar goes above the spot; if you click in the | 104 | the right window displays the same portion of the same buffer, and has |
| 105 | scroll bar, the mode line of the split window is side by side with | 105 | the same value of point. A positive numeric argument specifies how |
| 106 | your click. | 106 | many columns to give the left window; a negative numeric argument |
| 107 | specifies how many columns to give the right window. | ||
| 107 | 108 | ||
| 108 | @vindex truncate-partial-width-windows | 109 | @vindex truncate-partial-width-windows |
| 109 | When a window occupies less than the full width of the frame, it may | 110 | When you split a window with @kbd{C-x 3}, each resulting window |
| 110 | become too narrow for most of the text lines in its buffer. If most of | 111 | occupies less than the full width of the frame. If it becomes too |
| 111 | its lines are continued (@pxref{Continuation Lines}), the buffer may | 112 | narrow, the buffer may be difficult to read if continuation lines are |
| 112 | become difficult to read. Therefore, Emacs automatically truncates | 113 | in use (@pxref{Continuation Lines}). Therefore, Emacs automatically |
| 113 | lines if the window width becomes narrower than 50 columns. This | 114 | switches to line truncation if the window width becomes narrower than |
| 114 | truncation occurs regardless of the value of the variable | 115 | 50 columns. This truncation occurs regardless of the value of the |
| 115 | @code{truncate-lines} (@pxref{Line Truncation}); it is instead | 116 | variable @code{truncate-lines} (@pxref{Line Truncation}); it is |
| 116 | controlled by the variable @code{truncate-partial-width-windows}. If | 117 | instead controlled by the variable |
| 117 | the value of @code{truncate-partial-width-windows} is a positive integer | 118 | @code{truncate-partial-width-windows}. If the value of this variable |
| 118 | (the default is 50), that specifies the minimum width for a | 119 | is a positive integer (the default is 50), that specifies the minimum |
| 119 | partial-width window before automatic line truncation occurs; if the | 120 | width for a partial-width window before automatic line truncation |
| 120 | value is @code{nil}, automatic line truncation is disabled; and for any | 121 | occurs; if the value is @code{nil}, automatic line truncation is |
| 121 | other non-@code{nil} value, Emacs truncates lines in every partial-width | 122 | disabled; and for any other non-@code{nil} value, Emacs truncates |
| 122 | window regardless of its width. | 123 | lines in every partial-width window regardless of its width. |
| 123 | 124 | ||
| 124 | Horizontal scrolling is often used in side-by-side windows. | 125 | On text terminals, side-by-side windows are separated by a vertical |
| 125 | @xref{Horizontal Scrolling}. | 126 | divider which is drawn using the @code{vertical-border} face. |
| 126 | 127 | ||
| 127 | @vindex split-window-keep-point | 128 | @kindex C-Mouse-2 @r{(scroll bar)} |
| 128 | If @code{split-window-keep-point} is non-@code{nil}, the default, | 129 | You can also split a window horizontally or vertically by clicking |
| 129 | both of the windows resulting from @kbd{C-x 2} inherit the value of | 130 | @kbd{C-Mouse-2} in the mode line or the scroll bar. If you click on |
| 130 | point from the window that was split. This means that scrolling is | 131 | the mode line, that puts the vertical divider where you click; if you |
| 131 | inevitable. If this variable is @code{nil}, then @kbd{C-x 2} tries to | 132 | click in the scroll bar, that puts the new mode-line where you click. |
| 132 | avoid scrolling the text currently visible on the screen, by putting | ||
| 133 | point in each window at a position already visible in the window. It | ||
| 134 | also selects whichever window contains the screen line that the cursor | ||
| 135 | was previously on. Some users prefer that mode on slow terminals. | ||
| 136 | 133 | ||
| 137 | @node Other Window | 134 | @node Other Window |
| 138 | @section Using Other Windows | 135 | @section Using Other Windows |
| 139 | 136 | ||
| 140 | @table @kbd | 137 | @table @kbd |
| 141 | @item C-x o | 138 | @item C-x o |
| 142 | Select another window (@code{other-window}). That is @kbd{o}, not zero. | 139 | Select another window (@code{other-window}). |
| 143 | @item C-M-v | 140 | @item C-M-v |
| 144 | Scroll the next window (@code{scroll-other-window}). | 141 | Scroll the next window (@code{scroll-other-window}). |
| 145 | @item M-x compare-windows | ||
| 146 | Find next place where the text in the selected window does not match | ||
| 147 | the text in the next window. | ||
| 148 | @item Mouse-1 | 142 | @item Mouse-1 |
| 149 | @kbd{Mouse-1}, in a window's mode line, selects that window | 143 | @kbd{Mouse-1}, in the text area of a window, selects the window and |
| 150 | but does not move point in it (@code{mouse-select-window}). | 144 | moves point to the position clicked. Clicking in the mode line |
| 145 | selects the window without moving point in it. | ||
| 151 | @end table | 146 | @end table |
| 152 | 147 | ||
| 153 | @kindex C-x o | 148 | @kindex C-x o |
| 154 | @findex other-window | 149 | @findex other-window |
| 155 | To select a different window, click with @kbd{Mouse-1} on its mode | 150 | With the keyboard, you can switch windows by typing @kbd{C-x o} |
| 156 | line. With the keyboard, you can switch windows by typing @kbd{C-x o} | ||
| 157 | (@code{other-window}). That is an @kbd{o}, for ``other,'' not a zero. | 151 | (@code{other-window}). That is an @kbd{o}, for ``other,'' not a zero. |
| 158 | When there are more than two windows, this command moves through all the | 152 | When there are more than two windows, this command moves through all the |
| 159 | windows in a cyclic order, generally top to bottom and left to right. | 153 | windows in a cyclic order, generally top to bottom and left to right. |
| @@ -172,17 +166,13 @@ finish supplying the minibuffer argument that is requested. | |||
| 172 | window only, but there is one command to scroll the next window. | 166 | window only, but there is one command to scroll the next window. |
| 173 | @kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that | 167 | @kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that |
| 174 | @kbd{C-x o} would select. It takes arguments, positive and negative, | 168 | @kbd{C-x o} would select. It takes arguments, positive and negative, |
| 175 | like @kbd{C-v}. (In the minibuffer, @kbd{C-M-v} scrolls the window | 169 | like @kbd{C-v}. (In the minibuffer, @kbd{C-M-v} scrolls the help |
| 176 | that contains the minibuffer help display, if any, rather than the | 170 | window associated with the minibuffer, if any, rather than the next |
| 177 | next window in the standard cyclic order.) | 171 | window in the standard cyclic order; @pxref{Minibuffer Edit}.) |
| 178 | |||
| 179 | The command @kbd{M-x compare-windows} lets you compare two files or | ||
| 180 | buffers visible in two windows, by moving through them to the next | ||
| 181 | mismatch. @xref{Comparing Files}, for details. | ||
| 182 | 172 | ||
| 183 | @vindex mouse-autoselect-window | 173 | @vindex mouse-autoselect-window |
| 184 | If you set @code{mouse-autoselect-window} to a non-@code{nil} value, | 174 | If you set @code{mouse-autoselect-window} to a non-@code{nil} value, |
| 185 | moving the mouse into a different window selects that window. This | 175 | moving the mouse over a different window selects that window. This |
| 186 | feature is off by default. | 176 | feature is off by default. |
| 187 | 177 | ||
| 188 | @node Pop Up Window | 178 | @node Pop Up Window |
| @@ -236,8 +226,7 @@ window (@code{find-file-read-only-other-window}). @xref{Visiting}. | |||
| 236 | 226 | ||
| 237 | @table @kbd | 227 | @table @kbd |
| 238 | @item C-x 0 | 228 | @item C-x 0 |
| 239 | Delete the selected window (@code{delete-window}). The last character | 229 | Delete the selected window (@code{delete-window}). |
| 240 | in this key sequence is a zero. | ||
| 241 | @item C-x 1 | 230 | @item C-x 1 |
| 242 | Delete all windows in the selected frame except the selected window | 231 | Delete all windows in the selected frame except the selected window |
| 243 | (@code{delete-other-windows}). | 232 | (@code{delete-other-windows}). |
| @@ -260,14 +249,12 @@ Make all windows the same height (@code{balance-windows}). | |||
| 260 | 249 | ||
| 261 | @kindex C-x 0 | 250 | @kindex C-x 0 |
| 262 | @findex delete-window | 251 | @findex delete-window |
| 263 | To delete a window, type @kbd{C-x 0} (@code{delete-window}). (That is | 252 | To delete the selected window, type @kbd{C-x 0} |
| 264 | a zero.) The space occupied by the deleted window is given to an | 253 | (@code{delete-window}). (That is a zero.) Once a window is deleted, |
| 265 | adjacent window (but not the minibuffer window, even if that is active | 254 | the space that it occupied is given to an adjacent window (but not the |
| 266 | at the time). Once a window is deleted, its attributes are forgotten; | 255 | minibuffer window, even if that is active at the time). Deleting the |
| 267 | only restoring a window configuration can bring it back. Deleting the | ||
| 268 | window has no effect on the buffer it used to display; the buffer | 256 | window has no effect on the buffer it used to display; the buffer |
| 269 | continues to exist, and you can select it in any window with @kbd{C-x | 257 | continues to exist, and you can still switch to with @kbd{C-x b}. |
| 270 | b}. | ||
| 271 | 258 | ||
| 272 | @findex kill-buffer-and-window | 259 | @findex kill-buffer-and-window |
| 273 | @kindex C-x 4 0 | 260 | @kindex C-x 4 0 |
| @@ -277,31 +264,35 @@ selected window. | |||
| 277 | 264 | ||
| 278 | @kindex C-x 1 | 265 | @kindex C-x 1 |
| 279 | @findex delete-other-windows | 266 | @findex delete-other-windows |
| 280 | @kbd{C-x 1} (@code{delete-other-windows}) is more powerful in a | 267 | @kbd{C-x 1} (@code{delete-other-windows}) deletes all the windows, |
| 281 | different way; it deletes all the windows except the selected one (and | 268 | @emph{except} the selected one; the selected window expands to use the |
| 282 | the minibuffer); the selected window expands to use the whole frame | 269 | whole frame. (This command cannot be used while the minibuffer window |
| 283 | except for the echo area. | 270 | is active; attempting to do so signals an error.) |
| 284 | 271 | ||
| 285 | @kindex C-x ^ | 272 | @kindex C-x ^ |
| 286 | @findex enlarge-window | 273 | @findex enlarge-window |
| 287 | @kindex C-x @} | 274 | @kindex C-x @} |
| 288 | @findex enlarge-window-horizontally | ||
| 289 | @vindex window-min-height | 275 | @vindex window-min-height |
| 276 | The command @kbd{C-x ^} (@code{enlarge-window}) makes the selected | ||
| 277 | window one line taller, taking space from a vertically adjacent window | ||
| 278 | without changing the height of the frame. With a positive numeric | ||
| 279 | argument, this command increases the window height by that many lines; | ||
| 280 | with a negative argument, it reduces the height by that many lines. | ||
| 281 | If there are no vertically adjacent windows (i.e. the window is at the | ||
| 282 | full frame height), that signals an error. The command also signals | ||
| 283 | an error if you attempt to reduce the height of any window below a | ||
| 284 | certain minimum number of lines, specified by the variable | ||
| 285 | @code{window-min-height} (the default is 4). | ||
| 286 | |||
| 287 | @findex enlarge-window-horizontally | ||
| 288 | @findex shrink-window-horizontally | ||
| 290 | @vindex window-min-width | 289 | @vindex window-min-width |
| 291 | To readjust the division of space among vertically adjacent windows, | 290 | Similarly, @kbd{C-x @}} (@code{enlarge-window-horizontally}) makes |
| 292 | use @kbd{C-x ^} (@code{enlarge-window}). It makes the currently | 291 | the selected window wider, and @kbd{C-x @{} |
| 293 | selected window one line bigger, or as many lines as is specified | 292 | (@code{shrink-window-horizontally}) makes it narrower. These commands |
| 294 | with a numeric argument. With a negative argument, it makes the | 293 | signal an error if you attempt to reduce the width of any window below |
| 295 | selected window smaller. @kbd{C-x @}} | 294 | a certain minimum number of columns, specified by the variable |
| 296 | (@code{enlarge-window-horizontally}) makes the selected window wider by | 295 | @code{window-min-width} (the default is 10). |
| 297 | the specified number of columns. @kbd{C-x @{} | ||
| 298 | (@code{shrink-window-horizontally}) makes the selected window narrower | ||
| 299 | by the specified number of columns. | ||
| 300 | |||
| 301 | When you make a window bigger, the space comes from its peers. If | ||
| 302 | this makes any window too small, it is deleted and its space is given | ||
| 303 | to an adjacent window. The minimum size is specified by the variables | ||
| 304 | @code{window-min-height} and @code{window-min-width}. | ||
| 305 | 296 | ||
| 306 | @kindex C-x - | 297 | @kindex C-x - |
| 307 | @findex shrink-window-if-larger-than-buffer | 298 | @findex shrink-window-if-larger-than-buffer |
| @@ -322,7 +313,7 @@ heights and to delete windows. @xref{Mode Line Mouse}. | |||
| 322 | @section Displaying a Buffer in a Window | 313 | @section Displaying a Buffer in a Window |
| 323 | 314 | ||
| 324 | It is a common Emacs operation to display or ``pop up'' some buffer | 315 | It is a common Emacs operation to display or ``pop up'' some buffer |
| 325 | in response to a user command. There are several different ways by | 316 | in response to a user command. There are several different ways in |
| 326 | which commands do this. | 317 | which commands do this. |
| 327 | 318 | ||
| 328 | Many commands, like @kbd{C-x C-f} (@code{find-file}), display the | 319 | Many commands, like @kbd{C-x C-f} (@code{find-file}), display the |
| @@ -333,18 +324,18 @@ usually work by calling @code{switch-to-buffer} internally | |||
| 333 | 324 | ||
| 334 | @findex display-buffer | 325 | @findex display-buffer |
| 335 | Some commands try to display ``intelligently'', trying not to take | 326 | Some commands try to display ``intelligently'', trying not to take |
| 336 | over the selected window, e.g. by splitting the selected window and | 327 | over the selected window, e.g. by splitting off a new window and |
| 337 | displaying the desired buffer in the child window. Such commands, | 328 | displaying the desired buffer there. Such commands, which include the |
| 338 | which include the various help commands (@pxref{Help}), work by | 329 | various help commands (@pxref{Help}), work by calling |
| 339 | calling @code{display-buffer} internally. @xref{Window Choice}, for | 330 | @code{display-buffer} internally. @xref{Window Choice}, for details. |
| 340 | details. | ||
| 341 | 331 | ||
| 342 | Other commands do the same as @code{display-buffer}, and | 332 | Other commands do the same as @code{display-buffer}, and |
| 343 | additionally select the displaying window so that you can begin | 333 | additionally select the displaying window so that you can begin |
| 344 | editing its buffer. The command @kbd{C-x `} (@code{next-error}) is | 334 | editing its buffer. The command @kbd{C-x `} (@code{next-error}) is |
| 345 | one example (@pxref{Compilation Mode}). Such commands work by calling | 335 | one example (@pxref{Compilation Mode}). Such commands work by calling |
| 346 | @code{pop-to-buffer} internally. @xref{Switching Buffers,,Switching | 336 | the function @code{pop-to-buffer} internally. @xref{Switching |
| 347 | to a Buffer in a Window, elisp, The Emacs Lisp Reference Manual}. | 337 | Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp |
| 338 | Reference Manual}. | ||
| 348 | 339 | ||
| 349 | Commands with names ending in @code{-other-window} behave like | 340 | Commands with names ending in @code{-other-window} behave like |
| 350 | @code{display-buffer}, except that they never display in the selected | 341 | @code{display-buffer}, except that they never display in the selected |
| @@ -367,7 +358,10 @@ Several of these commands are bound in the @kbd{C-x 5} prefix key. | |||
| 367 | @findex display-buffer | 358 | @findex display-buffer |
| 368 | 359 | ||
| 369 | The @code{display-buffer} command (as well as commands that call it | 360 | The @code{display-buffer} command (as well as commands that call it |
| 370 | internally) chooses a window to display using the following steps: | 361 | internally) chooses a window to display by following the steps given |
| 362 | below. @xref{Choosing Window,,Choosing a Window for Display, elisp, | ||
| 363 | The Emacs Lisp Reference Manual}, for details about how to alter this | ||
| 364 | sequence of steps. | ||
| 371 | 365 | ||
| 372 | @itemize | 366 | @itemize |
| 373 | @vindex same-window-buffer-names | 367 | @vindex same-window-buffer-names |
| @@ -433,36 +427,38 @@ and display the buffer there. | |||
| 433 | @cindex mode, Winner | 427 | @cindex mode, Winner |
| 434 | @cindex undoing window configuration changes | 428 | @cindex undoing window configuration changes |
| 435 | @cindex window configuration changes, undoing | 429 | @cindex window configuration changes, undoing |
| 436 | @kbd{M-x winner-mode} is a global minor mode that records the | 430 | Winner mode is a global minor mode that records the changes in the |
| 437 | changes in the window configuration (i.e. how the frames are | 431 | window configuration (i.e. how the frames are partitioned into |
| 438 | partitioned into windows), so that you can ``undo'' them. To undo, | 432 | windows), so that you can ``undo'' them. You can toggle Winner mode |
| 439 | use @kbd{C-c left} (@code{winner-undo}). If you change your mind | 433 | with @kbd{M-x winner-mode}, or by customizing the variable |
| 440 | while undoing, you can redo the changes you had undone using @kbd{C-c | 434 | @code{winner-mode}. When the mode is enabled, @kbd{C-c left} |
| 441 | right} (@code{M-x winner-redo}). Another way to enable Winner mode is | 435 | (@code{winner-undo}) undoes the last window configuration change. If |
| 442 | by customizing the variable @code{winner-mode}. | 436 | you change your mind while undoing, you can redo the changes you had |
| 437 | undone using @kbd{C-c right} (@code{M-x winner-redo}). | ||
| 438 | |||
| 439 | Follow mode (@kbd{M-x follow-mode}) synchronizes several windows on | ||
| 440 | the same buffer so that they always display adjacent sections of that | ||
| 441 | buffer. @xref{Follow Mode}. | ||
| 443 | 442 | ||
| 444 | @cindex Windmove package | 443 | @cindex Windmove package |
| 445 | @cindex directional window selection | 444 | @cindex directional window selection |
| 446 | @findex windmove-right | 445 | @findex windmove-right |
| 447 | @findex windmove-default-keybindings | 446 | @findex windmove-default-keybindings |
| 448 | The Windmove commands move directionally between neighboring windows in | 447 | The Windmove package defines commands for moving directionally |
| 449 | a frame. @kbd{M-x windmove-right} selects the window immediately to the | 448 | between neighboring windows in a frame. @kbd{M-x windmove-right} |
| 450 | right of the currently selected one, and similarly for the ``left,'' ``up,'' | 449 | selects the window immediately to the right of the currently selected |
| 451 | and ``down'' counterparts. @kbd{M-x windmove-default-keybindings} binds | 450 | one, and similarly for the ``left,'' ``up,'' and ``down'' |
| 452 | these commands to @kbd{S-right} etc. (Not all terminals support shifted | 451 | counterparts. @kbd{M-x windmove-default-keybindings} binds these |
| 453 | arrow keys, however.) | 452 | commands to @kbd{S-right} etc.; doing so disables shift selection for |
| 453 | those keys (@pxref{Shift Selection}). | ||
| 454 | 454 | ||
| 455 | Follow minor mode (@kbd{M-x follow-mode}) synchronizes several | 455 | The command @kbd{M-x compare-windows} lets you compare the text |
| 456 | windows on the same buffer so that they always display adjacent | 456 | shown in different windows. @xref{Comparing Files}. |
| 457 | sections of that buffer. @xref{Follow Mode}. | ||
| 458 | 457 | ||
| 459 | @vindex scroll-all-mode | 458 | @vindex scroll-all-mode |
| 460 | @cindex scrolling windows together | 459 | @cindex scrolling windows together |
| 461 | @cindex Scroll-all mode | 460 | @cindex Scroll-all mode |
| 462 | @cindex mode, Scroll-all | 461 | @cindex mode, Scroll-all |
| 463 | @kbd{M-x scroll-all-mode} provides commands to scroll all visible | 462 | Scroll All mode (@kbd{M-x scroll-all-mode}) is a global minor mode |
| 464 | windows together. You can also turn it on by customizing the variable | 463 | that causes scrolling commands and point motion commands to apply to |
| 465 | @code{scroll-all-mode}. The commands provided are @kbd{M-x | 464 | every single window. |
| 466 | scroll-all-scroll-down-all}, @kbd{M-x scroll-all-page-down-all} and | ||
| 467 | their corresponding ``up'' equivalents. To make this mode useful, | ||
| 468 | you should bind these commands to appropriate keys. | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2da562bdcfb..1a692c6b36d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-11-06 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * windows.texi (Basic Windows): Clarify various definitions. | ||
| 4 | Treat window-normalize-* as internal; don't document them. | ||
| 5 | (Windows and Frames): Various clarifications, e.g. non-live | ||
| 6 | windows also belong to frames. Fix window-list description. | ||
| 7 | Simplify window nesting example. | ||
| 8 | (Splitting Windows, Window Configurations): Use | ||
| 9 | split-window-below. | ||
| 10 | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | 11 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * windows.texi (Window Sizes): Mention in the doc string that the | 13 | * windows.texi (Window Sizes): Mention in the doc string that the |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index bd20f5d8f44..8b466e02214 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -50,216 +50,188 @@ is displayed in windows. | |||
| 50 | @section Basic Concepts of Emacs Windows | 50 | @section Basic Concepts of Emacs Windows |
| 51 | @cindex window | 51 | @cindex window |
| 52 | 52 | ||
| 53 | A @dfn{window} in Emacs is the physical area of the screen in which a | 53 | A @dfn{window} is a area of the screen which is used to display a |
| 54 | buffer is displayed, see @ref{Buffers}. The term is also used to refer | 54 | buffer (@pxref{Buffers}). In Emacs Lisp, windows are represented by a |
| 55 | to a Lisp object that represents that screen area in Emacs Lisp. It | 55 | special Lisp object type. |
| 56 | should be clear from the context which is meant. | ||
| 57 | 56 | ||
| 58 | @cindex multiple windows | 57 | @cindex multiple windows |
| 59 | Emacs groups windows into frames; see @ref{Frames}. Each frame always | 58 | Windows are grouped into frames (@pxref{Frames}). Each frame |
| 60 | contains at least one window, but you can subdivide it into multiple, | 59 | contains at least one window; the user can subdivide it into multiple, |
| 61 | non-overlapping Emacs windows. Users create multiple windows so they | 60 | non-overlapping windows to view several buffers at once. Lisp |
| 62 | can look at several buffers at once. Lisp libraries use multiple | 61 | programs can use multiple windows for a variety of purposes. In |
| 63 | windows for a variety of reasons, but most often to display related | 62 | Rmail, for example, you can view a summary of message titles in one |
| 64 | information. In Rmail, for example, you can move through a summary | 63 | window, and the contents of the selected message in another window. |
| 65 | buffer in one window while the other window shows messages one at a time | ||
| 66 | as they are reached. | ||
| 67 | 64 | ||
| 68 | @cindex terminal screen | 65 | @cindex terminal screen |
| 69 | @cindex screen of terminal | 66 | @cindex screen of terminal |
| 70 | The meaning of ``window'' in Emacs is similar to what it means in the | 67 | Emacs uses the word ``window'' with a different meaning than in |
| 71 | context of general-purpose window systems such as X, but not identical. | 68 | graphical desktop environments and window systems, such as the X |
| 72 | The X Window System places X windows on the screen; Emacs uses one or | 69 | Window System. When Emacs is run on X, each of its graphical X |
| 73 | more X windows as frames, and subdivides them into Emacs windows. When | 70 | windows is an Emacs frame (containing one or more Emacs windows). |
| 74 | you use Emacs on a character-only terminal, Emacs treats the whole | 71 | When Emacs is run on a text-only terminal, the frame fills the entire |
| 75 | terminal screen as one frame. | 72 | terminal screen. |
| 76 | 73 | ||
| 77 | @cindex tiled windows | 74 | @cindex tiled windows |
| 78 | Most window systems support arbitrarily located overlapping windows. | 75 | Unlike X windows, Emacs windows are @dfn{tiled}; they never overlap |
| 79 | In contrast, Emacs windows are @dfn{tiled}; they never overlap, and | 76 | within the area of the frame. When a window is created, resized, or |
| 80 | together they fill the whole screen or frame. Because of the way in | 77 | deleted, the change in window space is taken from or given to the |
| 81 | which Emacs creates new windows (@pxref{Splitting Windows}) and resizes | 78 | adjacent windows, so that the total area of the frame is unchanged. |
| 82 | them (@pxref{Resizing Windows}), not all conceivable tilings of windows | ||
| 83 | on an Emacs frame are actually possible. | ||
| 84 | |||
| 85 | For practical purposes, a window exists only while it is displayed in | ||
| 86 | a frame. Once removed from the frame, the window is effectively deleted | ||
| 87 | and should not be used, even though the Lisp object representing it | ||
| 88 | might be still referenced from other Lisp objects; see @ref{Deleting | ||
| 89 | Windows}. Restoring a saved window configuration is the only way for a | ||
| 90 | window no longer on the screen to come back to life; see @ref{Window | ||
| 91 | Configurations}. | ||
| 92 | |||
| 93 | @defun windowp object | ||
| 94 | This function returns @code{t} if @var{object} is a window, @code{nil} | ||
| 95 | otherwise. It can return @code{t} if @var{object} denotes a window that | ||
| 96 | has been deleted. | ||
| 97 | @end defun | ||
| 98 | 79 | ||
| 99 | @cindex live windows | 80 | @cindex live windows |
| 100 | @cindex internal windows | 81 | @cindex internal windows |
| 101 | For historical reasons a window is considered @dfn{live} if and only | 82 | A @dfn{live window} is one that is actually displaying a buffer in a |
| 102 | if it currently displays a buffer; see @ref{Buffers and Windows}. In | 83 | frame. Such a window can be @dfn{deleted}, i.e. removed from the |
| 103 | order to show multiple windows within one and the same frame, Emacs | 84 | frame (@pxref{Deleting Windows}); then it is no longer live, but the |
| 104 | organizes them in form of a tree called window tree; see @ref{Windows | 85 | Lisp object representing it might be still referenced from other Lisp |
| 105 | and Frames}. The internal nodes of a window tree are called internal | 86 | objects. A deleted window may be brought back to life by restoring a |
| 106 | windows and are not considered live. The leaf nodes of a window tree | 87 | saved window configuration (@pxref{Window Configurations}). |
| 107 | constitute the windows displaying buffers and only they will be called | 88 | |
| 108 | live here. | 89 | @defun windowp object |
| 90 | This function returns @code{t} if @var{object} is a window (whether or | ||
| 91 | not it is live). Otherwise, it returns @code{nil}. | ||
| 92 | @end defun | ||
| 109 | 93 | ||
| 110 | @defun window-live-p object | 94 | @defun window-live-p object |
| 111 | This function returns @code{t} if @var{object} is a live window and | 95 | This function returns @code{t} if @var{object} is a live window and |
| 112 | @code{nil} otherwise. A live window is a window that displays a buffer. | 96 | @code{nil} otherwise. A live window is one that displays a buffer. |
| 113 | @end defun | 97 | @end defun |
| 114 | 98 | ||
| 115 | @defun window-any-p object | 99 | The windows in each frame are organized into a @dfn{window tree}. |
| 116 | This function returns @code{t} if @var{object} denotes a live or an | 100 | @xref{Windows and Frames}. The leaf nodes of each window tree are |
| 117 | internal window and @code{nil} otherwise. In particular, this function | 101 | live windows---the ones actually displaying buffers. The internal |
| 118 | returns @code{nil} if @var{object} is a window that has been | 102 | nodes of the window tree are internal windows, which are not live. |
| 119 | deleted. | 103 | You can distinguish internal windows from deleted windows with |
| 104 | @code{window-valid-p}. | ||
| 105 | |||
| 106 | @defun window-valid-p object | ||
| 107 | This function returns @code{t} if @var{object} is a live window, or an | ||
| 108 | internal window in a window tree. Otherwise, it returns @code{nil}, | ||
| 109 | including for the case where @var{object} is a deleted window. | ||
| 120 | @end defun | 110 | @end defun |
| 121 | 111 | ||
| 122 | @cindex selected window | 112 | @cindex selected window |
| 123 | In each frame, at any time, one and only one window is designated as | 113 | In each frame, at any time, exactly one Emacs window is designated |
| 124 | @dfn{selected within the frame}. Also, at any time, one frame is the | 114 | as @dfn{selected within the frame}. For the selected frame, that |
| 125 | selected frame (@pxref{Input Focus}). The window selected within the | 115 | window is called the @dfn{selected window}---the one in which most |
| 126 | selected frame is the @dfn{selected window}. | 116 | editing takes place, and in which the cursor for selected windows |
| 127 | 117 | appears (@pxref{Cursor Parameters}). The selected window's buffer is | |
| 128 | The selected window is always a live window. Its buffer is usually | 118 | usually also the current buffer, except when @code{set-buffer} has |
| 129 | the current buffer (except when @code{set-buffer} has been used); see | 119 | been used (@pxref{Current Buffer}). As for non-selected frames, the |
| 130 | @ref{Current Buffer}. | 120 | window selected within the frame becomes the selected window if the |
| 121 | frame is ever selected. @xref{Selecting Windows}. | ||
| 131 | 122 | ||
| 132 | @defun selected-window | 123 | @defun selected-window |
| 133 | This function returns the selected window. This is the window in which | 124 | This function returns the selected window (which is always a live |
| 134 | the cursor for selected windows (@pxref{Cursor Parameters}) appears and | 125 | window). |
| 135 | to which many commands apply. | ||
| 136 | @end defun | ||
| 137 | |||
| 138 | The window handling functions can be roughly grouped into functions | ||
| 139 | operating on live windows only and functions that accept any window as | ||
| 140 | argument. Many of these functions accept as argument the value | ||
| 141 | @code{nil} to specify the selected window. The two functions below can | ||
| 142 | be used to ``normalize'' arguments specifying windows in a uniform | ||
| 143 | manner. | ||
| 144 | |||
| 145 | @defun window-normalize-any-window window | ||
| 146 | This function returns the normalized value for @var{window} which can be | ||
| 147 | any window that has not been deleted. More precisely, if @var{window} | ||
| 148 | is @code{nil}, it returns the selected window. If @var{window} denotes | ||
| 149 | a live or internal window, it returns that window. Otherwise, this | ||
| 150 | function signals an error. | ||
| 151 | @end defun | ||
| 152 | |||
| 153 | @defun window-normalize-live-window window | ||
| 154 | This functions returns the normalized value for a live window | ||
| 155 | @var{window}. More precisely, if @var{window} is @code{nil}, it returns | ||
| 156 | the selected window. If @var{window} is a live window, it returns that | ||
| 157 | window. Otherwise, this function signals an error. | ||
| 158 | @end defun | 126 | @end defun |
| 159 | 127 | ||
| 160 | |||
| 161 | @node Windows and Frames | 128 | @node Windows and Frames |
| 162 | @section Windows and Frames | 129 | @section Windows and Frames |
| 163 | 130 | ||
| 164 | Each window is part of one and only one frame (@pxref{Frames}); you can | 131 | Each window belongs to exactly one frame (@pxref{Frames}). |
| 165 | get that frame with the function described next. | ||
| 166 | 132 | ||
| 167 | @defun window-frame window | 133 | @defun window-frame window |
| 168 | This function returns the frame that @var{window} is on. The argument | 134 | This function returns the frame that the window @var{window} belongs |
| 169 | @var{window} can be any window and defaults to the selected one. | 135 | to. If @var{window} is @code{nil}, it defaults to the selected |
| 136 | window. | ||
| 170 | @end defun | 137 | @end defun |
| 171 | 138 | ||
| 172 | The following function returns a list of all live windows on a specific | 139 | @defun window-list &optional frame minibuffer window |
| 173 | frame. | 140 | This function returns a list of live windows belonging to the frame |
| 141 | @var{frame}. If @var{frame} is omitted or @code{nil}, it defaults to | ||
| 142 | the selected frame. | ||
| 174 | 143 | ||
| 175 | @defun window-list &optional frame minibuf window | 144 | The optional argument @var{minibuffer} specifies whether to include |
| 176 | This function returns a list of @var{frame}'s live windows, starting | 145 | the minibuffer window in the returned list. If @var{minibuffer} is |
| 177 | with @var{window}. The optional argument @var{frame} has to denote a | 146 | @code{t}, the minibuffer window is included. If @var{minibuffer} is |
| 178 | live frame and defaults to the selected frame. The optional argument | 147 | @code{nil} or omitted, the minibuffer window is included only if it is |
| 179 | @var{window} has to denote a live window on the frame specified by | 148 | active. If @var{minibuffer} is neither @code{nil} nor @code{t}, the |
| 180 | @var{frame} and defaults to the selected one. | 149 | minibuffer window is never included. |
| 181 | 150 | ||
| 182 | The argument @var{minibuf} specifies if the minibuffer window shall be | 151 | The optional argument @var{window}, if non-@code{nil}, should be a |
| 183 | included in the return value. If @var{minibuf} is @code{t}, the result | 152 | live window on the specified frame; then @var{window} will be the |
| 184 | always includes the minibuffer window. If @var{minibuf} is @code{nil} | 153 | first element in the returned list. If @var{window} is omitted or |
| 185 | or omitted, that includes the minibuffer window only if it is active. | 154 | @code{nil}, the window selected within the frame is first element. |
| 186 | If @var{minibuf} is neither @code{nil} nor @code{t}, the result never | ||
| 187 | includes the minibuffer window. | ||
| 188 | @end defun | 155 | @end defun |
| 189 | 156 | ||
| 190 | @cindex window tree | 157 | @cindex window tree |
| 191 | Windows within one and the same frame are organized in form of a tree | 158 | @cindex root window |
| 192 | called @dfn{window tree}. The leaf nodes of a window tree constitute | 159 | Windows in the same frame are organized into a @dfn{window tree}, |
| 193 | the windows visible to the user. These are the windows associated with | 160 | whose leaf nodes are the live windows. The internal nodes of a window |
| 194 | buffers and are usually called live windows. The internal nodes of a | 161 | tree are not live; they exist for the purpose of organizing the |
| 195 | window tree are needed for finding, traversing and displaying the live | 162 | relationships between live windows. The root node of a window tree is |
| 196 | windows. | 163 | called the @dfn{root window}. It can be either a live window (if the |
| 197 | 164 | frame has just one window), or an internal window. | |
| 198 | A minibuffer window (@pxref{Minibuffer Windows}) is not considered | 165 | |
| 199 | part of its frame's window tree unless the frame is a minibuffer-only | 166 | A minibuffer window (@pxref{Minibuffer Windows}) is not part of its |
| 200 | frame. Most functions covered in this section accept, however, the | 167 | frame's window tree unless the frame is a minibuffer-only frame. |
| 201 | minibuffer window as argument. Also, the minibuffer window is listed by | 168 | Nonetheless, most of the functions in this section accept the |
| 202 | the function @code{window-tree} described at the end of this section. | 169 | minibuffer window as an argument. Also, the function |
| 203 | 170 | @code{window-tree} described at the end of this section lists the | |
| 204 | A window tree is rooted at the root window of its frame. | 171 | minibuffer window alongside the actual window tree. |
| 205 | 172 | ||
| 206 | @defun frame-root-window &optional frame-or-window | 173 | @defun frame-root-window &optional frame-or-window |
| 207 | This function returns the root window of @var{frame-or-window}. The | 174 | This function returns the root window for @var{frame-or-window}. The |
| 208 | argument @var{frame-or-window} has to denote either a window or a frame | 175 | argument @var{frame-or-window} should be either a window or a frame; |
| 209 | and defaults to the selected frame. If @var{frame-or-window} denotes a | 176 | if omitted or @code{nil}, it defaults to the selected frame. If |
| 210 | window, the return value is the root window of that window's frame. | 177 | @var{frame-or-window} is a window, the return value is the root window |
| 211 | This function always returns a window; a live window if the frame | 178 | of that window's frame. |
| 212 | specified by @var{frame-or-window} contains no other live windows and an | ||
| 213 | internal window otherwise. | ||
| 214 | @end defun | 179 | @end defun |
| 215 | 180 | ||
| 216 | @cindex subwindow | 181 | @cindex parent window |
| 217 | All other windows of a frame with the exception of the minibuffer window | 182 | @cindex child window |
| 218 | are subwindows of the frame's root window. A window is considered a | 183 | @cindex sibling window |
| 219 | @dfn{subwindow} of another window if it occupies a part of that other | 184 | When a window is split, there are two live windows where previously |
| 220 | window's screen area. | 185 | there was one. One of these is represented by the same Lisp window |
| 221 | 186 | object as the original window, and the other is represented by a | |
| 222 | The functions described next allow to access the members of a window | 187 | newly-created Lisp window object. Both of these live windows become |
| 223 | tree and take an arbitrary window as argument. | 188 | leaf nodes of the window tree, as @dfn{child windows} of a single |
| 189 | internal window. If necessary, Emacs automatically creates this | ||
| 190 | internal window, which is also called the @dfn{parent window}, and | ||
| 191 | assigns it to the appropriate position in the window tree. A set of | ||
| 192 | windows that share the same parent are called @dfn{siblings}. | ||
| 224 | 193 | ||
| 225 | @cindex parent window | 194 | @cindex parent window |
| 226 | @defun window-parent &optional window | 195 | @defun window-parent &optional window |
| 227 | Return @var{window}'s parent in the window tree. The optional argument | 196 | This function returns the parent window of @var{window}. If |
| 228 | @var{window} can denote an arbitrary window and defaults to the selected | 197 | @var{window} is omitted or @code{nil}, it defaults to the selected |
| 229 | one. The return value is @code{nil} if @var{window} is a minibuffer | 198 | window. The return value is @code{nil} if @var{window} has no parent |
| 230 | window or the root window of its frame and an internal window otherwise. | 199 | (i.e. it is a minibuffer window or the root window of its frame). |
| 231 | @end defun | 200 | @end defun |
| 232 | 201 | ||
| 233 | @cindex child window | 202 | Each internal window always has at least two child windows. If this |
| 234 | Parent windows do not appear on the screen. The screen area of a | 203 | number falls to one as a result of window deletion, Emacs |
| 235 | parent window is the rectangular part of the window's frame occupied by | 204 | automatically deletes the internal window, and its sole remaining |
| 236 | the window's @dfn{child windows}, that is, the set of windows having | 205 | child window takes its place in the window tree. |
| 237 | that window as their parent. Each parent window has at least two child | 206 | |
| 238 | windows, so there are no ``Matryoshka'' windows. Minibuffer windows do | 207 | Each child window can be either a live window, or an internal window |
| 239 | not have child windows. | 208 | (which in turn would have its own child windows). Therefore, each |
| 209 | internal window can be thought of as occupying a certain rectangular | ||
| 210 | @dfn{screen area}---the union of the areas occupied by the live | ||
| 211 | windows that are ultimately descended from it. | ||
| 240 | 212 | ||
| 241 | @cindex window combination | 213 | @cindex window combination |
| 242 | @cindex vertical combination | 214 | @cindex vertical combination |
| 243 | @cindex horizontal combination | 215 | @cindex horizontal combination |
| 244 | The children of any parent window form either a vertical or a horizontal | 216 | For each internal window, the screen areas of the immediate children |
| 245 | combination of windows. A @dfn{vertical combination} is a set of | 217 | are arranged either vertically or horizontally (never both). If the |
| 246 | windows arranged one above each other. A @dfn{horizontal combination} | 218 | child windows are arranged one above the other, they are said to form |
| 247 | is a set of windows arranged side by side. Consider the frame shown | 219 | a @dfn{vertical combination}; if they are arranged side by side, they |
| 248 | below (for simplicity we assume that the frame does not contain a | 220 | are said to form a @dfn{horizontal combination}. Consider the |
| 249 | minibuffer window): | 221 | following example: |
| 250 | 222 | ||
| 251 | @smallexample | 223 | @smallexample |
| 252 | @group | 224 | @group |
| 253 | ______________________________________ | 225 | ______________________________________ |
| 254 | | ______ ____________________________ | | 226 | | ______ ____________________________ | |
| 255 | || || __________________________ || | 227 | || || __________________________ || |
| 256 | || ||| ___________ ___________ ||| | 228 | || ||| ||| |
| 257 | || |||| || |||| | 229 | || ||| ||| |
| 258 | || |||| || |||| | 230 | || ||| ||| |
| 259 | || ||||_____W6____||_____W7____|||| | ||
| 260 | || |||____________W4____________||| | 231 | || |||____________W4____________||| |
| 261 | || || __________________________ || | 232 | || || __________________________ || |
| 262 | || ||| ||| | 233 | || ||| ||| |
| 234 | || ||| ||| | ||
| 263 | || |||____________W5____________||| | 235 | || |||____________W5____________||| |
| 264 | ||__W2__||_____________W3_____________ | | 236 | ||__W2__||_____________W3_____________ | |
| 265 | |__________________W1__________________| | 237 | |__________________W1__________________| |
| @@ -267,91 +239,70 @@ minibuffer window): | |||
| 267 | @end group | 239 | @end group |
| 268 | @end smallexample | 240 | @end smallexample |
| 269 | 241 | ||
| 270 | The root window of the frame is @code{W1}---a horizontal combination of | 242 | @noindent |
| 271 | the live window @code{W2} and the internal window @code{W3}. Hence | 243 | The root window of this frame is an internal window, @code{W1}. Its |
| 272 | @code{(window-parent W1)} is @code{nil} while @code{(window-parent W2)} | 244 | child windows form a horizontal combination, consisting of the live |
| 273 | and @code{(window-parent W3)} are both @code{W1}. | 245 | window @code{W2} and the internal window @code{W3}. The child windows |
| 274 | 246 | of @code{W3} form a vertical combination, consisting of the live | |
| 275 | The internal window @code{W3} is a vertical combination of @code{W4} | 247 | windows @code{W4} and @code{W5}. Hence, the live windows in this |
| 276 | and the live window @code{W5}. The internal window @code{W4} is a | 248 | window tree are @code{W2} @code{W4}, and @code{W5}. |
| 277 | horizontal combination of the live windows @code{W6} and @code{W7}. The | 249 | |
| 278 | windows you can actually see on the screen are @code{W2}, @code{W5}, | 250 | The following functions can be used to retrieve a child window of an |
| 279 | @code{W6} and @code{W7}. | 251 | internal window, and the siblings of a child window. |
| 280 | 252 | ||
| 281 | For any parent window, the first child window can be retrieved by the | 253 | @defun window-top-child window |
| 282 | functions given next. | 254 | This function returns the topmost child window of @var{window}, if |
| 283 | 255 | @var{window} is an internal window whose children form a vertical | |
| 284 | @defun window-top-child &optional window | 256 | combination. For any other type of window, the return value is |
| 285 | This function returns @var{window}'s first vertical child window. The | 257 | @code{nil}. |
| 286 | optional argument @var{window} can be an arbitrary window and defaults | ||
| 287 | to the selected one. The return value is @code{nil} if @var{window} is | ||
| 288 | a live window or its children form a horizontal combination. In the | ||
| 289 | example above @code{(window-top-child W3)} is @code{W4} while | ||
| 290 | @code{(window-top-child W4)} is @code{nil}. | ||
| 291 | @end defun | 258 | @end defun |
| 292 | 259 | ||
| 293 | @defun window-left-child &optional window | 260 | @defun window-left-child window |
| 294 | This function returns @var{window}'s first horizontal child window. The | 261 | This function returns the leftmost child window of @var{window}, if |
| 295 | optional argument @var{window} can be an arbitrary window and defaults | 262 | @var{window} is an internal window whose children form a horizontal |
| 296 | to the selected one. The return value is @code{nil} if @var{window} is | 263 | combination. For any other type of window, the return value is |
| 297 | a live window or its children form a vertical combination. In the | 264 | @code{nil}. |
| 298 | example above @code{(window-left-child W4)} is @code{W6} while | ||
| 299 | @code{(window-left-child W3)} is @code{nil}. | ||
| 300 | @end defun | 265 | @end defun |
| 301 | 266 | ||
| 302 | @defun window-child window | 267 | @defun window-child window |
| 303 | This function return @var{window}'s first child window. The return | 268 | This function returns the first child window of the internal window |
| 304 | value is @code{nil} if @var{window} is a live window. In the example | 269 | @var{window}---the topmost child window for a vertical combination, or |
| 305 | above @code{(window-child W3)} is @code{W4} while @code{(window-child | 270 | the leftmost child window for a horizontal combination. If |
| 306 | W4)} is @code{W6}. | 271 | @var{window} is a live window, the return value is @code{nil}. |
| 307 | @end defun | 272 | @end defun |
| 308 | 273 | ||
| 309 | The following function is useful to determine whether a window is part | ||
| 310 | of a vertical or horizontal combination. | ||
| 311 | |||
| 312 | @defun window-combined-p &optional window horizontal | 274 | @defun window-combined-p &optional window horizontal |
| 313 | This function returns non-@code{nil} if and only if @var{window} is | 275 | This function returns a non-@code{nil} value if and only if |
| 314 | vertically combined. The argument @var{window} can specify any window | 276 | @var{window} is part of a vertical combination. If @var{window} is |
| 315 | and defaults to the selected one. The actual return value is the first | 277 | omitted or nil, it defaults to the selected one. |
| 316 | vertical child of window. | ||
| 317 | 278 | ||
| 318 | If the optional argument @var{horizontal} is non-@code{nil}, this means | 279 | If the optional argument @var{horizontal} is non-@code{nil}, this |
| 319 | to return non-@code{nil} if and only if @var{window} is horizontally | 280 | means to return non-@code{nil} if and only if @var{window} is part of |
| 320 | combined. In this case, the return value is the first horizontal child | 281 | a horizontal combination. |
| 321 | of window. | ||
| 322 | @end defun | 282 | @end defun |
| 323 | 283 | ||
| 324 | @cindex sibling window | ||
| 325 | For any window that is part of a combination, the other windows in that | ||
| 326 | combination are called the window's @dfn{siblings}. The only windows | ||
| 327 | that do not have siblings are root windows of frames and minibuffer | ||
| 328 | windows. A window's siblings can be retrieved with the following two | ||
| 329 | functions. | ||
| 330 | |||
| 331 | @defun window-next-sibling &optional window | 284 | @defun window-next-sibling &optional window |
| 332 | This function returns @var{window}'s next sibling. The optional | 285 | This function returns the next sibling of the window @var{window}. If |
| 333 | argument @var{window} can be an arbitrary window and defaults to the | 286 | omitted or @code{nil}, @var{window} defaults to the selected window. |
| 334 | selected window. It returns @code{nil} if @var{window} is the last | 287 | The return value is @code{nil} if @var{window} is the last child of |
| 335 | child of its parent. In our example @code{(window-next-sibling W2)} is | 288 | its parent. |
| 336 | @code{W3} while @code{(window-next-sibling W3)} is @code{nil}. | ||
| 337 | @end defun | 289 | @end defun |
| 338 | 290 | ||
| 339 | @defun window-prev-sibling &optional window | 291 | @defun window-prev-sibling &optional window |
| 340 | This function returns @var{window}'s previous sibling. The optional | 292 | This function returns the previous sibling of the window @var{window}. |
| 341 | argument @var{window} can be an arbitrary window and defaults to the | 293 | If omitted or @code{nil}, @var{window} defaults to the selected |
| 342 | selected window. It returns @code{nil} if @var{window} is the first | 294 | window. The return value is @code{nil} if @var{window} is the first |
| 343 | child of its parent. In our example @code{(window-prev-sibling W3)} is | 295 | child of its parent. |
| 344 | @code{W2} and @code{(window-prev-sibling W2)} is @code{nil}. | ||
| 345 | @end defun | 296 | @end defun |
| 346 | 297 | ||
| 347 | The functions @code{window-next-sibling} and @code{window-prev-sibling} | 298 | The functions @code{window-next-sibling} and |
| 348 | should not be confused with the functions @code{next-window} and | 299 | @code{window-prev-sibling} should not be confused with the functions |
| 349 | @code{previous-window} which respectively return the next and previous | 300 | @code{next-window} and @code{previous-window} which respectively |
| 350 | window in the cyclic ordering of windows, see @ref{Cyclic Window | 301 | return the next and previous window in the cyclic ordering of windows |
| 351 | Ordering}. | 302 | (@pxref{Cyclic Window Ordering}). |
| 352 | 303 | ||
| 353 | In order to find the first live window on a frame, the following | 304 | You can use the following functions to find the first live window on |
| 354 | function can be used. | 305 | a frame, and to retrieve the entire window tree of a frame: |
| 355 | 306 | ||
| 356 | @defun frame-first-window &optional frame-or-window | 307 | @defun frame-first-window &optional frame-or-window |
| 357 | This function returns the live window at the upper left corner of the | 308 | This function returns the live window at the upper left corner of the |
| @@ -363,31 +314,27 @@ the assumption that the frame from our canonical example is selected | |||
| 363 | @code{(frame-first-window)} returns @code{W2}. | 314 | @code{(frame-first-window)} returns @code{W2}. |
| 364 | @end defun | 315 | @end defun |
| 365 | 316 | ||
| 366 | You can get the window tree of a frame with the following function. | ||
| 367 | |||
| 368 | @cindex window tree | ||
| 369 | @defun window-tree &optional frame | 317 | @defun window-tree &optional frame |
| 370 | This function returns the window tree for frame @var{frame}. The | 318 | This function returns a list representing the window tree for frame |
| 371 | optional argument @var{frame} must be a live frame and defaults to the | 319 | @var{frame}. If @var{frame} is omitted or @code{nil}, it defaults to |
| 372 | selected one. | 320 | the selected frame. |
| 373 | 321 | ||
| 374 | The return value is a list of the form @code{(@var{root} @var{mini})}, | 322 | The return value is a list of the form @code{(@var{root} @var{mini})}, |
| 375 | where @var{root} represents the window tree of the frame's | 323 | where @var{root} represents the window tree of the frame's root |
| 376 | root window, and @var{mini} is the frame's minibuffer window. | 324 | window, and @var{mini} is the frame's minibuffer window. |
| 377 | 325 | ||
| 378 | If the root window is live, @var{root} specifies the root window and | 326 | If the root window is live, @var{root} is that window itself. |
| 379 | nothing else. Otherwise, @var{root} is a list @code{(@var{dir} | 327 | Otherwise, @var{root} is a list @code{(@var{dir} @var{edges} @var{w1} |
| 380 | @var{edges} @var{w1} @var{w2} ...)} where @var{dir} is @code{nil} for a | 328 | @var{w2} ...)} where @var{dir} is @code{nil} for a horizontal |
| 381 | horizontal combination, and @code{t} for a vertical combination, | 329 | combination and @code{t} for a vertical combination, @var{edges} gives |
| 382 | @var{edges} gives the size and position of the combination, and the | 330 | the size and position of the combination, and the remaining elements |
| 383 | remaining elements are the child windows. Each child window may again | 331 | are the child windows. Each child window may again be a window object |
| 384 | be a live window or a list representing a window combination, and so on. | 332 | (for a live window) or a list with the same format as above (for an |
| 385 | The @var{edges} element is a list @code{(@var{left}@var{ top}@var{ | 333 | internal window). The @var{edges} element is a list @code{(@var{left} |
| 386 | right}@var{ bottom})} similar to the value returned by | 334 | @var{top} @var{right} @var{bottom})}, similar to the value returned by |
| 387 | @code{window-edges}, see @ref{Coordinates and Windows}. | 335 | @code{window-edges} (@pxref{Coordinates and Windows}). |
| 388 | @end defun | 336 | @end defun |
| 389 | 337 | ||
| 390 | |||
| 391 | @node Window Sizes | 338 | @node Window Sizes |
| 392 | @section Window Sizes | 339 | @section Window Sizes |
| 393 | @cindex window size | 340 | @cindex window size |
| @@ -1566,7 +1513,7 @@ configuration. | |||
| 1566 | For interactive use, Emacs provides two commands which always split the | 1513 | For interactive use, Emacs provides two commands which always split the |
| 1567 | selected window. | 1514 | selected window. |
| 1568 | 1515 | ||
| 1569 | @deffn Command split-window-above-each-other &optional size | 1516 | @deffn Command split-window-below &optional size |
| 1570 | This function splits the selected window into two windows, one above the | 1517 | This function splits the selected window into two windows, one above the |
| 1571 | other, leaving the upper of the two windows selected, with @var{size} | 1518 | other, leaving the upper of the two windows selected, with @var{size} |
| 1572 | lines. (If @var{size} is negative, then the lower of the two windows | 1519 | lines. (If @var{size} is negative, then the lower of the two windows |
| @@ -1582,16 +1529,16 @@ is the new, lower window. | |||
| 1582 | 1529 | ||
| 1583 | @defopt split-window-keep-point | 1530 | @defopt split-window-keep-point |
| 1584 | If this variable is non-@code{nil} (the default), then | 1531 | If this variable is non-@code{nil} (the default), then |
| 1585 | @code{split-window-above-each-other} behaves as described above. | 1532 | @code{split-window-below} behaves as described above. |
| 1586 | 1533 | ||
| 1587 | If it is @code{nil}, then @code{split-window-above-each-other} | 1534 | If it is @code{nil}, then @code{split-window-below} adjusts point |
| 1588 | adjusts point in each of the two windows to avoid scrolling. (This is | 1535 | in each of the two windows to avoid scrolling. (This is useful on |
| 1589 | useful on slow terminals.) It selects whichever window contains the | 1536 | slow terminals.) It selects whichever window contains the screen line |
| 1590 | screen line that point was previously on. Other functions are not | 1537 | that point was previously on. Other functions are not affected by |
| 1591 | affected by this variable. | 1538 | this variable. |
| 1592 | @end defopt | 1539 | @end defopt |
| 1593 | 1540 | ||
| 1594 | @deffn Command split-window-side-by-side &optional size | 1541 | @deffn Command split-window-right &optional size |
| 1595 | This function splits the selected window into two windows | 1542 | This function splits the selected window into two windows |
| 1596 | side-by-side, leaving the selected window on the left with @var{size} | 1543 | side-by-side, leaving the selected window on the left with @var{size} |
| 1597 | columns. If @var{size} is negative, the rightmost window gets | 1544 | columns. If @var{size} is negative, the rightmost window gets |
| @@ -3689,7 +3636,7 @@ as @code{save-window-excursion}: | |||
| 3689 | @group | 3636 | @group |
| 3690 | (let ((config (current-window-configuration))) | 3637 | (let ((config (current-window-configuration))) |
| 3691 | (unwind-protect | 3638 | (unwind-protect |
| 3692 | (progn (split-window-vertically nil) | 3639 | (progn (split-window-below nil) |
| 3693 | @dots{}) | 3640 | @dots{}) |
| 3694 | (set-window-configuration config))) | 3641 | (set-window-configuration config))) |
| 3695 | @end group | 3642 | @end group |
| @@ -1033,33 +1033,31 @@ directionality are not known in advance, without disrupting the layout | |||
| 1033 | of the line. | 1033 | of the line. |
| 1034 | 1034 | ||
| 1035 | ** Window changes | 1035 | ** Window changes |
| 1036 | |||
| 1037 | +++ | 1036 | +++ |
| 1038 | *** Window tree functions are accessible in Elisp. | 1037 | *** Window tree functions are accessible in Elisp. |
| 1039 | Functions are provided to return the parent, siblings or child windows | 1038 | Functions are provided to return the parent, siblings or child windows |
| 1040 | of any window including internal windows (windows not associated with a | 1039 | of any window including internal windows (windows not associated with a |
| 1041 | buffer) in the window tree. | 1040 | buffer) in the window tree. |
| 1042 | |||
| 1043 | +++ | 1041 | +++ |
| 1044 | *** Window manipulation can deal with internal windows. | 1042 | **** New function `window-valid-p' gives non-nil for live and internal |
| 1043 | windows. | ||
| 1044 | +++ | ||
| 1045 | **** Window manipulation can deal with internal windows. | ||
| 1045 | Many window handling functions like `split-window', `delete-window', or | 1046 | Many window handling functions like `split-window', `delete-window', or |
| 1046 | `delete-other-windows' as well as the window resizing functions can now | 1047 | `delete-other-windows' as well as the window resizing functions can now |
| 1047 | act on any window including internal ones. | 1048 | act on any window including internal ones. |
| 1048 | |||
| 1049 | +++ | 1049 | +++ |
| 1050 | *** window-total-height/-width vs window-body-height/-width. | 1050 | *** window-total-height/-width vs window-body-height/-width. |
| 1051 | The function `window-height' has been renamed to `window-total-height' | 1051 | The function `window-height' has been renamed to `window-total-height' |
| 1052 | and `window-width' has been renamed to `window-body-width'. The old | 1052 | and `window-width' has been renamed to `window-body-width'. The old |
| 1053 | names are provided as aliases. Two new functions `window-total-width' | 1053 | names are provided as aliases. Two new functions `window-total-width' |
| 1054 | and `window-body-height' are provided. | 1054 | and `window-body-height' are provided. |
| 1055 | |||
| 1056 | +++ | 1055 | +++ |
| 1057 | *** Window parameters specific to window handling functions. | 1056 | *** Window parameters specific to window handling functions. |
| 1058 | For each window you can specify a parameter to override the default | 1057 | For each window you can specify a parameter to override the default |
| 1059 | behavior of a number of functions like `split-window', `delete-window' | 1058 | behavior of a number of functions like `split-window', `delete-window' |
| 1060 | and `delete-other-windows'. The variable `ignore-window-parameters' | 1059 | and `delete-other-windows'. The variable `ignore-window-parameters' |
| 1061 | allows to ignore processing such parameters. | 1060 | allows to ignore processing such parameters. |
| 1062 | |||
| 1063 | +++ | 1061 | +++ |
| 1064 | *** New semantics of third argument of `split-window'. | 1062 | *** New semantics of third argument of `split-window'. |
| 1065 | The third argument of `split-window' has been renamed to SIDE and can be | 1063 | The third argument of `split-window' has been renamed to SIDE and can be |
| @@ -1067,17 +1065,14 @@ set to any of the values 'below, 'right, 'above, or 'left to make the | |||
| 1067 | new window appear on the corresponding side of the window that shall be | 1065 | new window appear on the corresponding side of the window that shall be |
| 1068 | split. Any other value of SIDE will cause `split-window' to split the | 1066 | split. Any other value of SIDE will cause `split-window' to split the |
| 1069 | window into two side-by-side windows as before. | 1067 | window into two side-by-side windows as before. |
| 1070 | |||
| 1071 | +++ | 1068 | +++ |
| 1072 | *** Window resizing functions. | 1069 | *** Window resizing functions. |
| 1073 | A new standard function for resizing windows called `window-resize' has | 1070 | A new standard function for resizing windows called `window-resize' has |
| 1074 | been introduced. This and all other functions for resizing windows no | 1071 | been introduced. This and all other functions for resizing windows no |
| 1075 | longer delete any windows when they become too small. | 1072 | longer delete any windows when they become too small. |
| 1076 | |||
| 1077 | +++ | 1073 | +++ |
| 1078 | *** Deleting the selected window now selects the most recently selected | 1074 | *** Deleting the selected window now selects the most recently selected |
| 1079 | live window on that frame instead. | 1075 | live window on that frame instead. |
| 1080 | |||
| 1081 | +++ | 1076 | +++ |
| 1082 | *** `adjust-window-trailing-edge' adjustments. | 1077 | *** `adjust-window-trailing-edge' adjustments. |
| 1083 | `adjust-window-trailing-edge' can now deal with fixed-size windows and | 1078 | `adjust-window-trailing-edge' can now deal with fixed-size windows and |
| @@ -1085,7 +1080,6 @@ is able to resize other windows if a window adjacent to the trailing | |||
| 1085 | edge cannot be shrunk any more. This makes its behavior more similar to | 1080 | edge cannot be shrunk any more. This makes its behavior more similar to |
| 1086 | that of Emacs 21 without compromising, however, its inability to delete | 1081 | that of Emacs 21 without compromising, however, its inability to delete |
| 1087 | windows which was introduced in Emacs 22. | 1082 | windows which was introduced in Emacs 22. |
| 1088 | |||
| 1089 | +++ | 1083 | +++ |
| 1090 | *** Window-local buffer lists. | 1084 | *** Window-local buffer lists. |
| 1091 | Windows now have local buffer lists. This means that removing a buffer | 1085 | Windows now have local buffer lists. This means that removing a buffer |
| @@ -1093,17 +1087,16 @@ from display in a window will preferably show the buffer previously | |||
| 1093 | shown in that window with its previous window-start and window-point | 1087 | shown in that window with its previous window-start and window-point |
| 1094 | positions. This also means that the same buffer may be automatically | 1088 | positions. This also means that the same buffer may be automatically |
| 1095 | shown twice even if it already appears in another window. | 1089 | shown twice even if it already appears in another window. |
| 1096 | |||
| 1097 | +++ | 1090 | +++ |
| 1098 | *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, | 1091 | *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, |
| 1099 | which if non-nil requires the buffer to be displayed in the currently | 1092 | which if non-nil requires the buffer to be displayed in the currently |
| 1100 | selected window, signaling an error otherwise. If nil, another window | 1093 | selected window, signaling an error otherwise. If nil, another window |
| 1101 | can be used, e.g. if the selected one is strongly dedicated. | 1094 | can be used, e.g. if the selected one is strongly dedicated. |
| 1102 | 1095 | +++ | |
| 1103 | *** `split-window-vertically' and `split-window-horizontally' renamed | 1096 | *** `split-window-vertically' and `split-window-horizontally' renamed |
| 1104 | to `split-window-below' and `split-window-right' respectively. | 1097 | to `split-window-below' and `split-window-right' respectively. |
| 1105 | The old names are kept as aliases. | 1098 | The old names are kept as aliases. |
| 1106 | 1099 | +++ | |
| 1107 | *** Display actions | 1100 | *** Display actions |
| 1108 | 1101 | ||
| 1109 | **** The second arg to `display-buffer' and `pop-to-buffer' is now | 1102 | **** The second arg to `display-buffer' and `pop-to-buffer' is now |
| @@ -1294,6 +1287,8 @@ functions. It's easiest to use these functions through | |||
| 1294 | STARTTLS opportunistically or use plain SSL, depending on your needs. | 1287 | STARTTLS opportunistically or use plain SSL, depending on your needs. |
| 1295 | 1288 | ||
| 1296 | Only versions 2.8.x and higher or GnuTLS have been tested. | 1289 | Only versions 2.8.x and higher or GnuTLS have been tested. |
| 1290 | [FIXME: this statement needs clarifying, given that GnuTLS >= 2.6.6 | ||
| 1291 | is the test used by configure.] | ||
| 1297 | 1292 | ||
| 1298 | *** gnutls-log-level | 1293 | *** gnutls-log-level |
| 1299 | Set `gnutls-log-level' higher than 0 to get debug output. 1 is for | 1294 | Set `gnutls-log-level' higher than 0 to get debug output. 1 is for |
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 6b451dd14e1..d5304258879 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in | |||
| @@ -50,7 +50,9 @@ all: stamp_BLD $(ALL) | |||
| 50 | 50 | ||
| 51 | ### TAGS ### | 51 | ### TAGS ### |
| 52 | 52 | ||
| 53 | TAGS: | 53 | FRC: |
| 54 | |||
| 55 | TAGS: FRC | ||
| 54 | ../lib-src/$(BLD)/etags.exe *.c *.h | 56 | ../lib-src/$(BLD)/etags.exe *.c *.h |
| 55 | 57 | ||
| 56 | ### DEPENDENCIES ### | 58 | ### DEPENDENCIES ### |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb276721dbc..e0716bea83f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,44 @@ | |||
| 1 | 2011-11-07 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change) | ||
| 2 | |||
| 3 | * mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text): | ||
| 4 | Ensure that mbox format messages end in two newlines (Bug#9974). | ||
| 5 | |||
| 6 | 2011-11-06 Chong Yidong <cyd@gnu.org> | ||
| 7 | |||
| 8 | * window.el (window-combination-p): Function deleted; its | ||
| 9 | side-effect is not used in any existing code. | ||
| 10 | (window-combinations, window-combined-p): Call window-*-child | ||
| 11 | directly. | ||
| 12 | |||
| 13 | 2011-11-05 Chong Yidong <cyd@gnu.org> | ||
| 14 | |||
| 15 | * window.el (window-valid-p): Rename from window-any-p. | ||
| 16 | (window-size-ignore, window-state-get): Callers changed. | ||
| 17 | (window-normalize-window): Rename from window-normalize-any-window. | ||
| 18 | New arg LIVE-ONLY, replacing window-normalize-live-window. | ||
| 19 | (window-normalize-live-window): Deleted. | ||
| 20 | (window-combination-p, window-combined-p, window-combinations) | ||
| 21 | (walk-window-subtree, window-atom-root, window-min-size) | ||
| 22 | (window-sizable, window-sizable-p, window-size-fixed-p) | ||
| 23 | (window-min-delta, window-max-delta, window-resizable) | ||
| 24 | (window-resizable-p, window-full-height-p, window-full-width-p) | ||
| 25 | (window-current-scroll-bars, window-point-1, set-window-point-1) | ||
| 26 | (window-at-side-p, window-in-direction, window-resize) | ||
| 27 | (adjust-window-trailing-edge, maximize-window, minimize-window) | ||
| 28 | (window-deletable-p, delete-window, delete-other-windows) | ||
| 29 | (record-window-buffer, unrecord-window-buffer) | ||
| 30 | (switch-to-prev-buffer, switch-to-next-buffer, window--delete) | ||
| 31 | (quit-window, split-window, window-state-put) | ||
| 32 | (set-window-text-height, fit-window-to-buffer) | ||
| 33 | (shrink-window-if-larger-than-buffer): Callers changed. | ||
| 34 | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | 35 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 36 | ||
| 37 | * mail/rmail.el (rmail-simplified-subject): Decode subject with | ||
| 38 | rfc2047-decode-string. | ||
| 39 | (rmail-mime-toggle-hidden): Declare to avoid byte-compilation | ||
| 40 | warnings. | ||
| 41 | |||
| 3 | * window.el (window-body-height, window-body-width): Mention in | 42 | * window.el (window-body-height, window-body-width): Mention in |
| 4 | the doc string that the return values are in frame's canonical | 43 | the doc string that the return values are in frame's canonical |
| 5 | units. (Bug#9949) | 44 | units. (Bug#9949) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 603a615192a..4b3441a8cdc 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -194,6 +194,7 @@ please report it with \\[report-emacs-bug].") | |||
| 194 | 194 | ||
| 195 | (declare-function mail-dont-reply-to "mail-utils" (destinations)) | 195 | (declare-function mail-dont-reply-to "mail-utils" (destinations)) |
| 196 | (declare-function rmail-update-summary "rmailsum" (&rest ignore)) | 196 | (declare-function rmail-update-summary "rmailsum" (&rest ignore)) |
| 197 | (declare-function rmail-mime-toggle-hidden "rmailmm" ()) | ||
| 197 | 198 | ||
| 198 | (defun rmail-probe (prog) | 199 | (defun rmail-probe (prog) |
| 199 | "Determine what flavor of movemail PROG is. | 200 | "Determine what flavor of movemail PROG is. |
| @@ -1720,10 +1721,12 @@ not be a new one). It returns non-nil if it got any new messages." | |||
| 1720 | (setq all-files (cdr all-files))) | 1721 | (setq all-files (cdr all-files))) |
| 1721 | ;; Put them back in their original order. | 1722 | ;; Put them back in their original order. |
| 1722 | (setq files (nreverse files)) | 1723 | (setq files (nreverse files)) |
| 1723 | ;; In case of brain damage caused by require-final-newline. | ||
| 1724 | (goto-char (point-max)) | 1724 | (goto-char (point-max)) |
| 1725 | (skip-chars-backward " \t\n") | 1725 | ;; Make sure we end with a blank line unless there are |
| 1726 | (delete-region (point) (point-max)) | 1726 | ;; no messages, as required by mbox format (Bug#9974). |
| 1727 | (unless (bobp) | ||
| 1728 | (while (not (looking-back "\n\n")) | ||
| 1729 | (insert "\n"))) | ||
| 1727 | (setq found (or | 1730 | (setq found (or |
| 1728 | (rmail-get-new-mail-1 file-name files delete-files) | 1731 | (rmail-get-new-mail-1 file-name files delete-files) |
| 1729 | found)))) | 1732 | found)))) |
| @@ -2023,22 +2026,12 @@ Value is the size of the newly read mail after conversion." | |||
| 2023 | (rmail-unrmail-new-mail-maybe | 2026 | (rmail-unrmail-new-mail-maybe |
| 2024 | tofile | 2027 | tofile |
| 2025 | (nth 1 (insert-file-contents tofile)))) | 2028 | (nth 1 (insert-file-contents tofile)))) |
| 2026 | ;; Determine if a pair of newline message separators need | ||
| 2027 | ;; to be added to the new collection of messages. This is | ||
| 2028 | ;; the case for all new message collections added to a | ||
| 2029 | ;; non-empty mail file. | ||
| 2030 | (unless (zerop size) | ||
| 2031 | (save-restriction | ||
| 2032 | (let ((start (point-min))) | ||
| 2033 | (widen) | ||
| 2034 | (unless (eq start (point-min)) | ||
| 2035 | (goto-char start) | ||
| 2036 | (insert "\n\n") | ||
| 2037 | (setq size (+ 2 size)))))) | ||
| 2038 | (goto-char (point-max)) | 2029 | (goto-char (point-max)) |
| 2039 | (or (= (preceding-char) ?\n) | 2030 | ;; Make sure the read-in mbox data properly ends with a |
| 2040 | (zerop size) | 2031 | ;; blank line unless it is of size 0. |
| 2041 | (insert ?\n)) | 2032 | (unless (zerop size) |
| 2033 | (while (not (looking-back "\n\n")) | ||
| 2034 | (insert "\n"))) | ||
| 2042 | (if (not (and rmail-preserve-inbox (string= file tofile))) | 2035 | (if (not (and rmail-preserve-inbox (string= file tofile))) |
| 2043 | (setq delete-files (cons tofile delete-files))))) | 2036 | (setq delete-files (cons tofile delete-files))))) |
| 2044 | (message "") | 2037 | (message "") |
| @@ -3262,6 +3255,7 @@ Interactively, empty argument means use same regexp used last time." | |||
| 3262 | Simplifying the subject means stripping leading and trailing whitespace, | 3255 | Simplifying the subject means stripping leading and trailing whitespace, |
| 3263 | and typical reply prefixes such as Re:." | 3256 | and typical reply prefixes such as Re:." |
| 3264 | (let ((subject (or (rmail-get-header "Subject" msgnum) ""))) | 3257 | (let ((subject (or (rmail-get-header "Subject" msgnum) ""))) |
| 3258 | (setq subject (rfc2047-decode-string subject)) | ||
| 3265 | (if (string-match "\\`[ \t]+" subject) | 3259 | (if (string-match "\\`[ \t]+" subject) |
| 3266 | (setq subject (substring subject (match-end 0)))) | 3260 | (setq subject (substring subject (match-end 0)))) |
| 3267 | (if (string-match rmail-reply-regexp subject) | 3261 | (if (string-match rmail-reply-regexp subject) |
diff --git a/lisp/window.el b/lisp/window.el index d6ab5e0e6cc..1b51bde36bd 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -100,8 +100,10 @@ be any window." | |||
| 100 | (setq window (window-next-sibling window)))) | 100 | (setq window (window-next-sibling window)))) |
| 101 | window) | 101 | window) |
| 102 | 102 | ||
| 103 | (defsubst window-any-p (object) | 103 | (defsubst window-valid-p (object) |
| 104 | "Return t if OBJECT denotes a live or internal window." | 104 | "Return t if OBJECT denotes a live window or internal window. |
| 105 | Otherwise, return nil; this includes the case where OBJECT is a | ||
| 106 | deleted window." | ||
| 105 | (and (windowp object) | 107 | (and (windowp object) |
| 106 | (or (window-buffer object) (window-child object)) | 108 | (or (window-buffer object) (window-child object)) |
| 107 | t)) | 109 | t)) |
| @@ -130,24 +132,21 @@ FRAME must be a live frame and defaults to the selected frame." | |||
| 130 | (error "%s is not a live frame" frame)) | 132 | (error "%s is not a live frame" frame)) |
| 131 | (selected-frame))) | 133 | (selected-frame))) |
| 132 | 134 | ||
| 133 | (defsubst window-normalize-any-window (window) | 135 | (defsubst window-normalize-window (window &optional live-only) |
| 134 | "Return window specified by WINDOW. | 136 | "Return window specified by WINDOW. |
| 135 | WINDOW must be a window that has not been deleted and defaults to | 137 | If WINDOW is nil, return `selected-window'. |
| 136 | the selected window." | 138 | If WINDOW is a live window or internal window, return WINDOW; |
| 137 | (if window | 139 | if LIVE-ONLY is non-nil, return WINDOW for a live window only. |
| 138 | (if (window-any-p window) | 140 | Otherwise, signal an error." |
| 139 | window | 141 | (cond ((null window) |
| 140 | (error "%s is not a window" window)) | 142 | (selected-window)) |
| 141 | (selected-window))) | 143 | (live-only |
| 142 | 144 | (if (window-live-p window) | |
| 143 | (defsubst window-normalize-live-window (window) | 145 | window |
| 144 | "Return live window specified by WINDOW. | 146 | (error "%s is not a live window" window))) |
| 145 | WINDOW must be a live window and defaults to the selected one." | 147 | ((if (window-valid-p window) |
| 146 | (if window | 148 | window |
| 147 | (if (and (windowp window) (window-buffer window)) | 149 | (error "%s is not a window" window))))) |
| 148 | window | ||
| 149 | (error "%s is not a live window" window)) | ||
| 150 | (selected-window))) | ||
| 151 | 150 | ||
| 152 | (defvar ignore-window-parameters nil | 151 | (defvar ignore-window-parameters nil |
| 153 | "If non-nil, standard functions ignore window parameters. | 152 | "If non-nil, standard functions ignore window parameters. |
| @@ -196,36 +195,35 @@ narrower, explictly specify the SIZE argument of that function." | |||
| 196 | :version "24.1" | 195 | :version "24.1" |
| 197 | :group 'windows) | 196 | :group 'windows) |
| 198 | 197 | ||
| 199 | (defun window-combination-p (&optional window horizontal) | ||
| 200 | "If WINDOW is a vertical combination return WINDOW's first child. | ||
| 201 | WINDOW can be any window and defaults to the selected one. | ||
| 202 | Optional argument HORIZONTAL non-nil means return WINDOW's first | ||
| 203 | child if WINDOW is a horizontal combination." | ||
| 204 | (setq window (window-normalize-any-window window)) | ||
| 205 | (if horizontal | ||
| 206 | (window-left-child window) | ||
| 207 | (window-top-child window))) | ||
| 208 | |||
| 209 | (defsubst window-combined-p (&optional window horizontal) | 198 | (defsubst window-combined-p (&optional window horizontal) |
| 210 | "Return non-nil if and only if WINDOW is vertically combined. | 199 | "Return non-nil if WINDOW has siblings in a given direction. |
| 211 | WINDOW can be any window and defaults to the selected one. | 200 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 212 | Optional argument HORIZONTAL non-nil means return non-nil if and | 201 | |
| 213 | only if WINDOW is horizontally combined." | 202 | HORIZONTAL determines a direction for the window combination. |
| 214 | (setq window (window-normalize-any-window window)) | 203 | If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part |
| 204 | of a vertical window combination. | ||
| 205 | If HORIZONTAL is non-nil, return non-nil if WINDOW is part of a | ||
| 206 | horizontal window combination." | ||
| 207 | (setq window (window-normalize-window window)) | ||
| 215 | (let ((parent (window-parent window))) | 208 | (let ((parent (window-parent window))) |
| 216 | (and parent (window-combination-p parent horizontal)))) | 209 | (and parent |
| 210 | (if horizontal | ||
| 211 | (window-left-child parent) | ||
| 212 | (window-top-child parent))))) | ||
| 217 | 213 | ||
| 218 | (defun window-combinations (&optional window horizontal) | 214 | (defun window-combinations (&optional window horizontal) |
| 219 | "Return largest number of vertically arranged subwindows of WINDOW. | 215 | "Return largest number of vertically arranged subwindows of WINDOW. |
| 220 | WINDOW can be any window and defaults to the selected one. | 216 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 221 | Optional argument HORIZONTAL non-nil means to return the largest | 217 | If HORIZONTAL is non-nil, return the largest number of |
| 222 | number of horizontally arranged subwindows of WINDOW." | 218 | horizontally arranged subwindows of WINDOW." |
| 223 | (setq window (window-normalize-any-window window)) | 219 | (setq window (window-normalize-window window)) |
| 224 | (cond | 220 | (cond |
| 225 | ((window-live-p window) | 221 | ((window-live-p window) |
| 226 | ;; If WINDOW is live, return 1. | 222 | ;; If WINDOW is live, return 1. |
| 227 | 1) | 223 | 1) |
| 228 | ((window-combination-p window horizontal) | 224 | ((if horizontal |
| 225 | (window-left-child window) | ||
| 226 | (window-top-child window)) | ||
| 229 | ;; If WINDOW is iso-combined, return the sum of the values for all | 227 | ;; If WINDOW is iso-combined, return the sum of the values for all |
| 230 | ;; subwindows of WINDOW. | 228 | ;; subwindows of WINDOW. |
| 231 | (let ((child (window-child window)) | 229 | (let ((child (window-child window)) |
| @@ -289,7 +287,7 @@ on all live and internal subwindows of WINDOW. | |||
| 289 | This function performs a pre-order, depth-first traversal of the | 287 | This function performs a pre-order, depth-first traversal of the |
| 290 | window tree rooted at WINDOW. If PROC changes that window tree, | 288 | window tree rooted at WINDOW. If PROC changes that window tree, |
| 291 | the result is unpredictable." | 289 | the result is unpredictable." |
| 292 | (setq window (window-normalize-any-window window)) | 290 | (setq window (window-normalize-window window)) |
| 293 | (walk-window-tree-1 proc window any t)) | 291 | (walk-window-tree-1 proc window any t)) |
| 294 | 292 | ||
| 295 | (defun windows-with-parameter (parameter &optional value frame any values) | 293 | (defun windows-with-parameter (parameter &optional value frame any values) |
| @@ -335,7 +333,7 @@ too." | |||
| 335 | "Return root of atomic window WINDOW is a part of. | 333 | "Return root of atomic window WINDOW is a part of. |
| 336 | WINDOW can be any window and defaults to the selected one. | 334 | WINDOW can be any window and defaults to the selected one. |
| 337 | Return nil if WINDOW is not part of a atomic window." | 335 | Return nil if WINDOW is not part of a atomic window." |
| 338 | (setq window (window-normalize-any-window window)) | 336 | (setq window (window-normalize-window window)) |
| 339 | (let (root) | 337 | (let (root) |
| 340 | (while (and window (window-parameter window 'window-atom)) | 338 | (while (and window (window-parameter window 'window-atom)) |
| 341 | (setq root window) | 339 | (setq root window) |
| @@ -532,7 +530,7 @@ window).") | |||
| 532 | 530 | ||
| 533 | (defsubst window-size-ignore (window ignore) | 531 | (defsubst window-size-ignore (window ignore) |
| 534 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." | 532 | "Return non-nil if IGNORE says to ignore size restrictions for WINDOW." |
| 535 | (if (window-any-p ignore) (eq window ignore) ignore)) | 533 | (if (window-valid-p ignore) (eq window ignore) ignore)) |
| 536 | 534 | ||
| 537 | (defun window-min-size (&optional window horizontal ignore) | 535 | (defun window-min-size (&optional window horizontal ignore) |
| 538 | "Return the minimum number of lines of WINDOW. | 536 | "Return the minimum number of lines of WINDOW. |
| @@ -547,7 +545,7 @@ windows may get as small as `window-safe-min-height' lines and | |||
| 547 | `window-safe-min-width' columns. IGNORE a window means ignore | 545 | `window-safe-min-width' columns. IGNORE a window means ignore |
| 548 | restrictions for that window only." | 546 | restrictions for that window only." |
| 549 | (window-min-size-1 | 547 | (window-min-size-1 |
| 550 | (window-normalize-any-window window) horizontal ignore)) | 548 | (window-normalize-window window) horizontal ignore)) |
| 551 | 549 | ||
| 552 | (defun window-min-size-1 (window horizontal ignore) | 550 | (defun window-min-size-1 (window horizontal ignore) |
| 553 | "Internal function of `window-min-size'." | 551 | "Internal function of `window-min-size'." |
| @@ -640,7 +638,7 @@ imposed by fixed size windows, `window-min-height' or | |||
| 640 | windows may get as small as `window-safe-min-height' lines and | 638 | windows may get as small as `window-safe-min-height' lines and |
| 641 | `window-safe-min-width' columns. IGNORE any window means ignore | 639 | `window-safe-min-width' columns. IGNORE any window means ignore |
| 642 | restrictions for that window only." | 640 | restrictions for that window only." |
| 643 | (setq window (window-normalize-any-window window)) | 641 | (setq window (window-normalize-window window)) |
| 644 | (cond | 642 | (cond |
| 645 | ((< delta 0) | 643 | ((< delta 0) |
| 646 | (max (- (window-min-size window horizontal ignore) | 644 | (max (- (window-min-size window horizontal ignore) |
| @@ -658,7 +656,7 @@ restrictions for that window only." | |||
| 658 | "Return t if WINDOW can be resized by DELTA lines. | 656 | "Return t if WINDOW can be resized by DELTA lines. |
| 659 | For the meaning of the arguments of this function see the | 657 | For the meaning of the arguments of this function see the |
| 660 | doc-string of `window-sizable'." | 658 | doc-string of `window-sizable'." |
| 661 | (setq window (window-normalize-any-window window)) | 659 | (setq window (window-normalize-window window)) |
| 662 | (if (> delta 0) | 660 | (if (> delta 0) |
| 663 | (>= (window-sizable window delta horizontal ignore) delta) | 661 | (>= (window-sizable window delta horizontal ignore) delta) |
| 664 | (<= (window-sizable window delta horizontal ignore) delta))) | 662 | (<= (window-sizable window delta horizontal ignore) delta))) |
| @@ -706,7 +704,7 @@ If this function returns nil, this does not necessarily mean that | |||
| 706 | WINDOW can be resized in the desired direction. The functions | 704 | WINDOW can be resized in the desired direction. The functions |
| 707 | `window-resizable' and `window-resizable-p' will tell that." | 705 | `window-resizable' and `window-resizable-p' will tell that." |
| 708 | (window-size-fixed-1 | 706 | (window-size-fixed-1 |
| 709 | (window-normalize-any-window window) horizontal)) | 707 | (window-normalize-window window) horizontal)) |
| 710 | 708 | ||
| 711 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) | 709 | (defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) |
| 712 | "Internal function for `window-min-delta'." | 710 | "Internal function for `window-min-delta'." |
| @@ -772,7 +770,7 @@ tree but try to enlarge windows within WINDOW's combination only. | |||
| 772 | Optional argument NODOWN non-nil means don't check whether WINDOW | 770 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 773 | itself \(and its subwindows) can be shrunk; check only whether at | 771 | itself \(and its subwindows) can be shrunk; check only whether at |
| 774 | least one other windows can be enlarged appropriately." | 772 | least one other windows can be enlarged appropriately." |
| 775 | (setq window (window-normalize-any-window window)) | 773 | (setq window (window-normalize-window window)) |
| 776 | (let ((size (window-total-size window horizontal)) | 774 | (let ((size (window-total-size window horizontal)) |
| 777 | (minimum (window-min-size window horizontal ignore))) | 775 | (minimum (window-min-size window horizontal ignore))) |
| 778 | (cond | 776 | (cond |
| @@ -854,7 +852,7 @@ WINDOW's combination. | |||
| 854 | Optional argument NODOWN non-nil means do not check whether | 852 | Optional argument NODOWN non-nil means do not check whether |
| 855 | WINDOW itself \(and its subwindows) can be enlarged; check only | 853 | WINDOW itself \(and its subwindows) can be enlarged; check only |
| 856 | whether other windows can be shrunk appropriately." | 854 | whether other windows can be shrunk appropriately." |
| 857 | (setq window (window-normalize-any-window window)) | 855 | (setq window (window-normalize-window window)) |
| 858 | (if (and (not (window-size-ignore window ignore)) | 856 | (if (and (not (window-size-ignore window ignore)) |
| 859 | (not nodown) (window-size-fixed-p window horizontal)) | 857 | (not nodown) (window-size-fixed-p window horizontal)) |
| 860 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed | 858 | ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed |
| @@ -898,7 +896,7 @@ within WINDOW's combination. | |||
| 898 | 896 | ||
| 899 | Optional argument NODOWN non-nil means don't check whether WINDOW | 897 | Optional argument NODOWN non-nil means don't check whether WINDOW |
| 900 | and its subwindows can be resized." | 898 | and its subwindows can be resized." |
| 901 | (setq window (window-normalize-any-window window)) | 899 | (setq window (window-normalize-window window)) |
| 902 | (cond | 900 | (cond |
| 903 | ((< delta 0) | 901 | ((< delta 0) |
| 904 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) | 902 | (max (- (window-min-delta window horizontal ignore trail noup nodown)) |
| @@ -912,7 +910,7 @@ and its subwindows can be resized." | |||
| 912 | "Return t if WINDOW can be resized vertically by DELTA lines. | 910 | "Return t if WINDOW can be resized vertically by DELTA lines. |
| 913 | For the meaning of the arguments of this function see the | 911 | For the meaning of the arguments of this function see the |
| 914 | doc-string of `window-resizable'." | 912 | doc-string of `window-resizable'." |
| 915 | (setq window (window-normalize-any-window window)) | 913 | (setq window (window-normalize-window window)) |
| 916 | (if (> delta 0) | 914 | (if (> delta 0) |
| 917 | (>= (window-resizable window delta horizontal ignore trail noup nodown) | 915 | (>= (window-resizable window delta horizontal ignore trail noup nodown) |
| 918 | delta) | 916 | delta) |
| @@ -941,7 +939,7 @@ More precisely, return t if and only if the total height of | |||
| 941 | WINDOW equals the total height of the root window of WINDOW's | 939 | WINDOW equals the total height of the root window of WINDOW's |
| 942 | frame. WINDOW can be any window and defaults to the selected | 940 | frame. WINDOW can be any window and defaults to the selected |
| 943 | one." | 941 | one." |
| 944 | (setq window (window-normalize-any-window window)) | 942 | (setq window (window-normalize-window window)) |
| 945 | (= (window-total-size window) | 943 | (= (window-total-size window) |
| 946 | (window-total-size (frame-root-window window)))) | 944 | (window-total-size (frame-root-window window)))) |
| 947 | 945 | ||
| @@ -960,7 +958,7 @@ otherwise." | |||
| 960 | More precisely, return t if and only if the total width of WINDOW | 958 | More precisely, return t if and only if the total width of WINDOW |
| 961 | equals the total width of the root window of WINDOW's frame. | 959 | equals the total width of the root window of WINDOW's frame. |
| 962 | WINDOW can be any window and defaults to the selected one." | 960 | WINDOW can be any window and defaults to the selected one." |
| 963 | (setq window (window-normalize-any-window window)) | 961 | (setq window (window-normalize-window window)) |
| 964 | (= (window-total-size window t) | 962 | (= (window-total-size window t) |
| 965 | (window-total-size (frame-root-window window) t))) | 963 | (window-total-size (frame-root-window window) t))) |
| 966 | 964 | ||
| @@ -1015,7 +1013,7 @@ or nil). | |||
| 1015 | Unlike `window-scroll-bars', this function reports the scroll bar | 1013 | Unlike `window-scroll-bars', this function reports the scroll bar |
| 1016 | type actually used, once frame defaults and `scroll-bar-mode' are | 1014 | type actually used, once frame defaults and `scroll-bar-mode' are |
| 1017 | taken into account." | 1015 | taken into account." |
| 1018 | (setq window (window-normalize-live-window window)) | 1016 | (setq window (window-normalize-window window t)) |
| 1019 | (let ((vert (nth 2 (window-scroll-bars window))) | 1017 | (let ((vert (nth 2 (window-scroll-bars window))) |
| 1020 | (hor nil)) | 1018 | (hor nil)) |
| 1021 | (when (or (eq vert t) (eq hor t)) | 1019 | (when (or (eq vert t) (eq hor t)) |
| @@ -1079,7 +1077,7 @@ WINDOW can be any live window and defaults to the selected one. | |||
| 1079 | This function is like `window-point' with one exception: If | 1077 | This function is like `window-point' with one exception: If |
| 1080 | WINDOW is selected, it returns the value of `point' of WINDOW's | 1078 | WINDOW is selected, it returns the value of `point' of WINDOW's |
| 1081 | buffer regardless of whether that buffer is current or not." | 1079 | buffer regardless of whether that buffer is current or not." |
| 1082 | (setq window (window-normalize-live-window window)) | 1080 | (setq window (window-normalize-window window t)) |
| 1083 | (if (eq window (selected-window)) | 1081 | (if (eq window (selected-window)) |
| 1084 | (with-current-buffer (window-buffer window) | 1082 | (with-current-buffer (window-buffer window) |
| 1085 | (point)) | 1083 | (point)) |
| @@ -1092,7 +1090,7 @@ WINDOW can be any live window and defaults to the selected one. | |||
| 1092 | This function is like `set-window-point' with one exception: If | 1090 | This function is like `set-window-point' with one exception: If |
| 1093 | WINDOW is selected, it moves `point' of WINDOW's buffer to POS | 1091 | WINDOW is selected, it moves `point' of WINDOW's buffer to POS |
| 1094 | regardless of whether that buffer is current or not." | 1092 | regardless of whether that buffer is current or not." |
| 1095 | (setq window (window-normalize-live-window window)) | 1093 | (setq window (window-normalize-window window t)) |
| 1096 | (if (eq window (selected-window)) | 1094 | (if (eq window (selected-window)) |
| 1097 | (with-current-buffer (window-buffer window) | 1095 | (with-current-buffer (window-buffer window) |
| 1098 | (goto-char pos)) | 1096 | (goto-char pos)) |
| @@ -1103,7 +1101,7 @@ regardless of whether that buffer is current or not." | |||
| 1103 | WINDOW can be any window and defaults to the selected one. SIDE | 1101 | WINDOW can be any window and defaults to the selected one. SIDE |
| 1104 | can be any of the symbols `left', `top', `right' or `bottom'. | 1102 | can be any of the symbols `left', `top', `right' or `bottom'. |
| 1105 | The default value nil is handled like `bottom'." | 1103 | The default value nil is handled like `bottom'." |
| 1106 | (setq window (window-normalize-any-window window)) | 1104 | (setq window (window-normalize-window window)) |
| 1107 | (let ((edge | 1105 | (let ((edge |
| 1108 | (cond | 1106 | (cond |
| 1109 | ((eq side 'left) 0) | 1107 | ((eq side 'left) 0) |
| @@ -1145,7 +1143,7 @@ DIRECTION must be one of `above', `below', `left' or `right'. | |||
| 1145 | WINDOW must be a live window and defaults to the selected one. | 1143 | WINDOW must be a live window and defaults to the selected one. |
| 1146 | IGNORE, when non-nil means a window can be returned even if its | 1144 | IGNORE, when non-nil means a window can be returned even if its |
| 1147 | `no-other-window' parameter is non-nil." | 1145 | `no-other-window' parameter is non-nil." |
| 1148 | (setq window (window-normalize-live-window window)) | 1146 | (setq window (window-normalize-window window t)) |
| 1149 | (unless (memq direction '(above below left right)) | 1147 | (unless (memq direction '(above below left right)) |
| 1150 | (error "Wrong direction %s" direction)) | 1148 | (error "Wrong direction %s" direction)) |
| 1151 | (let* ((frame (window-frame window)) | 1149 | (let* ((frame (window-frame window)) |
| @@ -1500,7 +1498,7 @@ This function resizes other windows proportionally and never | |||
| 1500 | deletes any windows. If you want to move only the low (right) | 1498 | deletes any windows. If you want to move only the low (right) |
| 1501 | edge of WINDOW consider using `adjust-window-trailing-edge' | 1499 | edge of WINDOW consider using `adjust-window-trailing-edge' |
| 1502 | instead." | 1500 | instead." |
| 1503 | (setq window (window-normalize-any-window window)) | 1501 | (setq window (window-normalize-window window)) |
| 1504 | (let* ((frame (window-frame window)) | 1502 | (let* ((frame (window-frame window)) |
| 1505 | sibling) | 1503 | sibling) |
| 1506 | (cond | 1504 | (cond |
| @@ -2019,7 +2017,7 @@ If DELTA is greater zero, then move the edge downwards or to the | |||
| 2019 | right. If DELTA is less than zero, move the edge upwards or to | 2017 | right. If DELTA is less than zero, move the edge upwards or to |
| 2020 | the left. If the edge can't be moved by DELTA lines or columns, | 2018 | the left. If the edge can't be moved by DELTA lines or columns, |
| 2021 | move it as far as possible in the desired direction." | 2019 | move it as far as possible in the desired direction." |
| 2022 | (setq window (window-normalize-any-window window)) | 2020 | (setq window (window-normalize-window window)) |
| 2023 | (let ((frame (window-frame window)) | 2021 | (let ((frame (window-frame window)) |
| 2024 | (right window) | 2022 | (right window) |
| 2025 | left this-delta min-delta max-delta failed) | 2023 | left this-delta min-delta max-delta failed) |
| @@ -2166,7 +2164,7 @@ Return nil." | |||
| 2166 | Make WINDOW as large as possible without deleting any windows. | 2164 | Make WINDOW as large as possible without deleting any windows. |
| 2167 | WINDOW can be any window and defaults to the selected window." | 2165 | WINDOW can be any window and defaults to the selected window." |
| 2168 | (interactive) | 2166 | (interactive) |
| 2169 | (setq window (window-normalize-any-window window)) | 2167 | (setq window (window-normalize-window window)) |
| 2170 | (window-resize window (window-max-delta window)) | 2168 | (window-resize window (window-max-delta window)) |
| 2171 | (window-resize window (window-max-delta window t) t)) | 2169 | (window-resize window (window-max-delta window t) t)) |
| 2172 | 2170 | ||
| @@ -2175,7 +2173,7 @@ WINDOW can be any window and defaults to the selected window." | |||
| 2175 | Make WINDOW as small as possible without deleting any windows. | 2173 | Make WINDOW as small as possible without deleting any windows. |
| 2176 | WINDOW can be any window and defaults to the selected window." | 2174 | WINDOW can be any window and defaults to the selected window." |
| 2177 | (interactive) | 2175 | (interactive) |
| 2178 | (setq window (window-normalize-any-window window)) | 2176 | (setq window (window-normalize-window window)) |
| 2179 | (window-resize window (- (window-min-delta window))) | 2177 | (window-resize window (- (window-min-delta window))) |
| 2180 | (window-resize window (- (window-min-delta window t)) t)) | 2178 | (window-resize window (- (window-min-delta window t)) t)) |
| 2181 | 2179 | ||
| @@ -2331,7 +2329,7 @@ and no others." | |||
| 2331 | "Return t if WINDOW can be safely deleted from its frame. | 2329 | "Return t if WINDOW can be safely deleted from its frame. |
| 2332 | Return `frame' if deleting WINDOW should also delete its | 2330 | Return `frame' if deleting WINDOW should also delete its |
| 2333 | frame." | 2331 | frame." |
| 2334 | (setq window (window-normalize-any-window window)) | 2332 | (setq window (window-normalize-window window)) |
| 2335 | 2333 | ||
| 2336 | (unless ignore-window-parameters | 2334 | (unless ignore-window-parameters |
| 2337 | ;; Handle atomicity. | 2335 | ;; Handle atomicity. |
| @@ -2381,7 +2379,7 @@ Otherwise, if WINDOW is part of an atomic window, call | |||
| 2381 | argument. If WINDOW is the only window on its frame or the last | 2379 | argument. If WINDOW is the only window on its frame or the last |
| 2382 | non-side window, signal an error." | 2380 | non-side window, signal an error." |
| 2383 | (interactive) | 2381 | (interactive) |
| 2384 | (setq window (window-normalize-any-window window)) | 2382 | (setq window (window-normalize-window window)) |
| 2385 | (let* ((frame (window-frame window)) | 2383 | (let* ((frame (window-frame window)) |
| 2386 | (function (window-parameter window 'delete-window)) | 2384 | (function (window-parameter window 'delete-window)) |
| 2387 | (parent (window-parent window)) | 2385 | (parent (window-parent window)) |
| @@ -2462,7 +2460,7 @@ WINDOW is a non-side window, make WINDOW the only non-side window | |||
| 2462 | on the frame. Side windows are not deleted. If WINDOW is a side | 2460 | on the frame. Side windows are not deleted. If WINDOW is a side |
| 2463 | window signal an error." | 2461 | window signal an error." |
| 2464 | (interactive) | 2462 | (interactive) |
| 2465 | (setq window (window-normalize-any-window window)) | 2463 | (setq window (window-normalize-window window)) |
| 2466 | (let* ((frame (window-frame window)) | 2464 | (let* ((frame (window-frame window)) |
| 2467 | (function (window-parameter window 'delete-other-windows)) | 2465 | (function (window-parameter window 'delete-other-windows)) |
| 2468 | (window-side (window-parameter window 'window-side)) | 2466 | (window-side (window-parameter window 'window-side)) |
| @@ -2544,7 +2542,7 @@ This may be a useful alternative binding for \\[delete-other-windows] | |||
| 2544 | (defun record-window-buffer (&optional window) | 2542 | (defun record-window-buffer (&optional window) |
| 2545 | "Record WINDOW's buffer. | 2543 | "Record WINDOW's buffer. |
| 2546 | WINDOW must be a live window and defaults to the selected one." | 2544 | WINDOW must be a live window and defaults to the selected one." |
| 2547 | (let* ((window (window-normalize-live-window window)) | 2545 | (let* ((window (window-normalize-window window t)) |
| 2548 | (buffer (window-buffer window)) | 2546 | (buffer (window-buffer window)) |
| 2549 | (entry (assq buffer (window-prev-buffers window)))) | 2547 | (entry (assq buffer (window-prev-buffers window)))) |
| 2550 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by | 2548 | ;; Reset WINDOW's next buffers. If needed, they are resurrected by |
| @@ -2580,7 +2578,7 @@ WINDOW must be a live window and defaults to the selected one." | |||
| 2580 | WINDOW must be a live window and defaults to the selected one. | 2578 | WINDOW must be a live window and defaults to the selected one. |
| 2581 | BUFFER must be a live buffer and defaults to the buffer of | 2579 | BUFFER must be a live buffer and defaults to the buffer of |
| 2582 | WINDOW." | 2580 | WINDOW." |
| 2583 | (let* ((window (window-normalize-live-window window)) | 2581 | (let* ((window (window-normalize-window window t)) |
| 2584 | (buffer (or buffer (window-buffer window)))) | 2582 | (buffer (or buffer (window-buffer window)))) |
| 2585 | (set-window-prev-buffers | 2583 | (set-window-prev-buffers |
| 2586 | window (assq-delete-all buffer (window-prev-buffers window))) | 2584 | window (assq-delete-all buffer (window-prev-buffers window))) |
| @@ -2613,7 +2611,7 @@ Optional argument BURY-OR-KILL non-nil means the buffer currently | |||
| 2613 | shown in WINDOW is about to be buried or killed and consequently | 2611 | shown in WINDOW is about to be buried or killed and consequently |
| 2614 | shall not be switched to in future invocations of this command." | 2612 | shall not be switched to in future invocations of this command." |
| 2615 | (interactive) | 2613 | (interactive) |
| 2616 | (let* ((window (window-normalize-live-window window)) | 2614 | (let* ((window (window-normalize-window window t)) |
| 2617 | (old-buffer (window-buffer window)) | 2615 | (old-buffer (window-buffer window)) |
| 2618 | ;; Save this since it's destroyed by `set-window-buffer'. | 2616 | ;; Save this since it's destroyed by `set-window-buffer'. |
| 2619 | (next-buffers (window-next-buffers window)) | 2617 | (next-buffers (window-next-buffers window)) |
| @@ -2702,7 +2700,7 @@ shall not be switched to in future invocations of this command." | |||
| 2702 | "In WINDOW switch to next buffer. | 2700 | "In WINDOW switch to next buffer. |
| 2703 | WINDOW must be a live window and defaults to the selected one." | 2701 | WINDOW must be a live window and defaults to the selected one." |
| 2704 | (interactive) | 2702 | (interactive) |
| 2705 | (let* ((window (window-normalize-live-window window)) | 2703 | (let* ((window (window-normalize-window window t)) |
| 2706 | (old-buffer (window-buffer window)) | 2704 | (old-buffer (window-buffer window)) |
| 2707 | (next-buffers (window-next-buffers window)) | 2705 | (next-buffers (window-next-buffers window)) |
| 2708 | new-buffer entry killed-buffers visible) | 2706 | new-buffer entry killed-buffers visible) |
| @@ -2825,7 +2823,7 @@ Optional argument DEDICATED-ONLY non-nil means to delete WINDOW | |||
| 2825 | only if it's dedicated to its buffer. Optional argument KILL | 2823 | only if it's dedicated to its buffer. Optional argument KILL |
| 2826 | means the buffer shown in window will be killed. Return non-nil | 2824 | means the buffer shown in window will be killed. Return non-nil |
| 2827 | if WINDOW gets deleted or its frame is auto-hidden." | 2825 | if WINDOW gets deleted or its frame is auto-hidden." |
| 2828 | (setq window (window-normalize-live-window window)) | 2826 | (setq window (window-normalize-window window t)) |
| 2829 | (unless (and dedicated-only (not (window-dedicated-p window))) | 2827 | (unless (and dedicated-only (not (window-dedicated-p window))) |
| 2830 | (let* ((buffer (window-buffer window)) | 2828 | (let* ((buffer (window-buffer window)) |
| 2831 | (deletable (window-deletable-p window))) | 2829 | (deletable (window-deletable-p window))) |
| @@ -2971,7 +2969,7 @@ WINDOW, \(3) restore the buffer previously displayed in WINDOW, | |||
| 2971 | or \(4) make WINDOW display some other buffer than the present | 2969 | or \(4) make WINDOW display some other buffer than the present |
| 2972 | one. If non-nil, reset `quit-restore' parameter to nil." | 2970 | one. If non-nil, reset `quit-restore' parameter to nil." |
| 2973 | (interactive "P") | 2971 | (interactive "P") |
| 2974 | (setq window (window-normalize-live-window window)) | 2972 | (setq window (window-normalize-window window t)) |
| 2975 | (let* ((buffer (window-buffer window)) | 2973 | (let* ((buffer (window-buffer window)) |
| 2976 | (quit-restore (window-parameter window 'quit-restore)) | 2974 | (quit-restore (window-parameter window 'quit-restore)) |
| 2977 | (prev-buffer | 2975 | (prev-buffer |
| @@ -3103,7 +3101,7 @@ window, these properties as well as the buffer displayed in the | |||
| 3103 | new window are inherited from the window selected on WINDOW's | 3101 | new window are inherited from the window selected on WINDOW's |
| 3104 | frame. The selected window is not changed by this function." | 3102 | frame. The selected window is not changed by this function." |
| 3105 | (interactive "i") | 3103 | (interactive "i") |
| 3106 | (setq window (window-normalize-any-window window)) | 3104 | (setq window (window-normalize-window window)) |
| 3107 | (let* ((side (cond | 3105 | (let* ((side (cond |
| 3108 | ((not side) 'below) | 3106 | ((not side) 'below) |
| 3109 | ((memq side '(below above right left)) side) | 3107 | ((memq side '(below above right left)) side) |
| @@ -3677,7 +3675,7 @@ to put the state recorded here into an arbitrary window. The | |||
| 3677 | value can be also stored on disk and read back in a new session." | 3675 | value can be also stored on disk and read back in a new session." |
| 3678 | (setq window | 3676 | (setq window |
| 3679 | (if window | 3677 | (if window |
| 3680 | (if (window-any-p window) | 3678 | (if (window-valid-p window) |
| 3681 | window | 3679 | window |
| 3682 | (error "%s is not a live or internal window" window)) | 3680 | (error "%s is not a live or internal window" window)) |
| 3683 | (frame-root-window))) | 3681 | (frame-root-window))) |
| @@ -3847,7 +3845,7 @@ Optional argument IGNORE non-nil means ignore minimum window | |||
| 3847 | sizes and fixed size restrictions. IGNORE equal `safe' means | 3845 | sizes and fixed size restrictions. IGNORE equal `safe' means |
| 3848 | subwindows can get as small as `window-safe-min-height' and | 3846 | subwindows can get as small as `window-safe-min-height' and |
| 3849 | `window-safe-min-width'." | 3847 | `window-safe-min-width'." |
| 3850 | (setq window (window-normalize-live-window window)) | 3848 | (setq window (window-normalize-window window t)) |
| 3851 | (let* ((frame (window-frame window)) | 3849 | (let* ((frame (window-frame window)) |
| 3852 | (head (car state)) | 3850 | (head (car state)) |
| 3853 | ;; We check here (1) whether the total sizes of root window of | 3851 | ;; We check here (1) whether the total sizes of root window of |
| @@ -5113,7 +5111,7 @@ Note that the current implementation of this function cannot | |||
| 5113 | always set the height exactly, but attempts to be conservative, | 5111 | always set the height exactly, but attempts to be conservative, |
| 5114 | by allocating more lines than are actually needed in the case | 5112 | by allocating more lines than are actually needed in the case |
| 5115 | where some error may be present." | 5113 | where some error may be present." |
| 5116 | (setq window (window-normalize-live-window window)) | 5114 | (setq window (window-normalize-window window t)) |
| 5117 | (let ((delta (- height (window-text-height window)))) | 5115 | (let ((delta (- height (window-text-height window)))) |
| 5118 | (unless (zerop delta) | 5116 | (unless (zerop delta) |
| 5119 | ;; Setting window-min-height to a value like 1 can lead to very | 5117 | ;; Setting window-min-height to a value like 1 can lead to very |
| @@ -5209,7 +5207,7 @@ WINDOW was scrolled." | |||
| 5209 | (interactive) | 5207 | (interactive) |
| 5210 | ;; Do all the work in WINDOW and its buffer and restore the selected | 5208 | ;; Do all the work in WINDOW and its buffer and restore the selected |
| 5211 | ;; window and the current buffer when we're done. | 5209 | ;; window and the current buffer when we're done. |
| 5212 | (setq window (window-normalize-live-window window)) | 5210 | (setq window (window-normalize-window window t)) |
| 5213 | ;; Can't resize a full height or fixed-size window. | 5211 | ;; Can't resize a full height or fixed-size window. |
| 5214 | (unless (or (window-size-fixed-p window) | 5212 | (unless (or (window-size-fixed-p window) |
| 5215 | (window-full-height-p window)) | 5213 | (window-full-height-p window)) |
| @@ -5315,7 +5313,7 @@ window, or if the window is the only window of its frame. | |||
| 5315 | 5313 | ||
| 5316 | Return non-nil if the window was shrunk, nil otherwise." | 5314 | Return non-nil if the window was shrunk, nil otherwise." |
| 5317 | (interactive) | 5315 | (interactive) |
| 5318 | (setq window (window-normalize-live-window window)) | 5316 | (setq window (window-normalize-window window t)) |
| 5319 | ;; Make sure that WINDOW is vertically combined and `point-min' is | 5317 | ;; Make sure that WINDOW is vertically combined and `point-min' is |
| 5320 | ;; visible (for whatever reason that's needed). The remaining issues | 5318 | ;; visible (for whatever reason that's needed). The remaining issues |
| 5321 | ;; should be taken care of by `fit-window-to-buffer'. | 5319 | ;; should be taken care of by `fit-window-to-buffer'. |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 64b9577e362..fc612d64fa8 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,40 @@ | |||
| 1 | 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com> | ||
| 2 | |||
| 3 | * inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX) | ||
| 4 | (UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX) | ||
| 5 | (INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN) | ||
| 6 | (intmax_t, INT64_MAX): Add for MSVC. | ||
| 7 | |||
| 8 | * config.nt: (mode_t) [!__GNUC__]: Define mode_t for MSVC. | ||
| 9 | |||
| 10 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | ||
| 11 | |||
| 12 | * config.nt (inline) [!__GNUC__]: Define to __inline for MSVC. | ||
| 13 | |||
| 14 | Support MSVC build with newer versions of Visual Studio. | ||
| 15 | * makefile.w32-in (clean-other-dirs-nmake) | ||
| 16 | (distclean-other-dirs-nmake, maintainer-clean-other-dirs-nmake): | ||
| 17 | Update for current structure of doc/ subdirectories. | ||
| 18 | |||
| 19 | * gmake.defs (OBJ0_c, OBJ1_c, OBJ2_c): New variables. | ||
| 20 | |||
| 21 | * INSTALL: Update for newer versions of MSVC. | ||
| 22 | |||
| 23 | 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change) | ||
| 24 | |||
| 25 | Support MSVC build with newer versions of Visual Studio. | ||
| 26 | * nmake.defs (USE_CRT_DLL): Define to 1. | ||
| 27 | (libc, EMACS_EXTRA_C_FLAGS, SYS_LDFLAGS, ARCH_CFLAGS): Update values. | ||
| 28 | (D): New variable. | ||
| 29 | |||
| 30 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | ||
| 31 | |||
| 32 | * runemacs.c (ensure_unicows_dll): New function, tries to load | ||
| 33 | UNICOWS.DLL on Windows 9X. | ||
| 34 | (WinMain): If ensure_unicows_dll fails to find UNICOWS.DLL, | ||
| 35 | display a dialog to the effect that Emacs cannot be started. | ||
| 36 | (Bug#8562) | ||
| 37 | |||
| 1 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | 38 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 39 | ||
| 3 | * README.W32: Mention UNICOWS.DLL as prerequisite for running | 40 | * README.W32: Mention UNICOWS.DLL as prerequisite for running |
diff --git a/nt/INSTALL b/nt/INSTALL index 613610890ae..63285047a67 100644 --- a/nt/INSTALL +++ b/nt/INSTALL | |||
| @@ -21,19 +21,32 @@ | |||
| 21 | 21 | ||
| 22 | cd nt | 22 | cd nt |
| 23 | 23 | ||
| 24 | 2. Run configure.bat. From the COMMAND.COM/CMD.EXE command prompt: | 24 | 2. Run configure.bat. |
| 25 | |||
| 26 | 2a.If you use MSVC, set up the build environment by running the | ||
| 27 | SetEnv.cmd batch file from the appropriate SDK directory. (Skip | ||
| 28 | this step if you are using MinGW.) For example: | ||
| 29 | |||
| 30 | "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Debug | ||
| 31 | |||
| 32 | if you are goiung to compile a debug version, or | ||
| 33 | |||
| 34 | "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Release | ||
| 35 | |||
| 36 | if you are going to compile an optimized version. | ||
| 37 | |||
| 38 | 2b.From the COMMAND.COM/CMD.EXE command prompt type: | ||
| 25 | 39 | ||
| 26 | configure | 40 | configure |
| 27 | 41 | ||
| 28 | from a Unixy shell prompt: | 42 | From a Unixy shell prompt: |
| 29 | 43 | ||
| 30 | cmd /c configure.bat | 44 | cmd /c configure.bat |
| 31 | or | 45 | or |
| 32 | command.com /c configure.bat | 46 | command.com /c configure.bat |
| 33 | 47 | ||
| 34 | 3. Run the Make utility suitable for your environment. If you build | 48 | 3. Run the Make utility suitable for your environment. If you build |
| 35 | with the Microsoft's Visual C compiler (but see notes about using | 49 | with the Microsoft's Visual C compiler: |
| 36 | VC++ 8.0 and later below): | ||
| 37 | 50 | ||
| 38 | nmake | 51 | nmake |
| 39 | 52 | ||
| @@ -101,24 +114,21 @@ | |||
| 101 | * Supported development environments | 114 | * Supported development environments |
| 102 | 115 | ||
| 103 | To compile Emacs, you will need either Microsoft Visual C++ 2.0, or | 116 | To compile Emacs, you will need either Microsoft Visual C++ 2.0, or |
| 104 | later up to 7.0, and nmake, or a Windows port of GCC 2.95 or later | 117 | later and nmake, or a Windows port of GCC 2.95 or later with MinGW |
| 105 | with MinGW and W32 API support and a port of GNU Make. You can use | 118 | and W32 API support and a port of GNU Make. You can use the Cygwin |
| 106 | the Cygwin ports of GCC, but Emacs requires the MinGW headers and | 119 | ports of GCC, but Emacs requires the MinGW headers and libraries to |
| 107 | libraries to build (latest versions of the Cygwin toolkit, at least | 120 | build (latest versions of the Cygwin toolkit, at least since v1.3.3, |
| 108 | since v1.3.3, include the MinGW headers and libraries as an integral | 121 | include the MinGW headers and libraries as an integral part). |
| 109 | part). | ||
| 110 | |||
| 111 | Note that building Emacs with Visual Studio 2005 (VC++ 8.0) and | ||
| 112 | later is not supported at this time, due to changes introduced by | ||
| 113 | Microsoft into the libraries shipped with the compiler. | ||
| 114 | 122 | ||
| 115 | The rest of this file assumes you have a working development | 123 | The rest of this file assumes you have a working development |
| 116 | environment. If you just installed such an environment, try | 124 | environment. If you just installed such an environment, try |
| 117 | building a trivial C "Hello world" program, and see if it works. If | 125 | building a trivial C "Hello world" program, and see if it works. If |
| 118 | it doesn't work, resolve that problem first! If you use Microsoft | 126 | it doesn't work, resolve that problem first! If you use Microsoft |
| 119 | Visual Studio .NET 2003, don't forget to run the VCVARS32.BAT batch | 127 | Visual Studio .NET 2003, don't forget to run the VCVARS32.BAT batch |
| 120 | file from the `Bin' subdirectory of the directory where you have | 128 | file from the `Bin' subdirectory of the directory where you have |
| 121 | installed VS.NET. | 129 | installed VS.NET. With other versions of MSVC, run the SetEnv.cmd |
| 130 | batch file from the `Bin' subdirectory of the directory where you | ||
| 131 | have the SDK installed. | ||
| 122 | 132 | ||
| 123 | If you use the MinGW port of GCC and GNU Make to build Emacs, there | 133 | If you use the MinGW port of GCC and GNU Make to build Emacs, there |
| 124 | are some compatibility issues wrt Make and the shell that is run by | 134 | are some compatibility issues wrt Make and the shell that is run by |
diff --git a/nt/config.nt b/nt/config.nt index 87c5f5cc8aa..3a06a9f5b7a 100644 --- a/nt/config.nt +++ b/nt/config.nt | |||
| @@ -328,9 +328,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 328 | 328 | ||
| 329 | /* Define to `__inline__' or `__inline' if that's what the C compiler | 329 | /* Define to `__inline__' or `__inline' if that's what the C compiler |
| 330 | calls it, or to nothing if 'inline' is not supported under any name. */ | 330 | calls it, or to nothing if 'inline' is not supported under any name. */ |
| 331 | #ifdef __GNUC__ | ||
| 331 | #ifndef __cplusplus | 332 | #ifndef __cplusplus |
| 332 | #undef inline | 333 | #undef inline |
| 333 | #endif | 334 | #endif |
| 335 | #else /* MSVC */ | ||
| 336 | #define inline __inline | ||
| 337 | #endif | ||
| 334 | 338 | ||
| 335 | /* Define to the equivalent of the C99 'restrict' keyword, or to | 339 | /* Define to the equivalent of the C99 'restrict' keyword, or to |
| 336 | nothing if this is not supported. Do not define if restrict is | 340 | nothing if this is not supported. Do not define if restrict is |
| @@ -341,6 +345,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 341 | # define restrict | 345 | # define restrict |
| 342 | #endif | 346 | #endif |
| 343 | 347 | ||
| 348 | /* `mode_t' is not defined for MSVC. Define. */ | ||
| 349 | #ifdef _MSC_VER | ||
| 350 | typedef unsigned short mode_t; | ||
| 351 | #endif | ||
| 352 | |||
| 344 | /* A va_copy replacement for MSVC. */ | 353 | /* A va_copy replacement for MSVC. */ |
| 345 | #ifdef _MSC_VER | 354 | #ifdef _MSC_VER |
| 346 | # ifdef _WIN64 | 355 | # ifdef _WIN64 |
diff --git a/nt/gmake.defs b/nt/gmake.defs index bbb560264c5..46d4acf76dd 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs | |||
| @@ -193,6 +193,11 @@ OLE32 = -lole32 | |||
| 193 | UNISCRIBE = -lusp10 | 193 | UNISCRIBE = -lusp10 |
| 194 | UUID = -luuid | 194 | UUID = -luuid |
| 195 | 195 | ||
| 196 | # Used by src/makefile.w32-in, since Nmake barfs on $(func SOMETHING) | ||
| 197 | OBJ0_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0)) | ||
| 198 | OBJ1_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1)) | ||
| 199 | OBJ2_c = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) | ||
| 200 | |||
| 196 | ifdef NOOPT | 201 | ifdef NOOPT |
| 197 | DEBUG_CFLAGS = -DEMACSDEBUG | 202 | DEBUG_CFLAGS = -DEMACSDEBUG |
| 198 | else | 203 | else |
diff --git a/nt/inc/stdint.h b/nt/inc/stdint.h index 4af0346af2c..5242a45df44 100644 --- a/nt/inc/stdint.h +++ b/nt/inc/stdint.h | |||
| @@ -27,20 +27,34 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | /* Minimum definitions to allow compilation with tool chains where | 27 | /* Minimum definitions to allow compilation with tool chains where |
| 28 | stdint.h is not available, e.g. Microsoft Visual Studio. */ | 28 | stdint.h is not available, e.g. Microsoft Visual Studio. */ |
| 29 | 29 | ||
| 30 | typedef unsigned int uint32_t; | 30 | #ifdef _WIN64 |
| 31 | #define INT32_MAX 2147483647 | 31 | typedef __int64 intptr_t; |
| 32 | #define UINT64_MAX 18446744073709551616 | ||
| 33 | #define UINT64_MIN 0 | ||
| 32 | /* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */ | 34 | /* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */ |
| 33 | #define INT64_MAX 9223372036854775807i64 | 35 | #define INT64_MAX 9223372036854775807i64 |
| 34 | 36 | #define INT64_MIN (~INT64_MAX) | |
| 35 | #ifdef _WIN64 | ||
| 36 | typedef __int64 intptr_t; | ||
| 37 | #define INTPTR_MAX INT64_MAX | 37 | #define INTPTR_MAX INT64_MAX |
| 38 | #define UINTMAX_MAX UINT64_MAX | ||
| 39 | #define UINTMAX_MIN UINT64_MIN | ||
| 40 | #define INTMAX_MAX INT64_MAX | ||
| 41 | #define INTMAX_MIN INT64_MIN | ||
| 38 | #else | 42 | #else |
| 39 | typedef int intptr_t; | 43 | typedef int intptr_t; |
| 44 | typedef unsigned int uint32_t; | ||
| 45 | #define UINT32_MAX 4294967296 | ||
| 46 | #define UINT32_MIN 0 | ||
| 47 | #define INT32_MAX 2147483647 | ||
| 48 | #define INT32_MIN (~INT32_MAX) | ||
| 40 | #define INTPTR_MAX INT32_MAX | 49 | #define INTPTR_MAX INT32_MAX |
| 50 | #define UINTMAX_MAX UINT32_MAX | ||
| 51 | #define UINTMAX_MIN UINT32_MIN | ||
| 52 | #define INTMAX_MAX INT32_MAX | ||
| 53 | #define INTMAX_MIN INT32_MIN | ||
| 41 | #endif | 54 | #endif |
| 42 | 55 | ||
| 43 | #define uintmax_t unsigned __int64 | 56 | #define uintmax_t unsigned __int64 |
| 57 | #define intmax_t __int64 | ||
| 44 | #define PTRDIFF_MAX INTPTR_MAX | 58 | #define PTRDIFF_MAX INTPTR_MAX |
| 45 | 59 | ||
| 46 | #endif /* !__GNUC__ */ | 60 | #endif /* !__GNUC__ */ |
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 05631855f6a..194f0759bbf 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in | |||
| @@ -313,15 +313,15 @@ clean-other-dirs-nmake: | |||
| 313 | $(MAKE) $(MFLAGS) clean | 313 | $(MAKE) $(MFLAGS) clean |
| 314 | cd ..\doc\lispintro | 314 | cd ..\doc\lispintro |
| 315 | $(MAKE) $(MFLAGS) clean | 315 | $(MAKE) $(MFLAGS) clean |
| 316 | cd ..\doc\lispref | 316 | cd ..\lispref |
| 317 | $(MAKE) $(MFLAGS) clean | 317 | $(MAKE) $(MFLAGS) clean |
| 318 | cd ..\leim | 318 | cd ..\..\leim |
| 319 | $(MAKE) $(MFLAGS) clean | 319 | $(MAKE) $(MFLAGS) clean |
| 320 | cd ..\doc\emacs | 320 | cd ..\doc\emacs |
| 321 | $(MAKE) $(MFLAGS) clean | 321 | $(MAKE) $(MFLAGS) clean |
| 322 | cd ..\doc\misc | 322 | cd ..\misc |
| 323 | $(MAKE) $(MFLAGS) clean | 323 | $(MAKE) $(MFLAGS) clean |
| 324 | cd ..\nt | 324 | cd ..\..\nt |
| 325 | 325 | ||
| 326 | clean-other-dirs-gmake: | 326 | clean-other-dirs-gmake: |
| 327 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean | 327 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean |
| @@ -381,13 +381,13 @@ distclean-other-dirs-nmake: | |||
| 381 | $(MAKE) $(MFLAGS) distclean | 381 | $(MAKE) $(MFLAGS) distclean |
| 382 | cd ..\doc\emacs | 382 | cd ..\doc\emacs |
| 383 | $(MAKE) $(MFLAGS) distclean | 383 | $(MAKE) $(MFLAGS) distclean |
| 384 | cd ..\doc\misc | 384 | cd ..\misc |
| 385 | $(MAKE) $(MFLAGS) distclean | 385 | $(MAKE) $(MFLAGS) distclean |
| 386 | cd ..\doc\lispintro | 386 | cd ..\lispintro |
| 387 | $(MAKE) $(MFLAGS) distclean | 387 | $(MAKE) $(MFLAGS) distclean |
| 388 | cd ..\doc\lispref | 388 | cd ..\lispref |
| 389 | $(MAKE) $(MFLAGS) distclean | 389 | $(MAKE) $(MFLAGS) distclean |
| 390 | cd ..\nt | 390 | cd ..\..\nt |
| 391 | 391 | ||
| 392 | distclean-other-dirs-gmake: | 392 | distclean-other-dirs-gmake: |
| 393 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib distclean | 393 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib distclean |
| @@ -415,13 +415,13 @@ maintainer-clean-other-dirs-nmake: | |||
| 415 | $(MAKE) $(MFLAGS) maintainer-clean | 415 | $(MAKE) $(MFLAGS) maintainer-clean |
| 416 | cd ..\doc\emacs | 416 | cd ..\doc\emacs |
| 417 | $(MAKE) $(MFLAGS) maintainer-clean | 417 | $(MAKE) $(MFLAGS) maintainer-clean |
| 418 | cd ..\doc\misc | 418 | cd ..\misc |
| 419 | $(MAKE) $(MFLAGS) maintainer-clean | 419 | $(MAKE) $(MFLAGS) maintainer-clean |
| 420 | cd ..\doc\lispintro | 420 | cd ..\lispintro |
| 421 | $(MAKE) $(MFLAGS) maintainer-clean | 421 | $(MAKE) $(MFLAGS) maintainer-clean |
| 422 | cd ..\doc\lispref | 422 | cd ..\lispref |
| 423 | $(MAKE) $(MFLAGS) maintainer-clean | 423 | $(MAKE) $(MFLAGS) maintainer-clean |
| 424 | cd ..\nt | 424 | cd ..\..\nt |
| 425 | 425 | ||
| 426 | maintainer-clean-other-dirs-gmake: | 426 | maintainer-clean-other-dirs-gmake: |
| 427 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib maintainer-clean | 427 | $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib maintainer-clean |
diff --git a/nt/nmake.defs b/nt/nmake.defs index 6c0922d78b9..4a7d93d40dd 100644 --- a/nt/nmake.defs +++ b/nt/nmake.defs | |||
| @@ -109,7 +109,15 @@ RC = rc | |||
| 109 | RC_OUT = -Fo | 109 | RC_OUT = -Fo |
| 110 | RC_INCLUDE = -i | 110 | RC_INCLUDE = -i |
| 111 | 111 | ||
| 112 | libc = libc.lib | 112 | USE_CRT_DLL = 1 |
| 113 | |||
| 114 | !ifdef USE_CRT_DLL | ||
| 115 | libc = msvcrt$(D).lib | ||
| 116 | EMACS_EXTRA_C_FLAGS= -D_DLL -D_MT -DUSE_CRT_DLL=1 | ||
| 117 | !else | ||
| 118 | libc = libcmt$(D).lib | ||
| 119 | EMACS_EXTRA_C_FLAGS= -D_MT | ||
| 120 | !endif | ||
| 113 | baselibs = | 121 | baselibs = |
| 114 | O = obj | 122 | O = obj |
| 115 | A = lib | 123 | A = lib |
| @@ -146,9 +154,13 @@ CFLAGS = -I. $(ARCH_CFLAGS) \ | |||
| 146 | $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) | 154 | $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) |
| 147 | ESC_CFLAGS = -I. $(ARCH_CFLAGS) \ | 155 | ESC_CFLAGS = -I. $(ARCH_CFLAGS) \ |
| 148 | $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) | 156 | $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) |
| 149 | EMACS_EXTRA_C_FLAGS = | ||
| 150 | 157 | ||
| 151 | SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj | 158 | #SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj |
| 159 | !ifdef NOOPT | ||
| 160 | SYS_LDFLAGS = -nologo -manifest -dynamicbase:no -debug -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj | ||
| 161 | !else | ||
| 162 | SYS_LDFLAGS = -nologo -manifest -dynamicbase:no -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj | ||
| 163 | !endif | ||
| 152 | 164 | ||
| 153 | # see comments in allocate_heap in w32heap.c before changing any of the | 165 | # see comments in allocate_heap in w32heap.c before changing any of the |
| 154 | # -stack, -heap, or -base settings. | 166 | # -stack, -heap, or -base settings. |
| @@ -184,16 +196,20 @@ DEL_TREE = rm -r | |||
| 184 | !ifdef NODEBUG | 196 | !ifdef NODEBUG |
| 185 | DEBUG_FLAG = | 197 | DEBUG_FLAG = |
| 186 | DEBUG_LINK = | 198 | DEBUG_LINK = |
| 199 | D = | ||
| 187 | !else | 200 | !else |
| 188 | DEBUG_FLAG = -Zi | 201 | DEBUG_FLAG = -Zi |
| 189 | DEBUG_LINK = -debug:full | 202 | DEBUG_LINK = -debug |
| 203 | D = d | ||
| 190 | !endif | 204 | !endif |
| 191 | 205 | ||
| 192 | !if "$(ARCH)" == "i386" | 206 | !if "$(ARCH)" == "i386" |
| 193 | !ifdef NOOPT | 207 | !ifdef NOOPT |
| 194 | ARCH_CFLAGS = -nologo -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG) | 208 | #ARCH_CFLAGS = -nologo -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG) |
| 209 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Od -Gd $(DEBUG_FLAG) | ||
| 195 | !else | 210 | !else |
| 196 | ARCH_CFLAGS = -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG) | 211 | #ARCH_CFLAGS = -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG) |
| 212 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Oi -Ot -Oy- -Ob2 -GF -Gy -Gd $(DEBUG_FLAG) | ||
| 197 | !endif | 213 | !endif |
| 198 | ARCH_LDFLAGS = $(SYS_LDFLAGS) | 214 | ARCH_LDFLAGS = $(SYS_LDFLAGS) |
| 199 | 215 | ||
diff --git a/nt/runemacs.c b/nt/runemacs.c index 07e24f745f8..47b8f54bb02 100644 --- a/nt/runemacs.c +++ b/nt/runemacs.c | |||
| @@ -45,6 +45,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 45 | #include <malloc.h> | 45 | #include <malloc.h> |
| 46 | 46 | ||
| 47 | static void set_user_model_id (void); | 47 | static void set_user_model_id (void); |
| 48 | static int ensure_unicows_dll (void); | ||
| 48 | 49 | ||
| 49 | int WINAPI | 50 | int WINAPI |
| 50 | WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) | 51 | WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) |
| @@ -59,6 +60,9 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) | |||
| 59 | char *p; | 60 | char *p; |
| 60 | char modname[MAX_PATH]; | 61 | char modname[MAX_PATH]; |
| 61 | 62 | ||
| 63 | if (!ensure_unicows_dll ()) | ||
| 64 | goto error; | ||
| 65 | |||
| 62 | set_user_model_id (); | 66 | set_user_model_id (); |
| 63 | 67 | ||
| 64 | if (!GetModuleFileName (NULL, modname, MAX_PATH)) | 68 | if (!GetModuleFileName (NULL, modname, MAX_PATH)) |
| @@ -203,3 +207,43 @@ set_user_model_id (void) | |||
| 203 | } | 207 | } |
| 204 | } | 208 | } |
| 205 | 209 | ||
| 210 | static int | ||
| 211 | ensure_unicows_dll (void) | ||
| 212 | { | ||
| 213 | OSVERSIONINFO os_ver; | ||
| 214 | HMODULE h; | ||
| 215 | |||
| 216 | ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); | ||
| 217 | os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); | ||
| 218 | if (!GetVersionEx (&os_ver)) | ||
| 219 | return 0; | ||
| 220 | |||
| 221 | if (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) | ||
| 222 | { | ||
| 223 | h = LoadLibrary ("Unicows.dll"); | ||
| 224 | if (!h) | ||
| 225 | { | ||
| 226 | int button; | ||
| 227 | |||
| 228 | button = MessageBox (NULL, | ||
| 229 | "Emacs cannot load the UNICOWS.DLL library.\n" | ||
| 230 | "This library is essential for using Emacs\n" | ||
| 231 | "on this system. You need to install it.\n\n" | ||
| 232 | "However, you can still use Emacs by invoking\n" | ||
| 233 | "it with the '-nw' command-line option.\n\n" | ||
| 234 | "Emacs will exit when you click OK.", | ||
| 235 | "Emacs cannot load UNICOWS.DLL", | ||
| 236 | MB_ICONERROR | MB_TASKMODAL | ||
| 237 | | MB_SETFOREGROUND | MB_OK); | ||
| 238 | switch (button) | ||
| 239 | { | ||
| 240 | case IDOK: | ||
| 241 | default: | ||
| 242 | return 0; | ||
| 243 | } | ||
| 244 | } | ||
| 245 | FreeLibrary (h); | ||
| 246 | return 1; | ||
| 247 | } | ||
| 248 | return 1; | ||
| 249 | } | ||
diff --git a/src/ChangeLog b/src/ChangeLog index ccfcb48daf0..3711292ad35 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,160 @@ | |||
| 1 | 2011-11-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926). | ||
| 4 | This is also needed for porting to any host where GC_MARK_STACK is | ||
| 5 | not GC_MAKE_GCPROS_NOOPS. | ||
| 6 | (which_symbols): Use it. | ||
| 7 | |||
| 8 | 2011-11-07 Kenichi Handa <handa@m17n.org> | ||
| 9 | |||
| 10 | * coding.c (coding_set_destination): Check coding->src_pos only | ||
| 11 | when coding->src_object is a buffer (bug#9910). | ||
| 12 | |||
| 13 | * process.c (send_process): Set the member src_multibyte of coding | ||
| 14 | to 0 (bug#9911) when sending a unibyte text. | ||
| 15 | |||
| 16 | * callproc.c (Fcall_process): Set the member src_multibyte of | ||
| 17 | process_coding to 0 (bug#9912). | ||
| 18 | |||
| 19 | 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 20 | |||
| 21 | * xmenu.c (cleanup_widget_value_tree): New function. | ||
| 22 | (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of | ||
| 23 | calling free_menubar_widget_value_tree directly (Bug#9830). | ||
| 24 | |||
| 25 | 2011-11-06 Paul Eggert <eggert@cs.ucla.edu> | ||
| 26 | |||
| 27 | Fix some portability problems with 'inline'. | ||
| 28 | * dispextern.h (window_box, window_box_height, window_text_bottom_y) | ||
| 29 | (window_box_width, window_box_left, window_box_left_offset) | ||
| 30 | (window_box_right, window_box_right_offset): Declare extern. | ||
| 31 | Otherwise, these inline functions do not conform to C99 and | ||
| 32 | are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in | ||
| 33 | <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>. | ||
| 34 | * intervals.c (adjust_intervals_for_insertion) | ||
| 35 | (adjust_intervals_for_deletion): Now extern, because otherwise the | ||
| 36 | extern inline functions 'offset_intervals' couldn't refer to it. | ||
| 37 | (static_offset_intervals): Remove. | ||
| 38 | (offset_intervals): Rewrite using the old contents of | ||
| 39 | static_offset_intervals. The old version didn't conform to C99 | ||
| 40 | because an extern inline function contained a reference to an | ||
| 41 | identifier with static linkage. | ||
| 42 | |||
| 43 | 2011-11-06 Andreas Schwab <schwab@linux-m68k.org> | ||
| 44 | |||
| 45 | * keyboard.c (interrupt_signal): Don't call kill-emacs while in | ||
| 46 | GC. | ||
| 47 | |||
| 48 | 2011-11-06 Eli Zaretskii <eliz@gnu.org> | ||
| 49 | |||
| 50 | * xdisp.c (init_iterator, reseat_to_string): Don't set the | ||
| 51 | iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963) | ||
| 52 | (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil, | ||
| 53 | return Qleft_to_right. | ||
| 54 | |||
| 55 | 2011-11-06 Chong Yidong <cyd@gnu.org> | ||
| 56 | |||
| 57 | * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window) | ||
| 58 | (Fminibuffer_window, Fwindow_buffer, Fwindow_splits) | ||
| 59 | (Fset_window_splits, Fwindow_nest, Fset_window_nest) | ||
| 60 | (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size) | ||
| 61 | (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line) | ||
| 62 | (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars) | ||
| 63 | (Fwindow_vscroll): Doc fix. | ||
| 64 | (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default | ||
| 65 | argument, since it makes no sense to pass a live window and for | ||
| 66 | consistency with window-child. | ||
| 67 | |||
| 68 | 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com> | ||
| 69 | |||
| 70 | * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to | ||
| 71 | support MSVC. | ||
| 72 | |||
| 73 | 2011-11-05 Jason Rumney <jasonr@gnu.org> | ||
| 74 | |||
| 75 | * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts. | ||
| 76 | (add_font_entity_to_list): Filter out non-Japanese Shift-JIS | ||
| 77 | fonts (Bug#6029). | ||
| 78 | (add_font_entity_to_list): Fix logic errors in mixed boolean and | ||
| 79 | bitwise arithmetic preventing use of unicode-sip and non-truetype | ||
| 80 | opentype fonts. | ||
| 81 | |||
| 82 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | ||
| 83 | |||
| 84 | * s/ms-w32.h (fstat, stat, utime): Move redirections to | ||
| 85 | "emacs"-only part. | ||
| 86 | |||
| 87 | * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange | ||
| 88 | initialization code to keep similarity to xfns.c after changes | ||
| 89 | from 2011-11-05. | ||
| 90 | |||
| 91 | 2011-11-05 Jan Djärv <jan.h.d@swipnet.se> | ||
| 92 | |||
| 93 | * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG. | ||
| 94 | (unwind_create_frame): New function (Bug#9943). | ||
| 95 | (Fx_create_frame): Restructure code to be more similar to the one in | ||
| 96 | xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943). | ||
| 97 | Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943). | ||
| 98 | Move terminal->reference_count++ just before making the frame official | ||
| 99 | (Bug#9943). | ||
| 100 | |||
| 101 | * nsterm.m (x_free_frame_resources): New function. | ||
| 102 | (x_destroy_window): Move code to x_free_frame_resources. | ||
| 103 | |||
| 104 | * xfns.c (unwind_create_frame): Fix comment. | ||
| 105 | (Fx_create_frame, x_create_tip_frame): Move | ||
| 106 | terminal->reference_count++ just before making the frame | ||
| 107 | official. Move initialization of image_cache_refcount and | ||
| 108 | dpyinfo_refcount before calling init_frame_faces (Bug#9943). | ||
| 109 | |||
| 110 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | ||
| 111 | |||
| 112 | Support MSVC build with newer versions of Visual Studio. | ||
| 113 | * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as | ||
| 114 | Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on | ||
| 115 | nt/gmake.defs. | ||
| 116 | |||
| 117 | * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields, | ||
| 118 | which are not supported by MSVC. | ||
| 119 | (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay) | ||
| 120 | (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in | ||
| 121 | bitfields. | ||
| 122 | (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated | ||
| 123 | types in bitfields. | ||
| 124 | (DEFUN) [_MSC_VER]: Define in a different way for MSVC. | ||
| 125 | |||
| 126 | * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version. | ||
| 127 | |||
| 128 | 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change) | ||
| 129 | |||
| 130 | Support MSVC build with newer versions of Visual Studio. | ||
| 131 | * w32.c: Don't include w32api.h for MSVC. | ||
| 132 | (init_environment) [_MSC_VER]: Call sys_access, not _access. | ||
| 133 | |||
| 134 | * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC. | ||
| 135 | [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h. | ||
| 136 | (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins. | ||
| 137 | (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the | ||
| 138 | e_* cousins. | ||
| 139 | (alloca) [_MSC_VER]: Define to _alloca. | ||
| 140 | |||
| 141 | * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC. | ||
| 142 | |||
| 143 | * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC. | ||
| 144 | |||
| 145 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | ||
| 146 | |||
| 147 | * xdisp.c (note_mouse_highlight): If either of | ||
| 148 | previous/next-single-property-change returns nil, treat that as | ||
| 149 | the beginning or the end of the buffer. (Bug#9955) | ||
| 150 | |||
| 151 | 2011-11-04 Jan Djärv <jan.h.d@swipnet.se> | ||
| 152 | |||
| 153 | * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or | ||
| 154 | label is not null (Bug#9951). | ||
| 155 | (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl | ||
| 156 | may be NULL. | ||
| 157 | |||
| 1 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | 158 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 159 | ||
| 3 | * window.c (Fwindow_body_size): Mention in the doc string that the | 160 | * window.c (Fwindow_body_size): Mention in the doc string that the |
| @@ -2736,6 +2893,9 @@ | |||
| 2736 | 2893 | ||
| 2737 | 2011-07-08 Jason Rumney <jasonr@gnu.org> | 2894 | 2011-07-08 Jason Rumney <jasonr@gnu.org> |
| 2738 | 2895 | ||
| 2896 | * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than | ||
| 2897 | SH_SHOW for hidden windows (Bug#5482). | ||
| 2898 | |||
| 2739 | * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using | 2899 | * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using |
| 2740 | frame struct members of non-existent frames (Bug#6284). | 2900 | frame struct members of non-existent frames (Bug#6284). |
| 2741 | 2901 | ||
diff --git a/src/alloc.c b/src/alloc.c index 210dd7d1687..985e4b71426 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -315,6 +315,7 @@ static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); | |||
| 315 | on free lists recognizable in O(1). */ | 315 | on free lists recognizable in O(1). */ |
| 316 | 316 | ||
| 317 | static Lisp_Object Vdead; | 317 | static Lisp_Object Vdead; |
| 318 | #define DEADP(x) EQ (x, Vdead) | ||
| 318 | 319 | ||
| 319 | #ifdef GC_MALLOC_CHECK | 320 | #ifdef GC_MALLOC_CHECK |
| 320 | 321 | ||
| @@ -411,6 +412,10 @@ static void check_gcpros (void); | |||
| 411 | 412 | ||
| 412 | #endif /* GC_MARK_STACK || GC_MALLOC_CHECK */ | 413 | #endif /* GC_MARK_STACK || GC_MALLOC_CHECK */ |
| 413 | 414 | ||
| 415 | #ifndef DEADP | ||
| 416 | # define DEADP(x) 0 | ||
| 417 | #endif | ||
| 418 | |||
| 414 | /* Recording what needs to be marked for gc. */ | 419 | /* Recording what needs to be marked for gc. */ |
| 415 | 420 | ||
| 416 | struct gcpro *gcprolist; | 421 | struct gcpro *gcprolist; |
| @@ -6261,7 +6266,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) | |||
| 6261 | int gc_count = inhibit_garbage_collection (); | 6266 | int gc_count = inhibit_garbage_collection (); |
| 6262 | Lisp_Object found = Qnil; | 6267 | Lisp_Object found = Qnil; |
| 6263 | 6268 | ||
| 6264 | if (!EQ (obj, Vdead)) | 6269 | if (! DEADP (obj)) |
| 6265 | { | 6270 | { |
| 6266 | for (sblk = symbol_block; sblk; sblk = sblk->next) | 6271 | for (sblk = symbol_block; sblk; sblk = sblk->next) |
| 6267 | { | 6272 | { |
diff --git a/src/callproc.c b/src/callproc.c index 97531f73848..0859aaef2e6 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -748,6 +748,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 748 | val = raw_text_coding_system (val); | 748 | val = raw_text_coding_system (val); |
| 749 | setup_coding_system (val, &process_coding); | 749 | setup_coding_system (val, &process_coding); |
| 750 | } | 750 | } |
| 751 | process_coding.src_multibyte = 0; | ||
| 751 | 752 | ||
| 752 | immediate_quit = 1; | 753 | immediate_quit = 1; |
| 753 | QUIT; | 754 | QUIT; |
diff --git a/src/coding.c b/src/coding.c index 5fd59d394d9..79908e9b29b 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1043,7 +1043,7 @@ coding_set_destination (struct coding_system *coding) | |||
| 1043 | { | 1043 | { |
| 1044 | if (BUFFERP (coding->dst_object)) | 1044 | if (BUFFERP (coding->dst_object)) |
| 1045 | { | 1045 | { |
| 1046 | if (coding->src_pos < 0) | 1046 | if (BUFFERP (coding->src_object) && coding->src_pos < 0) |
| 1047 | { | 1047 | { |
| 1048 | coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE; | 1048 | coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE; |
| 1049 | coding->dst_bytes = (GAP_END_ADDR | 1049 | coding->dst_bytes = (GAP_END_ADDR |
diff --git a/src/dispextern.h b/src/dispextern.h index 006ceb31a5a..d36cdd167ff 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3034,14 +3034,14 @@ int resize_mini_window (struct window *, int); | |||
| 3034 | void set_vertical_scroll_bar (struct window *); | 3034 | void set_vertical_scroll_bar (struct window *); |
| 3035 | #endif | 3035 | #endif |
| 3036 | int try_window (Lisp_Object, struct text_pos, int); | 3036 | int try_window (Lisp_Object, struct text_pos, int); |
| 3037 | void window_box (struct window *, int, int *, int *, int *, int *); | 3037 | extern void window_box (struct window *, int, int *, int *, int *, int *); |
| 3038 | int window_box_height (struct window *); | 3038 | extern int window_box_height (struct window *); |
| 3039 | int window_text_bottom_y (struct window *); | 3039 | extern int window_text_bottom_y (struct window *); |
| 3040 | int window_box_width (struct window *, int); | 3040 | extern int window_box_width (struct window *, int); |
| 3041 | int window_box_left (struct window *, int); | 3041 | extern int window_box_left (struct window *, int); |
| 3042 | int window_box_left_offset (struct window *, int); | 3042 | extern int window_box_left_offset (struct window *, int); |
| 3043 | int window_box_right (struct window *, int); | 3043 | extern int window_box_right (struct window *, int); |
| 3044 | int window_box_right_offset (struct window *, int); | 3044 | extern int window_box_right_offset (struct window *, int); |
| 3045 | int estimate_mode_line_height (struct frame *, enum face_id); | 3045 | int estimate_mode_line_height (struct frame *, enum face_id); |
| 3046 | void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, | 3046 | void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, |
| 3047 | NativeRectangle *, int); | 3047 | NativeRectangle *, int); |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 26959d57d4b..af697c72673 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -4237,7 +4237,7 @@ xg_make_tool_item (FRAME_PTR f, | |||
| 4237 | gtk_container_add (GTK_CONTAINER (weventbox), wb); | 4237 | gtk_container_add (GTK_CONTAINER (weventbox), wb); |
| 4238 | gtk_container_add (GTK_CONTAINER (ti), weventbox); | 4238 | gtk_container_add (GTK_CONTAINER (ti), weventbox); |
| 4239 | 4239 | ||
| 4240 | if (wimage) | 4240 | if (wimage || label) |
| 4241 | { | 4241 | { |
| 4242 | intptr_t ii = i; | 4242 | intptr_t ii = i; |
| 4243 | gpointer gi = (gpointer) ii; | 4243 | gpointer gi = (gpointer) ii; |
| @@ -4302,21 +4302,21 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name, | |||
| 4302 | GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage); | 4302 | GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage); |
| 4303 | 4303 | ||
| 4304 | /* Check if the tool icon matches. */ | 4304 | /* Check if the tool icon matches. */ |
| 4305 | if (stock_name) | 4305 | if (stock_name && wimage) |
| 4306 | { | 4306 | { |
| 4307 | old = g_object_get_data (G_OBJECT (wimage), | 4307 | old = g_object_get_data (G_OBJECT (wimage), |
| 4308 | XG_TOOL_BAR_STOCK_NAME); | 4308 | XG_TOOL_BAR_STOCK_NAME); |
| 4309 | if (!old || strcmp (old, stock_name)) | 4309 | if (!old || strcmp (old, stock_name)) |
| 4310 | return 1; | 4310 | return 1; |
| 4311 | } | 4311 | } |
| 4312 | else if (icon_name) | 4312 | else if (icon_name && wimage) |
| 4313 | { | 4313 | { |
| 4314 | old = g_object_get_data (G_OBJECT (wimage), | 4314 | old = g_object_get_data (G_OBJECT (wimage), |
| 4315 | XG_TOOL_BAR_ICON_NAME); | 4315 | XG_TOOL_BAR_ICON_NAME); |
| 4316 | if (!old || strcmp (old, icon_name)) | 4316 | if (!old || strcmp (old, icon_name)) |
| 4317 | return 1; | 4317 | return 1; |
| 4318 | } | 4318 | } |
| 4319 | else | 4319 | else if (wimage) |
| 4320 | { | 4320 | { |
| 4321 | gpointer gold_img = g_object_get_data (G_OBJECT (wimage), | 4321 | gpointer gold_img = g_object_get_data (G_OBJECT (wimage), |
| 4322 | XG_TOOL_BAR_IMAGE_DATA); | 4322 | XG_TOOL_BAR_IMAGE_DATA); |
| @@ -4331,7 +4331,7 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name, | |||
| 4331 | return 1; | 4331 | return 1; |
| 4332 | 4332 | ||
| 4333 | /* Ensure label is correct. */ | 4333 | /* Ensure label is correct. */ |
| 4334 | if (label) | 4334 | if (label && wlbl) |
| 4335 | gtk_label_set_text (GTK_LABEL (wlbl), label); | 4335 | gtk_label_set_text (GTK_LABEL (wlbl), label); |
| 4336 | return 0; | 4336 | return 0; |
| 4337 | } | 4337 | } |
diff --git a/src/intervals.c b/src/intervals.c index 1f3f8cf793e..be1bdfb9056 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -52,6 +52,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 52 | 52 | ||
| 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) | 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) |
| 54 | 54 | ||
| 55 | extern INTERVAL adjust_intervals_for_insertion (INTERVAL, | ||
| 56 | EMACS_INT, EMACS_INT); | ||
| 57 | extern void adjust_intervals_for_deletion (struct buffer *, | ||
| 58 | EMACS_INT, EMACS_INT); | ||
| 59 | |||
| 55 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); | 60 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); |
| 56 | static INTERVAL merge_interval_right (INTERVAL); | 61 | static INTERVAL merge_interval_right (INTERVAL); |
| 57 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); | 62 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); |
| @@ -798,7 +803,7 @@ update_interval (register INTERVAL i, EMACS_INT pos) | |||
| 798 | and check the hungry bits of both. Then add the length going back up | 803 | and check the hungry bits of both. Then add the length going back up |
| 799 | to the root. */ | 804 | to the root. */ |
| 800 | 805 | ||
| 801 | static INTERVAL | 806 | INTERVAL |
| 802 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | 807 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, |
| 803 | EMACS_INT length) | 808 | EMACS_INT length) |
| 804 | { | 809 | { |
| @@ -859,7 +864,7 @@ adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | |||
| 859 | interval. Another possibility would be to create a new interval for | 864 | interval. Another possibility would be to create a new interval for |
| 860 | this text, and make it have the merged properties of both ends. */ | 865 | this text, and make it have the merged properties of both ends. */ |
| 861 | 866 | ||
| 862 | static INTERVAL | 867 | INTERVAL |
| 863 | adjust_intervals_for_insertion (INTERVAL tree, | 868 | adjust_intervals_for_insertion (INTERVAL tree, |
| 864 | EMACS_INT position, EMACS_INT length) | 869 | EMACS_INT position, EMACS_INT length) |
| 865 | { | 870 | { |
| @@ -1369,7 +1374,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from, | |||
| 1369 | text. The deletion is effected at position START (which is a | 1374 | text. The deletion is effected at position START (which is a |
| 1370 | buffer position, i.e. origin 1). */ | 1375 | buffer position, i.e. origin 1). */ |
| 1371 | 1376 | ||
| 1372 | static void | 1377 | void |
| 1373 | adjust_intervals_for_deletion (struct buffer *buffer, | 1378 | adjust_intervals_for_deletion (struct buffer *buffer, |
| 1374 | EMACS_INT start, EMACS_INT length) | 1379 | EMACS_INT start, EMACS_INT length) |
| 1375 | { | 1380 | { |
| @@ -1425,9 +1430,8 @@ adjust_intervals_for_deletion (struct buffer *buffer, | |||
| 1425 | compiler that does not allow calling a static function (here, | 1430 | compiler that does not allow calling a static function (here, |
| 1426 | adjust_intervals_for_deletion) from a non-static inline function. */ | 1431 | adjust_intervals_for_deletion) from a non-static inline function. */ |
| 1427 | 1432 | ||
| 1428 | static inline void | 1433 | inline void |
| 1429 | static_offset_intervals (struct buffer *buffer, EMACS_INT start, | 1434 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) |
| 1430 | EMACS_INT length) | ||
| 1431 | { | 1435 | { |
| 1432 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) | 1436 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) |
| 1433 | return; | 1437 | return; |
| @@ -1440,12 +1444,6 @@ static_offset_intervals (struct buffer *buffer, EMACS_INT start, | |||
| 1440 | adjust_intervals_for_deletion (buffer, start, -length); | 1444 | adjust_intervals_for_deletion (buffer, start, -length); |
| 1441 | } | 1445 | } |
| 1442 | } | 1446 | } |
| 1443 | |||
| 1444 | inline void | ||
| 1445 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) | ||
| 1446 | { | ||
| 1447 | static_offset_intervals (buffer, start, length); | ||
| 1448 | } | ||
| 1449 | 1447 | ||
| 1450 | /* Merge interval I with its lexicographic successor. The resulting | 1448 | /* Merge interval I with its lexicographic successor. The resulting |
| 1451 | interval is returned, and has the properties of the original | 1449 | interval is returned, and has the properties of the original |
diff --git a/src/keyboard.c b/src/keyboard.c index bda8a1d82f3..a9350fc32f3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -10872,8 +10872,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ | |||
| 10872 | if (!terminal) | 10872 | if (!terminal) |
| 10873 | { | 10873 | { |
| 10874 | /* If there are no frames there, let's pretend that we are a | 10874 | /* If there are no frames there, let's pretend that we are a |
| 10875 | well-behaving UN*X program and quit. */ | 10875 | well-behaving UN*X program and quit. We cannot do that while |
| 10876 | Fkill_emacs (Qnil); | 10876 | GC is in progress, though. */ |
| 10877 | if (!gc_in_progress) | ||
| 10878 | Fkill_emacs (Qnil); | ||
| 10879 | else | ||
| 10880 | Vquit_flag = Qt; | ||
| 10877 | } | 10881 | } |
| 10878 | else | 10882 | else |
| 10879 | { | 10883 | { |
diff --git a/src/lisp.h b/src/lisp.h index c0ddb7f2b02..fd53bf13731 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -168,6 +168,9 @@ extern int suppress_checking EXTERNALLY_VISIBLE; | |||
| 168 | # if HAVE_ATTRIBUTE_ALIGNED | 168 | # if HAVE_ATTRIBUTE_ALIGNED |
| 169 | # define DECL_ALIGN(type, var) \ | 169 | # define DECL_ALIGN(type, var) \ |
| 170 | type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var | 170 | type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var |
| 171 | # elif defined(_MSC_VER) | ||
| 172 | # define DECL_ALIGN(type, var) \ | ||
| 173 | type __declspec(align(1 << GCTYPEBITS)) var | ||
| 171 | # else | 174 | # else |
| 172 | /* What directives do other compilers use? */ | 175 | /* What directives do other compilers use? */ |
| 173 | # endif | 176 | # endif |
| @@ -225,6 +228,15 @@ extern int suppress_checking EXTERNALLY_VISIBLE; | |||
| 225 | # endif | 228 | # endif |
| 226 | #endif | 229 | #endif |
| 227 | 230 | ||
| 231 | /* Stolen from GDB. The only known compiler that doesn't support | ||
| 232 | enums in bitfields is MSVC. */ | ||
| 233 | #ifdef _MSC_VER | ||
| 234 | #define ENUM_BF(TYPE) unsigned int | ||
| 235 | #else | ||
| 236 | #define ENUM_BF(TYPE) enum TYPE | ||
| 237 | #endif | ||
| 238 | |||
| 239 | |||
| 228 | enum Lisp_Type | 240 | enum Lisp_Type |
| 229 | { | 241 | { |
| 230 | /* Integer. XINT (obj) is the integer value. */ | 242 | /* Integer. XINT (obj) is the integer value. */ |
| @@ -315,12 +327,12 @@ union Lisp_Object | |||
| 315 | /* Use explict signed, the signedness of a bit-field of type | 327 | /* Use explict signed, the signedness of a bit-field of type |
| 316 | int is implementation defined. */ | 328 | int is implementation defined. */ |
| 317 | signed EMACS_INT val : VALBITS; | 329 | signed EMACS_INT val : VALBITS; |
| 318 | enum Lisp_Type type : GCTYPEBITS; | 330 | ENUM_BF (Lisp_Type) type : GCTYPEBITS; |
| 319 | } s; | 331 | } s; |
| 320 | struct | 332 | struct |
| 321 | { | 333 | { |
| 322 | EMACS_UINT val : VALBITS; | 334 | EMACS_UINT val : VALBITS; |
| 323 | enum Lisp_Type type : GCTYPEBITS; | 335 | ENUM_BF (Lisp_Type) type : GCTYPEBITS; |
| 324 | } u; | 336 | } u; |
| 325 | } | 337 | } |
| 326 | Lisp_Object; | 338 | Lisp_Object; |
| @@ -336,14 +348,14 @@ union Lisp_Object | |||
| 336 | 348 | ||
| 337 | struct | 349 | struct |
| 338 | { | 350 | { |
| 339 | enum Lisp_Type type : GCTYPEBITS; | 351 | ENUM_BF (Lisp_Type) type : GCTYPEBITS; |
| 340 | /* Use explict signed, the signedness of a bit-field of type | 352 | /* Use explict signed, the signedness of a bit-field of type |
| 341 | int is implementation defined. */ | 353 | int is implementation defined. */ |
| 342 | signed EMACS_INT val : VALBITS; | 354 | signed EMACS_INT val : VALBITS; |
| 343 | } s; | 355 | } s; |
| 344 | struct | 356 | struct |
| 345 | { | 357 | { |
| 346 | enum Lisp_Type type : GCTYPEBITS; | 358 | ENUM_BF (Lisp_Type) type : GCTYPEBITS; |
| 347 | EMACS_UINT val : VALBITS; | 359 | EMACS_UINT val : VALBITS; |
| 348 | } u; | 360 | } u; |
| 349 | } | 361 | } |
| @@ -1100,7 +1112,7 @@ struct Lisp_Symbol | |||
| 1100 | 1 : it's a varalias, the value is really in the `alias' symbol. | 1112 | 1 : it's a varalias, the value is really in the `alias' symbol. |
| 1101 | 2 : it's a localized var, the value is in the `blv' object. | 1113 | 2 : it's a localized var, the value is in the `blv' object. |
| 1102 | 3 : it's a forwarding variable, the value is in `forward'. */ | 1114 | 3 : it's a forwarding variable, the value is in `forward'. */ |
| 1103 | enum symbol_redirect redirect : 3; | 1115 | ENUM_BF (symbol_redirect) redirect : 3; |
| 1104 | 1116 | ||
| 1105 | /* Non-zero means symbol is constant, i.e. changing its value | 1117 | /* Non-zero means symbol is constant, i.e. changing its value |
| 1106 | should signal an error. If the value is 3, then the var | 1118 | should signal an error. If the value is 3, then the var |
| @@ -1313,7 +1325,7 @@ struct Lisp_Hash_Table | |||
| 1313 | 1325 | ||
| 1314 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ | 1326 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ |
| 1315 | { | 1327 | { |
| 1316 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ | 1328 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */ |
| 1317 | unsigned gcmarkbit : 1; | 1329 | unsigned gcmarkbit : 1; |
| 1318 | int spacer : 15; | 1330 | int spacer : 15; |
| 1319 | /* Make it as long as "Lisp_Free without padding". */ | 1331 | /* Make it as long as "Lisp_Free without padding". */ |
| @@ -1322,7 +1334,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */ | |||
| 1322 | 1334 | ||
| 1323 | struct Lisp_Marker | 1335 | struct Lisp_Marker |
| 1324 | { | 1336 | { |
| 1325 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */ | 1337 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */ |
| 1326 | unsigned gcmarkbit : 1; | 1338 | unsigned gcmarkbit : 1; |
| 1327 | int spacer : 13; | 1339 | int spacer : 13; |
| 1328 | /* This flag is temporarily used in the functions | 1340 | /* This flag is temporarily used in the functions |
| @@ -1472,7 +1484,7 @@ struct Lisp_Overlay | |||
| 1472 | I.e. 9words plus 2 bits, 3words of which are for external linked lists. | 1484 | I.e. 9words plus 2 bits, 3words of which are for external linked lists. |
| 1473 | */ | 1485 | */ |
| 1474 | { | 1486 | { |
| 1475 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ | 1487 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ |
| 1476 | unsigned gcmarkbit : 1; | 1488 | unsigned gcmarkbit : 1; |
| 1477 | int spacer : 15; | 1489 | int spacer : 15; |
| 1478 | struct Lisp_Overlay *next; | 1490 | struct Lisp_Overlay *next; |
| @@ -1491,7 +1503,7 @@ struct Lisp_Kboard_Objfwd | |||
| 1491 | This type of object is used in the arg to record_unwind_protect. */ | 1503 | This type of object is used in the arg to record_unwind_protect. */ |
| 1492 | struct Lisp_Save_Value | 1504 | struct Lisp_Save_Value |
| 1493 | { | 1505 | { |
| 1494 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Save_Value */ | 1506 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ |
| 1495 | unsigned gcmarkbit : 1; | 1507 | unsigned gcmarkbit : 1; |
| 1496 | int spacer : 14; | 1508 | int spacer : 14; |
| 1497 | /* If DOGC is set, POINTER is the address of a memory | 1509 | /* If DOGC is set, POINTER is the address of a memory |
| @@ -1505,7 +1517,7 @@ struct Lisp_Save_Value | |||
| 1505 | /* A miscellaneous object, when it's on the free list. */ | 1517 | /* A miscellaneous object, when it's on the free list. */ |
| 1506 | struct Lisp_Free | 1518 | struct Lisp_Free |
| 1507 | { | 1519 | { |
| 1508 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Free */ | 1520 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */ |
| 1509 | unsigned gcmarkbit : 1; | 1521 | unsigned gcmarkbit : 1; |
| 1510 | int spacer : 15; | 1522 | int spacer : 15; |
| 1511 | union Lisp_Misc *chain; | 1523 | union Lisp_Misc *chain; |
| @@ -1900,13 +1912,23 @@ typedef struct { | |||
| 1900 | 1912 | ||
| 1901 | /* This version of DEFUN declares a function prototype with the right | 1913 | /* This version of DEFUN declares a function prototype with the right |
| 1902 | arguments, so we can catch errors with maxargs at compile-time. */ | 1914 | arguments, so we can catch errors with maxargs at compile-time. */ |
| 1903 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | 1915 | #ifdef _MSC_VER |
| 1904 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ | 1916 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ |
| 1905 | static DECL_ALIGN (struct Lisp_Subr, sname) = \ | 1917 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ |
| 1906 | { PVEC_SUBR, \ | 1918 | static DECL_ALIGN (struct Lisp_Subr, sname) = \ |
| 1907 | { .a ## maxargs = fnname }, \ | 1919 | { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ |
| 1908 | minargs, maxargs, lname, intspec, 0}; \ | 1920 | { (Lisp_Object (__cdecl *)(void))fnname }, \ |
| 1909 | Lisp_Object fnname | 1921 | minargs, maxargs, lname, intspec, 0}; \ |
| 1922 | Lisp_Object fnname | ||
| 1923 | #else /* not _MSC_VER */ | ||
| 1924 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | ||
| 1925 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ | ||
| 1926 | static DECL_ALIGN (struct Lisp_Subr, sname) = \ | ||
| 1927 | { PVEC_SUBR, \ | ||
| 1928 | { .a ## maxargs = fnname }, \ | ||
| 1929 | minargs, maxargs, lname, intspec, 0}; \ | ||
| 1930 | Lisp_Object fnname | ||
| 1931 | #endif | ||
| 1910 | 1932 | ||
| 1911 | /* Note that the weird token-substitution semantics of ANSI C makes | 1933 | /* Note that the weird token-substitution semantics of ANSI C makes |
| 1912 | this work for MANY and UNEVALLED. */ | 1934 | this work for MANY and UNEVALLED. */ |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 53cb5f857ab..e97f7f3aca4 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -177,7 +177,7 @@ temacs: stamp_BLD $(TEMACS) | |||
| 177 | $(TEMACS): $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \ | 177 | $(TEMACS): $(TLIB0) $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES) \ |
| 178 | ../nt/$(BLD)/addsection.exe $(GNULIB) | 178 | ../nt/$(BLD)/addsection.exe $(GNULIB) |
| 179 | $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) | 179 | $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) |
| 180 | "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 21 | 180 | "$(THISDIR)/../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 21 |
| 181 | 181 | ||
| 182 | # These omit firstfile.${O}, but there's no documentation in there | 182 | # These omit firstfile.${O}, but there's no documentation in there |
| 183 | # anyways. | 183 | # anyways. |
| @@ -232,7 +232,7 @@ globals.h: gl-stamp | |||
| 232 | 232 | ||
| 233 | gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES) | 233 | gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES) |
| 234 | - $(DEL) gl-tmp | 234 | - $(DEL) gl-tmp |
| 235 | "../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp | 235 | "$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp |
| 236 | cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h" | 236 | cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h" |
| 237 | - $(DEL) gl-tmp | 237 | - $(DEL) gl-tmp |
| 238 | echo timestamp > $@ | 238 | echo timestamp > $@ |
| @@ -348,11 +348,11 @@ TAGS-LISP: $(OBJ0) $(OBJ1) $(OBJ2) | |||
| 348 | TAGS-gmake: | 348 | TAGS-gmake: |
| 349 | ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \ | 349 | ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \ |
| 350 | --regex=@../nt/emacs-src.tags \ | 350 | --regex=@../nt/emacs-src.tags \ |
| 351 | $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0)) | 351 | $(OBJ0_c) |
| 352 | ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ | 352 | ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ |
| 353 | $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1)) | 353 | $(OBJ1_c) |
| 354 | ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ | 354 | ../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \ |
| 355 | $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \ | 355 | $(OBJ2_c) \ |
| 356 | $(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h | 356 | $(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h |
| 357 | 357 | ||
| 358 | TAGS-nmake: | 358 | TAGS-nmake: |
diff --git a/src/nsfns.m b/src/nsfns.m index a09011d8461..23362433a39 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -101,6 +101,10 @@ extern BOOL ns_in_resize; | |||
| 101 | static Lisp_Object as_script, *as_result; | 101 | static Lisp_Object as_script, *as_result; |
| 102 | static int as_status; | 102 | static int as_status; |
| 103 | 103 | ||
| 104 | #if GLYPH_DEBUG | ||
| 105 | static ptrdiff_t image_cache_refcount; | ||
| 106 | #endif | ||
| 107 | |||
| 104 | /* ========================================================================== | 108 | /* ========================================================================== |
| 105 | 109 | ||
| 106 | Internal utility functions | 110 | Internal utility functions |
| @@ -1038,6 +1042,41 @@ frame_parm_handler ns_frame_parm_handlers[] = | |||
| 1038 | }; | 1042 | }; |
| 1039 | 1043 | ||
| 1040 | 1044 | ||
| 1045 | /* Handler for signals raised during x_create_frame. | ||
| 1046 | FRAME is the frame which is partially constructed. */ | ||
| 1047 | |||
| 1048 | static Lisp_Object | ||
| 1049 | unwind_create_frame (Lisp_Object frame) | ||
| 1050 | { | ||
| 1051 | struct frame *f = XFRAME (frame); | ||
| 1052 | |||
| 1053 | /* If frame is already dead, nothing to do. This can happen if the | ||
| 1054 | display is disconnected after the frame has become official, but | ||
| 1055 | before x_create_frame removes the unwind protect. */ | ||
| 1056 | if (!FRAME_LIVE_P (f)) | ||
| 1057 | return Qnil; | ||
| 1058 | |||
| 1059 | /* If frame is ``official'', nothing to do. */ | ||
| 1060 | if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) | ||
| 1061 | { | ||
| 1062 | #if GLYPH_DEBUG && XASSERTS | ||
| 1063 | struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | ||
| 1064 | #endif | ||
| 1065 | |||
| 1066 | x_free_frame_resources (f); | ||
| 1067 | free_glyphs (f); | ||
| 1068 | |||
| 1069 | #if GLYPH_DEBUG | ||
| 1070 | /* Check that reference counts are indeed correct. */ | ||
| 1071 | xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); | ||
| 1072 | #endif | ||
| 1073 | return Qt; | ||
| 1074 | } | ||
| 1075 | |||
| 1076 | return Qnil; | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | |||
| 1041 | 1080 | ||
| 1042 | /* ========================================================================== | 1081 | /* ========================================================================== |
| 1043 | 1082 | ||
| @@ -1047,46 +1086,50 @@ frame_parm_handler ns_frame_parm_handlers[] = | |||
| 1047 | 1086 | ||
| 1048 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, | 1087 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
| 1049 | 1, 1, 0, | 1088 | 1, 1, 0, |
| 1050 | doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms. | 1089 | doc: /* Make a new Nextstep window, called a "frame" in Emacs terms. |
| 1051 | Return an Emacs frame object. | 1090 | Return an Emacs frame object. |
| 1052 | PARMS is an alist of frame parameters. | 1091 | PARMS is an alist of frame parameters. |
| 1053 | If the parameters specify that the frame should not have a minibuffer, | 1092 | If the parameters specify that the frame should not have a minibuffer, |
| 1054 | and do not specify a specific minibuffer window to use, | 1093 | and do not specify a specific minibuffer window to use, |
| 1055 | then `default-minibuffer-frame' must be a frame whose minibuffer can | 1094 | then `default-minibuffer-frame' must be a frame whose minibuffer can |
| 1056 | be shared by the new frame. */) | 1095 | be shared by the new frame. |
| 1096 | |||
| 1097 | This function is an internal primitive--use `make-frame' instead. */) | ||
| 1057 | (Lisp_Object parms) | 1098 | (Lisp_Object parms) |
| 1058 | { | 1099 | { |
| 1059 | static int desc_ctr = 1; | ||
| 1060 | struct frame *f; | 1100 | struct frame *f; |
| 1061 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | ||
| 1062 | Lisp_Object frame, tem; | 1101 | Lisp_Object frame, tem; |
| 1063 | Lisp_Object name; | 1102 | Lisp_Object name; |
| 1064 | int minibuffer_only = 0; | 1103 | int minibuffer_only = 0; |
| 1104 | int window_prompting = 0; | ||
| 1105 | int width, height; | ||
| 1065 | int count = specpdl_ptr - specpdl; | 1106 | int count = specpdl_ptr - specpdl; |
| 1107 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | ||
| 1066 | Lisp_Object display; | 1108 | Lisp_Object display; |
| 1067 | struct ns_display_info *dpyinfo = NULL; | 1109 | struct ns_display_info *dpyinfo = NULL; |
| 1068 | Lisp_Object parent; | 1110 | Lisp_Object parent; |
| 1069 | struct kboard *kb; | 1111 | struct kboard *kb; |
| 1070 | Lisp_Object tfont, tfontsize; | 1112 | Lisp_Object tfont, tfontsize; |
| 1071 | int window_prompting = 0; | 1113 | static int desc_ctr = 1; |
| 1072 | int width, height; | ||
| 1073 | 1114 | ||
| 1074 | check_ns (); | 1115 | check_ns (); |
| 1075 | 1116 | ||
| 1076 | /* Seems a little strange, but other terms do it. Perhaps the code below | 1117 | /* x_get_arg modifies parms. */ |
| 1077 | is modifying something? */ | ||
| 1078 | parms = Fcopy_alist (parms); | 1118 | parms = Fcopy_alist (parms); |
| 1079 | 1119 | ||
| 1120 | /* Use this general default value to start with | ||
| 1121 | until we know if this frame has a specified name. */ | ||
| 1122 | Vx_resource_name = Vinvocation_name; | ||
| 1123 | |||
| 1080 | display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); | 1124 | display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); |
| 1081 | if (EQ (display, Qunbound)) | 1125 | if (EQ (display, Qunbound)) |
| 1082 | display = Qnil; | 1126 | display = Qnil; |
| 1083 | dpyinfo = check_ns_display_info (display); | 1127 | dpyinfo = check_ns_display_info (display); |
| 1128 | kb = dpyinfo->terminal->kboard; | ||
| 1084 | 1129 | ||
| 1085 | if (!dpyinfo->terminal->name) | 1130 | if (!dpyinfo->terminal->name) |
| 1086 | error ("Terminal is not live, can't create new frames on it"); | 1131 | error ("Terminal is not live, can't create new frames on it"); |
| 1087 | 1132 | ||
| 1088 | kb = dpyinfo->terminal->kboard; | ||
| 1089 | |||
| 1090 | name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING); | 1133 | name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING); |
| 1091 | if (!STRINGP (name) | 1134 | if (!STRINGP (name) |
| 1092 | && ! EQ (name, Qunbound) | 1135 | && ! EQ (name, Qunbound) |
| @@ -1095,8 +1138,6 @@ be shared by the new frame. */) | |||
| 1095 | 1138 | ||
| 1096 | if (STRINGP (name)) | 1139 | if (STRINGP (name)) |
| 1097 | Vx_resource_name = name; | 1140 | Vx_resource_name = name; |
| 1098 | else | ||
| 1099 | Vx_resource_name = Vinvocation_name; | ||
| 1100 | 1141 | ||
| 1101 | parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); | 1142 | parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); |
| 1102 | if (EQ (parent, Qunbound)) | 1143 | if (EQ (parent, Qunbound)) |
| @@ -1104,57 +1145,36 @@ be shared by the new frame. */) | |||
| 1104 | if (! NILP (parent)) | 1145 | if (! NILP (parent)) |
| 1105 | CHECK_NUMBER (parent); | 1146 | CHECK_NUMBER (parent); |
| 1106 | 1147 | ||
| 1148 | /* make_frame_without_minibuffer can run Lisp code and garbage collect. */ | ||
| 1149 | /* No need to protect DISPLAY because that's not used after passing | ||
| 1150 | it to make_frame_without_minibuffer. */ | ||
| 1107 | frame = Qnil; | 1151 | frame = Qnil; |
| 1108 | GCPRO4 (parms, parent, name, frame); | 1152 | GCPRO4 (parms, parent, name, frame); |
| 1109 | |||
| 1110 | tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", | 1153 | tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", |
| 1111 | RES_TYPE_SYMBOL); | 1154 | RES_TYPE_SYMBOL); |
| 1112 | if (EQ (tem, Qnone) || NILP (tem)) | 1155 | if (EQ (tem, Qnone) || NILP (tem)) |
| 1113 | { | ||
| 1114 | f = make_frame_without_minibuffer (Qnil, kb, display); | 1156 | f = make_frame_without_minibuffer (Qnil, kb, display); |
| 1115 | } | ||
| 1116 | else if (EQ (tem, Qonly)) | 1157 | else if (EQ (tem, Qonly)) |
| 1117 | { | 1158 | { |
| 1118 | f = make_minibuffer_frame (); | 1159 | f = make_minibuffer_frame (); |
| 1119 | minibuffer_only = 1; | 1160 | minibuffer_only = 1; |
| 1120 | } | 1161 | } |
| 1121 | else if (WINDOWP (tem)) | 1162 | else if (WINDOWP (tem)) |
| 1122 | { | ||
| 1123 | f = make_frame_without_minibuffer (tem, kb, display); | 1163 | f = make_frame_without_minibuffer (tem, kb, display); |
| 1124 | } | ||
| 1125 | else | 1164 | else |
| 1126 | { | ||
| 1127 | f = make_frame (1); | 1165 | f = make_frame (1); |
| 1128 | } | ||
| 1129 | |||
| 1130 | /* Set the name; the functions to which we pass f expect the name to | ||
| 1131 | be set. */ | ||
| 1132 | if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String)) | ||
| 1133 | { | ||
| 1134 | f->name = build_string ([ns_app_name UTF8String]); | ||
| 1135 | f->explicit_name =0; | ||
| 1136 | } | ||
| 1137 | else | ||
| 1138 | { | ||
| 1139 | f->name = name; | ||
| 1140 | f->explicit_name = 1; | ||
| 1141 | specbind (Qx_resource_name, name); | ||
| 1142 | } | ||
| 1143 | 1166 | ||
| 1144 | XSETFRAME (frame, f); | 1167 | XSETFRAME (frame, f); |
| 1145 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; | 1168 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
| 1146 | 1169 | ||
| 1147 | f->terminal = dpyinfo->terminal; | 1170 | f->terminal = dpyinfo->terminal; |
| 1148 | f->terminal->reference_count++; | ||
| 1149 | 1171 | ||
| 1150 | f->output_method = output_ns; | 1172 | f->output_method = output_ns; |
| 1151 | f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); | 1173 | f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); |
| 1152 | memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns))); | 1174 | memset (f->output_data.ns, 0, sizeof *(f->output_data.ns)); |
| 1153 | 1175 | ||
| 1154 | FRAME_FONTSET (f) = -1; | 1176 | FRAME_FONTSET (f) = -1; |
| 1155 | 1177 | ||
| 1156 | /* record_unwind_protect (unwind_create_frame, frame); safety; maybe later? */ | ||
| 1157 | |||
| 1158 | f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", | 1178 | f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", |
| 1159 | RES_TYPE_STRING); | 1179 | RES_TYPE_STRING); |
| 1160 | if (! STRINGP (f->icon_name)) | 1180 | if (! STRINGP (f->icon_name)) |
| @@ -1162,6 +1182,9 @@ be shared by the new frame. */) | |||
| 1162 | 1182 | ||
| 1163 | FRAME_NS_DISPLAY_INFO (f) = dpyinfo; | 1183 | FRAME_NS_DISPLAY_INFO (f) = dpyinfo; |
| 1164 | 1184 | ||
| 1185 | /* With FRAME_NS_DISPLAY_INFO set up, this unwind-protect is safe. */ | ||
| 1186 | record_unwind_protect (unwind_create_frame, frame); | ||
| 1187 | |||
| 1165 | f->output_data.ns->window_desc = desc_ctr++; | 1188 | f->output_data.ns->window_desc = desc_ctr++; |
| 1166 | if (!NILP (parent)) | 1189 | if (!NILP (parent)) |
| 1167 | { | 1190 | { |
| @@ -1174,6 +1197,20 @@ be shared by the new frame. */) | |||
| 1174 | f->output_data.ns->explicit_parent = 0; | 1197 | f->output_data.ns->explicit_parent = 0; |
| 1175 | } | 1198 | } |
| 1176 | 1199 | ||
| 1200 | /* Set the name; the functions to which we pass f expect the name to | ||
| 1201 | be set. */ | ||
| 1202 | if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name)) | ||
| 1203 | { | ||
| 1204 | f->name = build_string ([ns_app_name UTF8String]); | ||
| 1205 | f->explicit_name = 0; | ||
| 1206 | } | ||
| 1207 | else | ||
| 1208 | { | ||
| 1209 | f->name = name; | ||
| 1210 | f->explicit_name = 1; | ||
| 1211 | specbind (Qx_resource_name, name); | ||
| 1212 | } | ||
| 1213 | |||
| 1177 | f->resx = dpyinfo->resx; | 1214 | f->resx = dpyinfo->resx; |
| 1178 | f->resy = dpyinfo->resy; | 1215 | f->resy = dpyinfo->resy; |
| 1179 | 1216 | ||
| @@ -1223,11 +1260,15 @@ be shared by the new frame. */) | |||
| 1223 | "leftFringe", "LeftFringe", RES_TYPE_NUMBER); | 1260 | "leftFringe", "LeftFringe", RES_TYPE_NUMBER); |
| 1224 | x_default_parameter (f, parms, Qright_fringe, Qnil, | 1261 | x_default_parameter (f, parms, Qright_fringe, Qnil, |
| 1225 | "rightFringe", "RightFringe", RES_TYPE_NUMBER); | 1262 | "rightFringe", "RightFringe", RES_TYPE_NUMBER); |
| 1226 | /* end PENDING */ | ||
| 1227 | 1263 | ||
| 1228 | init_frame_faces (f); | 1264 | #if GLYPH_DEBUG |
| 1265 | image_cache_refcount = | ||
| 1266 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 1267 | #endif | ||
| 1229 | 1268 | ||
| 1230 | /* The X resources controlling the menu-bar and tool-bar are | 1269 | init_frame_faces (f); |
| 1270 | |||
| 1271 | /* The resources controlling the menu-bar and tool-bar are | ||
| 1231 | processed specially at startup, and reflected in the mode | 1272 | processed specially at startup, and reflected in the mode |
| 1232 | variables; ignore them here. */ | 1273 | variables; ignore them here. */ |
| 1233 | x_default_parameter (f, parms, Qmenu_bar_lines, | 1274 | x_default_parameter (f, parms, Qmenu_bar_lines, |
| @@ -1244,38 +1285,6 @@ be shared by the new frame. */) | |||
| 1244 | x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", | 1285 | x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", |
| 1245 | RES_TYPE_STRING); | 1286 | RES_TYPE_STRING); |
| 1246 | 1287 | ||
| 1247 | /* TODO: other terms seem to get away w/o this complexity.. */ | ||
| 1248 | if (NILP (Fassq (Qwidth, parms))) | ||
| 1249 | { | ||
| 1250 | Lisp_Object value | ||
| 1251 | = x_get_arg (dpyinfo, parms, Qwidth, "width", "Width", | ||
| 1252 | RES_TYPE_NUMBER); | ||
| 1253 | if (! EQ (value, Qunbound)) | ||
| 1254 | parms = Fcons (Fcons (Qwidth, value), parms); | ||
| 1255 | } | ||
| 1256 | if (NILP (Fassq (Qheight, parms))) | ||
| 1257 | { | ||
| 1258 | Lisp_Object value | ||
| 1259 | = x_get_arg (dpyinfo, parms, Qheight, "height", "Height", | ||
| 1260 | RES_TYPE_NUMBER); | ||
| 1261 | if (! EQ (value, Qunbound)) | ||
| 1262 | parms = Fcons (Fcons (Qheight, value), parms); | ||
| 1263 | } | ||
| 1264 | if (NILP (Fassq (Qleft, parms))) | ||
| 1265 | { | ||
| 1266 | Lisp_Object value | ||
| 1267 | = x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER); | ||
| 1268 | if (! EQ (value, Qunbound)) | ||
| 1269 | parms = Fcons (Fcons (Qleft, value), parms); | ||
| 1270 | } | ||
| 1271 | if (NILP (Fassq (Qtop, parms))) | ||
| 1272 | { | ||
| 1273 | Lisp_Object value | ||
| 1274 | = x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER); | ||
| 1275 | if (! EQ (value, Qunbound)) | ||
| 1276 | parms = Fcons (Fcons (Qtop, value), parms); | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | window_prompting = x_figure_window_size (f, parms, 1); | 1288 | window_prompting = x_figure_window_size (f, parms, 1); |
| 1280 | 1289 | ||
| 1281 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); | 1290 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); |
| @@ -1297,23 +1306,27 @@ be shared by the new frame. */) | |||
| 1297 | 1306 | ||
| 1298 | x_icon (f, parms); | 1307 | x_icon (f, parms); |
| 1299 | 1308 | ||
| 1309 | /* ns_display_info does not have a reference_count. */ | ||
| 1310 | f->terminal->reference_count++; | ||
| 1311 | |||
| 1300 | /* It is now ok to make the frame official even if we get an error below. | 1312 | /* It is now ok to make the frame official even if we get an error below. |
| 1301 | The frame needs to be on Vframe_list or making it visible won't work. */ | 1313 | The frame needs to be on Vframe_list or making it visible won't work. */ |
| 1302 | Vframe_list = Fcons (frame, Vframe_list); | 1314 | Vframe_list = Fcons (frame, Vframe_list); |
| 1303 | /*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */ | 1315 | |
| 1304 | 1316 | x_default_parameter (f, parms, Qicon_type, Qnil, | |
| 1305 | x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", | 1317 | "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL); |
| 1306 | RES_TYPE_SYMBOL); | 1318 | |
| 1307 | x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", | 1319 | x_default_parameter (f, parms, Qauto_raise, Qnil, |
| 1308 | RES_TYPE_BOOLEAN); | 1320 | "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
| 1309 | x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower", | 1321 | x_default_parameter (f, parms, Qauto_lower, Qnil, |
| 1310 | RES_TYPE_BOOLEAN); | 1322 | "autoLower", "AutoLower", RES_TYPE_BOOLEAN); |
| 1311 | x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType", | 1323 | x_default_parameter (f, parms, Qcursor_type, Qbox, |
| 1312 | RES_TYPE_SYMBOL); | 1324 | "cursorType", "CursorType", RES_TYPE_SYMBOL); |
| 1313 | x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth", | 1325 | x_default_parameter (f, parms, Qscroll_bar_width, Qnil, |
| 1314 | "ScrollBarWidth", RES_TYPE_NUMBER); | 1326 | "scrollBarWidth", "ScrollBarWidth", |
| 1315 | x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", | 1327 | RES_TYPE_NUMBER); |
| 1316 | RES_TYPE_NUMBER); | 1328 | x_default_parameter (f, parms, Qalpha, Qnil, |
| 1329 | "alpha", "Alpha", RES_TYPE_NUMBER); | ||
| 1317 | 1330 | ||
| 1318 | width = FRAME_COLS (f); | 1331 | width = FRAME_COLS (f); |
| 1319 | height = FRAME_LINES (f); | 1332 | height = FRAME_LINES (f); |
| @@ -1324,20 +1337,24 @@ be shared by the new frame. */) | |||
| 1324 | 1337 | ||
| 1325 | if (! f->output_data.ns->explicit_parent) | 1338 | if (! f->output_data.ns->explicit_parent) |
| 1326 | { | 1339 | { |
| 1327 | tem = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); | 1340 | Lisp_Object visibility; |
| 1328 | if (EQ (tem, Qunbound)) | 1341 | |
| 1329 | tem = Qt; | 1342 | visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, |
| 1330 | x_set_visibility (f, tem, Qnil); | 1343 | RES_TYPE_SYMBOL); |
| 1331 | if (EQ (tem, Qicon)) | 1344 | if (EQ (visibility, Qunbound)) |
| 1345 | visibility = Qt; | ||
| 1346 | |||
| 1347 | if (EQ (visibility, Qicon)) | ||
| 1332 | x_iconify_frame (f); | 1348 | x_iconify_frame (f); |
| 1333 | else if (! NILP (tem)) | 1349 | else if (! NILP (visibility)) |
| 1334 | { | 1350 | { |
| 1335 | x_make_frame_visible (f); | 1351 | x_make_frame_visible (f); |
| 1336 | f->async_visible = 1; | ||
| 1337 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; | 1352 | [[FRAME_NS_VIEW (f) window] makeKeyWindow]; |
| 1338 | } | 1353 | } |
| 1339 | else | 1354 | else |
| 1340 | f->async_visible = 0; | 1355 | { |
| 1356 | /* Must have been Qnil. */ | ||
| 1357 | } | ||
| 1341 | } | 1358 | } |
| 1342 | 1359 | ||
| 1343 | if (FRAME_HAS_MINIBUF_P (f) | 1360 | if (FRAME_HAS_MINIBUF_P (f) |
| @@ -1352,6 +1369,9 @@ be shared by the new frame. */) | |||
| 1352 | f->param_alist = Fcons (XCAR (tem), f->param_alist); | 1369 | f->param_alist = Fcons (XCAR (tem), f->param_alist); |
| 1353 | 1370 | ||
| 1354 | UNGCPRO; | 1371 | UNGCPRO; |
| 1372 | |||
| 1373 | /* Make sure windows on this frame appear in calls to next-window | ||
| 1374 | and similar functions. */ | ||
| 1355 | Vwindow_list = Qnil; | 1375 | Vwindow_list = Qnil; |
| 1356 | 1376 | ||
| 1357 | return unbind_to (count, frame); | 1377 | return unbind_to (count, frame); |
diff --git a/src/nsterm.m b/src/nsterm.m index a2ae5e69512..3d3723fc28c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -164,7 +164,7 @@ static Lisp_Object last_mouse_motion_frame; | |||
| 164 | static EmacsScroller *last_mouse_scroll_bar = nil; | 164 | static EmacsScroller *last_mouse_scroll_bar = nil; |
| 165 | static struct frame *ns_updating_frame; | 165 | static struct frame *ns_updating_frame; |
| 166 | static NSView *focus_view = NULL; | 166 | static NSView *focus_view = NULL; |
| 167 | static int ns_window_num =0; | 167 | static int ns_window_num = 0; |
| 168 | static NSRect uRect; | 168 | static NSRect uRect; |
| 169 | static BOOL gsaved = NO; | 169 | static BOOL gsaved = NO; |
| 170 | BOOL ns_in_resize = NO; | 170 | BOOL ns_in_resize = NO; |
| @@ -1123,12 +1123,10 @@ x_iconify_frame (struct frame *f) | |||
| 1123 | [[view window] miniaturize: NSApp]; | 1123 | [[view window] miniaturize: NSApp]; |
| 1124 | } | 1124 | } |
| 1125 | 1125 | ||
| 1126 | /* Free X resources of frame F. */ | ||
| 1126 | 1127 | ||
| 1127 | void | 1128 | void |
| 1128 | x_destroy_window (struct frame *f) | 1129 | x_free_frame_resources (struct frame *f) |
| 1129 | /* -------------------------------------------------------------------------- | ||
| 1130 | External: Delete the window | ||
| 1131 | -------------------------------------------------------------------------- */ | ||
| 1132 | { | 1130 | { |
| 1133 | NSView *view = FRAME_NS_VIEW (f); | 1131 | NSView *view = FRAME_NS_VIEW (f); |
| 1134 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 1132 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); |
| @@ -1163,10 +1161,21 @@ x_destroy_window (struct frame *f) | |||
| 1163 | [[view window] close]; | 1161 | [[view window] close]; |
| 1164 | [view release]; | 1162 | [view release]; |
| 1165 | 1163 | ||
| 1166 | ns_window_num--; | ||
| 1167 | UNBLOCK_INPUT; | 1164 | UNBLOCK_INPUT; |
| 1168 | } | 1165 | } |
| 1169 | 1166 | ||
| 1167 | void | ||
| 1168 | x_destroy_window (struct frame *f) | ||
| 1169 | /* -------------------------------------------------------------------------- | ||
| 1170 | External: Delete the window | ||
| 1171 | -------------------------------------------------------------------------- */ | ||
| 1172 | { | ||
| 1173 | NSTRACE (x_destroy_window); | ||
| 1174 | check_ns (); | ||
| 1175 | x_free_frame_resources (f); | ||
| 1176 | ns_window_num--; | ||
| 1177 | } | ||
| 1178 | |||
| 1170 | 1179 | ||
| 1171 | void | 1180 | void |
| 1172 | x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) | 1181 | x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) |
diff --git a/src/process.c b/src/process.c index c316139a713..301274676d6 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5387,6 +5387,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, | |||
| 5387 | } | 5387 | } |
| 5388 | else | 5388 | else |
| 5389 | { | 5389 | { |
| 5390 | coding->src_multibyte = 0; | ||
| 5390 | /* For sending a unibyte text, character code conversion should | 5391 | /* For sending a unibyte text, character code conversion should |
| 5391 | not take place but EOL conversion should. So, setup raw-text | 5392 | not take place but EOL conversion should. So, setup raw-text |
| 5392 | or one of the subsidiary if we have not yet done it. */ | 5393 | or one of the subsidiary if we have not yet done it. */ |
diff --git a/src/regex.c b/src/regex.c index 8033ab9edaa..ccbad58abb3 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -530,7 +530,11 @@ init_syntax_once (void) | |||
| 530 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) | 530 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
| 531 | 531 | ||
| 532 | /* Type of source-pattern and string chars. */ | 532 | /* Type of source-pattern and string chars. */ |
| 533 | #ifdef _MSC_VER | ||
| 534 | typedef unsigned char re_char; | ||
| 535 | #else | ||
| 533 | typedef const unsigned char re_char; | 536 | typedef const unsigned char re_char; |
| 537 | #endif | ||
| 534 | 538 | ||
| 535 | typedef char boolean; | 539 | typedef char boolean; |
| 536 | #define false 0 | 540 | #define false 0 |
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 813c3cef115..fb0882860d1 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -86,6 +86,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 86 | #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) | 86 | #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) |
| 87 | 87 | ||
| 88 | #include <sys/types.h> | 88 | #include <sys/types.h> |
| 89 | |||
| 90 | #ifdef _MSC_VER | ||
| 91 | typedef unsigned long sigset_t; | ||
| 92 | typedef int ssize_t; | ||
| 93 | #endif | ||
| 94 | |||
| 89 | struct sigaction { | 95 | struct sigaction { |
| 90 | int sa_flags; | 96 | int sa_flags; |
| 91 | void (*sa_handler)(int); | 97 | void (*sa_handler)(int); |
| @@ -181,6 +187,17 @@ struct sigaction { | |||
| 181 | 187 | ||
| 182 | #ifdef emacs | 188 | #ifdef emacs |
| 183 | 189 | ||
| 190 | #ifdef _MSC_VER | ||
| 191 | #include <sys/timeb.h> | ||
| 192 | #include <sys/stat.h> | ||
| 193 | #include <signal.h> | ||
| 194 | |||
| 195 | /* MSVC gets link-time errors without these redirections. */ | ||
| 196 | #define fstat(a, b) sys_fstat(a, b) | ||
| 197 | #define stat(a, b) sys_stat(a, b) | ||
| 198 | #define utime sys_utime | ||
| 199 | #endif | ||
| 200 | |||
| 184 | /* Calls that are emulated or shadowed. */ | 201 | /* Calls that are emulated or shadowed. */ |
| 185 | #undef access | 202 | #undef access |
| 186 | #define access sys_access | 203 | #define access sys_access |
| @@ -267,6 +284,7 @@ typedef int pid_t; | |||
| 267 | 284 | ||
| 268 | #if !defined (_MSC_VER) || (_MSC_VER < 1400) | 285 | #if !defined (_MSC_VER) || (_MSC_VER < 1400) |
| 269 | #define tzname _tzname | 286 | #define tzname _tzname |
| 287 | #undef utime | ||
| 270 | #define utime _utime | 288 | #define utime _utime |
| 271 | #endif | 289 | #endif |
| 272 | 290 | ||
| @@ -317,13 +335,17 @@ extern char *get_emacs_configuration_options (void); | |||
| 317 | #define _WINSOCK_H | 335 | #define _WINSOCK_H |
| 318 | 336 | ||
| 319 | /* Defines size_t and alloca (). */ | 337 | /* Defines size_t and alloca (). */ |
| 320 | #ifdef USE_CRT_DLL | 338 | #if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL) |
| 321 | #define malloc e_malloc | 339 | #define malloc e_malloc |
| 322 | #define free e_free | 340 | #define free e_free |
| 323 | #define realloc e_realloc | 341 | #define realloc e_realloc |
| 324 | #define calloc e_calloc | 342 | #define calloc e_calloc |
| 325 | #endif | 343 | #endif |
| 344 | #ifdef _MSC_VER | ||
| 345 | #define alloca _alloca | ||
| 346 | #else | ||
| 326 | #include <malloc.h> | 347 | #include <malloc.h> |
| 348 | #endif | ||
| 327 | 349 | ||
| 328 | #include <sys/stat.h> | 350 | #include <sys/stat.h> |
| 329 | 351 | ||
| @@ -94,7 +94,9 @@ typedef struct _MEMORY_STATUS_EX { | |||
| 94 | 94 | ||
| 95 | #include <tlhelp32.h> | 95 | #include <tlhelp32.h> |
| 96 | #include <psapi.h> | 96 | #include <psapi.h> |
| 97 | #ifndef _MSC_VER | ||
| 97 | #include <w32api.h> | 98 | #include <w32api.h> |
| 99 | #endif | ||
| 98 | #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15) | 100 | #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15) |
| 99 | /* This either is not in psapi.h or guarded by higher value of | 101 | /* This either is not in psapi.h or guarded by higher value of |
| 100 | _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 | 102 | _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 |
| @@ -1547,7 +1549,12 @@ init_environment (char ** argv) | |||
| 1547 | read-only filesystem, like CD-ROM or a write-protected floppy. | 1549 | read-only filesystem, like CD-ROM or a write-protected floppy. |
| 1548 | The only way to be really sure is to actually create a file and | 1550 | The only way to be really sure is to actually create a file and |
| 1549 | see if it succeeds. But I think that's too much to ask. */ | 1551 | see if it succeeds. But I think that's too much to ask. */ |
| 1552 | #ifdef _MSC_VER | ||
| 1553 | /* MSVC's _access crashes with D_OK. */ | ||
| 1554 | if (tmp && sys_access (tmp, D_OK) == 0) | ||
| 1555 | #else | ||
| 1550 | if (tmp && _access (tmp, D_OK) == 0) | 1556 | if (tmp && _access (tmp, D_OK) == 0) |
| 1557 | #endif | ||
| 1551 | { | 1558 | { |
| 1552 | char * var = alloca (strlen (tmp) + 8); | 1559 | char * var = alloca (strlen (tmp) + 8); |
| 1553 | sprintf (var, "TMPDIR=%s", tmp); | 1560 | sprintf (var, "TMPDIR=%s", tmp); |
diff --git a/src/w32fns.c b/src/w32fns.c index f7ba1c59e7b..6f32442514a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -140,8 +140,8 @@ struct MONITOR_INFO | |||
| 140 | DWORD dwFlags; | 140 | DWORD dwFlags; |
| 141 | }; | 141 | }; |
| 142 | 142 | ||
| 143 | /* Reportedly, VS 6 does not have this in its headers. */ | 143 | /* Reportedly, MSVC does not have this in its headers. */ |
| 144 | #if defined (_MSC_VER) && _MSC_VER < 1300 | 144 | #ifdef _MSC_VER |
| 145 | DECLARE_HANDLE(HMONITOR); | 145 | DECLARE_HANDLE(HMONITOR); |
| 146 | #endif | 146 | #endif |
| 147 | 147 | ||
| @@ -3977,7 +3977,7 @@ x_make_gc (struct frame *f) | |||
| 3977 | 3977 | ||
| 3978 | 3978 | ||
| 3979 | /* Handler for signals raised during x_create_frame and | 3979 | /* Handler for signals raised during x_create_frame and |
| 3980 | x_create_top_frame. FRAME is the frame which is partially | 3980 | x_create_tip_frame. FRAME is the frame which is partially |
| 3981 | constructed. */ | 3981 | constructed. */ |
| 3982 | 3982 | ||
| 3983 | static Lisp_Object | 3983 | static Lisp_Object |
| @@ -4135,7 +4135,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4135 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL); | 4135 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL); |
| 4136 | 4136 | ||
| 4137 | f->terminal = dpyinfo->terminal; | 4137 | f->terminal = dpyinfo->terminal; |
| 4138 | f->terminal->reference_count++; | ||
| 4139 | 4138 | ||
| 4140 | f->output_method = output_w32; | 4139 | f->output_method = output_w32; |
| 4141 | f->output_data.w32 = | 4140 | f->output_data.w32 = |
| @@ -4154,7 +4153,8 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4154 | /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ | 4153 | /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ |
| 4155 | record_unwind_protect (unwind_create_frame, frame); | 4154 | record_unwind_protect (unwind_create_frame, frame); |
| 4156 | #if GLYPH_DEBUG | 4155 | #if GLYPH_DEBUG |
| 4157 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | 4156 | image_cache_refcount = |
| 4157 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 4158 | dpyinfo_refcount = dpyinfo->reference_count; | 4158 | dpyinfo_refcount = dpyinfo->reference_count; |
| 4159 | #endif /* GLYPH_DEBUG */ | 4159 | #endif /* GLYPH_DEBUG */ |
| 4160 | 4160 | ||
| @@ -4287,6 +4287,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4287 | x_make_gc (f); | 4287 | x_make_gc (f); |
| 4288 | 4288 | ||
| 4289 | /* Now consider the frame official. */ | 4289 | /* Now consider the frame official. */ |
| 4290 | f->terminal->reference_count++; | ||
| 4290 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; | 4291 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; |
| 4291 | Vframe_list = Fcons (frame, Vframe_list); | 4292 | Vframe_list = Fcons (frame, Vframe_list); |
| 4292 | 4293 | ||
| @@ -5229,7 +5230,6 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, | |||
| 5229 | from this point on, x_destroy_window might screw up reference | 5230 | from this point on, x_destroy_window might screw up reference |
| 5230 | counts etc. */ | 5231 | counts etc. */ |
| 5231 | f->terminal = dpyinfo->terminal; | 5232 | f->terminal = dpyinfo->terminal; |
| 5232 | f->terminal->reference_count++; | ||
| 5233 | f->output_method = output_w32; | 5233 | f->output_method = output_w32; |
| 5234 | f->output_data.w32 = | 5234 | f->output_data.w32 = |
| 5235 | (struct w32_output *) xmalloc (sizeof (struct w32_output)); | 5235 | (struct w32_output *) xmalloc (sizeof (struct w32_output)); |
| @@ -5239,7 +5239,8 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, | |||
| 5239 | f->icon_name = Qnil; | 5239 | f->icon_name = Qnil; |
| 5240 | 5240 | ||
| 5241 | #if GLYPH_DEBUG | 5241 | #if GLYPH_DEBUG |
| 5242 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | 5242 | image_cache_refcount = |
| 5243 | FRAME_IMAGE_CACHE ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 5243 | dpyinfo_refcount = dpyinfo->reference_count; | 5244 | dpyinfo_refcount = dpyinfo->reference_count; |
| 5244 | #endif /* GLYPH_DEBUG */ | 5245 | #endif /* GLYPH_DEBUG */ |
| 5245 | FRAME_KBOARD (f) = kb; | 5246 | FRAME_KBOARD (f) = kb; |
| @@ -5380,15 +5381,16 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, | |||
| 5380 | 5381 | ||
| 5381 | UNGCPRO; | 5382 | UNGCPRO; |
| 5382 | 5383 | ||
| 5384 | /* Now that the frame is official, it counts as a reference to | ||
| 5385 | its display. */ | ||
| 5386 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; | ||
| 5387 | f->terminal->reference_count++; | ||
| 5388 | |||
| 5383 | /* It is now ok to make the frame official even if we get an error | 5389 | /* It is now ok to make the frame official even if we get an error |
| 5384 | below. And the frame needs to be on Vframe_list or making it | 5390 | below. And the frame needs to be on Vframe_list or making it |
| 5385 | visible won't work. */ | 5391 | visible won't work. */ |
| 5386 | Vframe_list = Fcons (frame, Vframe_list); | 5392 | Vframe_list = Fcons (frame, Vframe_list); |
| 5387 | 5393 | ||
| 5388 | /* Now that the frame is official, it counts as a reference to | ||
| 5389 | its display. */ | ||
| 5390 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; | ||
| 5391 | |||
| 5392 | /* Setting attributes of faces of the tooltip frame from resources | 5394 | /* Setting attributes of faces of the tooltip frame from resources |
| 5393 | and similar will increment face_change_count, which leads to the | 5395 | and similar will increment face_change_count, which leads to the |
| 5394 | clearing of all current matrices. Since this isn't necessary | 5396 | clearing of all current matrices. Since this isn't necessary |
diff --git a/src/w32font.c b/src/w32font.c index 6c1b4d0bc20..26bf4207de5 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -1292,6 +1292,15 @@ font_matches_spec (DWORD type, NEWTEXTMETRICEX *font, | |||
| 1292 | = font_supported_scripts (&font->ntmFontSig); | 1292 | = font_supported_scripts (&font->ntmFontSig); |
| 1293 | if (! memq_no_quit (val, support)) | 1293 | if (! memq_no_quit (val, support)) |
| 1294 | return 0; | 1294 | return 0; |
| 1295 | |||
| 1296 | /* Avoid using non-Japanese fonts for Japanese, even | ||
| 1297 | if they claim they are capable, due to known | ||
| 1298 | breakage in Vista and Windows 7 fonts | ||
| 1299 | (bug#6029). */ | ||
| 1300 | if (EQ (val, Qkana) | ||
| 1301 | && (font->ntmTm.tmCharSet != SHIFTJIS_CHARSET | ||
| 1302 | || !(font->ntmFontSig.fsCsb[0] & CSB_JAPANESE))) | ||
| 1303 | return 0; | ||
| 1295 | } | 1304 | } |
| 1296 | else | 1305 | else |
| 1297 | { | 1306 | { |
| @@ -1507,7 +1516,7 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, | |||
| 1507 | /* For uniscribe backend, consider only truetype or opentype fonts | 1516 | /* For uniscribe backend, consider only truetype or opentype fonts |
| 1508 | that have some unicode coverage. */ | 1517 | that have some unicode coverage. */ |
| 1509 | if (match_data->opentype_only | 1518 | if (match_data->opentype_only |
| 1510 | && ((!physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE | 1519 | && ((!(physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE) |
| 1511 | && !(font_type & TRUETYPE_FONTTYPE)) | 1520 | && !(font_type & TRUETYPE_FONTTYPE)) |
| 1512 | || !is_unicode)) | 1521 | || !is_unicode)) |
| 1513 | return 1; | 1522 | return 1; |
| @@ -1568,8 +1577,8 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, | |||
| 1568 | the bits for CJK ranges that include those characters. */ | 1577 | the bits for CJK ranges that include those characters. */ |
| 1569 | else if (EQ (spec_charset, Qunicode_sip)) | 1578 | else if (EQ (spec_charset, Qunicode_sip)) |
| 1570 | { | 1579 | { |
| 1571 | if (!physical_font->ntmFontSig.fsUsb[1] & 0x02000000 | 1580 | if (!(physical_font->ntmFontSig.fsUsb[1] & 0x02000000) |
| 1572 | || !physical_font->ntmFontSig.fsUsb[1] & 0x28000000) | 1581 | || !(physical_font->ntmFontSig.fsUsb[1] & 0x28000000)) |
| 1573 | return 1; | 1582 | return 1; |
| 1574 | } | 1583 | } |
| 1575 | 1584 | ||
| @@ -1577,8 +1586,16 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font, | |||
| 1577 | 1586 | ||
| 1578 | /* If registry was specified, ensure it is reported as the same. */ | 1587 | /* If registry was specified, ensure it is reported as the same. */ |
| 1579 | if (!NILP (spec_charset)) | 1588 | if (!NILP (spec_charset)) |
| 1580 | ASET (entity, FONT_REGISTRY_INDEX, spec_charset); | 1589 | { |
| 1581 | 1590 | /* Avoid using non-Japanese fonts for Japanese, even if they | |
| 1591 | claim they are capable, due to known breakage in Vista | ||
| 1592 | and Windows 7 fonts (bug#6029). */ | ||
| 1593 | if (logical_font->elfLogFont.lfCharSet == SHIFTJIS_CHARSET | ||
| 1594 | && !(physical_font->ntmFontSig.fsCsb[0] & CSB_JAPANESE)) | ||
| 1595 | return 1; | ||
| 1596 | else | ||
| 1597 | ASET (entity, FONT_REGISTRY_INDEX, spec_charset); | ||
| 1598 | } | ||
| 1582 | /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT | 1599 | /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT |
| 1583 | fonts as unicode and skip other charsets. */ | 1600 | fonts as unicode and skip other charsets. */ |
| 1584 | else if (match_data->opentype_only) | 1601 | else if (match_data->opentype_only) |
diff --git a/src/w32term.c b/src/w32term.c index 39f1e245e18..f876cff0363 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5690,15 +5690,15 @@ x_make_frame_visible (struct frame *f) | |||
| 5690 | 5690 | ||
| 5691 | f->output_data.w32->asked_for_visible = 1; | 5691 | f->output_data.w32->asked_for_visible = 1; |
| 5692 | 5692 | ||
| 5693 | /* The first of these seems to give more expected behavior, but | 5693 | /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL |
| 5694 | was added as a commented out line in Sept 1997, with the | 5694 | causes unexpected behaviour when unminimizing frames that were |
| 5695 | second version remaining uncommented. There may have been | 5695 | previously maximised. But only SW_SHOWNORMAL works properly for |
| 5696 | some problem with it that led to it not being enabled, | 5696 | frames that were truely hidden (using make-frame-invisible), so |
| 5697 | so the old version remains commented out below in case we | 5697 | we need it to avoid Bug#5482. It seems that async_iconified |
| 5698 | decide we need to go back to it [23.0.60 2008-06-09]. */ | 5698 | is only set for minimised windows that are still visible, so |
| 5699 | use that to determine the appropriate flag to pass ShowWindow. */ | ||
| 5699 | my_show_window (f, FRAME_W32_WINDOW (f), | 5700 | my_show_window (f, FRAME_W32_WINDOW (f), |
| 5700 | f->async_iconified ? SW_RESTORE : SW_SHOW); | 5701 | f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL); |
| 5701 | /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); */ | ||
| 5702 | } | 5702 | } |
| 5703 | 5703 | ||
| 5704 | /* Synchronize to ensure Emacs knows the frame is visible | 5704 | /* Synchronize to ensure Emacs knows the frame is visible |
diff --git a/src/window.c b/src/window.c index 496a4e6c6ea..5cc77fb8f02 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -161,7 +161,8 @@ DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | |||
| 161 | 161 | ||
| 162 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | 162 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, |
| 163 | doc: /* Return t if OBJECT is a live window and nil otherwise. | 163 | doc: /* Return t if OBJECT is a live window and nil otherwise. |
| 164 | A live window is a window that displays a buffer. */) | 164 | A live window is a window that displays a buffer. |
| 165 | Internal windows and deleted windows are not live. */) | ||
| 165 | (Lisp_Object object) | 166 | (Lisp_Object object) |
| 166 | { | 167 | { |
| 167 | return WINDOW_LIVE_P (object) ? Qt : Qnil; | 168 | return WINDOW_LIVE_P (object) ? Qt : Qnil; |
| @@ -170,7 +171,7 @@ A live window is a window that displays a buffer. */) | |||
| 170 | /* Frames and windows. */ | 171 | /* Frames and windows. */ |
| 171 | DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, | 172 | DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
| 172 | doc: /* Return the frame that window WINDOW is on. | 173 | doc: /* Return the frame that window WINDOW is on. |
| 173 | WINDOW can be any window and defaults to the selected one. */) | 174 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 174 | (Lisp_Object window) | 175 | (Lisp_Object window) |
| 175 | { | 176 | { |
| 176 | return decode_any_window (window)->frame; | 177 | return decode_any_window (window)->frame; |
| @@ -179,9 +180,8 @@ WINDOW can be any window and defaults to the selected one. */) | |||
| 179 | DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, | 180 | DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, |
| 180 | doc: /* Return the root window of FRAME-OR-WINDOW. | 181 | doc: /* Return the root window of FRAME-OR-WINDOW. |
| 181 | If omitted, FRAME-OR-WINDOW defaults to the currently selected frame. | 182 | If omitted, FRAME-OR-WINDOW defaults to the currently selected frame. |
| 182 | Else if FRAME-OR-WINDOW denotes any window, return the root window of | 183 | With a frame argument, return that frame's root window. |
| 183 | that window's frame. If FRAME-OR-WINDOW denotes a live frame, return | 184 | With a window argument, return the root window of that window's frame. */) |
| 184 | the root window of that frame. */) | ||
| 185 | (Lisp_Object frame_or_window) | 185 | (Lisp_Object frame_or_window) |
| 186 | { | 186 | { |
| 187 | Lisp_Object window; | 187 | Lisp_Object window; |
| @@ -200,9 +200,8 @@ the root window of that frame. */) | |||
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0, | 202 | DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0, |
| 203 | doc: /* Return the window used now for minibuffers. | 203 | doc: /* Return the minibuffer window for frame FRAME. |
| 204 | If the optional argument FRAME is specified, return the minibuffer window | 204 | If FRAME is omitted or nil, it defaults to the selected frame. */) |
| 205 | used by that frame. */) | ||
| 206 | (Lisp_Object frame) | 205 | (Lisp_Object frame) |
| 207 | { | 206 | { |
| 208 | if (NILP (frame)) | 207 | if (NILP (frame)) |
| @@ -214,7 +213,7 @@ used by that frame. */) | |||
| 214 | DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, | 213 | DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, |
| 215 | Swindow_minibuffer_p, 0, 1, 0, | 214 | Swindow_minibuffer_p, 0, 1, 0, |
| 216 | doc: /* Return non-nil if WINDOW is a minibuffer window. | 215 | doc: /* Return non-nil if WINDOW is a minibuffer window. |
| 217 | WINDOW can be any window and defaults to the selected one. */) | 216 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 218 | (Lisp_Object window) | 217 | (Lisp_Object window) |
| 219 | { | 218 | { |
| 220 | return MINI_WINDOW_P (decode_any_window (window)) ? Qt : Qnil; | 219 | return MINI_WINDOW_P (decode_any_window (window)) ? Qt : Qnil; |
| @@ -411,44 +410,48 @@ buffer of the selected window before each command. */) | |||
| 411 | } | 410 | } |
| 412 | 411 | ||
| 413 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | 412 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, |
| 414 | doc: /* Return the buffer that WINDOW is displaying. | 413 | doc: /* Return the buffer displayed in window WINDOW. |
| 415 | WINDOW can be any window and defaults to the selected one. | 414 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 416 | If WINDOW is an internal window return nil. */) | 415 | Return nil for an internal window or a deleted window. */) |
| 417 | (Lisp_Object window) | 416 | (Lisp_Object window) |
| 418 | { | 417 | { |
| 419 | return decode_any_window (window)->buffer; | 418 | return decode_any_window (window)->buffer; |
| 420 | } | 419 | } |
| 421 | 420 | ||
| 422 | DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, | 421 | DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, |
| 423 | doc: /* Return WINDOW's parent window. | 422 | doc: /* Return the parent window of window WINDOW. |
| 424 | WINDOW can be any window and defaults to the selected one. | 423 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 425 | Return nil if WINDOW has no parent. */) | 424 | Return nil for a window with no parent (e.g. a root window). */) |
| 426 | (Lisp_Object window) | 425 | (Lisp_Object window) |
| 427 | { | 426 | { |
| 428 | return decode_any_window (window)->parent; | 427 | return decode_any_window (window)->parent; |
| 429 | } | 428 | } |
| 430 | 429 | ||
| 431 | DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0, | 430 | DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, |
| 432 | doc: /* Return WINDOW's topmost child window. | 431 | doc: /* Return the topmost child window of window WINDOW. |
| 433 | WINDOW can be any window and defaults to the selected one. | 432 | Return nil if WINDOW is a live window (live windows have no children). |
| 434 | Return nil if WINDOW is not a vertical combination. */) | 433 | Return nil if WINDOW is an internal window whose children form a |
| 434 | horizontal combination. */) | ||
| 435 | (Lisp_Object window) | 435 | (Lisp_Object window) |
| 436 | { | 436 | { |
| 437 | CHECK_WINDOW (window); | ||
| 437 | return decode_any_window (window)->vchild; | 438 | return decode_any_window (window)->vchild; |
| 438 | } | 439 | } |
| 439 | 440 | ||
| 440 | DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0, | 441 | DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, |
| 441 | doc: /* Return WINDOW's leftmost child window. | 442 | doc: /* Return the leftmost child window of window WINDOW. |
| 442 | WINDOW can be any window and defaults to the selected one. | 443 | Return nil if WINDOW is a live window (live windows have no children). |
| 443 | Return nil if WINDOW is not a horizontal combination. */) | 444 | Return nil if WINDOW is an internal window whose children form a |
| 445 | vertical combination. */) | ||
| 444 | (Lisp_Object window) | 446 | (Lisp_Object window) |
| 445 | { | 447 | { |
| 448 | CHECK_WINDOW (window); | ||
| 446 | return decode_any_window (window)->hchild; | 449 | return decode_any_window (window)->hchild; |
| 447 | } | 450 | } |
| 448 | 451 | ||
| 449 | DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, | 452 | DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, |
| 450 | doc: /* Return WINDOW's next sibling window. | 453 | doc: /* Return the next sibling window of window WINDOW. |
| 451 | WINDOW can be any window and defaults to the selected one. | 454 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 452 | Return nil if WINDOW has no next sibling. */) | 455 | Return nil if WINDOW has no next sibling. */) |
| 453 | (Lisp_Object window) | 456 | (Lisp_Object window) |
| 454 | { | 457 | { |
| @@ -456,8 +459,8 @@ Return nil if WINDOW has no next sibling. */) | |||
| 456 | } | 459 | } |
| 457 | 460 | ||
| 458 | DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, | 461 | DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, |
| 459 | doc: /* Return WINDOW's previous sibling window. | 462 | doc: /* Return the previous sibling window of window WINDOW. |
| 460 | WINDOW can be any window and defaults to the selected one. | 463 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 461 | Return nil if WINDOW has no previous sibling. */) | 464 | Return nil if WINDOW has no previous sibling. */) |
| 462 | (Lisp_Object window) | 465 | (Lisp_Object window) |
| 463 | { | 466 | { |
| @@ -465,8 +468,8 @@ Return nil if WINDOW has no previous sibling. */) | |||
| 465 | } | 468 | } |
| 466 | 469 | ||
| 467 | DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0, | 470 | DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0, |
| 468 | doc: /* Return splits status for WINDOW. | 471 | doc: /* Return splits status for the window WINDOW. |
| 469 | WINDOW can be any window and defaults to the selected one. | 472 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 470 | 473 | ||
| 471 | If the value returned by this function is nil and WINDOW is resized, the | 474 | If the value returned by this function is nil and WINDOW is resized, the |
| 472 | corresponding space is preferably taken from (or given to) WINDOW's | 475 | corresponding space is preferably taken from (or given to) WINDOW's |
| @@ -481,9 +484,8 @@ WINDOW may resize all windows in the same combination. */) | |||
| 481 | } | 484 | } |
| 482 | 485 | ||
| 483 | DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0, | 486 | DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0, |
| 484 | doc: /* Set splits status of WINDOW to STATUS. | 487 | doc: /* Set splits status of window WINDOW to STATUS. |
| 485 | WINDOW can be any window and defaults to the selected one. Return | 488 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 486 | STATUS. | ||
| 487 | 489 | ||
| 488 | If STATUS is nil and WINDOW is later resized, the corresponding space is | 490 | If STATUS is nil and WINDOW is later resized, the corresponding space is |
| 489 | preferably taken from (or given to) WINDOW's right sibling. When WINDOW | 491 | preferably taken from (or given to) WINDOW's right sibling. When WINDOW |
| @@ -501,8 +503,8 @@ windows in the same combination. */) | |||
| 501 | } | 503 | } |
| 502 | 504 | ||
| 503 | DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0, | 505 | DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0, |
| 504 | doc: /* Return nest status of WINDOW. | 506 | doc: /* Return nest status of window WINDOW. |
| 505 | WINDOW can be any window and defaults to the selected one. | 507 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 506 | 508 | ||
| 507 | If the return value is nil, subwindows of WINDOW can be recombined with | 509 | If the return value is nil, subwindows of WINDOW can be recombined with |
| 508 | WINDOW's siblings. A return value of non-nil means that subwindows of | 510 | WINDOW's siblings. A return value of non-nil means that subwindows of |
| @@ -513,9 +515,8 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */) | |||
| 513 | } | 515 | } |
| 514 | 516 | ||
| 515 | DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0, | 517 | DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0, |
| 516 | doc: /* Set nest status of WINDOW to STATUS. | 518 | doc: /* Set nest status of window WINDOW to STATUS; return STATUS. |
| 517 | WINDOW can be any window and defaults to the selected one. Return | 519 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 518 | STATUS. | ||
| 519 | 520 | ||
| 520 | If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's | 521 | If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's |
| 521 | siblings. STATUS non-nil means that subwindows of WINDOW are never | 522 | siblings. STATUS non-nil means that subwindows of WINDOW are never |
| @@ -530,22 +531,24 @@ siblings. STATUS non-nil means that subwindows of WINDOW are never | |||
| 530 | } | 531 | } |
| 531 | 532 | ||
| 532 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, | 533 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, |
| 533 | doc: /* Return WINDOW's use time. | 534 | doc: /* Return the use time of window WINDOW. |
| 534 | WINDOW defaults to the selected window. The window with the highest use | 535 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 535 | time is the most recently selected one. The window with the lowest use | 536 | The window with the highest use time is the most recently selected |
| 536 | time is the least recently selected one. */) | 537 | one. The window with the lowest use time is the least recently |
| 538 | selected one. */) | ||
| 537 | (Lisp_Object window) | 539 | (Lisp_Object window) |
| 538 | { | 540 | { |
| 539 | return decode_window (window)->use_time; | 541 | return decode_window (window)->use_time; |
| 540 | } | 542 | } |
| 541 | 543 | ||
| 542 | DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0, | 544 | DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0, |
| 543 | doc: /* Return the total number of lines of WINDOW. | 545 | doc: /* Return the total number of lines of window WINDOW. |
| 544 | WINDOW can be any window and defaults to the selected one. The return | 546 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 545 | value includes WINDOW's mode line and header line, if any. If WINDOW | 547 | |
| 546 | is internal, the return value is the sum of the total number of lines | 548 | The return value includes WINDOW's mode line and header line, if any. |
| 547 | of WINDOW's child windows if these are vertically combined and the | 549 | If WINDOW is internal, the return value is the sum of the total number |
| 548 | height of WINDOW's first child otherwise. | 550 | of lines of WINDOW's child windows if these are vertically combined |
| 551 | and the height of WINDOW's first child otherwise. | ||
| 549 | 552 | ||
| 550 | Optional argument HORIZONTAL non-nil means return the total number of | 553 | Optional argument HORIZONTAL non-nil means return the total number of |
| 551 | columns of WINDOW. In this case the return value includes any vertical | 554 | columns of WINDOW. In this case the return value includes any vertical |
| @@ -562,17 +565,17 @@ first child otherwise. */) | |||
| 562 | } | 565 | } |
| 563 | 566 | ||
| 564 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, | 567 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, |
| 565 | doc: /* Return new total size of WINDOW. | 568 | doc: /* Return the new total size of window WINDOW. |
| 566 | WINDOW defaults to the selected window. */) | 569 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 567 | (Lisp_Object window) | 570 | (Lisp_Object window) |
| 568 | { | 571 | { |
| 569 | return decode_any_window (window)->new_total; | 572 | return decode_any_window (window)->new_total; |
| 570 | } | 573 | } |
| 571 | 574 | ||
| 572 | DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, | 575 | DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, |
| 573 | doc: /* Return normal height of WINDOW. | 576 | doc: /* Return the normal height of window WINDOW. |
| 574 | WINDOW can be any window and defaults to the selected one. Optional | 577 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 575 | argument HORIZONTAL non-nil means return normal width of WINDOW. */) | 578 | If HORIZONTAL is non-nil, return the normal width of WINDOW. */) |
| 576 | (Lisp_Object window, Lisp_Object horizontal) | 579 | (Lisp_Object window, Lisp_Object horizontal) |
| 577 | { | 580 | { |
| 578 | if (NILP (horizontal)) | 581 | if (NILP (horizontal)) |
| @@ -582,24 +585,24 @@ argument HORIZONTAL non-nil means return normal width of WINDOW. */) | |||
| 582 | } | 585 | } |
| 583 | 586 | ||
| 584 | DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, | 587 | DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, |
| 585 | doc: /* Return new normal size of WINDOW. | 588 | doc: /* Return new normal size of window WINDOW. |
| 586 | WINDOW can be any window and defaults to the selected one. */) | 589 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 587 | (Lisp_Object window) | 590 | (Lisp_Object window) |
| 588 | { | 591 | { |
| 589 | return decode_any_window (window)->new_normal; | 592 | return decode_any_window (window)->new_normal; |
| 590 | } | 593 | } |
| 591 | 594 | ||
| 592 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, | 595 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, |
| 593 | doc: /* Return left column of WINDOW. | 596 | doc: /* Return left column of window WINDOW. |
| 594 | WINDOW can be any window and defaults to the selected one. */) | 597 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 595 | (Lisp_Object window) | 598 | (Lisp_Object window) |
| 596 | { | 599 | { |
| 597 | return decode_any_window (window)->left_col; | 600 | return decode_any_window (window)->left_col; |
| 598 | } | 601 | } |
| 599 | 602 | ||
| 600 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, | 603 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, |
| 601 | doc: /* Return top line of WINDOW. | 604 | doc: /* Return top line of window WINDOW. |
| 602 | WINDOW can be any window and defaults to the selected one. */) | 605 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 603 | (Lisp_Object window) | 606 | (Lisp_Object window) |
| 604 | { | 607 | { |
| 605 | return decode_any_window (window)->top_line; | 608 | return decode_any_window (window)->top_line; |
| @@ -2313,7 +2316,7 @@ window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) | |||
| 2313 | DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0, | 2316 | DEFUN ("window-list", Fwindow_list, Swindow_list, 0, 3, 0, |
| 2314 | doc: /* Return a list of windows on FRAME, starting with WINDOW. | 2317 | doc: /* Return a list of windows on FRAME, starting with WINDOW. |
| 2315 | FRAME nil or omitted means use the selected frame. | 2318 | FRAME nil or omitted means use the selected frame. |
| 2316 | WINDOW nil or omitted means use the selected window. | 2319 | WINDOW nil or omitted means use the window selected within FRAME. |
| 2317 | MINIBUF t means include the minibuffer window, even if it isn't active. | 2320 | MINIBUF t means include the minibuffer window, even if it isn't active. |
| 2318 | MINIBUF nil or omitted means include the minibuffer window only | 2321 | MINIBUF nil or omitted means include the minibuffer window only |
| 2319 | if it's active. | 2322 | if it's active. |
| @@ -6007,7 +6010,7 @@ means no margin. */) | |||
| 6007 | DEFUN ("window-margins", Fwindow_margins, Swindow_margins, | 6010 | DEFUN ("window-margins", Fwindow_margins, Swindow_margins, |
| 6008 | 0, 1, 0, | 6011 | 0, 1, 0, |
| 6009 | doc: /* Get width of marginal areas of window WINDOW. | 6012 | doc: /* Get width of marginal areas of window WINDOW. |
| 6010 | If WINDOW is omitted or nil, use the currently selected window. | 6013 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 6011 | Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). | 6014 | Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). |
| 6012 | If a marginal area does not exist, its width will be returned | 6015 | If a marginal area does not exist, its width will be returned |
| 6013 | as nil. */) | 6016 | as nil. */) |
| @@ -6071,7 +6074,7 @@ display marginal areas and the text area. */) | |||
| 6071 | DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, | 6074 | DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, |
| 6072 | 0, 1, 0, | 6075 | 0, 1, 0, |
| 6073 | doc: /* Get width of fringes of window WINDOW. | 6076 | doc: /* Get width of fringes of window WINDOW. |
| 6074 | If WINDOW is omitted or nil, use the currently selected window. | 6077 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 6075 | Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | 6078 | Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) |
| 6076 | (Lisp_Object window) | 6079 | (Lisp_Object window) |
| 6077 | { | 6080 | { |
| @@ -6140,7 +6143,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) | |||
| 6140 | DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars, | 6143 | DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars, |
| 6141 | 0, 1, 0, | 6144 | 0, 1, 0, |
| 6142 | doc: /* Get width and type of scroll bars of window WINDOW. | 6145 | doc: /* Get width and type of scroll bars of window WINDOW. |
| 6143 | If WINDOW is omitted or nil, use the currently selected window. | 6146 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 6144 | Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). | 6147 | Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). |
| 6145 | If WIDTH is nil or TYPE is t, the window is using the frame's corresponding | 6148 | If WIDTH is nil or TYPE is t, the window is using the frame's corresponding |
| 6146 | value. */) | 6149 | value. */) |
| @@ -6163,7 +6166,7 @@ value. */) | |||
| 6163 | 6166 | ||
| 6164 | DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, | 6167 | DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, |
| 6165 | doc: /* Return the amount by which WINDOW is scrolled vertically. | 6168 | doc: /* Return the amount by which WINDOW is scrolled vertically. |
| 6166 | Use the selected window if WINDOW is nil or omitted. | 6169 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 6167 | Normally, value is a multiple of the canonical character height of WINDOW; | 6170 | Normally, value is a multiple of the canonical character height of WINDOW; |
| 6168 | optional second arg PIXELS-P means value is measured in pixels. */) | 6171 | optional second arg PIXELS-P means value is measured in pixels. */) |
| 6169 | (Lisp_Object window, Lisp_Object pixels_p) | 6172 | (Lisp_Object window, Lisp_Object pixels_p) |
diff --git a/src/xdisp.c b/src/xdisp.c index 6414ab00fd8..5d6d919af67 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2768,9 +2768,13 @@ init_iterator (struct it *it, struct window *w, | |||
| 2768 | /* Do we need to reorder bidirectional text? Not if this is a | 2768 | /* Do we need to reorder bidirectional text? Not if this is a |
| 2769 | unibyte buffer: by definition, none of the single-byte | 2769 | unibyte buffer: by definition, none of the single-byte |
| 2770 | characters are strong R2L, so no reordering is needed. And | 2770 | characters are strong R2L, so no reordering is needed. And |
| 2771 | bidi.c doesn't support unibyte buffers anyway. */ | 2771 | bidi.c doesn't support unibyte buffers anyway. Also, don't |
| 2772 | reorder while we are loading loadup.el, since the tables of | ||
| 2773 | character properties needed for reordering are not yet | ||
| 2774 | available. */ | ||
| 2772 | it->bidi_p = | 2775 | it->bidi_p = |
| 2773 | !NILP (BVAR (current_buffer, bidi_display_reordering)) | 2776 | NILP (Vpurify_flag) |
| 2777 | && !NILP (BVAR (current_buffer, bidi_display_reordering)) | ||
| 2774 | && it->multibyte_p; | 2778 | && it->multibyte_p; |
| 2775 | 2779 | ||
| 2776 | /* If we are to reorder bidirectional text, init the bidi | 2780 | /* If we are to reorder bidirectional text, init the bidi |
| @@ -6171,8 +6175,12 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string, | |||
| 6171 | it->multibyte_p = multibyte > 0; | 6175 | it->multibyte_p = multibyte > 0; |
| 6172 | 6176 | ||
| 6173 | /* Bidirectional reordering of strings is controlled by the default | 6177 | /* Bidirectional reordering of strings is controlled by the default |
| 6174 | value of bidi-display-reordering. */ | 6178 | value of bidi-display-reordering. Don't try to reorder while |
| 6175 | it->bidi_p = !NILP (BVAR (&buffer_defaults, bidi_display_reordering)); | 6179 | loading loadup.el, as the necessary character property tables are |
| 6180 | not yet available. */ | ||
| 6181 | it->bidi_p = | ||
| 6182 | NILP (Vpurify_flag) | ||
| 6183 | && !NILP (BVAR (&buffer_defaults, bidi_display_reordering)); | ||
| 6176 | 6184 | ||
| 6177 | if (s == NULL) | 6185 | if (s == NULL) |
| 6178 | { | 6186 | { |
| @@ -19565,7 +19573,10 @@ See also `bidi-paragraph-direction'. */) | |||
| 19565 | } | 19573 | } |
| 19566 | 19574 | ||
| 19567 | if (NILP (BVAR (buf, bidi_display_reordering)) | 19575 | if (NILP (BVAR (buf, bidi_display_reordering)) |
| 19568 | || NILP (BVAR (buf, enable_multibyte_characters))) | 19576 | || NILP (BVAR (buf, enable_multibyte_characters)) |
| 19577 | /* When we are loading loadup.el, the character property tables | ||
| 19578 | needed for bidi iteration are not yet available. */ | ||
| 19579 | || !NILP (Vpurify_flag)) | ||
| 19569 | return Qleft_to_right; | 19580 | return Qleft_to_right; |
| 19570 | else if (!NILP (BVAR (buf, bidi_paragraph_direction))) | 19581 | else if (!NILP (BVAR (buf, bidi_paragraph_direction))) |
| 19571 | return BVAR (buf, bidi_paragraph_direction); | 19582 | return BVAR (buf, bidi_paragraph_direction); |
| @@ -27390,8 +27401,12 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 27390 | } | 27401 | } |
| 27391 | 27402 | ||
| 27392 | mouse_face_from_buffer_pos (window, hlinfo, pos, | 27403 | mouse_face_from_buffer_pos (window, hlinfo, pos, |
| 27393 | XFASTINT (before), | 27404 | NILP (before) |
| 27394 | XFASTINT (after), | 27405 | ? 1 |
| 27406 | : XFASTINT (before), | ||
| 27407 | NILP (after) | ||
| 27408 | ? BUF_Z (XBUFFER (buffer)) | ||
| 27409 | : XFASTINT (after), | ||
| 27395 | before_string, after_string, | 27410 | before_string, after_string, |
| 27396 | disp_string); | 27411 | disp_string); |
| 27397 | cursor = No_Cursor; | 27412 | cursor = No_Cursor; |
diff --git a/src/xfns.c b/src/xfns.c index ac030582ffe..49c4c774cae 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2914,7 +2914,7 @@ x_free_gcs (struct frame *f) | |||
| 2914 | 2914 | ||
| 2915 | 2915 | ||
| 2916 | /* Handler for signals raised during x_create_frame and | 2916 | /* Handler for signals raised during x_create_frame and |
| 2917 | x_create_top_frame. FRAME is the frame which is partially | 2917 | x_create_tip_frame. FRAME is the frame which is partially |
| 2918 | constructed. */ | 2918 | constructed. */ |
| 2919 | 2919 | ||
| 2920 | static Lisp_Object | 2920 | static Lisp_Object |
| @@ -3138,7 +3138,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3138 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; | 3138 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
| 3139 | 3139 | ||
| 3140 | f->terminal = dpyinfo->terminal; | 3140 | f->terminal = dpyinfo->terminal; |
| 3141 | f->terminal->reference_count++; | ||
| 3142 | 3141 | ||
| 3143 | f->output_method = output_x_window; | 3142 | f->output_method = output_x_window; |
| 3144 | f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); | 3143 | f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); |
| @@ -3308,6 +3307,12 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3308 | "scrollBarBackground", | 3307 | "scrollBarBackground", |
| 3309 | "ScrollBarBackground", 0); | 3308 | "ScrollBarBackground", 0); |
| 3310 | 3309 | ||
| 3310 | #if GLYPH_DEBUG | ||
| 3311 | image_cache_refcount = | ||
| 3312 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 3313 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 3314 | #endif /* GLYPH_DEBUG */ | ||
| 3315 | |||
| 3311 | /* Init faces before x_default_parameter is called for scroll-bar | 3316 | /* Init faces before x_default_parameter is called for scroll-bar |
| 3312 | parameters because that function calls x_set_scroll_bar_width, | 3317 | parameters because that function calls x_set_scroll_bar_width, |
| 3313 | which calls change_frame_size, which calls Fset_window_buffer, | 3318 | which calls change_frame_size, which calls Fset_window_buffer, |
| @@ -3316,11 +3321,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3316 | happen. */ | 3321 | happen. */ |
| 3317 | init_frame_faces (f); | 3322 | init_frame_faces (f); |
| 3318 | 3323 | ||
| 3319 | #if GLYPH_DEBUG | ||
| 3320 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | ||
| 3321 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 3322 | #endif /* GLYPH_DEBUG */ | ||
| 3323 | |||
| 3324 | /* The X resources controlling the menu-bar and tool-bar are | 3324 | /* The X resources controlling the menu-bar and tool-bar are |
| 3325 | processed specially at startup, and reflected in the mode | 3325 | processed specially at startup, and reflected in the mode |
| 3326 | variables; ignore them here. */ | 3326 | variables; ignore them here. */ |
| @@ -3364,6 +3364,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3364 | x_make_gc (f); | 3364 | x_make_gc (f); |
| 3365 | 3365 | ||
| 3366 | /* Now consider the frame official. */ | 3366 | /* Now consider the frame official. */ |
| 3367 | f->terminal->reference_count++; | ||
| 3367 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | 3368 | FRAME_X_DISPLAY_INFO (f)->reference_count++; |
| 3368 | Vframe_list = Fcons (frame, Vframe_list); | 3369 | Vframe_list = Fcons (frame, Vframe_list); |
| 3369 | 3370 | ||
| @@ -4594,7 +4595,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4594 | record_unwind_protect (unwind_create_tip_frame, frame); | 4595 | record_unwind_protect (unwind_create_tip_frame, frame); |
| 4595 | 4596 | ||
| 4596 | f->terminal = dpyinfo->terminal; | 4597 | f->terminal = dpyinfo->terminal; |
| 4597 | f->terminal->reference_count++; | ||
| 4598 | 4598 | ||
| 4599 | /* By setting the output method, we're essentially saying that | 4599 | /* By setting the output method, we're essentially saying that |
| 4600 | the frame is live, as per FRAME_LIVE_P. If we get a signal | 4600 | the frame is live, as per FRAME_LIVE_P. If we get a signal |
| @@ -4716,6 +4716,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4716 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), | 4716 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
| 4717 | "borderColor", "BorderColor", RES_TYPE_STRING); | 4717 | "borderColor", "BorderColor", RES_TYPE_STRING); |
| 4718 | 4718 | ||
| 4719 | #if GLYPH_DEBUG | ||
| 4720 | image_cache_refcount = | ||
| 4721 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 4722 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 4723 | #endif /* GLYPH_DEBUG */ | ||
| 4724 | |||
| 4719 | /* Init faces before x_default_parameter is called for scroll-bar | 4725 | /* Init faces before x_default_parameter is called for scroll-bar |
| 4720 | parameters because that function calls x_set_scroll_bar_width, | 4726 | parameters because that function calls x_set_scroll_bar_width, |
| 4721 | which calls change_frame_size, which calls Fset_window_buffer, | 4727 | which calls change_frame_size, which calls Fset_window_buffer, |
| @@ -4724,11 +4730,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4724 | happen. */ | 4730 | happen. */ |
| 4725 | init_frame_faces (f); | 4731 | init_frame_faces (f); |
| 4726 | 4732 | ||
| 4727 | #if GLYPH_DEBUG | ||
| 4728 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | ||
| 4729 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 4730 | #endif /* GLYPH_DEBUG */ | ||
| 4731 | |||
| 4732 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; | 4733 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
| 4733 | 4734 | ||
| 4734 | x_figure_window_size (f, parms, 0); | 4735 | x_figure_window_size (f, parms, 0); |
| @@ -4834,14 +4835,16 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4834 | 4835 | ||
| 4835 | UNGCPRO; | 4836 | UNGCPRO; |
| 4836 | 4837 | ||
| 4838 | /* Now that the frame will be official, it counts as a reference to | ||
| 4839 | its display and terminal. */ | ||
| 4840 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | ||
| 4841 | f->terminal->reference_count++; | ||
| 4842 | |||
| 4837 | /* It is now ok to make the frame official even if we get an error | 4843 | /* It is now ok to make the frame official even if we get an error |
| 4838 | below. And the frame needs to be on Vframe_list or making it | 4844 | below. And the frame needs to be on Vframe_list or making it |
| 4839 | visible won't work. */ | 4845 | visible won't work. */ |
| 4840 | Vframe_list = Fcons (frame, Vframe_list); | 4846 | Vframe_list = Fcons (frame, Vframe_list); |
| 4841 | 4847 | ||
| 4842 | /* Now that the frame is official, it counts as a reference to | ||
| 4843 | its display. */ | ||
| 4844 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | ||
| 4845 | 4848 | ||
| 4846 | /* Setting attributes of faces of the tooltip frame from resources | 4849 | /* Setting attributes of faces of the tooltip frame from resources |
| 4847 | and similar will increment face_change_count, which leads to the | 4850 | and similar will increment face_change_count, which leads to the |
diff --git a/src/xmenu.c b/src/xmenu.c index 7fcd2ad3724..0dd652b566d 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1604,6 +1604,17 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, | |||
| 1604 | 1604 | ||
| 1605 | #endif /* not USE_GTK */ | 1605 | #endif /* not USE_GTK */ |
| 1606 | 1606 | ||
| 1607 | static Lisp_Object | ||
| 1608 | cleanup_widget_value_tree (Lisp_Object arg) | ||
| 1609 | { | ||
| 1610 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | ||
| 1611 | widget_value *wv = p->pointer; | ||
| 1612 | |||
| 1613 | free_menubar_widget_value_tree (wv); | ||
| 1614 | |||
| 1615 | return Qnil; | ||
| 1616 | } | ||
| 1617 | |||
| 1607 | Lisp_Object | 1618 | Lisp_Object |
| 1608 | xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | 1619 | xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, |
| 1609 | Lisp_Object title, const char **error_name, Time timestamp) | 1620 | Lisp_Object title, const char **error_name, Time timestamp) |
| @@ -1618,6 +1629,8 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 1618 | 1629 | ||
| 1619 | int first_pane; | 1630 | int first_pane; |
| 1620 | 1631 | ||
| 1632 | int specpdl_count = SPECPDL_INDEX (); | ||
| 1633 | |||
| 1621 | if (! FRAME_X_P (f)) | 1634 | if (! FRAME_X_P (f)) |
| 1622 | abort (); | 1635 | abort (); |
| 1623 | 1636 | ||
| @@ -1812,11 +1825,15 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 1812 | /* No selection has been chosen yet. */ | 1825 | /* No selection has been chosen yet. */ |
| 1813 | menu_item_selection = 0; | 1826 | menu_item_selection = 0; |
| 1814 | 1827 | ||
| 1828 | /* Make sure to free the widget_value objects we used to specify the | ||
| 1829 | contents even with longjmp. */ | ||
| 1830 | record_unwind_protect (cleanup_widget_value_tree, | ||
| 1831 | make_save_value (first_wv, 0)); | ||
| 1832 | |||
| 1815 | /* Actually create and show the menu until popped down. */ | 1833 | /* Actually create and show the menu until popped down. */ |
| 1816 | create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp); | 1834 | create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp); |
| 1817 | 1835 | ||
| 1818 | /* Free the widget_value objects we used to specify the contents. */ | 1836 | unbind_to (specpdl_count, Qnil); |
| 1819 | free_menubar_widget_value_tree (first_wv); | ||
| 1820 | 1837 | ||
| 1821 | /* Find the selected item, and its pane, to return | 1838 | /* Find the selected item, and its pane, to return |
| 1822 | the proper value. */ | 1839 | the proper value. */ |
| @@ -2003,6 +2020,8 @@ xdialog_show (FRAME_PTR f, | |||
| 2003 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ | 2020 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ |
| 2004 | int boundary_seen = 0; | 2021 | int boundary_seen = 0; |
| 2005 | 2022 | ||
| 2023 | int specpdl_count = SPECPDL_INDEX (); | ||
| 2024 | |||
| 2006 | if (! FRAME_X_P (f)) | 2025 | if (! FRAME_X_P (f)) |
| 2007 | abort (); | 2026 | abort (); |
| 2008 | 2027 | ||
| @@ -2116,11 +2135,15 @@ xdialog_show (FRAME_PTR f, | |||
| 2116 | /* No selection has been chosen yet. */ | 2135 | /* No selection has been chosen yet. */ |
| 2117 | menu_item_selection = 0; | 2136 | menu_item_selection = 0; |
| 2118 | 2137 | ||
| 2138 | /* Make sure to free the widget_value objects we used to specify the | ||
| 2139 | contents even with longjmp. */ | ||
| 2140 | record_unwind_protect (cleanup_widget_value_tree, | ||
| 2141 | make_save_value (first_wv, 0)); | ||
| 2142 | |||
| 2119 | /* Actually create and show the dialog. */ | 2143 | /* Actually create and show the dialog. */ |
| 2120 | create_and_show_dialog (f, first_wv); | 2144 | create_and_show_dialog (f, first_wv); |
| 2121 | 2145 | ||
| 2122 | /* Free the widget_value objects we used to specify the contents. */ | 2146 | unbind_to (specpdl_count, Qnil); |
| 2123 | free_menubar_widget_value_tree (first_wv); | ||
| 2124 | 2147 | ||
| 2125 | /* Find the selected item, and its pane, to return | 2148 | /* Find the selected item, and its pane, to return |
| 2126 | the proper value. */ | 2149 | the proper value. */ |