diff options
| author | Paul Eggert | 2012-01-16 19:43:00 -0800 |
|---|---|---|
| committer | Paul Eggert | 2012-01-16 19:43:00 -0800 |
| commit | 78df1fb1d46d556bfc2698ca1802972b13613ba8 (patch) | |
| tree | 114803047bb77b06e149d9218cd4540b9f287e65 /src | |
| parent | 807f82fcebc7d946baa23f1d29ff5b0cf336f08e (diff) | |
| parent | 1b0880d5f1b478fe097aef8b702a5c7c70bd9f18 (diff) | |
| download | emacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.tar.gz emacs-78df1fb1d46d556bfc2698ca1802972b13613ba8.zip | |
Merge from trunk.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/window.c | 111 |
2 files changed, 111 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a989246335d..c27b4c69bb5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2012-01-15 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-01-17 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix integer width and related bugs (Bug#9874). | 3 | Fix integer width and related bugs (Bug#9874). |
| 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): | 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): |
| @@ -788,6 +788,12 @@ | |||
| 788 | rather than rolling our own approximation. | 788 | rather than rolling our own approximation. |
| 789 | (SCROLL_BAR_VEC_SIZE): Remove; not used. | 789 | (SCROLL_BAR_VEC_SIZE): Remove; not used. |
| 790 | 790 | ||
| 791 | 2012-01-16 Martin Rudalics <rudalics@gmx.at> | ||
| 792 | |||
| 793 | * window.c (Vwindow_persistent_parameters): New variable. | ||
| 794 | (Fset_window_configuration, save_window_save): Handle persistent | ||
| 795 | window parameters. | ||
| 796 | |||
| 791 | 2012-01-14 Eli Zaretskii <eliz@gnu.org> | 797 | 2012-01-14 Eli Zaretskii <eliz@gnu.org> |
| 792 | 798 | ||
| 793 | * w32fns.c (signal_user_input): Don't do a QUIT, to avoid | 799 | * w32fns.c (signal_user_input): Don't do a QUIT, to avoid |
diff --git a/src/window.c b/src/window.c index 27e4914ad1a..edf60cd8ff3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -57,7 +57,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; | |||
| 57 | static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; | 57 | static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; |
| 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; | 58 | static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; |
| 59 | static Lisp_Object Qsafe, Qabove, Qbelow; | 59 | static Lisp_Object Qsafe, Qabove, Qbelow; |
| 60 | static Lisp_Object Qauto_buffer_name; | 60 | static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate; |
| 61 | 61 | ||
| 62 | static int displayed_window_lines (struct window *); | 62 | static int displayed_window_lines (struct window *); |
| 63 | static struct window *decode_window (Lisp_Object); | 63 | static struct window *decode_window (Lisp_Object); |
| @@ -5412,6 +5412,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5412 | { | 5412 | { |
| 5413 | Lisp_Object window; | 5413 | Lisp_Object window; |
| 5414 | Lisp_Object dead_windows = Qnil; | 5414 | Lisp_Object dead_windows = Qnil; |
| 5415 | register Lisp_Object tem, par, pers; | ||
| 5415 | register struct window *w; | 5416 | register struct window *w; |
| 5416 | register struct saved_window *p; | 5417 | register struct saved_window *p; |
| 5417 | struct window *root_window; | 5418 | struct window *root_window; |
| @@ -5545,7 +5546,28 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5545 | w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; | 5546 | w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; |
| 5546 | w->dedicated = p->dedicated; | 5547 | w->dedicated = p->dedicated; |
| 5547 | w->combination_limit = p->combination_limit; | 5548 | w->combination_limit = p->combination_limit; |
| 5548 | w->window_parameters = p->window_parameters; | 5549 | /* Restore any window parameters that have been saved. |
| 5550 | Parameters that have not been saved are left alone. */ | ||
| 5551 | for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) | ||
| 5552 | { | ||
| 5553 | pers = XCAR (tem); | ||
| 5554 | if (CONSP (pers)) | ||
| 5555 | { | ||
| 5556 | if (NILP (XCDR (pers))) | ||
| 5557 | { | ||
| 5558 | par = Fassq (XCAR (pers), w->window_parameters); | ||
| 5559 | if (CONSP (par) && !NILP (XCDR (par))) | ||
| 5560 | /* Reset a parameter to nil if and only if it | ||
| 5561 | has a non-nil association. Don't make new | ||
| 5562 | associations. */ | ||
| 5563 | Fsetcdr (par, Qnil); | ||
| 5564 | } | ||
| 5565 | else | ||
| 5566 | /* Always restore a non-nil value. */ | ||
| 5567 | Fset_window_parameter (window, XCAR (pers), XCDR (pers)); | ||
| 5568 | } | ||
| 5569 | } | ||
| 5570 | |||
| 5549 | XSETFASTINT (w->last_modified, 0); | 5571 | XSETFASTINT (w->last_modified, 0); |
| 5550 | XSETFASTINT (w->last_overlay_modified, 0); | 5572 | XSETFASTINT (w->last_overlay_modified, 0); |
| 5551 | 5573 | ||
| @@ -5812,7 +5834,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 5812 | { | 5834 | { |
| 5813 | register struct saved_window *p; | 5835 | register struct saved_window *p; |
| 5814 | register struct window *w; | 5836 | register struct window *w; |
| 5815 | register Lisp_Object tem; | 5837 | register Lisp_Object tem, pers, par; |
| 5816 | 5838 | ||
| 5817 | for (;!NILP (window); window = w->next) | 5839 | for (;!NILP (window); window = w->next) |
| 5818 | { | 5840 | { |
| @@ -5840,12 +5862,60 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 5840 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; | 5862 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; |
| 5841 | p->dedicated = w->dedicated; | 5863 | p->dedicated = w->dedicated; |
| 5842 | p->combination_limit = w->combination_limit; | 5864 | p->combination_limit = w->combination_limit; |
| 5843 | p->window_parameters = w->window_parameters; | 5865 | p->window_parameters = Qnil; |
| 5866 | |||
| 5867 | if (!NILP (Vwindow_persistent_parameters)) | ||
| 5868 | { | ||
| 5869 | /* Run cycle detection on Vwindow_persistent_parameters. */ | ||
| 5870 | Lisp_Object tortoise, hare; | ||
| 5871 | |||
| 5872 | hare = tortoise = Vwindow_persistent_parameters; | ||
| 5873 | while (CONSP (hare)) | ||
| 5874 | { | ||
| 5875 | hare = XCDR (hare); | ||
| 5876 | if (!CONSP (hare)) | ||
| 5877 | break; | ||
| 5878 | |||
| 5879 | hare = XCDR (hare); | ||
| 5880 | tortoise = XCDR (tortoise); | ||
| 5881 | |||
| 5882 | if (EQ (hare, tortoise)) | ||
| 5883 | /* Reset Vwindow_persistent_parameters to Qnil. */ | ||
| 5884 | { | ||
| 5885 | Vwindow_persistent_parameters = Qnil; | ||
| 5886 | break; | ||
| 5887 | } | ||
| 5888 | } | ||
| 5889 | |||
| 5890 | for (tem = Vwindow_persistent_parameters; CONSP (tem); | ||
| 5891 | tem = XCDR (tem)) | ||
| 5892 | { | ||
| 5893 | pers = XCAR (tem); | ||
| 5894 | /* Save values for persistent window parameters whose cdr | ||
| 5895 | is either nil or t. */ | ||
| 5896 | if (CONSP (pers) && (NILP (XCDR (pers)) || EQ (XCDR (pers), Qt))) | ||
| 5897 | { | ||
| 5898 | par = Fassq (XCAR (pers), w->window_parameters); | ||
| 5899 | if (NILP (par)) | ||
| 5900 | /* If the window has no value for the parameter, | ||
| 5901 | make one. */ | ||
| 5902 | p->window_parameters = Fcons (Fcons (XCAR (pers), Qnil), | ||
| 5903 | p->window_parameters); | ||
| 5904 | else | ||
| 5905 | /* If the window has a value for the parameter, | ||
| 5906 | save it. */ | ||
| 5907 | p->window_parameters = Fcons (Fcons (XCAR (par), | ||
| 5908 | XCDR (par)), | ||
| 5909 | p->window_parameters); | ||
| 5910 | } | ||
| 5911 | } | ||
| 5912 | } | ||
| 5913 | |||
| 5844 | if (!NILP (w->buffer)) | 5914 | if (!NILP (w->buffer)) |
| 5845 | { | 5915 | { |
| 5846 | /* Save w's value of point in the window configuration. | 5916 | /* Save w's value of point in the window configuration. If w |
| 5847 | If w is the selected window, then get the value of point | 5917 | is the selected window, then get the value of point from |
| 5848 | from the buffer; pointm is garbage in the selected window. */ | 5918 | the buffer; pointm is garbage in the selected window. */ |
| 5849 | if (EQ (window, selected_window)) | 5919 | if (EQ (window, selected_window)) |
| 5850 | { | 5920 | { |
| 5851 | p->pointm = Fmake_marker (); | 5921 | p->pointm = Fmake_marker (); |
| @@ -6435,6 +6505,8 @@ syms_of_window (void) | |||
| 6435 | DEFSYM (Qabove, "above"); | 6505 | DEFSYM (Qabove, "above"); |
| 6436 | DEFSYM (Qbelow, "below"); | 6506 | DEFSYM (Qbelow, "below"); |
| 6437 | DEFSYM (Qauto_buffer_name, "auto-buffer-name"); | 6507 | DEFSYM (Qauto_buffer_name, "auto-buffer-name"); |
| 6508 | DEFSYM (Qclone_of, "clone-of"); | ||
| 6509 | DEFSYM (Qstate, "state"); | ||
| 6438 | 6510 | ||
| 6439 | staticpro (&Vwindow_list); | 6511 | staticpro (&Vwindow_list); |
| 6440 | 6512 | ||
| @@ -6544,6 +6616,31 @@ retrieved via the function `window-combination-limit' and altered by the | |||
| 6544 | function `set-window-combination-limit'. */); | 6616 | function `set-window-combination-limit'. */); |
| 6545 | Vwindow_combination_limit = Qnil; | 6617 | Vwindow_combination_limit = Qnil; |
| 6546 | 6618 | ||
| 6619 | DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters, | ||
| 6620 | doc: /* Alist of persistent window parameters. | ||
| 6621 | Parameters in this list are saved by `current-window-configuration' and | ||
| 6622 | `window-state-get' and subsequently restored to their previous values by | ||
| 6623 | `set-window-configuration' and `window-state-put'. | ||
| 6624 | |||
| 6625 | The car of each entry of this alist is the symbol specifying the | ||
| 6626 | parameter. The cdr is one of the following: | ||
| 6627 | |||
| 6628 | The symbol `state' means the parameter is saved by `window-state-get' | ||
| 6629 | provided its IGNORE argument is nil. `current-window-configuration' | ||
| 6630 | does not save this parameter. | ||
| 6631 | |||
| 6632 | nil means the parameter is saved by `current-window-configuration' and, | ||
| 6633 | provided its IGNORE argument is nil, by `window-state-get'. | ||
| 6634 | |||
| 6635 | t means the parameter is saved unconditionally by both | ||
| 6636 | `current-window-configuration' and `window-state-get'. Parameters | ||
| 6637 | without read syntax (like windows or frames) should not use that. | ||
| 6638 | |||
| 6639 | Parameters not saved by `current-window-configuration' or | ||
| 6640 | `window-state-get' are left alone by `set-window-configuration' | ||
| 6641 | respectively are not installed by `window-state-put'. */); | ||
| 6642 | Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qstate)); | ||
| 6643 | |||
| 6547 | defsubr (&Sselected_window); | 6644 | defsubr (&Sselected_window); |
| 6548 | defsubr (&Sminibuffer_window); | 6645 | defsubr (&Sminibuffer_window); |
| 6549 | defsubr (&Swindow_minibuffer_p); | 6646 | defsubr (&Swindow_minibuffer_p); |