aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-07-05 22:12:55 +0000
committerKaroly Lorentey2005-07-05 22:12:55 +0000
commit41be4f66fd33b17eba3e3ed4b8f8828c77f18517 (patch)
tree23558632ba5eac56317f1df9fac514f439e7f82d /src
parent2f98e6e37b5870a644a178d4d6998c6c7f1f68dd (diff)
parent41700b79db6e52aee51d9d57c453b5f6fbd61e6e (diff)
downloademacs-41be4f66fd33b17eba3e3ed4b8f8828c77f18517.tar.gz
emacs-41be4f66fd33b17eba3e3ed4b8f8828c77f18517.zip
Merged from miles@gnu.org--gnu-2005 (patch 83-87, 449-468)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-449 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-450 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-451 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-452 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-453 Update from CVS: lisp/subr.el (add-to-ordered-list): Doc fix. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-454 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-455 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-456 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-457 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-458 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-459 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-460 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-462 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-463 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-465 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-466 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-467 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-468 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-83 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-84 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-85 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-86 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-87 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-371
Diffstat (limited to 'src')
-rw-r--r--src/COPYING6
-rw-r--r--src/ChangeLog88
-rw-r--r--src/emacs.c8
-rw-r--r--src/eval.c72
-rw-r--r--src/fileio.c37
-rw-r--r--src/macterm.c2
-rw-r--r--src/term.c10
-rw-r--r--src/w32term.c57
-rw-r--r--src/window.c25
-rw-r--r--src/xdisp.c16
-rw-r--r--src/xterm.c7
11 files changed, 260 insertions, 68 deletions
diff --git a/src/COPYING b/src/COPYING
index d60c31a97a5..3912109b5cd 100644
--- a/src/COPYING
+++ b/src/COPYING
@@ -2,7 +2,7 @@
2 Version 2, June 1991 2 Version 2, June 1991
3 3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies 6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed. 7 of this license document, but changing it is not allowed.
8 8
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
305 305
306 You should have received a copy of the GNU General Public License 306 You should have received a copy of the GNU General Public License
307 along with this program; if not, write to the Free Software 307 along with this program; if not, write to the Free Software
308 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 308 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
309 309
310 310
311Also add information on how to contact you by electronic and paper mail. 311Also add information on how to contact you by electronic and paper mail.
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
313If the program is interactive, make it output a short notice like this 313If the program is interactive, make it output a short notice like this
314when it starts in an interactive mode: 314when it starts in an interactive mode:
315 315
316 Gnomovision version 69, Copyright (C) year name of author 316 Gnomovision version 69, Copyright (C) year name of author
317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 This is free software, and you are welcome to redistribute it 318 This is free software, and you are welcome to redistribute it
319 under certain conditions; type `show c' for details. 319 under certain conditions; type `show c' for details.
diff --git a/src/ChangeLog b/src/ChangeLog
index 046d1a321fe..3753d88a0e8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,81 @@
12005-07-03 Richard M. Stallman <rms@gnu.org>
2
3 * xdisp.c (try_window): Fix previous change in how it handles
4 a partially-visible line or one only partly past the margin.
5
6 * window.c (window_scroll_pixel_based): Take account
7 of this_scroll_margin when finding point when scrolling up.
8
92005-06-29 Ralf Angeli <angeli@iwi.uni-sb.de>
10
11 * window.c (window_scroll_pixel_based, window_scroll_line_based):
12 Handle `scroll-preserve-screen-position' non-nil, non-t specially.
13 (syms_of_window): <scroll-preserve-screen-position>: Doc fix.
14
152005-07-02 Juri Linkov <juri@jurta.org>
16
17 * w32term.c (w32_draw_vertical_window_border): Use foreground of
18 VERTICAL_BORDER_FACE_ID for vertical border line.
19
202005-07-02 Eli Zaretskii <eliz@gnu.org>
21
22 * fileio.c (Fcopy_file): Rearrange the code that calls fchown and
23 fchmod so that chmod doesn't get called on MSDOS before the file
24 is closed.
25
262005-07-01 Jason Rumney <jasonr@gnu.org>
27
28 * w32term.c (cleartype_active): New flag for enabling sub-pixel
29 workaround.
30 (w32_initialize): Initialize it.
31 (w32_native_per_char_metric): Allow a couple of extra pixels when
32 Cleartype is active.
33
34 * w32term.c (w32_initialize): Move check for screen reader here
35 from syms_of_w32term.
36
372005-06-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
38
39 * xterm.c (handle_one_xevent): bzero compose_status when nbytes
40 is not zero.
41
422005-07-01 Masatake YAMATO <jet@gyve.org>
43
44 * emacs.c (main): Passing ADD_NO_RANDOMIZE to
45 `personality'.
46
472005-06-30 Juri Linkov <juri@jurta.org>
48
49 * xdisp.c (x_draw_vertical_border): If left fringe is not present
50 decrease x coord of vertical border by 1 pixel to not occupy text
51 area of the right window.
52
53 * xterm.c (x_draw_vertical_window_border): Use foreground of
54 VERTICAL_BORDER_FACE_ID for vertical border line.
55
56 * term.c (turn_on_face): In standout mode apply specified
57 fg to bg, and specified bg to fg (this makes the logic of
58 inversion on terminal consistent with X).
59
602005-06-29 Juanma Barranquero <lekktu@gmail.com>
61
62 * eval.c (user_variable_p_eh): New function.
63 (Fuser_variable_p): Use it. Clarify docstring.
64 Return t for aliases of user options, nil for alias loops.
65
662005-06-27 Richard M. Stallman <rms@gnu.org>
67
68 * eval.c (Fdefvar): Improve error message.
69
702005-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
71
72 * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last
73 change.
74
752005-06-27 Juanma Barranquero <lekktu@gmail.com>
76
77 * eval.c (Fdefvar): Don't try to set constant symbols.
78
12005-06-25 Richard M. Stallman <rms@gnu.org> 792005-06-25 Richard M. Stallman <rms@gnu.org>
2 80
3 * macfns.c (Fx_show_tip): Pass new arg to try_window. 81 * macfns.c (Fx_show_tip): Pass new arg to try_window.
@@ -46,17 +124,16 @@
46 * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix. 124 * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix.
47 (syms_of_xdisp) <void-text-area-pointer>: Doc fix. 125 (syms_of_xdisp) <void-text-area-pointer>: Doc fix.
48 126
49 * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on 127 * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows.
50 MSDOS/Windows.
51 128
522005-06-23 Richard M. Stallman <rms@gnu.org> 1292005-06-23 Richard M. Stallman <rms@gnu.org>
53 130
54 * xdisp.c (get_next_display_element): Finish reversing the tests of 131 * xdisp.c (get_next_display_element): Finish reversing the tests of
55 Vnobreak_char_display. 132 Vnobreak_char_display.
56 133
57 * xdisp.c (Vnobreak_char_display): Renamed from Vshow_nonbreak_escape. 134 * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape.
58 All uses changed. 135 All uses changed.
59 (Qnobreak_space): Renamed from Qno_break_space. All uses changed. 136 (Qnobreak_space): Rename from Qno_break_space. All uses changed.
60 (syms_of_xdisp): Define nobreak-char-display and nobreak-space. 137 (syms_of_xdisp): Define nobreak-char-display and nobreak-space.
61 138
62 * fileio.c (Frename_file): Preserve owner and group, if possible, 139 * fileio.c (Frename_file): Preserve owner and group, if possible,
@@ -352,8 +429,7 @@
352 429
3532005-06-06 Eli Zaretskii <eliz@gnu.org> 4302005-06-06 Eli Zaretskii <eliz@gnu.org>
354 431
355 * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): 432 * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros.
356 Remove macros.
357 433
358 * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. 434 * unexw32.c (RVA_TO_PTR): Move here from w32heap.h.
359 435
diff --git a/src/emacs.c b/src/emacs.c
index c26dc9de9e3..5e0f42981f7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -919,7 +919,13 @@ main (argc, argv
919 { 919 {
920 /* Set this so we only do this once. */ 920 /* Set this so we only do this once. */
921 putenv("EMACS_HEAP_EXEC=true"); 921 putenv("EMACS_HEAP_EXEC=true");
922 personality (PER_LINUX32); 922
923 /* A flag to turn off address randomization which is introduced
924 in linux kernel shipped with fedora core 4 */
925#define ADD_NO_RANDOMIZE 0x0040000
926 personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
927#undef ADD_NO_RANDOMIZE
928
923 execvp (argv[0], argv); 929 execvp (argv[0], argv);
924 930
925 /* If the exec fails, try to dump anyway. */ 931 /* If the exec fails, try to dump anyway. */
diff --git a/src/eval.c b/src/eval.c
index c33021da7b7..17e9f7f4360 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -806,6 +806,10 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
806 register Lisp_Object sym, tem, tail; 806 register Lisp_Object sym, tem, tail;
807 807
808 sym = Fcar (args); 808 sym = Fcar (args);
809 if (SYMBOL_CONSTANT_P (sym))
810 error ("Constant symbol `%s' specified in defvar",
811 SDATA (SYMBOL_NAME (sym)));
812
809 tail = Fcdr (args); 813 tail = Fcdr (args);
810 if (!NILP (Fcdr (Fcdr (tail)))) 814 if (!NILP (Fcdr (Fcdr (tail))))
811 error ("Too many arguments"); 815 error ("Too many arguments");
@@ -885,12 +889,24 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
885 return sym; 889 return sym;
886} 890}
887 891
892/* Error handler used in Fuser_variable_p. */
893static Lisp_Object
894user_variable_p_eh (ignore)
895 Lisp_Object ignore;
896{
897 return Qnil;
898}
899
888DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0, 900DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0,
889 doc: /* Returns t if VARIABLE is intended to be set and modified by users. 901 doc: /* Return t if VARIABLE is intended to be set and modified by users.
890\(The alternative is a variable used internally in a Lisp program.) 902\(The alternative is a variable used internally in a Lisp program.)
891Determined by whether the first character of the documentation 903A variable is a user variable if
892for the variable is `*' or if the variable is customizable (has a non-nil 904\(1) the first character of its documentation is `*', or
893value of `standard-value' or of `custom-autoload' on its property list). */) 905\(2) it is customizable (its property list contains a non-nil value
906 of `standard-value' or `custom-autoload'), or
907\(3) it is an alias for another user variable.
908Return nil if VARIABLE is an alias and there is a loop in the
909chain of symbols. */)
894 (variable) 910 (variable)
895 Lisp_Object variable; 911 Lisp_Object variable;
896{ 912{
@@ -899,23 +915,37 @@ value of `standard-value' or of `custom-autoload' on its property list). */)
899 if (!SYMBOLP (variable)) 915 if (!SYMBOLP (variable))
900 return Qnil; 916 return Qnil;
901 917
902 documentation = Fget (variable, Qvariable_documentation); 918 /* If indirect and there's an alias loop, don't check anything else. */
903 if (INTEGERP (documentation) && XINT (documentation) < 0) 919 if (XSYMBOL (variable)->indirect_variable
904 return Qt; 920 && NILP (internal_condition_case_1 (indirect_variable, variable,
905 if (STRINGP (documentation) 921 Qt, user_variable_p_eh)))
906 && ((unsigned char) SREF (documentation, 0) == '*')) 922 return Qnil;
907 return Qt; 923
908 /* If it is (STRING . INTEGER), a negative integer means a user variable. */ 924 while (1)
909 if (CONSP (documentation) 925 {
910 && STRINGP (XCAR (documentation)) 926 documentation = Fget (variable, Qvariable_documentation);
911 && INTEGERP (XCDR (documentation)) 927 if (INTEGERP (documentation) && XINT (documentation) < 0)
912 && XINT (XCDR (documentation)) < 0) 928 return Qt;
913 return Qt; 929 if (STRINGP (documentation)
914 /* Customizable? See `custom-variable-p'. */ 930 && ((unsigned char) SREF (documentation, 0) == '*'))
915 if ((!NILP (Fget (variable, intern ("standard-value")))) 931 return Qt;
916 || (!NILP (Fget (variable, intern ("custom-autoload"))))) 932 /* If it is (STRING . INTEGER), a negative integer means a user variable. */
917 return Qt; 933 if (CONSP (documentation)
918 return Qnil; 934 && STRINGP (XCAR (documentation))
935 && INTEGERP (XCDR (documentation))
936 && XINT (XCDR (documentation)) < 0)
937 return Qt;
938 /* Customizable? See `custom-variable-p'. */
939 if ((!NILP (Fget (variable, intern ("standard-value"))))
940 || (!NILP (Fget (variable, intern ("custom-autoload")))))
941 return Qt;
942
943 if (!XSYMBOL (variable)->indirect_variable)
944 return Qnil;
945
946 /* An indirect variable? Let's follow the chain. */
947 variable = XSYMBOL (variable)->value;
948 }
919} 949}
920 950
921DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, 951DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0,
diff --git a/src/fileio.c b/src/fileio.c
index ac81f73df16..24820f6d3f9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2523,7 +2523,7 @@ uid and gid of FILE to NEWNAME. */)
2523 copyable by us. */ 2523 copyable by us. */
2524 input_file_statable_p = (fstat (ifd, &st) >= 0); 2524 input_file_statable_p = (fstat (ifd, &st) >= 0);
2525 2525
2526#if !defined (DOS_NT) || __DJGPP__ > 1 2526#if !defined (MSDOS) || __DJGPP__ > 1
2527 if (out_st.st_mode != 0 2527 if (out_st.st_mode != 0
2528 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) 2528 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
2529 { 2529 {
@@ -2576,25 +2576,16 @@ uid and gid of FILE to NEWNAME. */)
2576 report_file_error ("I/O error", Fcons (newname, Qnil)); 2576 report_file_error ("I/O error", Fcons (newname, Qnil));
2577 immediate_quit = 0; 2577 immediate_quit = 0;
2578 2578
2579 /* Preserve the owner and group, if requested. */ 2579#ifndef MSDOS
2580 if (input_file_statable_p && ! NILP (preserve_uid_gid)) 2580 /* Preserve the original file modes, and if requested, also its
2581 fchown (ofd, st.st_uid, st.st_gid); 2581 owner and group. */
2582
2583 if (input_file_statable_p) 2582 if (input_file_statable_p)
2584 { 2583 {
2585#ifndef MSDOS 2584 if (! NILP (preserve_uid_gid))
2585 fchown (ofd, st.st_uid, st.st_gid);
2586 fchmod (ofd, st.st_mode & 07777); 2586 fchmod (ofd, st.st_mode & 07777);
2587#else /* MSDOS */
2588#if defined (__DJGPP__) && __DJGPP__ > 1
2589 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
2590 and if it can't, it tells so. Otherwise, under MSDOS we usually
2591 get only the READ bit, which will make the copied file read-only,
2592 so it's better not to chmod at all. */
2593 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
2594 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2595#endif /* DJGPP version 2 or newer */
2596#endif /* MSDOS */
2597 } 2587 }
2588#endif /* not MSDOS */
2598 2589
2599 /* Closing the output clobbers the file times on some systems. */ 2590 /* Closing the output clobbers the file times on some systems. */
2600 if (emacs_close (ofd) < 0) 2591 if (emacs_close (ofd) < 0)
@@ -2616,7 +2607,19 @@ uid and gid of FILE to NEWNAME. */)
2616 } 2607 }
2617 2608
2618 emacs_close (ifd); 2609 emacs_close (ifd);
2619#endif /* WINDOWSNT */ 2610
2611#if defined (__DJGPP__) && __DJGPP__ > 1
2612 if (input_file_statable_p)
2613 {
2614 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
2615 and if it can't, it tells so. Otherwise, under MSDOS we usually
2616 get only the READ bit, which will make the copied file read-only,
2617 so it's better not to chmod at all. */
2618 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
2619 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2620 }
2621#endif /* DJGPP version 2 or newer */
2622#endif /* not WINDOWSNT */
2620 2623
2621 /* Discard the unwind protects. */ 2624 /* Discard the unwind protects. */
2622 specpdl_ptr = specpdl + count; 2625 specpdl_ptr = specpdl + count;
diff --git a/src/macterm.c b/src/macterm.c
index f5c71ab2c24..a97dc6203f6 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -7640,6 +7640,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
7640 default: 7640 default:
7641 break; 7641 break;
7642 } 7642 }
7643 break;
7643 7644
7644 case kEventClassKeyboard: 7645 case kEventClassKeyboard:
7645 switch (GetEventKind (eventRef)) 7646 switch (GetEventKind (eventRef))
@@ -7662,6 +7663,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
7662 default: 7663 default:
7663 break; 7664 break;
7664 } 7665 }
7666 break;
7665 7667
7666 default: 7668 default:
7667 break; 7669 break;
diff --git a/src/term.c b/src/term.c
index 1d165d36aca..4fbf87daba8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1850,14 +1850,20 @@ turn_on_face (f, face_id)
1850 1850
1851 if (fg >= 0 && tty->TS_set_foreground) 1851 if (fg >= 0 && tty->TS_set_foreground)
1852 { 1852 {
1853 p = tparam (tty->TS_set_foreground, NULL, 0, (int) fg); 1853 if (tty->standout_mode)
1854 p = tparam (tty->TS_set_background, NULL, 0, (int) fg);
1855 else
1856 p = tparam (tty->TS_set_foreground, NULL, 0, (int) fg);
1854 OUTPUT (tty, p); 1857 OUTPUT (tty, p);
1855 xfree (p); 1858 xfree (p);
1856 } 1859 }
1857 1860
1858 if (bg >= 0 && tty->TS_set_background) 1861 if (bg >= 0 && tty->TS_set_background)
1859 { 1862 {
1860 p = tparam (tty->TS_set_background, NULL, 0, (int) bg); 1863 if (tty->standout_mode)
1864 p = tparam (tty->TS_set_foreground, NULL, 0, (int) bg);
1865 else
1866 p = tparam (tty->TS_set_background, NULL, 0, (int) bg);
1861 OUTPUT (tty, p); 1867 OUTPUT (tty, p);
1862 xfree (p); 1868 xfree (p);
1863 } 1869 }
diff --git a/src/w32term.c b/src/w32term.c
index 57f27d70e4d..9e6f50e9c21 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -138,6 +138,9 @@ int w32_use_visible_system_caret;
138 for Far East languages. */ 138 for Far East languages. */
139int w32_enable_unicode_output; 139int w32_enable_unicode_output;
140 140
141/* Flag to enable Cleartype hack for font metrics. */
142static int cleartype_active;
143
141DWORD dwWindowsThreadId = 0; 144DWORD dwWindowsThreadId = 0;
142HANDLE hWindowsThread = NULL; 145HANDLE hWindowsThread = NULL;
143DWORD dwMainThreadId = 0; 146DWORD dwMainThreadId = 0;
@@ -507,6 +510,7 @@ w32_draw_vertical_window_border (w, x, y0, y1)
507 struct frame *f = XFRAME (WINDOW_FRAME (w)); 510 struct frame *f = XFRAME (WINDOW_FRAME (w));
508 RECT r; 511 RECT r;
509 HDC hdc; 512 HDC hdc;
513 struct face *face;
510 514
511 r.left = x; 515 r.left = x;
512 r.right = x + 1; 516 r.right = x + 1;
@@ -514,7 +518,12 @@ w32_draw_vertical_window_border (w, x, y0, y1)
514 r.bottom = y1; 518 r.bottom = y1;
515 519
516 hdc = get_frame_dc (f); 520 hdc = get_frame_dc (f);
517 w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r); 521 face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID);
522 if (face)
523 w32_fill_rect (f, hdc, face->foreground, &r);
524 else
525 w32_fill_rect (f, hdc, FRAME_FOREGROUND_PIXEL (f), &r);
526
518 release_frame_dc (f, hdc); 527 release_frame_dc (f, hdc);
519} 528}
520 529
@@ -907,6 +916,16 @@ w32_native_per_char_metric (font, char2b, font_type, pcm)
907 int real_width; 916 int real_width;
908 GetCharWidth (hdc, *char2b, *char2b, &real_width); 917 GetCharWidth (hdc, *char2b, *char2b, &real_width);
909#endif 918#endif
919 if (cleartype_active)
920 {
921 /* Cleartype antialiasing causes characters to overhang
922 by a pixel on each side compared with what GetCharABCWidths
923 reports. */
924 char_widths.abcA -= 1;
925 char_widths.abcC -= 1;
926 char_widths.abcB += 2;
927 }
928
910 pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; 929 pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC;
911#if 0 930#if 0
912 /* As far as I can tell, this is the best way to determine what 931 /* As far as I can tell, this is the best way to determine what
@@ -6404,6 +6423,12 @@ w32_initialize ()
6404 w32_system_caret_x = 0; 6423 w32_system_caret_x = 0;
6405 w32_system_caret_y = 0; 6424 w32_system_caret_y = 0;
6406 6425
6426 /* Initialize w32_use_visible_system_caret based on whether a screen
6427 reader is in use. */
6428 if (!SystemParametersInfo (SPI_GETSCREENREADER, 0,
6429 &w32_use_visible_system_caret, 0))
6430 w32_use_visible_system_caret = 0;
6431
6407 last_tool_bar_item = -1; 6432 last_tool_bar_item = -1;
6408 any_help_event_p = 0; 6433 any_help_event_p = 0;
6409 6434
@@ -6448,6 +6473,8 @@ w32_initialize ()
6448 /* Dynamically link to optional system components. */ 6473 /* Dynamically link to optional system components. */
6449 { 6474 {
6450 HANDLE user_lib = LoadLibrary ("user32.dll"); 6475 HANDLE user_lib = LoadLibrary ("user32.dll");
6476 UINT smoothing_type;
6477 BOOL smoothing_enabled;
6451 6478
6452#define LOAD_PROC(fn) pfn##fn = (void *) GetProcAddress (user_lib, #fn) 6479#define LOAD_PROC(fn) pfn##fn = (void *) GetProcAddress (user_lib, #fn)
6453 6480
@@ -6468,6 +6495,28 @@ w32_initialize ()
6468 effectively form the border of the main scroll bar range. */ 6495 effectively form the border of the main scroll bar range. */
6469 vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border 6496 vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border
6470 = GetSystemMetrics (SM_CYVSCROLL); 6497 = GetSystemMetrics (SM_CYVSCROLL);
6498
6499 /* Constants that are not always defined by the system headers
6500 since they only exist on certain versions of Windows. */
6501#ifndef SPI_GETFONTSMOOTHING
6502#define SPI_GETFONTSMOOTHING 0x4A
6503#endif
6504#ifndef SPI_GETFONTSMOOTHINGTYPE
6505#define SPI_GETFONTSMOOTHINGTYPE 0x0200A
6506#endif
6507#ifndef FE_FONTSMOOTHINGCLEARTYPE
6508#define FE_FONTSMOOTHINGCLEARTYPE 0x2
6509#endif
6510
6511 /* Determine if Cleartype is in use. Used to enable a hack in
6512 the char metric calculations which adds extra pixels to
6513 compensate for the "sub-pixels" that are not counted by the
6514 system APIs. */
6515 cleartype_active =
6516 SystemParametersInfo (SPI_GETFONTSMOOTHING, 0, &smoothing_enabled, 0)
6517 && smoothing_enabled
6518 && SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE, 0, &smoothing_type, 0)
6519 && smoothing_type == FE_FONTSMOOTHINGCLEARTYPE;
6471 } 6520 }
6472} 6521}
6473 6522
@@ -6537,11 +6586,7 @@ software is running as it starts up.
6537When this variable is set, other variables affecting the appearance of 6586When this variable is set, other variables affecting the appearance of
6538the cursor have no effect. */); 6587the cursor have no effect. */);
6539 6588
6540 /* Initialize w32_use_visible_system_caret based on whether a screen 6589 w32_use_visible_system_caret = 0;
6541 reader is in use. */
6542 if (!SystemParametersInfo (SPI_GETSCREENREADER, 0,
6543 &w32_use_visible_system_caret, 0))
6544 w32_use_visible_system_caret = 0;
6545 6590
6546 /* We don't yet support this, but defining this here avoids whining 6591 /* We don't yet support this, but defining this here avoids whining
6547 from cus-start.el and other places, like "M-x set-variable". */ 6592 from cus-start.el and other places, like "M-x set-variable". */
diff --git a/src/window.c b/src/window.c
index df284420ddf..38d680fbc72 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4785,7 +4785,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4785 /* We moved the window start towards ZV, so PT may be now 4785 /* We moved the window start towards ZV, so PT may be now
4786 in the scroll margin at the top. */ 4786 in the scroll margin at the top. */
4787 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4787 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
4788 if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin) 4788 if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin
4789 && (NILP (Vscroll_preserve_screen_position)
4790 || EQ (Vscroll_preserve_screen_position, Qt)))
4789 /* We found PT at a legitimate height. Leave it alone. */ 4791 /* We found PT at a legitimate height. Leave it alone. */
4790 ; 4792 ;
4791 else if (preserve_y >= 0) 4793 else if (preserve_y >= 0)
@@ -4822,7 +4824,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4822 /* We moved the window start towards BEGV, so PT may be now 4824 /* We moved the window start towards BEGV, so PT may be now
4823 in the scroll margin at the bottom. */ 4825 in the scroll margin at the bottom. */
4824 move_it_to (&it, PT, -1, 4826 move_it_to (&it, PT, -1,
4825 it.last_visible_y - this_scroll_margin - 1, -1, 4827 (it.last_visible_y - CURRENT_HEADER_LINE_HEIGHT (w)
4828 - this_scroll_margin - 1),
4829 -1,
4826 MOVE_TO_POS | MOVE_TO_Y); 4830 MOVE_TO_POS | MOVE_TO_Y);
4827 4831
4828 /* Save our position, in case it's correct. */ 4832 /* Save our position, in case it's correct. */
@@ -4838,7 +4842,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4838 partial_p = it.current_y > it.last_visible_y; 4842 partial_p = it.current_y > it.last_visible_y;
4839 } 4843 }
4840 4844
4841 if (charpos == PT && !partial_p) 4845 if (charpos == PT && !partial_p
4846 && (NILP (Vscroll_preserve_screen_position)
4847 || EQ (Vscroll_preserve_screen_position, Qt)))
4842 /* We found PT before we found the display margin, so PT is ok. */ 4848 /* We found PT before we found the display margin, so PT is ok. */
4843 ; 4849 ;
4844 else if (preserve_y >= 0) 4850 else if (preserve_y >= 0)
@@ -4953,7 +4959,8 @@ window_scroll_line_based (window, n, whole, noerror)
4953 the window-scroll-functions. */ 4959 the window-scroll-functions. */
4954 w->force_start = Qt; 4960 w->force_start = Qt;
4955 4961
4956 if (whole && !NILP (Vscroll_preserve_screen_position)) 4962 if (!NILP (Vscroll_preserve_screen_position)
4963 && (whole || !EQ (Vscroll_preserve_screen_position, Qt)))
4957 { 4964 {
4958 SET_PT_BOTH (pos, pos_byte); 4965 SET_PT_BOTH (pos, pos_byte);
4959 Fvertical_motion (make_number (original_vpos), window); 4966 Fvertical_motion (make_number (original_vpos), window);
@@ -6916,9 +6923,13 @@ If there is only one window, it is split regardless of this value. */);
6916 6923
6917 DEFVAR_LISP ("scroll-preserve-screen-position", 6924 DEFVAR_LISP ("scroll-preserve-screen-position",
6918 &Vscroll_preserve_screen_position, 6925 &Vscroll_preserve_screen_position,
6919 doc: /* *Non-nil means scroll commands move point to keep its screen line unchanged. 6926 doc: /* *Controls if scroll commands move point to keep its screen line unchanged.
6920This is only when it is impossible to keep point fixed and still 6927A value of nil means point does not keep its screen position except
6921scroll as specified. */); 6928at the scroll margin or window boundary respectively.
6929A value of t means point keeps its screen position if the scroll
6930command moved it vertically out of the window, e.g. when scrolling
6931by full screens.
6932Any other value means point always keeps its screen position. */);
6922 Vscroll_preserve_screen_position = Qnil; 6933 Vscroll_preserve_screen_position = Qnil;
6923 6934
6924 DEFVAR_LISP ("window-configuration-change-hook", 6935 DEFVAR_LISP ("window-configuration-change-hook",
diff --git a/src/xdisp.c b/src/xdisp.c
index 1fc5a8b277c..40eaaa46779 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12748,11 +12748,11 @@ try_window (window, pos, check_margins)
12748 12748
12749 if ((w->cursor.y < this_scroll_margin 12749 if ((w->cursor.y < this_scroll_margin
12750 && CHARPOS (pos) > BEGV) 12750 && CHARPOS (pos) > BEGV)
12751 /* Old redisplay didn't take scroll margin into account at the bottom, 12751 /* rms: considering make_cursor_line_fully_visible_p here
12752 but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */ 12752 seems to give wrong results. We don't want to recenter
12753 || (w->cursor.y + (make_cursor_line_fully_visible_p 12753 when the last line is partly visible, we want to allow
12754 ? cursor_height + this_scroll_margin 12754 that case to be handled in the usual way. */
12755 : 1)) > it.last_visible_y) 12755 || (w->cursor.y + 1) > it.last_visible_y)
12756 { 12756 {
12757 w->cursor.vpos = -1; 12757 w->cursor.vpos = -1;
12758 clear_glyph_matrix (w->desired_matrix); 12758 clear_glyph_matrix (w->desired_matrix);
@@ -22409,6 +22409,9 @@ x_draw_vertical_border (w)
22409 window_box_edges (w, -1, &x0, &y0, &x1, &y1); 22409 window_box_edges (w, -1, &x0, &y0, &x1, &y1);
22410 y1 -= 1; 22410 y1 -= 1;
22411 22411
22412 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
22413 x1 -= 1;
22414
22412 FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1); 22415 FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1);
22413 } 22416 }
22414 else if (!WINDOW_LEFTMOST_P (w) 22417 else if (!WINDOW_LEFTMOST_P (w)
@@ -22419,6 +22422,9 @@ x_draw_vertical_border (w)
22419 window_box_edges (w, -1, &x0, &y0, &x1, &y1); 22422 window_box_edges (w, -1, &x0, &y0, &x1, &y1);
22420 y1 -= 1; 22423 y1 -= 1;
22421 22424
22425 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
22426 x0 -= 1;
22427
22422 FRAME_RIF (f)->draw_vertical_window_border (w, x0, y0, y1); 22428 FRAME_RIF (f)->draw_vertical_window_border (w, x0, y0, y1);
22423 } 22429 }
22424} 22430}
diff --git a/src/xterm.c b/src/xterm.c
index 68d2e46cc77..1a52e0e5893 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -546,6 +546,12 @@ x_draw_vertical_window_border (w, x, y0, y1)
546 int x, y0, y1; 546 int x, y0, y1;
547{ 547{
548 struct frame *f = XFRAME (WINDOW_FRAME (w)); 548 struct frame *f = XFRAME (WINDOW_FRAME (w));
549 struct face *face;
550
551 face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID);
552 if (face)
553 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
554 face->foreground);
549 555
550 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 556 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
551 f->output_data.x->normal_gc, x, y0, x, y1); 557 f->output_data.x->normal_gc, x, y0, x, y1);
@@ -6294,6 +6300,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6294 if (compose_status.chars_matched > 0 && nbytes == 0) 6300 if (compose_status.chars_matched > 0 && nbytes == 0)
6295 break; 6301 break;
6296 6302
6303 bzero (&compose_status, sizeof (compose_status));
6297 orig_keysym = keysym; 6304 orig_keysym = keysym;
6298 6305
6299 /* Common for all keysym input events. */ 6306 /* Common for all keysym input events. */