diff options
| author | Dmitry Antipov | 2012-11-03 09:11:34 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-11-03 09:11:34 +0400 |
| commit | b6a9e8b1a2ed4dbf77aa51d3817c9f47c1cb16b4 (patch) | |
| tree | f469b6af821b39f50db51a57fc71a5a01d71680e /src | |
| parent | f7e65065fc261e4ec4bcf93b2c329d0c078750a8 (diff) | |
| download | emacs-b6a9e8b1a2ed4dbf77aa51d3817c9f47c1cb16b4.tar.gz emacs-b6a9e8b1a2ed4dbf77aa51d3817c9f47c1cb16b4.zip | |
* window.c (decode_next_window_args): Update window arg after
calling decode_live_window and so fix crash reported at
http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
by Juanma Barranquero <lekktu@gmail.com>.
(Fwindow_body_width, Fwindow_body_height): Simplify a bit.
* font.c (Ffont_at): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/font.c | 5 | ||||
| -rw-r--r-- | src/window.c | 7 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 26d4b7f5349..512982858d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * window.c (decode_next_window_args): Update window arg after | ||
| 4 | calling decode_live_window and so fix crash reported at | ||
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html | ||
| 6 | by Juanma Barranquero <lekktu@gmail.com>. | ||
| 7 | (Fwindow_body_width, Fwindow_body_height): Simplify a bit. | ||
| 8 | * font.c (Ffont_at): Likewise. | ||
| 9 | |||
| 1 | 2012-11-01 Jan Djärv <jan.h.d@swipnet.se> | 10 | 2012-11-01 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 11 | ||
| 3 | * widget.c (resize_cb): New function. | 12 | * widget.c (resize_cb): New function. |
diff --git a/src/font.c b/src/font.c index 87932b0e440..e960f9b3d13 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4766,7 +4766,6 @@ character at index specified by POSITION. */) | |||
| 4766 | (Lisp_Object position, Lisp_Object window, Lisp_Object string) | 4766 | (Lisp_Object position, Lisp_Object window, Lisp_Object string) |
| 4767 | { | 4767 | { |
| 4768 | struct window *w = decode_live_window (window); | 4768 | struct window *w = decode_live_window (window); |
| 4769 | ptrdiff_t pos; | ||
| 4770 | 4769 | ||
| 4771 | if (NILP (string)) | 4770 | if (NILP (string)) |
| 4772 | { | 4771 | { |
| @@ -4775,7 +4774,6 @@ character at index specified by POSITION. */) | |||
| 4775 | CHECK_NUMBER_COERCE_MARKER (position); | 4774 | CHECK_NUMBER_COERCE_MARKER (position); |
| 4776 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) | 4775 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) |
| 4777 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); | 4776 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); |
| 4778 | pos = XINT (position); | ||
| 4779 | } | 4777 | } |
| 4780 | else | 4778 | else |
| 4781 | { | 4779 | { |
| @@ -4783,10 +4781,9 @@ character at index specified by POSITION. */) | |||
| 4783 | CHECK_STRING (string); | 4781 | CHECK_STRING (string); |
| 4784 | if (! (0 <= XINT (position) && XINT (position) < SCHARS (string))) | 4782 | if (! (0 <= XINT (position) && XINT (position) < SCHARS (string))) |
| 4785 | args_out_of_range (string, position); | 4783 | args_out_of_range (string, position); |
| 4786 | pos = XINT (position); | ||
| 4787 | } | 4784 | } |
| 4788 | 4785 | ||
| 4789 | return font_at (-1, pos, NULL, w, string); | 4786 | return font_at (-1, XINT (position), NULL, w, string); |
| 4790 | } | 4787 | } |
| 4791 | 4788 | ||
| 4792 | #if 0 | 4789 | #if 0 |
diff --git a/src/window.c b/src/window.c index 8dbecf9c81e..766765cfa09 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -774,8 +774,7 @@ area is only partially visible, that counts as a whole line; to | |||
| 774 | exclude partially-visible lines, use `window-text-height'. */) | 774 | exclude partially-visible lines, use `window-text-height'. */) |
| 775 | (Lisp_Object window) | 775 | (Lisp_Object window) |
| 776 | { | 776 | { |
| 777 | struct window *w = decode_live_window (window); | 777 | return make_number (window_body_lines (decode_live_window (window))); |
| 778 | return make_number (window_body_lines (w)); | ||
| 779 | } | 778 | } |
| 780 | 779 | ||
| 781 | DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0, | 780 | DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0, |
| @@ -787,8 +786,7 @@ marginal areas, or scroll bars. On a graphical display, the width is | |||
| 787 | expressed as an integer multiple of the default character width. */) | 786 | expressed as an integer multiple of the default character width. */) |
| 788 | (Lisp_Object window) | 787 | (Lisp_Object window) |
| 789 | { | 788 | { |
| 790 | struct window *w = decode_live_window (window); | 789 | return make_number (window_body_cols (decode_live_window (window))); |
| 791 | return make_number (window_body_cols (w)); | ||
| 792 | } | 790 | } |
| 793 | 791 | ||
| 794 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | 792 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, |
| @@ -2254,6 +2252,7 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object | |||
| 2254 | { | 2252 | { |
| 2255 | struct window *w = decode_live_window (*window); | 2253 | struct window *w = decode_live_window (*window); |
| 2256 | 2254 | ||
| 2255 | XSETWINDOW (*window, w); | ||
| 2257 | /* MINIBUF nil may or may not include minibuffers. Decide if it | 2256 | /* MINIBUF nil may or may not include minibuffers. Decide if it |
| 2258 | does. */ | 2257 | does. */ |
| 2259 | if (NILP (*minibuf)) | 2258 | if (NILP (*minibuf)) |