diff options
| author | Joakim Verona | 2011-11-09 14:05:54 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-09 14:05:54 +0100 |
| commit | c8d4b74cfa26762d34fd1703a07463008b32be16 (patch) | |
| tree | 6610ac356d47e328bb1094d9f5a0dcc15ed5fb6a /src | |
| parent | 32db4845d5c433fd15c6665cbed169e5d8b94f05 (diff) | |
| parent | 2cffd68198c4d574f073ab238dc12b1221005eab (diff) | |
| download | emacs-c8d4b74cfa26762d34fd1703a07463008b32be16.tar.gz emacs-c8d4b74cfa26762d34fd1703a07463008b32be16.zip | |
upstream
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 43 | ||||
| -rw-r--r-- | src/ccl.c | 2 | ||||
| -rw-r--r-- | src/dispextern.h | 16 | ||||
| -rw-r--r-- | src/font.c | 2 | ||||
| -rw-r--r-- | src/intervals.c | 19 | ||||
| -rw-r--r-- | src/lisp.h | 4 | ||||
| -rw-r--r-- | src/s/gnu.h | 2 | ||||
| -rw-r--r-- | src/w32.c | 5 | ||||
| -rw-r--r-- | src/window.c | 113 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
10 files changed, 139 insertions, 83 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5b406a7bc46..04e58e4742f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2011-11-08 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926). | ||
| 4 | |||
| 5 | 2011-11-08 Paul Eggert <eggert@cs.ucla.edu> | ||
| 6 | |||
| 7 | Avoid some portability problems by eschewing 'extern inline' functions. | ||
| 8 | The trivial performance wins aren't worth the portability hassles; see | ||
| 9 | <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html> | ||
| 10 | et seq. | ||
| 11 | * dispextern.h (window_box, window_box_height, window_text_bottom_y) | ||
| 12 | (window_box_width, window_box_left, window_box_left_offset) | ||
| 13 | (window_box_right, window_box_right_offset): Undo previous change, | ||
| 14 | by removing the "extern"s. | ||
| 15 | * intervals.c (adjust_intervals_for_insertion) | ||
| 16 | (adjust_intervals_for_deletion): Undo previous change, | ||
| 17 | making these static again. | ||
| 18 | (offset_intervals, temp_set_point_both, temp_set_point) | ||
| 19 | (copy_intervals_to_string): No longer inline. | ||
| 20 | * xdisp.c (window_text_bottom_y, window_box_width) | ||
| 21 | (window_box_height, window_box_left_offset) | ||
| 22 | (window_box_right_offset, window_box_left, window_box_right) | ||
| 23 | (window_box): No longer inline. | ||
| 24 | |||
| 25 | 2011-11-08 Chong Yidong <cyd@gnu.org> | ||
| 26 | |||
| 27 | * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix. | ||
| 28 | (Fwindow_body_height, Fwindow_body_width): Move from Lisp. Signal | ||
| 29 | an error if not a live window. | ||
| 30 | (Fwindow_total_width, Fwindow_total_height): Move from Lisp. | ||
| 31 | (Fwindow_total_size, Fwindow_body_size): Move to Lisp. | ||
| 32 | |||
| 33 | 2011-11-07 Juanma Barranquero <lekktu@gmail.com> | ||
| 34 | |||
| 35 | * lisp.h (syms_of_abbrev): Remove declaration. | ||
| 36 | Reported by CHENG Gao <chenggao@royau.me>. | ||
| 37 | |||
| 38 | 2011-11-07 Eli Zaretskii <eliz@gnu.org> | ||
| 39 | |||
| 40 | * w32.c (check_windows_init_file): Don't look for term/w32-win.el | ||
| 41 | if Vpurify_flag is non-nil. Fixes a crash when running w32 build | ||
| 42 | of temacs in GUI mode. | ||
| 43 | |||
| 1 | 2011-11-07 Martin Rudalics <rudalics@gmx.at> | 44 | 2011-11-07 Martin Rudalics <rudalics@gmx.at> |
| 2 | 45 | ||
| 3 | * window.h: Declare delete_all_child_windows instead of | 46 | * window.h: Declare delete_all_child_windows instead of |
| @@ -429,7 +429,7 @@ static Lisp_Object Vccl_program_table; | |||
| 429 | 429 | ||
| 430 | #define CCL_Extension 0x1F /* Extended CCL code | 430 | #define CCL_Extension 0x1F /* Extended CCL code |
| 431 | 1:ExtendedCOMMNDRrrRRRrrrXXXXX | 431 | 1:ExtendedCOMMNDRrrRRRrrrXXXXX |
| 432 | 2:ARGUEMENT | 432 | 2:ARGUMENT |
| 433 | 3:... | 433 | 3:... |
| 434 | ------------------------------ | 434 | ------------------------------ |
| 435 | extended_command (rrr,RRR,Rrr,ARGS) | 435 | extended_command (rrr,RRR,Rrr,ARGS) |
diff --git a/src/dispextern.h b/src/dispextern.h index d36cdd167ff..006ceb31a5a 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 | extern void window_box (struct window *, int, int *, int *, int *, int *); | 3037 | void window_box (struct window *, int, int *, int *, int *, int *); |
| 3038 | extern int window_box_height (struct window *); | 3038 | int window_box_height (struct window *); |
| 3039 | extern int window_text_bottom_y (struct window *); | 3039 | int window_text_bottom_y (struct window *); |
| 3040 | extern int window_box_width (struct window *, int); | 3040 | int window_box_width (struct window *, int); |
| 3041 | extern int window_box_left (struct window *, int); | 3041 | int window_box_left (struct window *, int); |
| 3042 | extern int window_box_left_offset (struct window *, int); | 3042 | int window_box_left_offset (struct window *, int); |
| 3043 | extern int window_box_right (struct window *, int); | 3043 | int window_box_right (struct window *, int); |
| 3044 | extern int window_box_right_offset (struct window *, int); | 3044 | 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/font.c b/src/font.c index 1a4742ba959..f6723157de1 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -162,7 +162,7 @@ static struct font_driver_list *font_driver_list; | |||
| 162 | 162 | ||
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | /* Creaters of font-related Lisp object. */ | 165 | /* Creators of font-related Lisp object. */ |
| 166 | 166 | ||
| 167 | static Lisp_Object | 167 | static Lisp_Object |
| 168 | font_make_spec (void) | 168 | font_make_spec (void) |
diff --git a/src/intervals.c b/src/intervals.c index be1bdfb9056..a78c7f07f6c 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -52,11 +52,6 @@ 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 | |||
| 60 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); | 55 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); |
| 61 | static INTERVAL merge_interval_right (INTERVAL); | 56 | static INTERVAL merge_interval_right (INTERVAL); |
| 62 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); | 57 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); |
| @@ -803,7 +798,7 @@ update_interval (register INTERVAL i, EMACS_INT pos) | |||
| 803 | and check the hungry bits of both. Then add the length going back up | 798 | and check the hungry bits of both. Then add the length going back up |
| 804 | to the root. */ | 799 | to the root. */ |
| 805 | 800 | ||
| 806 | INTERVAL | 801 | static INTERVAL |
| 807 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | 802 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, |
| 808 | EMACS_INT length) | 803 | EMACS_INT length) |
| 809 | { | 804 | { |
| @@ -864,7 +859,7 @@ adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | |||
| 864 | interval. Another possibility would be to create a new interval for | 859 | interval. Another possibility would be to create a new interval for |
| 865 | this text, and make it have the merged properties of both ends. */ | 860 | this text, and make it have the merged properties of both ends. */ |
| 866 | 861 | ||
| 867 | INTERVAL | 862 | static INTERVAL |
| 868 | adjust_intervals_for_insertion (INTERVAL tree, | 863 | adjust_intervals_for_insertion (INTERVAL tree, |
| 869 | EMACS_INT position, EMACS_INT length) | 864 | EMACS_INT position, EMACS_INT length) |
| 870 | { | 865 | { |
| @@ -1374,7 +1369,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from, | |||
| 1374 | text. The deletion is effected at position START (which is a | 1369 | text. The deletion is effected at position START (which is a |
| 1375 | buffer position, i.e. origin 1). */ | 1370 | buffer position, i.e. origin 1). */ |
| 1376 | 1371 | ||
| 1377 | void | 1372 | static void |
| 1378 | adjust_intervals_for_deletion (struct buffer *buffer, | 1373 | adjust_intervals_for_deletion (struct buffer *buffer, |
| 1379 | EMACS_INT start, EMACS_INT length) | 1374 | EMACS_INT start, EMACS_INT length) |
| 1380 | { | 1375 | { |
| @@ -1430,7 +1425,7 @@ adjust_intervals_for_deletion (struct buffer *buffer, | |||
| 1430 | compiler that does not allow calling a static function (here, | 1425 | compiler that does not allow calling a static function (here, |
| 1431 | adjust_intervals_for_deletion) from a non-static inline function. */ | 1426 | adjust_intervals_for_deletion) from a non-static inline function. */ |
| 1432 | 1427 | ||
| 1433 | inline void | 1428 | void |
| 1434 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) | 1429 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) |
| 1435 | { | 1430 | { |
| 1436 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) | 1431 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) |
| @@ -1882,7 +1877,7 @@ lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop | |||
| 1882 | /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to | 1877 | /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to |
| 1883 | byte position BYTEPOS. */ | 1878 | byte position BYTEPOS. */ |
| 1884 | 1879 | ||
| 1885 | inline void | 1880 | void |
| 1886 | temp_set_point_both (struct buffer *buffer, | 1881 | temp_set_point_both (struct buffer *buffer, |
| 1887 | EMACS_INT charpos, EMACS_INT bytepos) | 1882 | EMACS_INT charpos, EMACS_INT bytepos) |
| 1888 | { | 1883 | { |
| @@ -1902,7 +1897,7 @@ temp_set_point_both (struct buffer *buffer, | |||
| 1902 | 1897 | ||
| 1903 | /* Set point "temporarily", without checking any text properties. */ | 1898 | /* Set point "temporarily", without checking any text properties. */ |
| 1904 | 1899 | ||
| 1905 | inline void | 1900 | void |
| 1906 | temp_set_point (struct buffer *buffer, EMACS_INT charpos) | 1901 | temp_set_point (struct buffer *buffer, EMACS_INT charpos) |
| 1907 | { | 1902 | { |
| 1908 | temp_set_point_both (buffer, charpos, | 1903 | temp_set_point_both (buffer, charpos, |
| @@ -2391,7 +2386,7 @@ copy_intervals (INTERVAL tree, EMACS_INT start, EMACS_INT length) | |||
| 2391 | 2386 | ||
| 2392 | /* Give STRING the properties of BUFFER from POSITION to LENGTH. */ | 2387 | /* Give STRING the properties of BUFFER from POSITION to LENGTH. */ |
| 2393 | 2388 | ||
| 2394 | inline void | 2389 | void |
| 2395 | copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, | 2390 | copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, |
| 2396 | EMACS_INT position, EMACS_INT length) | 2391 | EMACS_INT position, EMACS_INT length) |
| 2397 | { | 2392 | { |
diff --git a/src/lisp.h b/src/lisp.h index fd53bf13731..5407956c202 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3159,10 +3159,6 @@ extern void syms_of_fileio (void); | |||
| 3159 | extern Lisp_Object make_temp_name (Lisp_Object, int); | 3159 | extern Lisp_Object make_temp_name (Lisp_Object, int); |
| 3160 | extern Lisp_Object Qdelete_file; | 3160 | extern Lisp_Object Qdelete_file; |
| 3161 | 3161 | ||
| 3162 | /* Defined in abbrev.c */ | ||
| 3163 | |||
| 3164 | extern void syms_of_abbrev (void); | ||
| 3165 | |||
| 3166 | /* Defined in search.c */ | 3162 | /* Defined in search.c */ |
| 3167 | extern void shrink_regexp_cache (void); | 3163 | extern void shrink_regexp_cache (void); |
| 3168 | EXFUN (Fstring_match, 3); | 3164 | EXFUN (Fstring_match, 3); |
diff --git a/src/s/gnu.h b/src/s/gnu.h index c40f764f8bf..b40f7b0a95b 100644 --- a/src/s/gnu.h +++ b/src/s/gnu.h | |||
| @@ -44,3 +44,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 44 | #endif /* !_IO_STDIO_H */ | 44 | #endif /* !_IO_STDIO_H */ |
| 45 | #endif /* emacs */ | 45 | #endif /* emacs */ |
| 46 | 46 | ||
| 47 | /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */ | ||
| 48 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS | ||
| @@ -5784,7 +5784,10 @@ check_windows_init_file (void) | |||
| 5784 | it cannot find the Windows installation file. If this file does | 5784 | it cannot find the Windows installation file. If this file does |
| 5785 | not exist in the expected place, tell the user. */ | 5785 | not exist in the expected place, tell the user. */ |
| 5786 | 5786 | ||
| 5787 | if (!noninteractive && !inhibit_window_system) | 5787 | if (!noninteractive && !inhibit_window_system |
| 5788 | /* Vload_path is not yet initialized when we are loading | ||
| 5789 | loadup.el. */ | ||
| 5790 | && NILP (Vpurify_flag)) | ||
| 5788 | { | 5791 | { |
| 5789 | Lisp_Object objs[2]; | 5792 | Lisp_Object objs[2]; |
| 5790 | Lisp_Object full_load_path; | 5793 | Lisp_Object full_load_path; |
diff --git a/src/window.c b/src/window.c index 078b39cc2f1..b21671b4153 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -541,27 +541,34 @@ selected one. */) | |||
| 541 | return decode_window (window)->use_time; | 541 | return decode_window (window)->use_time; |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0, | 544 | DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0, |
| 545 | doc: /* Return the total number of lines of window WINDOW. | 545 | doc: /* Return the total height, in lines, of window WINDOW. |
| 546 | If WINDOW is omitted or nil, it defaults to the selected window. | 546 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 547 | 547 | ||
| 548 | The return value includes WINDOW's mode line and header line, if any. | 548 | The return value includes the mode line and header line, if any. |
| 549 | If WINDOW is internal, the return value is the sum of the total number | 549 | If WINDOW is an internal window, the total height is the height |
| 550 | of lines of WINDOW's child windows if these are vertically combined | 550 | of the screen areas spanned by its children. |
| 551 | and the height of WINDOW's first child otherwise. | 551 | |
| 552 | 552 | On a graphical display, this total height is reported as an | |
| 553 | Optional argument HORIZONTAL non-nil means return the total number of | 553 | integer multiple of the default character height. */) |
| 554 | columns of WINDOW. In this case the return value includes any vertical | 554 | (Lisp_Object window) |
| 555 | dividers or scrollbars of WINDOW. If WINDOW is internal, the return | ||
| 556 | value is the sum of the total number of columns of WINDOW's child | ||
| 557 | windows if they are horizontally combined and the width of WINDOW's | ||
| 558 | first child otherwise. */) | ||
| 559 | (Lisp_Object window, Lisp_Object horizontal) | ||
| 560 | { | 555 | { |
| 561 | if (NILP (horizontal)) | 556 | return decode_any_window (window)->total_lines; |
| 562 | return decode_any_window (window)->total_lines; | 557 | } |
| 563 | else | 558 | |
| 564 | return decode_any_window (window)->total_cols; | 559 | DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, |
| 560 | doc: /* Return the total width, in columns, of window WINDOW. | ||
| 561 | If WINDOW is omitted or nil, it defaults to the selected window. | ||
| 562 | |||
| 563 | The return value includes any vertical dividers or scroll bars | ||
| 564 | belonging to WINDOW. If WINDOW is an internal window, the total width | ||
| 565 | is the width of the screen areas spanned by its children. | ||
| 566 | |||
| 567 | On a graphical display, this total width is reported as an | ||
| 568 | integer multiple of the default character width. */) | ||
| 569 | (Lisp_Object window) | ||
| 570 | { | ||
| 571 | return decode_any_window (window)->total_cols; | ||
| 565 | } | 572 | } |
| 566 | 573 | ||
| 567 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, | 574 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, |
| @@ -594,6 +601,10 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) | |||
| 594 | 601 | ||
| 595 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, | 602 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, |
| 596 | doc: /* Return left column of window WINDOW. | 603 | doc: /* Return left column of window WINDOW. |
| 604 | This is the distance, in columns, between the left edge of WINDOW and | ||
| 605 | the left edge of the frame's window area. For instance, the return | ||
| 606 | value is 0 if there is no window to the left of WINDOW. | ||
| 607 | |||
| 597 | If WINDOW is omitted or nil, it defaults to the selected window. */) | 608 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 598 | (Lisp_Object window) | 609 | (Lisp_Object window) |
| 599 | { | 610 | { |
| @@ -602,6 +613,10 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) | |||
| 602 | 613 | ||
| 603 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, | 614 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, |
| 604 | doc: /* Return top line of window WINDOW. | 615 | doc: /* Return top line of window WINDOW. |
| 616 | This is the distance, in lines, between the top of WINDOW and the top | ||
| 617 | of the frame's window area. For instance, the return value is 0 if | ||
| 618 | there is no window above WINDOW. | ||
| 619 | |||
| 605 | If WINDOW is omitted or nil, it defaults to the selected window. */) | 620 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 606 | (Lisp_Object window) | 621 | (Lisp_Object window) |
| 607 | { | 622 | { |
| @@ -657,34 +672,34 @@ window_body_cols (struct window *w) | |||
| 657 | return width; | 672 | return width; |
| 658 | } | 673 | } |
| 659 | 674 | ||
| 660 | DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0, | 675 | DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 1, 0, |
| 661 | doc: /* Return the number of lines or columns of WINDOW's body. | 676 | doc: /* Return the height, in lines, of WINDOW's text area. |
| 662 | WINDOW must be a live window and defaults to the selected one. | 677 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 678 | Signal an error if the window is not live. | ||
| 663 | 679 | ||
| 664 | If the optional argument HORIZONTAL is omitted or nil, the function | 680 | The returned height does not include the mode line or header line. |
| 665 | returns the number of WINDOW's lines, excluding the mode line and | 681 | On a graphical display, the height is expressed as an integer multiple |
| 666 | header line, if any. | 682 | of the default character height. If a line at the bottom of the text |
| 667 | 683 | area is only partially visible, that counts as a whole line; to | |
| 668 | If HORIZONTAL is non-nil, the function returns the number of columns | 684 | exclude partially-visible lines, use `window-text-height'. */) |
| 669 | excluding any vertical dividers or scroll bars owned by WINDOW. On a | 685 | (Lisp_Object window) |
| 670 | window-system the return value also excludes the number of columns | ||
| 671 | used for WINDOW's fringes or display margins. | ||
| 672 | |||
| 673 | Note that the return value is measured in canonical units, i.e. for | ||
| 674 | the default frame's face. If the window shows some characters with | ||
| 675 | non-default face, e.g., if the font of some characters is larger or | ||
| 676 | smaller than the default font, the value returned by this function | ||
| 677 | will not match the actual number of lines or characters per line | ||
| 678 | shown in the window. To get the actual number of columns and lines, | ||
| 679 | use `posn-at-point'. */) | ||
| 680 | (Lisp_Object window, Lisp_Object horizontal) | ||
| 681 | { | 686 | { |
| 682 | struct window *w = decode_any_window (window); | 687 | struct window *w = decode_window (window); |
| 688 | return make_number (window_body_lines (w)); | ||
| 689 | } | ||
| 683 | 690 | ||
| 684 | if (NILP (horizontal)) | 691 | DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0, |
| 685 | return make_number (window_body_lines (w)); | 692 | doc: /* Return the width, in columns, of WINDOW's text area. |
| 686 | else | 693 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 687 | return make_number (window_body_cols (w)); | 694 | Signal an error if the window is not live. |
| 695 | |||
| 696 | The return value does not include any vertical dividers, fringe or | ||
| 697 | marginal areas, or scroll bars. On a graphical display, the width is | ||
| 698 | expressed as an integer multiple of the default character width. */) | ||
| 699 | (Lisp_Object window) | ||
| 700 | { | ||
| 701 | struct window *w = decode_window (window); | ||
| 702 | return make_number (window_body_cols (w)); | ||
| 688 | } | 703 | } |
| 689 | 704 | ||
| 690 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | 705 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, |
| @@ -5223,10 +5238,10 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5223 | DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height, | 5238 | DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height, |
| 5224 | 0, 1, 0, | 5239 | 0, 1, 0, |
| 5225 | doc: /* Return the height in lines of the text display area of WINDOW. | 5240 | doc: /* Return the height in lines of the text display area of WINDOW. |
| 5226 | WINDOW defaults to the selected window. | 5241 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 5227 | 5242 | ||
| 5228 | The return value does not include the mode line, any header line, nor | 5243 | The returned height does not include the mode line, any header line, |
| 5229 | any partial-height lines in the text display area. */) | 5244 | nor any partial-height lines at the bottom of the text area. */) |
| 5230 | (Lisp_Object window) | 5245 | (Lisp_Object window) |
| 5231 | { | 5246 | { |
| 5232 | struct window *w = decode_window (window); | 5247 | struct window *w = decode_window (window); |
| @@ -6588,14 +6603,16 @@ function `window-nest' and altered by the function `set-window-nest'. */); | |||
| 6588 | defsubr (&Swindow_use_time); | 6603 | defsubr (&Swindow_use_time); |
| 6589 | defsubr (&Swindow_top_line); | 6604 | defsubr (&Swindow_top_line); |
| 6590 | defsubr (&Swindow_left_column); | 6605 | defsubr (&Swindow_left_column); |
| 6591 | defsubr (&Swindow_total_size); | 6606 | defsubr (&Swindow_total_height); |
| 6607 | defsubr (&Swindow_total_width); | ||
| 6592 | defsubr (&Swindow_normal_size); | 6608 | defsubr (&Swindow_normal_size); |
| 6593 | defsubr (&Swindow_new_total); | 6609 | defsubr (&Swindow_new_total); |
| 6594 | defsubr (&Swindow_new_normal); | 6610 | defsubr (&Swindow_new_normal); |
| 6595 | defsubr (&Sset_window_new_total); | 6611 | defsubr (&Sset_window_new_total); |
| 6596 | defsubr (&Sset_window_new_normal); | 6612 | defsubr (&Sset_window_new_normal); |
| 6597 | defsubr (&Swindow_resize_apply); | 6613 | defsubr (&Swindow_resize_apply); |
| 6598 | defsubr (&Swindow_body_size); | 6614 | defsubr (&Swindow_body_height); |
| 6615 | defsubr (&Swindow_body_width); | ||
| 6599 | defsubr (&Swindow_hscroll); | 6616 | defsubr (&Swindow_hscroll); |
| 6600 | defsubr (&Sset_window_hscroll); | 6617 | defsubr (&Sset_window_hscroll); |
| 6601 | defsubr (&Swindow_redisplay_end_trigger); | 6618 | defsubr (&Swindow_redisplay_end_trigger); |
diff --git a/src/xdisp.c b/src/xdisp.c index 5d6d919af67..f5a39306c35 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -959,7 +959,7 @@ static int coords_in_mouse_face_p (struct window *, int, int); | |||
| 959 | 959 | ||
| 960 | This is the height of W minus the height of a mode line, if any. */ | 960 | This is the height of W minus the height of a mode line, if any. */ |
| 961 | 961 | ||
| 962 | inline int | 962 | int |
| 963 | window_text_bottom_y (struct window *w) | 963 | window_text_bottom_y (struct window *w) |
| 964 | { | 964 | { |
| 965 | int height = WINDOW_TOTAL_HEIGHT (w); | 965 | int height = WINDOW_TOTAL_HEIGHT (w); |
| @@ -973,7 +973,7 @@ window_text_bottom_y (struct window *w) | |||
| 973 | means return the total width of W, not including fringes to | 973 | means return the total width of W, not including fringes to |
| 974 | the left and right of the window. */ | 974 | the left and right of the window. */ |
| 975 | 975 | ||
| 976 | inline int | 976 | int |
| 977 | window_box_width (struct window *w, int area) | 977 | window_box_width (struct window *w, int area) |
| 978 | { | 978 | { |
| 979 | int cols = XFASTINT (w->total_cols); | 979 | int cols = XFASTINT (w->total_cols); |
| @@ -1012,7 +1012,7 @@ window_box_width (struct window *w, int area) | |||
| 1012 | /* Return the pixel height of the display area of window W, not | 1012 | /* Return the pixel height of the display area of window W, not |
| 1013 | including mode lines of W, if any. */ | 1013 | including mode lines of W, if any. */ |
| 1014 | 1014 | ||
| 1015 | inline int | 1015 | int |
| 1016 | window_box_height (struct window *w) | 1016 | window_box_height (struct window *w) |
| 1017 | { | 1017 | { |
| 1018 | struct frame *f = XFRAME (w->frame); | 1018 | struct frame *f = XFRAME (w->frame); |
| @@ -1059,7 +1059,7 @@ window_box_height (struct window *w) | |||
| 1059 | area AREA of window W. AREA < 0 means return the left edge of the | 1059 | area AREA of window W. AREA < 0 means return the left edge of the |
| 1060 | whole window, to the right of the left fringe of W. */ | 1060 | whole window, to the right of the left fringe of W. */ |
| 1061 | 1061 | ||
| 1062 | inline int | 1062 | int |
| 1063 | window_box_left_offset (struct window *w, int area) | 1063 | window_box_left_offset (struct window *w, int area) |
| 1064 | { | 1064 | { |
| 1065 | int x; | 1065 | int x; |
| @@ -1091,7 +1091,7 @@ window_box_left_offset (struct window *w, int area) | |||
| 1091 | area AREA of window W. AREA < 0 means return the right edge of the | 1091 | area AREA of window W. AREA < 0 means return the right edge of the |
| 1092 | whole window, to the left of the right fringe of W. */ | 1092 | whole window, to the left of the right fringe of W. */ |
| 1093 | 1093 | ||
| 1094 | inline int | 1094 | int |
| 1095 | window_box_right_offset (struct window *w, int area) | 1095 | window_box_right_offset (struct window *w, int area) |
| 1096 | { | 1096 | { |
| 1097 | return window_box_left_offset (w, area) + window_box_width (w, area); | 1097 | return window_box_left_offset (w, area) + window_box_width (w, area); |
| @@ -1101,7 +1101,7 @@ window_box_right_offset (struct window *w, int area) | |||
| 1101 | area AREA of window W. AREA < 0 means return the left edge of the | 1101 | area AREA of window W. AREA < 0 means return the left edge of the |
| 1102 | whole window, to the right of the left fringe of W. */ | 1102 | whole window, to the right of the left fringe of W. */ |
| 1103 | 1103 | ||
| 1104 | inline int | 1104 | int |
| 1105 | window_box_left (struct window *w, int area) | 1105 | window_box_left (struct window *w, int area) |
| 1106 | { | 1106 | { |
| 1107 | struct frame *f = XFRAME (w->frame); | 1107 | struct frame *f = XFRAME (w->frame); |
| @@ -1121,7 +1121,7 @@ window_box_left (struct window *w, int area) | |||
| 1121 | area AREA of window W. AREA < 0 means return the right edge of the | 1121 | area AREA of window W. AREA < 0 means return the right edge of the |
| 1122 | whole window, to the left of the right fringe of W. */ | 1122 | whole window, to the left of the right fringe of W. */ |
| 1123 | 1123 | ||
| 1124 | inline int | 1124 | int |
| 1125 | window_box_right (struct window *w, int area) | 1125 | window_box_right (struct window *w, int area) |
| 1126 | { | 1126 | { |
| 1127 | return window_box_left (w, area) + window_box_width (w, area); | 1127 | return window_box_left (w, area) + window_box_width (w, area); |
| @@ -1134,7 +1134,7 @@ window_box_right (struct window *w, int area) | |||
| 1134 | coordinates of the upper-left corner of the box. Return in | 1134 | coordinates of the upper-left corner of the box. Return in |
| 1135 | *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ | 1135 | *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ |
| 1136 | 1136 | ||
| 1137 | inline void | 1137 | void |
| 1138 | window_box (struct window *w, int area, int *box_x, int *box_y, | 1138 | window_box (struct window *w, int area, int *box_x, int *box_y, |
| 1139 | int *box_width, int *box_height) | 1139 | int *box_width, int *box_height) |
| 1140 | { | 1140 | { |