diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 87 | ||||
| -rw-r--r-- | src/alloc.c | 32 | ||||
| -rw-r--r-- | src/atimer.c | 2 | ||||
| -rw-r--r-- | src/buffer.c | 3 | ||||
| -rw-r--r-- | src/emacs.c | 10 | ||||
| -rw-r--r-- | src/mac.c | 26 | ||||
| -rw-r--r-- | src/macterm.c | 84 | ||||
| -rw-r--r-- | src/macterm.h | 1 | ||||
| -rw-r--r-- | src/minibuf.c | 4 | ||||
| -rw-r--r-- | src/window.c | 137 | ||||
| -rw-r--r-- | src/xfaces.c | 2 |
11 files changed, 310 insertions, 78 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 105a03a2b8c..256172630ef 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,60 @@ +2005-11-30 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> + + * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer. + +2005-11-30 Kim F. Storm <storm@cua.dk> + + * alloc.c: Include fcntl.h. Define O_WRONLY if not defined. + (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by + passing it to `emacs_write'. + +2005-11-29 Ari Roponen <arjuropo@cc.jyu.fi> (tiny change) + + * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'. + +2005-11-27 Richard M. Stallman <rms@gnu.org> + + * window.c (adjust_window_trailing_edge): New function. + (Fadjust_window_trailing_edge): New function. + (syms_of_window): Defsubr it. + (window_deletion_count): New variable. + (delete_window): Update window_deletion_count. + +2005-11-26 Eli Zaretskii <eliz@gnu.org> + + * minibuf.c (syms_of_minibuf): Mention the extension of + `completion-auto-help's meaning by complete.el. + +2005-11-26 Henrik Enberg <henrik.enberg@telia.com> + + * xfaces.c (Finternal_set_lisp_face_attribute_from_resource): + Handle :inherit property as a lisp expression. + +2005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (Qcontrol): Rename from Qctrl. All uses changed. + (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper, + Qsuper, and Qmodifier_value. + (Vmac_control_modifier, Vmac_option_modifier) + (Vmac_command_modifier, Vmac_function_modifier) + (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2) + (Vmac_pass_command_to_system, Vmac_pass_control_to_system) + (Vmac_charset_info_alist): Doc fixes. + +2005-11-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * emacs.c (main) [MAC_OSX]: Change working directory to home + directory if `-psn_*' option is specified. + + * mac.c (DECODE_UTF_8): Remove macro. + [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function + created from cfstring_to_lisp. + [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it. + (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise. + + * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]: + Add prototype. + 2005-11-21 Ken Raeburn <raeburn@mit.edu> * keymap.c (shadow_lookup): Use make_number to pass a number to @@ -9,8 +66,8 @@ 2005-11-20 Chong Yidong <cyd@stupidchicken.com> - * xfaces.c (Finternal_set_lisp_face_attribute): Use - :ignore-defface for new frame defaults when `unspecified' is + * xfaces.c (Finternal_set_lisp_face_attribute): + Use :ignore-defface for new frame defaults when `unspecified' is supplied. (Finternal_get_lisp_face_attribute): Hide :ignore-defface. (merge_face_vectors): Don't do :ignore-defface overwriting here. @@ -35,24 +92,22 @@ * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable. - [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New - function. + [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun. (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it. [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if font size is smaller than or equal to cg_text_anti_aliasing_threshold. 2005-11-17 Chong Yidong <cyd@stupidchicken.com> - * image.c (x_create_bitmap_from_xpm_data): Free attributes on - fail. + * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail. * xfaces.c (Qignore_defface): New variable. (syms_of_xfaces): Provide `:ignore-defface'. (IGNORE_DEFFACE_P): New macro. (check_lface_attrs, lface_fully_specified_p) (Finternal_set_lisp_face_attribute) - (Fface_attribute_relative_p, Fmerge_face_attribute): Handle - Qignore_defface as a possible value. + (Fface_attribute_relative_p, Fmerge_face_attribute): + Handle Qignore_defface as a possible value. (merge_face_vectors): The merged face is `unspecified' if the mergee specifies `:ignore-defface'. @@ -593,8 +648,8 @@ * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to get end of text rows. Obtain header-line/mode-line rows directly. - * xterm.c, w32term.c, macterm.c (note_mouse_movement): Restore - help_echo_string if mouse is moved inside last_mouse_glyph. + * xterm.c, w32term.c, macterm.c (note_mouse_movement): + Restore help_echo_string if mouse is moved inside last_mouse_glyph. 2005-10-12 Kim F. Storm <storm@cua.dk> @@ -659,8 +714,8 @@ (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name. Don't use Fdowncase because family name is already lowered by decode_mac_font_name. - (init_font_name_table): Always call decode_mac_font_name. Add - pair of family name and its reference to fm_font_family_alist. + (init_font_name_table): Always call decode_mac_font_name. + Add pair of family name and its reference to fm_font_family_alist. (mac_clear_font_name_table): Clear fm_font_family_alist. (XLoadQueryFont): Move font size parsing part to parse_x_font_name. Lookup fm_font_family_alist to get font family reference. @@ -760,8 +815,8 @@ (x_fix_overlapping_area): Add new OVERLAPS arg. (get_glyph_string_clip_rects): Add extern. - * dispnew.c (redraw_overlapping_rows): Call - rif->fix_overlapping_area with new OVERLAPS arg as redrawn part. + * dispnew.c (redraw_overlapping_rows): + Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part. * xdisp.c: Rename member for_overlaps_p in struct glyph_string to for_overlaps. @@ -1106,8 +1161,8 @@ * xsmfns.c: (get_current_dir_name): Remove prototype. - * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: Add - prototype. + * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: + Add prototype. * sysdep.c [WINDOWSNT]: Add prototype for getwd. Don't #undef NULL after including blockinput.h. diff --git a/src/alloc.c b/src/alloc.c index bc48f7bb3b4..5ab28bc0cde 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -66,6 +66,14 @@ Boston, MA 02110-1301, USA. */ extern POINTER_TYPE *sbrk (); #endif +#ifdef HAVE_FCNTL_H +#define INCLUDED_FCNTL +#include <fcntl.h> +#endif +#ifndef O_WRONLY +#define O_WRONLY 1 +#endif + #ifdef DOUG_LEA_MALLOC #include <malloc.h> @@ -4498,21 +4506,37 @@ int valid_lisp_object_p (obj) Lisp_Object obj; { + void *p; #if !GC_MARK_STACK - /* Cannot determine this. */ - return -1; + int fd; #else - void *p; struct mem_node *m; +#endif if (INTEGERP (obj)) return 1; p = (void *) XPNTR (obj); - if (PURE_POINTER_P (p)) return 1; +#if !GC_MARK_STACK + /* We need to determine whether it is safe to access memory at + address P. Obviously, we cannot just access it (we would SEGV + trying), so we trick the o/s to tell us whether p is a valid + pointer. Unfortunately, we cannot use NULL_DEVICE here, as + emacs_write may not validate p in that case. */ + if ((fd = emacs_open("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) + { + int valid = emacs_write(fd, (char *)p, 16) == 16; + emacs_close(fd); + unlink("__Valid__Lisp__Object__"); + return valid; + } + + return -1; +#else + m = mem_find (p); if (m == MEM_NIL) diff --git a/src/atimer.c b/src/atimer.c index f8ed1b265ec..d260f67d24d 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -231,7 +231,7 @@ stop_other_atimers (t) struct atimer *p, *prev; /* See if T is active. */ - for (p = atimers, prev = 0; p && p != t; p = p->next) + for (p = atimers, prev = NULL; p && p != t; prev = p, p = p->next) ; if (p == t) diff --git a/src/buffer.c b/src/buffer.c index 5e304d5a1bb..a20f6a2d683 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1722,9 +1722,6 @@ do not put this buffer at the front of the list of recently selected ones. */) } } Fset_buffer (buf); - if (NILP (norecord)) - /* Why bother ? Fselect_window will do it for us anyway. -stef */ - record_buffer (buf); Fselect_window (Fdisplay_buffer (buf, other_window, Qnil), norecord); return buf; } diff --git a/src/emacs.c b/src/emacs.c index 33941ae9227..ff1a40283fc 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -963,9 +963,15 @@ main (argc, argv #ifdef MAC_OSX /* Skip process serial number passed in the form -psn_x_y as - command-line argument. */ + command-line argument. The WindowServer adds this option when + Emacs is invoked from the Finder or by the `open' command. In + these cases, the working directory becomes `/', so we change it + to the user's home directory. */ if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0) - skip_args++; + { + chdir (getenv ("HOME")); + skip_args++; + } #endif /* MAC_OSX */ #ifdef VMS diff --git a/src/mac.c b/src/mac.c index 2493945727d..76ba3d41798 100644 --- a/src/mac.c +++ b/src/mac.c @@ -265,7 +265,6 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) #if TARGET_API_MAC_CARBON static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; static Lisp_Object Qarray, Qdictionary; -#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0) struct cfdict_context { @@ -336,12 +335,11 @@ cfdata_to_lisp (data) } -/* From CFString to a lisp string. Never returns a unibyte string - (even if it only contains ASCII characters). - This may cause GC during code conversion. */ +/* From CFString to a lisp string. Returns a unibyte string + containing a UTF-8 byte sequence. */ Lisp_Object -cfstring_to_lisp (string) +cfstring_to_lisp_nodecode (string) CFStringRef string; { Lisp_Object result = Qnil; @@ -362,9 +360,23 @@ cfstring_to_lisp (string) } } + return result; +} + + +/* From CFString to a lisp string. Never returns a unibyte string + (even if it only contains ASCII characters). + This may cause GC during code conversion. */ + +Lisp_Object +cfstring_to_lisp (string) + CFStringRef string; +{ + Lisp_Object result = cfstring_to_lisp_nodecode (string); + if (!NILP (result)) { - result = DECODE_UTF_8 (result); + result = code_convert_string_norecord (result, Qutf_8, 0); /* This may be superfluous. Just to make sure that the result is a multibyte string. */ result = string_to_multibyte (result); @@ -1141,7 +1153,7 @@ xrm_get_preference_database (application) CFSetGetValues (key_set, (const void **)keys); for (index = 0; index < count; index++) { - res_name = SDATA (cfstring_to_lisp (keys[index])); + res_name = SDATA (cfstring_to_lisp_nodecode (keys[index])); quarks = parse_resource_name (&res_name); if (!(NILP (quarks) || *res_name)) { diff --git a/src/macterm.c b/src/macterm.c index 6c74e429726..2976a84e190 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -199,7 +199,7 @@ extern EMACS_INT extra_keyboard_modifiers; /* The keysyms to use for the various modifiers. */ -static Lisp_Object Qalt, Qhyper, Qsuper, Qctrl, +static Lisp_Object Qalt, Qhyper, Qsuper, Qcontrol, Qmeta, Qmodifier_value; extern int inhibit_window_system; @@ -10923,17 +10923,19 @@ syms_of_macterm () x_error_message_string = Qnil; #endif + Qcontrol = intern ("control"); staticpro (&Qcontrol); + Qmeta = intern ("meta"); staticpro (&Qmeta); + Qalt = intern ("alt"); staticpro (&Qalt); + Qhyper = intern ("hyper"); staticpro (&Qhyper); + Qsuper = intern ("super"); staticpro (&Qsuper); Qmodifier_value = intern ("modifier-value"); - Qctrl = intern ("ctrl"); - Fput (Qctrl, Qmodifier_value, make_number (ctrl_modifier)); - Qmeta = intern ("meta"); - Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); - Qalt = intern ("alt"); - Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); - Qhyper = intern ("hyper"); - Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); - Qsuper = intern ("super"); - Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); + staticpro (&Qmodifier_value); + + Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier)); + Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); + Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); + Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); + Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); Qapplication = intern ("application"); staticpro (&Qapplication); Qabout = intern ("about"); staticpro (&Qabout); @@ -10980,63 +10982,61 @@ syms_of_macterm () staticpro (&last_mouse_motion_frame); last_mouse_motion_frame = Qnil; - - /* Variables to configure modifier key assignment. */ DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier, doc: /* Modifier key assumed when the Mac control key is pressed. -The value can be `alt', `ctrl', `hyper', or `super' for the respective -modifier. The default is `ctrl'. */); - Vmac_control_modifier = Qctrl; +The value can be `alt', `control', `hyper', or `super' for the +respective modifier. The default is `control'. */); + Vmac_control_modifier = Qcontrol; DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, doc: /* Modifier key assumed when the Mac alt/option key is pressed. -The value can be `alt', `ctrl', `hyper', or `super' for the respective -modifier. If the value is nil then the key will act as the normal -Mac control modifier, and the option key can be used to compose -characters depending on the chosen Mac keyboard setting. */); +The value can be `alt', `control', `hyper', or `super' for the +respective modifier. If the value is nil then the key will act as the +normal Mac control modifier, and the option key can be used to compose +characters depending on the chosen Mac keyboard setting. */); Vmac_option_modifier = Qnil; DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier, doc: /* Modifier key assumed when the Mac command key is pressed. -The value can be `alt', `ctrl', `hyper', or `super' for the respective -modifier. The default is `meta'. */); +The value can be `alt', `control', `hyper', or `super' for the +respective modifier. The default is `meta'. */); Vmac_command_modifier = Qmeta; DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier, doc: /* Modifier key assumed when the Mac function key is pressed. -The value can be `alt', `ctrl', `hyper', or `super' for the respective -modifier. Note that remapping the function key may lead to unexpected -results for some keys on non-US/GB keyboards. */); +The value can be `alt', `control', `hyper', or `super' for the +respective modifier. Note that remapping the function key may lead to +unexpected results for some keys on non-US/GB keyboards. */); Vmac_function_modifier = Qnil; DEFVAR_LISP ("mac-emulate-three-button-mouse", &Vmac_emulate_three_button_mouse, - doc: /* t means that when the option-key is held down while pressing the -mouse button, the click will register as mouse-2 and while the -command-key is held down, the click will register as mouse-3. -'reverse means that the option-key will register for mouse-3 -and the command-key will register for mouse-2. nil means that -no emulation should be done and the modifiers should be placed -on the mouse-1 event. */); + doc: /* Specify a way of three button mouse emulation. +The value can be nil, t, or the symbol `reverse'. +nil means that no emulation should be done and the modifiers should be +placed on the mouse-1 event. +t means that when the option-key is held down while pressing the mouse +button, the click will register as mouse-2 and while the command-key +is held down, the click will register as mouse-3. +The symbol `reverse' means that the option-key will register for +mouse-3 and the command-key will register for mouse-2. */); Vmac_emulate_three_button_mouse = Qnil; #if USE_CARBON_EVENTS DEFVAR_LISP ("mac-wheel-button-is-mouse-2", &Vmac_wheel_button_is_mouse_2, - doc: /* Non-nil means that the wheel button will be treated as mouse-2 and -the right click will be mouse-3. -Otherwise, the right click will be mouse-2 and the wheel button mouse-3.*/); + doc: /* Non-nil if the wheel button is mouse-2 and the right click mouse-3. +Otherwise, the right click will be treated as mouse-2 and the wheel +button will be mouse-3. */); Vmac_wheel_button_is_mouse_2 = Qt; DEFVAR_LISP ("mac-pass-command-to-system", &Vmac_pass_command_to_system, - doc: /* If non-nil, the Mac \"Command\" key is passed on to the Mac -Toolbox for processing before Emacs sees it. */); + doc: /* Non-nil if command key presses are passed on to the Mac Toolbox. */); Vmac_pass_command_to_system = Qt; DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system, - doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac -Toolbox for processing before Emacs sees it. */); + doc: /* Non-nil if control key presses are passed on to the Mac Toolbox. */); Vmac_pass_control_to_system = Qt; #endif @@ -11051,14 +11051,14 @@ may anti-alias the text. */); creating the terminal frame on Mac OS 9 before loading term/mac-win.elc. */ DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist, - doc: /* Alist linking Emacs character sets to Mac text encoding and Emacs coding system. + doc: /* Alist of Emacs character sets vs text encodings and coding systems. Each entry should be of the form: (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM) where CHARSET-NAME is a string used in font names to identify the -charset, TEXT-ENCODING is a TextEncodingBase value, and CODING_SYSTEM -is a coding system corresponding to TEXT-ENCODING. */); +charset, TEXT-ENCODING is a TextEncodingBase value in Mac, and +CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */); Vmac_charset_info_alist = Fcons (list3 (build_string ("mac-roman"), make_number (smRoman), Qnil), Qnil); diff --git a/src/macterm.h b/src/macterm.h index ca6f82021fe..214037c3346 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -581,6 +581,7 @@ extern void mac_clear_font_name_table P_ ((void)); extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); +extern Lisp_Object cfstring_to_lisp_nodecode P_ ((CFStringRef)); extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef)); extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef)); extern Lisp_Object cfdate_to_lisp P_ ((CFDateRef)); diff --git a/src/minibuf.c b/src/minibuf.c index 71a0f15b72a..4aa6dde6cac 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2776,7 +2776,9 @@ elements are deleted. */); history_delete_duplicates = 0; DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, - doc: /* *Non-nil means automatically provide help for invalid completion input. */); + doc: /* *Non-nil means automatically provide help for invalid completion input. +Under Partial Completion mode, a non-nil, non-t value has a special meaning; +see the doc string of `partial-completion-mode' for more details. */); Vcompletion_auto_help = Qt; DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case, diff --git a/src/window.c b/src/window.c index 69cee518ca4..2d974b4647f 100644 --- a/src/window.c +++ b/src/window.c @@ -212,6 +212,10 @@ Lisp_Object Vwindow_configuration_change_hook; Lisp_Object Vscroll_preserve_screen_position; +/* Incremented by 1 whenever a window is deleted. */ + +int window_deletion_count; + #if 0 /* This isn't used anywhere. */ /* Nonzero means we can split a frame even if it is "unsplittable". */ static int inhibit_frame_unsplittable; @@ -1335,7 +1339,7 @@ delete_window (window) CHECK_WINDOW (window); p = XWINDOW (window); - /* It's okay to delete an already-deleted window. */ + /* It's a no-op to delete an already-deleted window. */ if (NILP (p->buffer) && NILP (p->hchild) && NILP (p->vchild)) @@ -1399,6 +1403,9 @@ delete_window (window) } } + /* Now we know we can delete this one. */ + window_deletion_count++; + tem = p->buffer; /* tem is null for dummy parent windows (which have inferiors but not any contents themselves) */ @@ -4233,9 +4240,136 @@ enlarge_window (window, delta, horiz_flag, preserve_before) adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window)))); } + +/* Adjust the size of WINDOW by DELTA, moving only its trailing edge. + HORIZ_FLAG nonzero means adjust the width, moving the right edge. + zero means adjust the height, moving the bottom edge. + + Following siblings of the selected window are resized to fulfill + the size request. If they become too small in the process, they + are not deleted; instead, we signal an error. */ + +static void +adjust_window_trailing_edge (window, delta, horiz_flag) + Lisp_Object window; + int delta, horiz_flag; +{ + Lisp_Object parent, child; + struct window *p; + Lisp_Object old_config = Fcurrent_window_configuration (Qnil); + int delcount = window_deletion_count; + + /* Check values of window_min_width and window_min_height for + validity. */ + check_min_window_sizes (); + + if (NILP (window)) + window = Fselected_window (); + + CHECK_WINDOW (window); + + /* Give up if this window cannot be resized. */ + if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1)) + error ("Window is not resizable"); + + while (1) + { + p = XWINDOW (window); + parent = p->parent; + + /* Make sure there is a following window. */ + if (NILP (parent) + && (horiz_flag ? 1 + : NILP (XWINDOW (window)->next))) + { + Fset_window_configuration (old_config); + error ("No other window following this one"); + } + + /* Don't make this window too small. */ + if (XINT (CURSIZE (window)) + delta + < (horiz_flag ? window_min_width : window_min_height)) + { + Fset_window_configuration (old_config); + error ("Cannot adjust window size as specified"); + } + + /* Clear out some redisplay caches. */ + XSETFASTINT (p->last_modified, 0); + XSETFASTINT (p->last_overlay_modified, 0); + + /* Adjust this window's edge. */ + XSETINT (CURSIZE (window), + XINT (CURSIZE (window)) + delta); + + /* If this window has following siblings in the desired dimension, + make them smaller. + (If we reach the top of the tree and can never do this, + we will fail and report an error, above.) */ + if (horiz_flag + ? !NILP (XWINDOW (parent)->hchild) + : !NILP (XWINDOW (parent)->vchild)) + { + if (!NILP (XWINDOW (window)->next)) + { + XSETINT (CURBEG (p->next), + XINT (CURBEG (p->next)) + delta); + size_window (p->next, XINT (CURSIZE (p->next)) - delta, + horiz_flag, 0); + break; + } + } + else + /* Here we have a chain of parallel siblings, in the other dimension. + Change the size of the other siblings. */ + for (child = (horiz_flag + ? XWINDOW (parent)->vchild + : XWINDOW (parent)->hchild); + ! NILP (child); + child = XWINDOW (child)->next) + if (! EQ (child, window)) + size_window (child, XINT (CURSIZE (child)) + delta, + horiz_flag, 0); + + window = parent; + } + + /* If we made a window so small it got deleted, + we failed. Report failure. */ + if (delcount != window_deletion_count) + { + Fset_window_configuration (old_config); + error ("Cannot adjust window size as specified"); + } + + /* Adjust glyph matrices. */ + adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window)))); +} + #undef CURBEG #undef CURSIZE +DEFUN ("adjust-window-trailing-edge", Fadjust_window_trailing_edge, + Sadjust_window_trailing_edge, 3, 3, 0, + doc: /* Adjust the bottom or right edge of WINDOW by DELTA. +If HORIZ_FLAG is t, that means adjust the width, moving the right edge. +Otherwise, adjust the height, moving the bottom edge. + +Following siblings of the selected window are resized to fulfill +the size request. If they become too small in the process, they +are not deleted; instead, we signal an error. */) + (window, delta, horizontal) + Lisp_Object window, delta, horizontal; +{ + CHECK_NUMBER (delta); + adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal)); + + if (! NILP (Vwindow_configuration_change_hook)) + call1 (Vrun_hooks, Qwindow_configuration_change_hook); + + return Qnil; +} + /*********************************************************************** @@ -7116,6 +7250,7 @@ The selected frame is the one whose configuration has changed. */); defsubr (&Ssplit_window); defsubr (&Senlarge_window); defsubr (&Sshrink_window); + defsubr (&Sadjust_window_trailing_edge); defsubr (&Sscroll_up); defsubr (&Sscroll_down); defsubr (&Sscroll_left); diff --git a/src/xfaces.c b/src/xfaces.c index c096b15ba1f..7c9230f1140 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4704,7 +4704,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource", if (SYMBOLP (boolean_value)) value = boolean_value; } - else if (EQ (attr, QCbox)) + else if (EQ (attr, QCbox) || EQ (attr, QCinherit)) value = Fcar (Fread_from_string (value, Qnil, Qnil)); return Finternal_set_lisp_face_attribute (face, attr, value, frame); |
