aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-12-03 14:25:50 +0000
committerKaroly Lorentey2005-12-03 14:25:50 +0000
commit9ef706664e98e37e9633712126bae99869904677 (patch)
tree193bce7424700e4c7d70f54b04f7f81d64525554 /src
parent950bed4bb96d2a580818bdaab64a164c7c9a1c1e (diff)
parent9f6efa0c78099f2f028c4db1db5a58567a1cfb4e (diff)
downloademacs-9ef706664e98e37e9633712126bae99869904677.tar.gz
emacs-9ef706664e98e37e9633712126bae99869904677.zip
Merged from miles@gnu.org--gnu-2005 (patch 659-663)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-660 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-661 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-662 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-663 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-445
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog87
-rw-r--r--src/alloc.c32
-rw-r--r--src/atimer.c2
-rw-r--r--src/buffer.c3
-rw-r--r--src/emacs.c10
-rw-r--r--src/mac.c26
-rw-r--r--src/macterm.c84
-rw-r--r--src/macterm.h1
-rw-r--r--src/minibuf.c4
-rw-r--r--src/window.c137
-rw-r--r--src/xfaces.c2
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 @@
12005-11-30 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu>
2
3 * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer.
4
52005-11-30 Kim F. Storm <storm@cua.dk>
6
7 * alloc.c: Include fcntl.h. Define O_WRONLY if not defined.
8 (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by
9 passing it to `emacs_write'.
10
112005-11-29 Ari Roponen <arjuropo@cc.jyu.fi> (tiny change)
12
13 * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'.
14
152005-11-27 Richard M. Stallman <rms@gnu.org>
16
17 * window.c (adjust_window_trailing_edge): New function.
18 (Fadjust_window_trailing_edge): New function.
19 (syms_of_window): Defsubr it.
20 (window_deletion_count): New variable.
21 (delete_window): Update window_deletion_count.
22
232005-11-26 Eli Zaretskii <eliz@gnu.org>
24
25 * minibuf.c (syms_of_minibuf): Mention the extension of
26 `completion-auto-help's meaning by complete.el.
27
282005-11-26 Henrik Enberg <henrik.enberg@telia.com>
29
30 * xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
31 Handle :inherit property as a lisp expression.
32
332005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
34
35 * macterm.c (Qcontrol): Rename from Qctrl. All uses changed.
36 (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper,
37 Qsuper, and Qmodifier_value.
38 (Vmac_control_modifier, Vmac_option_modifier)
39 (Vmac_command_modifier, Vmac_function_modifier)
40 (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2)
41 (Vmac_pass_command_to_system, Vmac_pass_control_to_system)
42 (Vmac_charset_info_alist): Doc fixes.
43
442005-11-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
45
46 * emacs.c (main) [MAC_OSX]: Change working directory to home
47 directory if `-psn_*' option is specified.
48
49 * mac.c (DECODE_UTF_8): Remove macro.
50 [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function
51 created from cfstring_to_lisp.
52 [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it.
53 (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise.
54
55 * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]:
56 Add prototype.
57
12005-11-21 Ken Raeburn <raeburn@mit.edu> 582005-11-21 Ken Raeburn <raeburn@mit.edu>
2 59
3 * keymap.c (shadow_lookup): Use make_number to pass a number to 60 * keymap.c (shadow_lookup): Use make_number to pass a number to
@@ -9,8 +66,8 @@
9 66
102005-11-20 Chong Yidong <cyd@stupidchicken.com> 672005-11-20 Chong Yidong <cyd@stupidchicken.com>
11 68
12 * xfaces.c (Finternal_set_lisp_face_attribute): Use 69 * xfaces.c (Finternal_set_lisp_face_attribute):
13 :ignore-defface for new frame defaults when `unspecified' is 70 Use :ignore-defface for new frame defaults when `unspecified' is
14 supplied. 71 supplied.
15 (Finternal_get_lisp_face_attribute): Hide :ignore-defface. 72 (Finternal_get_lisp_face_attribute): Hide :ignore-defface.
16 (merge_face_vectors): Don't do :ignore-defface overwriting here. 73 (merge_face_vectors): Don't do :ignore-defface overwriting here.
@@ -35,24 +92,22 @@
35 92
36 * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): 93 * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold):
37 New variable. 94 New variable.
38 [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New 95 [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun.
39 function.
40 (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it. 96 (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it.
41 [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if 97 [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if
42 font size is smaller than or equal to cg_text_anti_aliasing_threshold. 98 font size is smaller than or equal to cg_text_anti_aliasing_threshold.
43 99
442005-11-17 Chong Yidong <cyd@stupidchicken.com> 1002005-11-17 Chong Yidong <cyd@stupidchicken.com>
45 101
46 * image.c (x_create_bitmap_from_xpm_data): Free attributes on 102 * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail.
47 fail.
48 103
49 * xfaces.c (Qignore_defface): New variable. 104 * xfaces.c (Qignore_defface): New variable.
50 (syms_of_xfaces): Provide `:ignore-defface'. 105 (syms_of_xfaces): Provide `:ignore-defface'.
51 (IGNORE_DEFFACE_P): New macro. 106 (IGNORE_DEFFACE_P): New macro.
52 (check_lface_attrs, lface_fully_specified_p) 107 (check_lface_attrs, lface_fully_specified_p)
53 (Finternal_set_lisp_face_attribute) 108 (Finternal_set_lisp_face_attribute)
54 (Fface_attribute_relative_p, Fmerge_face_attribute): Handle 109 (Fface_attribute_relative_p, Fmerge_face_attribute):
55 Qignore_defface as a possible value. 110 Handle Qignore_defface as a possible value.
56 (merge_face_vectors): The merged face is `unspecified' if the 111 (merge_face_vectors): The merged face is `unspecified' if the
57 mergee specifies `:ignore-defface'. 112 mergee specifies `:ignore-defface'.
58 113
@@ -593,8 +648,8 @@
593 * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to 648 * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to
594 get end of text rows. Obtain header-line/mode-line rows directly. 649 get end of text rows. Obtain header-line/mode-line rows directly.
595 650
596 * xterm.c, w32term.c, macterm.c (note_mouse_movement): Restore 651 * xterm.c, w32term.c, macterm.c (note_mouse_movement):
597 help_echo_string if mouse is moved inside last_mouse_glyph. 652 Restore help_echo_string if mouse is moved inside last_mouse_glyph.
598 653
5992005-10-12 Kim F. Storm <storm@cua.dk> 6542005-10-12 Kim F. Storm <storm@cua.dk>
600 655
@@ -659,8 +714,8 @@
659 (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name. 714 (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name.
660 Don't use Fdowncase because family name is already lowered by 715 Don't use Fdowncase because family name is already lowered by
661 decode_mac_font_name. 716 decode_mac_font_name.
662 (init_font_name_table): Always call decode_mac_font_name. Add 717 (init_font_name_table): Always call decode_mac_font_name.
663 pair of family name and its reference to fm_font_family_alist. 718 Add pair of family name and its reference to fm_font_family_alist.
664 (mac_clear_font_name_table): Clear fm_font_family_alist. 719 (mac_clear_font_name_table): Clear fm_font_family_alist.
665 (XLoadQueryFont): Move font size parsing part to parse_x_font_name. 720 (XLoadQueryFont): Move font size parsing part to parse_x_font_name.
666 Lookup fm_font_family_alist to get font family reference. 721 Lookup fm_font_family_alist to get font family reference.
@@ -760,8 +815,8 @@
760 (x_fix_overlapping_area): Add new OVERLAPS arg. 815 (x_fix_overlapping_area): Add new OVERLAPS arg.
761 (get_glyph_string_clip_rects): Add extern. 816 (get_glyph_string_clip_rects): Add extern.
762 817
763 * dispnew.c (redraw_overlapping_rows): Call 818 * dispnew.c (redraw_overlapping_rows):
764 rif->fix_overlapping_area with new OVERLAPS arg as redrawn part. 819 Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part.
765 820
766 * xdisp.c: Rename member for_overlaps_p in struct glyph_string to 821 * xdisp.c: Rename member for_overlaps_p in struct glyph_string to
767 for_overlaps. 822 for_overlaps.
@@ -1106,8 +1161,8 @@
1106 1161
1107 * xsmfns.c: (get_current_dir_name): Remove prototype. 1162 * xsmfns.c: (get_current_dir_name): Remove prototype.
1108 1163
1109 * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]: Add 1164 * lisp.h: (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
1110 prototype. 1165 Add prototype.
1111 1166
1112 * sysdep.c [WINDOWSNT]: Add prototype for getwd. 1167 * sysdep.c [WINDOWSNT]: Add prototype for getwd.
1113 Don't #undef NULL after including blockinput.h. 1168 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. */
66extern POINTER_TYPE *sbrk (); 66extern POINTER_TYPE *sbrk ();
67#endif 67#endif
68 68
69#ifdef HAVE_FCNTL_H
70#define INCLUDED_FCNTL
71#include <fcntl.h>
72#endif
73#ifndef O_WRONLY
74#define O_WRONLY 1
75#endif
76
69#ifdef DOUG_LEA_MALLOC 77#ifdef DOUG_LEA_MALLOC
70 78
71#include <malloc.h> 79#include <malloc.h>
@@ -4498,21 +4506,37 @@ int
4498valid_lisp_object_p (obj) 4506valid_lisp_object_p (obj)
4499 Lisp_Object obj; 4507 Lisp_Object obj;
4500{ 4508{
4509 void *p;
4501#if !GC_MARK_STACK 4510#if !GC_MARK_STACK
4502 /* Cannot determine this. */ 4511 int fd;
4503 return -1;
4504#else 4512#else
4505 void *p;
4506 struct mem_node *m; 4513 struct mem_node *m;
4514#endif
4507 4515
4508 if (INTEGERP (obj)) 4516 if (INTEGERP (obj))
4509 return 1; 4517 return 1;
4510 4518
4511 p = (void *) XPNTR (obj); 4519 p = (void *) XPNTR (obj);
4512
4513 if (PURE_POINTER_P (p)) 4520 if (PURE_POINTER_P (p))
4514 return 1; 4521 return 1;
4515 4522
4523#if !GC_MARK_STACK
4524 /* We need to determine whether it is safe to access memory at
4525 address P. Obviously, we cannot just access it (we would SEGV
4526 trying), so we trick the o/s to tell us whether p is a valid
4527 pointer. Unfortunately, we cannot use NULL_DEVICE here, as
4528 emacs_write may not validate p in that case. */
4529 if ((fd = emacs_open("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0)
4530 {
4531 int valid = emacs_write(fd, (char *)p, 16) == 16;
4532 emacs_close(fd);
4533 unlink("__Valid__Lisp__Object__");
4534 return valid;
4535 }
4536
4537 return -1;
4538#else
4539
4516 m = mem_find (p); 4540 m = mem_find (p);
4517 4541
4518 if (m == MEM_NIL) 4542 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)
231 struct atimer *p, *prev; 231 struct atimer *p, *prev;
232 232
233 /* See if T is active. */ 233 /* See if T is active. */
234 for (p = atimers, prev = 0; p && p != t; p = p->next) 234 for (p = atimers, prev = NULL; p && p != t; prev = p, p = p->next)
235 ; 235 ;
236 236
237 if (p == t) 237 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. */)
1722 } 1722 }
1723 } 1723 }
1724 Fset_buffer (buf); 1724 Fset_buffer (buf);
1725 if (NILP (norecord))
1726 /* Why bother ? Fselect_window will do it for us anyway. -stef */
1727 record_buffer (buf);
1728 Fselect_window (Fdisplay_buffer (buf, other_window, Qnil), norecord); 1725 Fselect_window (Fdisplay_buffer (buf, other_window, Qnil), norecord);
1729 return buf; 1726 return buf;
1730} 1727}
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
963 963
964#ifdef MAC_OSX 964#ifdef MAC_OSX
965 /* Skip process serial number passed in the form -psn_x_y as 965 /* Skip process serial number passed in the form -psn_x_y as
966 command-line argument. */ 966 command-line argument. The WindowServer adds this option when
967 Emacs is invoked from the Finder or by the `open' command. In
968 these cases, the working directory becomes `/', so we change it
969 to the user's home directory. */
967 if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0) 970 if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0)
968 skip_args++; 971 {
972 chdir (getenv ("HOME"));
973 skip_args++;
974 }
969#endif /* MAC_OSX */ 975#endif /* MAC_OSX */
970 976
971#ifdef VMS 977#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)
265#if TARGET_API_MAC_CARBON 265#if TARGET_API_MAC_CARBON
266static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; 266static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
267static Lisp_Object Qarray, Qdictionary; 267static Lisp_Object Qarray, Qdictionary;
268#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
269 268
270struct cfdict_context 269struct cfdict_context
271{ 270{
@@ -336,12 +335,11 @@ cfdata_to_lisp (data)
336} 335}
337 336
338 337
339/* From CFString to a lisp string. Never returns a unibyte string 338/* From CFString to a lisp string. Returns a unibyte string
340 (even if it only contains ASCII characters). 339 containing a UTF-8 byte sequence. */
341 This may cause GC during code conversion. */
342 340
343Lisp_Object 341Lisp_Object
344cfstring_to_lisp (string) 342cfstring_to_lisp_nodecode (string)
345 CFStringRef string; 343 CFStringRef string;
346{ 344{
347 Lisp_Object result = Qnil; 345 Lisp_Object result = Qnil;
@@ -362,9 +360,23 @@ cfstring_to_lisp (string)
362 } 360 }
363 } 361 }
364 362
363 return result;
364}
365
366
367/* From CFString to a lisp string. Never returns a unibyte string
368 (even if it only contains ASCII characters).
369 This may cause GC during code conversion. */
370
371Lisp_Object
372cfstring_to_lisp (string)
373 CFStringRef string;
374{
375 Lisp_Object result = cfstring_to_lisp_nodecode (string);
376
365 if (!NILP (result)) 377 if (!NILP (result))
366 { 378 {
367 result = DECODE_UTF_8 (result); 379 result = code_convert_string_norecord (result, Qutf_8, 0);
368 /* This may be superfluous. Just to make sure that the result 380 /* This may be superfluous. Just to make sure that the result
369 is a multibyte string. */ 381 is a multibyte string. */
370 result = string_to_multibyte (result); 382 result = string_to_multibyte (result);
@@ -1141,7 +1153,7 @@ xrm_get_preference_database (application)
1141 CFSetGetValues (key_set, (const void **)keys); 1153 CFSetGetValues (key_set, (const void **)keys);
1142 for (index = 0; index < count; index++) 1154 for (index = 0; index < count; index++)
1143 { 1155 {
1144 res_name = SDATA (cfstring_to_lisp (keys[index])); 1156 res_name = SDATA (cfstring_to_lisp_nodecode (keys[index]));
1145 quarks = parse_resource_name (&res_name); 1157 quarks = parse_resource_name (&res_name);
1146 if (!(NILP (quarks) || *res_name)) 1158 if (!(NILP (quarks) || *res_name))
1147 { 1159 {
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;
199 199
200/* The keysyms to use for the various modifiers. */ 200/* The keysyms to use for the various modifiers. */
201 201
202static Lisp_Object Qalt, Qhyper, Qsuper, Qctrl, 202static Lisp_Object Qalt, Qhyper, Qsuper, Qcontrol,
203 Qmeta, Qmodifier_value; 203 Qmeta, Qmodifier_value;
204 204
205extern int inhibit_window_system; 205extern int inhibit_window_system;
@@ -10923,17 +10923,19 @@ syms_of_macterm ()
10923 x_error_message_string = Qnil; 10923 x_error_message_string = Qnil;
10924#endif 10924#endif
10925 10925
10926 Qcontrol = intern ("control"); staticpro (&Qcontrol);
10927 Qmeta = intern ("meta"); staticpro (&Qmeta);
10928 Qalt = intern ("alt"); staticpro (&Qalt);
10929 Qhyper = intern ("hyper"); staticpro (&Qhyper);
10930 Qsuper = intern ("super"); staticpro (&Qsuper);
10926 Qmodifier_value = intern ("modifier-value"); 10931 Qmodifier_value = intern ("modifier-value");
10927 Qctrl = intern ("ctrl"); 10932 staticpro (&Qmodifier_value);
10928 Fput (Qctrl, Qmodifier_value, make_number (ctrl_modifier)); 10933
10929 Qmeta = intern ("meta"); 10934 Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier));
10930 Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); 10935 Fput (Qmeta, Qmodifier_value, make_number (meta_modifier));
10931 Qalt = intern ("alt"); 10936 Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
10932 Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); 10937 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
10933 Qhyper = intern ("hyper"); 10938 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
10934 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
10935 Qsuper = intern ("super");
10936 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
10937 10939
10938 Qapplication = intern ("application"); staticpro (&Qapplication); 10940 Qapplication = intern ("application"); staticpro (&Qapplication);
10939 Qabout = intern ("about"); staticpro (&Qabout); 10941 Qabout = intern ("about"); staticpro (&Qabout);
@@ -10980,63 +10982,61 @@ syms_of_macterm ()
10980 staticpro (&last_mouse_motion_frame); 10982 staticpro (&last_mouse_motion_frame);
10981 last_mouse_motion_frame = Qnil; 10983 last_mouse_motion_frame = Qnil;
10982 10984
10983
10984
10985/* Variables to configure modifier key assignment. */ 10985/* Variables to configure modifier key assignment. */
10986 10986
10987 DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier, 10987 DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier,
10988 doc: /* Modifier key assumed when the Mac control key is pressed. 10988 doc: /* Modifier key assumed when the Mac control key is pressed.
10989The value can be `alt', `ctrl', `hyper', or `super' for the respective 10989The value can be `alt', `control', `hyper', or `super' for the
10990modifier. The default is `ctrl'. */); 10990respective modifier. The default is `control'. */);
10991 Vmac_control_modifier = Qctrl; 10991 Vmac_control_modifier = Qcontrol;
10992 10992
10993 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, 10993 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier,
10994 doc: /* Modifier key assumed when the Mac alt/option key is pressed. 10994 doc: /* Modifier key assumed when the Mac alt/option key is pressed.
10995The value can be `alt', `ctrl', `hyper', or `super' for the respective 10995The value can be `alt', `control', `hyper', or `super' for the
10996modifier. If the value is nil then the key will act as the normal 10996respective modifier. If the value is nil then the key will act as the
10997Mac control modifier, and the option key can be used to compose 10997normal Mac control modifier, and the option key can be used to compose
10998characters depending on the chosen Mac keyboard setting. */); 10998characters depending on the chosen Mac keyboard setting. */);
10999 Vmac_option_modifier = Qnil; 10999 Vmac_option_modifier = Qnil;
11000 11000
11001 DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier, 11001 DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier,
11002 doc: /* Modifier key assumed when the Mac command key is pressed. 11002 doc: /* Modifier key assumed when the Mac command key is pressed.
11003The value can be `alt', `ctrl', `hyper', or `super' for the respective 11003The value can be `alt', `control', `hyper', or `super' for the
11004modifier. The default is `meta'. */); 11004respective modifier. The default is `meta'. */);
11005 Vmac_command_modifier = Qmeta; 11005 Vmac_command_modifier = Qmeta;
11006 11006
11007 DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier, 11007 DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier,
11008 doc: /* Modifier key assumed when the Mac function key is pressed. 11008 doc: /* Modifier key assumed when the Mac function key is pressed.
11009The value can be `alt', `ctrl', `hyper', or `super' for the respective 11009The value can be `alt', `control', `hyper', or `super' for the
11010modifier. Note that remapping the function key may lead to unexpected 11010respective modifier. Note that remapping the function key may lead to
11011results for some keys on non-US/GB keyboards. */); 11011unexpected results for some keys on non-US/GB keyboards. */);
11012 Vmac_function_modifier = Qnil; 11012 Vmac_function_modifier = Qnil;
11013 11013
11014 DEFVAR_LISP ("mac-emulate-three-button-mouse", 11014 DEFVAR_LISP ("mac-emulate-three-button-mouse",
11015 &Vmac_emulate_three_button_mouse, 11015 &Vmac_emulate_three_button_mouse,
11016 doc: /* t means that when the option-key is held down while pressing the 11016 doc: /* Specify a way of three button mouse emulation.
11017mouse button, the click will register as mouse-2 and while the 11017The value can be nil, t, or the symbol `reverse'.
11018command-key is held down, the click will register as mouse-3. 11018nil means that no emulation should be done and the modifiers should be
11019'reverse means that the option-key will register for mouse-3 11019placed on the mouse-1 event.
11020and the command-key will register for mouse-2. nil means that 11020t means that when the option-key is held down while pressing the mouse
11021no emulation should be done and the modifiers should be placed 11021button, the click will register as mouse-2 and while the command-key
11022on the mouse-1 event. */); 11022is held down, the click will register as mouse-3.
11023The symbol `reverse' means that the option-key will register for
11024mouse-3 and the command-key will register for mouse-2. */);
11023 Vmac_emulate_three_button_mouse = Qnil; 11025 Vmac_emulate_three_button_mouse = Qnil;
11024 11026
11025#if USE_CARBON_EVENTS 11027#if USE_CARBON_EVENTS
11026 DEFVAR_LISP ("mac-wheel-button-is-mouse-2", &Vmac_wheel_button_is_mouse_2, 11028 DEFVAR_LISP ("mac-wheel-button-is-mouse-2", &Vmac_wheel_button_is_mouse_2,
11027 doc: /* Non-nil means that the wheel button will be treated as mouse-2 and 11029 doc: /* Non-nil if the wheel button is mouse-2 and the right click mouse-3.
11028the right click will be mouse-3. 11030Otherwise, the right click will be treated as mouse-2 and the wheel
11029Otherwise, the right click will be mouse-2 and the wheel button mouse-3.*/); 11031button will be mouse-3. */);
11030 Vmac_wheel_button_is_mouse_2 = Qt; 11032 Vmac_wheel_button_is_mouse_2 = Qt;
11031 11033
11032 DEFVAR_LISP ("mac-pass-command-to-system", &Vmac_pass_command_to_system, 11034 DEFVAR_LISP ("mac-pass-command-to-system", &Vmac_pass_command_to_system,
11033 doc: /* If non-nil, the Mac \"Command\" key is passed on to the Mac 11035 doc: /* Non-nil if command key presses are passed on to the Mac Toolbox. */);
11034Toolbox for processing before Emacs sees it. */);
11035 Vmac_pass_command_to_system = Qt; 11036 Vmac_pass_command_to_system = Qt;
11036 11037
11037 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system, 11038 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system,
11038 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac 11039 doc: /* Non-nil if control key presses are passed on to the Mac Toolbox. */);
11039Toolbox for processing before Emacs sees it. */);
11040 Vmac_pass_control_to_system = Qt; 11040 Vmac_pass_control_to_system = Qt;
11041 11041
11042#endif 11042#endif
@@ -11051,14 +11051,14 @@ may anti-alias the text. */);
11051 creating the terminal frame on Mac OS 9 before loading 11051 creating the terminal frame on Mac OS 9 before loading
11052 term/mac-win.elc. */ 11052 term/mac-win.elc. */
11053 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist, 11053 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
11054 doc: /* Alist linking Emacs character sets to Mac text encoding and Emacs coding system. 11054 doc: /* Alist of Emacs character sets vs text encodings and coding systems.
11055Each entry should be of the form: 11055Each entry should be of the form:
11056 11056
11057 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM) 11057 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
11058 11058
11059where CHARSET-NAME is a string used in font names to identify the 11059where CHARSET-NAME is a string used in font names to identify the
11060charset, TEXT-ENCODING is a TextEncodingBase value, and CODING_SYSTEM 11060charset, TEXT-ENCODING is a TextEncodingBase value in Mac, and
11061is a coding system corresponding to TEXT-ENCODING. */); 11061CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */);
11062 Vmac_charset_info_alist = 11062 Vmac_charset_info_alist =
11063 Fcons (list3 (build_string ("mac-roman"), 11063 Fcons (list3 (build_string ("mac-roman"),
11064 make_number (smRoman), Qnil), Qnil); 11064 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));
581extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 581extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
582extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 582extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
583extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 583extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
584extern Lisp_Object cfstring_to_lisp_nodecode P_ ((CFStringRef));
584extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef)); 585extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef));
585extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef)); 586extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef));
586extern Lisp_Object cfdate_to_lisp P_ ((CFDateRef)); 587extern 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. */);
2776 history_delete_duplicates = 0; 2776 history_delete_duplicates = 0;
2777 2777
2778 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, 2778 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
2779 doc: /* *Non-nil means automatically provide help for invalid completion input. */); 2779 doc: /* *Non-nil means automatically provide help for invalid completion input.
2780Under Partial Completion mode, a non-nil, non-t value has a special meaning;
2781see the doc string of `partial-completion-mode' for more details. */);
2780 Vcompletion_auto_help = Qt; 2782 Vcompletion_auto_help = Qt;
2781 2783
2782 DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case, 2784 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;
212 212
213Lisp_Object Vscroll_preserve_screen_position; 213Lisp_Object Vscroll_preserve_screen_position;
214 214
215/* Incremented by 1 whenever a window is deleted. */
216
217int window_deletion_count;
218
215#if 0 /* This isn't used anywhere. */ 219#if 0 /* This isn't used anywhere. */
216/* Nonzero means we can split a frame even if it is "unsplittable". */ 220/* Nonzero means we can split a frame even if it is "unsplittable". */
217static int inhibit_frame_unsplittable; 221static int inhibit_frame_unsplittable;
@@ -1335,7 +1339,7 @@ delete_window (window)
1335 CHECK_WINDOW (window); 1339 CHECK_WINDOW (window);
1336 p = XWINDOW (window); 1340 p = XWINDOW (window);
1337 1341
1338 /* It's okay to delete an already-deleted window. */ 1342 /* It's a no-op to delete an already-deleted window. */
1339 if (NILP (p->buffer) 1343 if (NILP (p->buffer)
1340 && NILP (p->hchild) 1344 && NILP (p->hchild)
1341 && NILP (p->vchild)) 1345 && NILP (p->vchild))
@@ -1399,6 +1403,9 @@ delete_window (window)
1399 } 1403 }
1400 } 1404 }
1401 1405
1406 /* Now we know we can delete this one. */
1407 window_deletion_count++;
1408
1402 tem = p->buffer; 1409 tem = p->buffer;
1403 /* tem is null for dummy parent windows 1410 /* tem is null for dummy parent windows
1404 (which have inferiors but not any contents themselves) */ 1411 (which have inferiors but not any contents themselves) */
@@ -4233,9 +4240,136 @@ enlarge_window (window, delta, horiz_flag, preserve_before)
4233 adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window)))); 4240 adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window))));
4234} 4241}
4235 4242
4243
4244/* Adjust the size of WINDOW by DELTA, moving only its trailing edge.
4245 HORIZ_FLAG nonzero means adjust the width, moving the right edge.
4246 zero means adjust the height, moving the bottom edge.
4247
4248 Following siblings of the selected window are resized to fulfill
4249 the size request. If they become too small in the process, they
4250 are not deleted; instead, we signal an error. */
4251
4252static void
4253adjust_window_trailing_edge (window, delta, horiz_flag)
4254 Lisp_Object window;
4255 int delta, horiz_flag;
4256{
4257 Lisp_Object parent, child;
4258 struct window *p;
4259 Lisp_Object old_config = Fcurrent_window_configuration (Qnil);
4260 int delcount = window_deletion_count;
4261
4262 /* Check values of window_min_width and window_min_height for
4263 validity. */
4264 check_min_window_sizes ();
4265
4266 if (NILP (window))
4267 window = Fselected_window ();
4268
4269 CHECK_WINDOW (window);
4270
4271 /* Give up if this window cannot be resized. */
4272 if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1))
4273 error ("Window is not resizable");
4274
4275 while (1)
4276 {
4277 p = XWINDOW (window);
4278 parent = p->parent;
4279
4280 /* Make sure there is a following window. */
4281 if (NILP (parent)
4282 && (horiz_flag ? 1
4283 : NILP (XWINDOW (window)->next)))
4284 {
4285 Fset_window_configuration (old_config);
4286 error ("No other window following this one");
4287 }
4288
4289 /* Don't make this window too small. */
4290 if (XINT (CURSIZE (window)) + delta
4291 < (horiz_flag ? window_min_width : window_min_height))
4292 {
4293 Fset_window_configuration (old_config);
4294 error ("Cannot adjust window size as specified");
4295 }
4296
4297 /* Clear out some redisplay caches. */
4298 XSETFASTINT (p->last_modified, 0);
4299 XSETFASTINT (p->last_overlay_modified, 0);
4300
4301 /* Adjust this window's edge. */
4302 XSETINT (CURSIZE (window),
4303 XINT (CURSIZE (window)) + delta);
4304
4305 /* If this window has following siblings in the desired dimension,
4306 make them smaller.
4307 (If we reach the top of the tree and can never do this,
4308 we will fail and report an error, above.) */
4309 if (horiz_flag
4310 ? !NILP (XWINDOW (parent)->hchild)
4311 : !NILP (XWINDOW (parent)->vchild))
4312 {
4313 if (!NILP (XWINDOW (window)->next))
4314 {
4315 XSETINT (CURBEG (p->next),
4316 XINT (CURBEG (p->next)) + delta);
4317 size_window (p->next, XINT (CURSIZE (p->next)) - delta,
4318 horiz_flag, 0);
4319 break;
4320 }
4321 }
4322 else
4323 /* Here we have a chain of parallel siblings, in the other dimension.
4324 Change the size of the other siblings. */
4325 for (child = (horiz_flag
4326 ? XWINDOW (parent)->vchild
4327 : XWINDOW (parent)->hchild);
4328 ! NILP (child);
4329 child = XWINDOW (child)->next)
4330 if (! EQ (child, window))
4331 size_window (child, XINT (CURSIZE (child)) + delta,
4332 horiz_flag, 0);
4333
4334 window = parent;
4335 }
4336
4337 /* If we made a window so small it got deleted,
4338 we failed. Report failure. */
4339 if (delcount != window_deletion_count)
4340 {
4341 Fset_window_configuration (old_config);
4342 error ("Cannot adjust window size as specified");
4343 }
4344
4345 /* Adjust glyph matrices. */
4346 adjust_glyphs (XFRAME (WINDOW_FRAME (XWINDOW (window))));
4347}
4348
4236#undef CURBEG 4349#undef CURBEG
4237#undef CURSIZE 4350#undef CURSIZE
4238 4351
4352DEFUN ("adjust-window-trailing-edge", Fadjust_window_trailing_edge,
4353 Sadjust_window_trailing_edge, 3, 3, 0,
4354 doc: /* Adjust the bottom or right edge of WINDOW by DELTA.
4355If HORIZ_FLAG is t, that means adjust the width, moving the right edge.
4356Otherwise, adjust the height, moving the bottom edge.
4357
4358Following siblings of the selected window are resized to fulfill
4359the size request. If they become too small in the process, they
4360are not deleted; instead, we signal an error. */)
4361 (window, delta, horizontal)
4362 Lisp_Object window, delta, horizontal;
4363{
4364 CHECK_NUMBER (delta);
4365 adjust_window_trailing_edge (window, XINT (delta), !NILP (horizontal));
4366
4367 if (! NILP (Vwindow_configuration_change_hook))
4368 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
4369
4370 return Qnil;
4371}
4372
4239 4373
4240 4374
4241/*********************************************************************** 4375/***********************************************************************
@@ -7116,6 +7250,7 @@ The selected frame is the one whose configuration has changed. */);
7116 defsubr (&Ssplit_window); 7250 defsubr (&Ssplit_window);
7117 defsubr (&Senlarge_window); 7251 defsubr (&Senlarge_window);
7118 defsubr (&Sshrink_window); 7252 defsubr (&Sshrink_window);
7253 defsubr (&Sadjust_window_trailing_edge);
7119 defsubr (&Sscroll_up); 7254 defsubr (&Sscroll_up);
7120 defsubr (&Sscroll_down); 7255 defsubr (&Sscroll_down);
7121 defsubr (&Sscroll_left); 7256 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",
4704 if (SYMBOLP (boolean_value)) 4704 if (SYMBOLP (boolean_value))
4705 value = boolean_value; 4705 value = boolean_value;
4706 } 4706 }
4707 else if (EQ (attr, QCbox)) 4707 else if (EQ (attr, QCbox) || EQ (attr, QCinherit))
4708 value = Fcar (Fread_from_string (value, Qnil, Qnil)); 4708 value = Fcar (Fread_from_string (value, Qnil, Qnil));
4709 4709
4710 return Finternal_set_lisp_face_attribute (face, attr, value, frame); 4710 return Finternal_set_lisp_face_attribute (face, attr, value, frame);