From 3b6536b10170a03da2d0b4682513a2ec3d5df4e5 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 7 Nov 2004 01:57:27 +0000 Subject: Whitespace fixup. --- src/emacs.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/emacs.c b/src/emacs.c index 67efa4ae4e5..e24b79aa116 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1620,16 +1620,14 @@ main (argc, argv keys_of_minibuf (); keys_of_window (); } - else + else { - /* - Initialization that must be done even if the global variable - initialized is non zero - */ + /* Initialization that must be done even if the global variable + initialized is non zero. */ #ifdef HAVE_NTGUI globals_of_w32fns (); globals_of_w32menu (); -#endif /* end #ifdef HAVE_NTGUI */ +#endif /* HAVE_NTGUI */ } if (!noninteractive) @@ -2279,7 +2277,7 @@ synchronize_locale (category, plocale, desired_locale) { *plocale = desired_locale; setlocale (category, (STRINGP (desired_locale) - ? (char *)(SDATA (desired_locale)) + ? (char *) SDATA (desired_locale) : "")); } } -- cgit v1.2.1 From e1e419ecc6263bc887bc4c4a23f1db4e8582da81 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 7 Nov 2004 03:47:09 +0000 Subject: (merge_named_face): GCPRO the face_name in the named_merge_point struct that we make. (merge_face_heights): Eliminate GCPRO arg. All callers changed. --- src/xfaces.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index 8f604e33cce..1e0de77ea3b 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3432,8 +3432,8 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) call into lisp. */ Lisp_Object -merge_face_heights (from, to, invalid, gcpro) - Lisp_Object from, to, invalid, gcpro; +merge_face_heights (from, to, invalid) + Lisp_Object from, to, invalid; { Lisp_Object result = invalid; @@ -3458,16 +3458,11 @@ merge_face_heights (from, to, invalid, gcpro) /* Call function with current height as argument. From is the new height. */ Lisp_Object args[2]; - struct gcpro gcpro1; - - GCPRO1 (gcpro); args[0] = from; args[1] = to; result = safe_call (2, args); - UNGCPRO; - /* Ensure that if TO was absolute, so is the result. */ if (INTEGERP (to) && !INTEGERP (result)) result = invalid; @@ -3520,8 +3515,7 @@ merge_face_vectors (f, from, to, named_merge_points) if (!UNSPECIFIEDP (from[i])) { if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) - to[i] = merge_face_heights (from[i], to[i], to[i], - named_merge_points); + to[i] = merge_face_heights (from[i], to[i], to[i]); else to[i] = from[i]; } @@ -3548,11 +3542,16 @@ merge_named_face (f, face_name, to, named_merge_points) if (push_named_merge_point (&named_merge_point, face_name, &named_merge_points)) { + struct gcpro gcpro1; Lisp_Object from[LFACE_VECTOR_SIZE]; int ok = get_lface_attributes (f, face_name, from, 0); if (ok) - merge_face_vectors (f, from, to, named_merge_points); + { + GCPRO1 (named_merge_point.face_name); + merge_face_vectors (f, from, to, named_merge_points); + UNGCPRO; + } return ok; } @@ -3643,8 +3642,7 @@ merge_face_ref (f, face_ref, to, err_msgs, named_merge_points) else if (EQ (keyword, QCheight)) { Lisp_Object new_height = - merge_face_heights (value, to[LFACE_HEIGHT_INDEX], - Qnil, Qnil); + merge_face_heights (value, to[LFACE_HEIGHT_INDEX], Qnil); if (! NILP (new_height)) to[LFACE_HEIGHT_INDEX] = new_height; @@ -4031,7 +4029,7 @@ FRAME 0 means change the face on all frames, and change the default /* The default face must have an absolute size, otherwise, we do a test merge with a random height to see if VALUE's ok. */ - : merge_face_heights (value, make_number (10), Qnil, Qnil)); + : merge_face_heights (value, make_number (10), Qnil)); if (!INTEGERP (test) || XINT (test) <= 0) signal_error ("Invalid face height", value); @@ -4737,7 +4735,7 @@ the result will be absolute, otherwise it will be relative. */) if (EQ (value1, Qunspecified)) return value2; else if (EQ (attribute, QCheight)) - return merge_face_heights (value1, value2, value1, Qnil); + return merge_face_heights (value1, value2, value1); else return value1; } -- cgit v1.2.1 From c9aa6a41844ea095db79d56251cf0bf23e3c5376 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 7 Nov 2004 03:48:56 +0000 Subject: (Fcall_interactively): Avoid reusing EVENT for other data. --- src/callint.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/callint.c b/src/callint.c index da88693cd78..2b8ae86f16f 100644 --- a/src/callint.c +++ b/src/callint.c @@ -451,25 +451,25 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) string++; else if (*string == '@') { - Lisp_Object event; + Lisp_Object event, tem; event = (next_event < key_count ? XVECTOR (keys)->contents[next_event] : Qnil); if (EVENT_HAS_PARAMETERS (event) - && (event = XCDR (event), CONSP (event)) - && (event = XCAR (event), CONSP (event)) - && (event = XCAR (event), WINDOWP (event))) + && (tem = XCDR (event), CONSP (tem)) + && (tem = XCAR (tem), CONSP (tem)) + && (tem = XCAR (tem), WINDOWP (tem))) { - if (MINI_WINDOW_P (XWINDOW (event)) - && ! (minibuf_level > 0 && EQ (event, minibuf_window))) + if (MINI_WINDOW_P (XWINDOW (tem)) + && ! (minibuf_level > 0 && EQ (tem, minibuf_window))) error ("Attempt to select inactive minibuffer window"); /* If the current buffer wants to clean up, let it. */ if (!NILP (Vmouse_leave_buffer_hook)) call1 (Vrun_hooks, Qmouse_leave_buffer_hook); - Fselect_window (event, Qnil); + Fselect_window (tem, Qnil); } string++; } -- cgit v1.2.1 From f28c1bd9cd71668830a1db49d8e15be8a817c84f Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 7 Nov 2004 03:50:11 +0000 Subject: (command_loop_1): Change Vtransient_mark_mode before deciding whether to inctivate mark. --- src/ChangeLog | 12 +++++++++++- src/keyboard.c | 18 ++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b65bb2d5714..ea570820e1a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2004-11-06 Richard M. Stallman + + * callint.c (Fcall_interactively): Avoid reusing EVENT for other data. + + * xfaces.c (merge_named_face): GCPRO the face_name in the + named_merge_point struct that we make. + (merge_face_heights): Eliminate GCPRO arg. All callers changed. + + * keyboard.c (command_loop_1): Change Vtransient_mark_mode + before deciding whether to inactivate mark. + 2004-11-06 Lars Brinkhoff * config.in: Regenerate (add HAVE_GETRUSAGE). @@ -17,7 +28,6 @@ * xmenu.c (popup_get_selection, create_and_show_popup_menu) (create_and_show_dialog): Revert change from 2004-10-31. - 2004-11-05 Luc Teirlinck * macros.c (syms_of_macros) : Doc fix. diff --git a/src/keyboard.c b/src/keyboard.c index d145ec50d2c..e2c21793c6c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1840,6 +1840,14 @@ command_loop_1 () if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks)) { + /* Setting transient-mark-mode to `only' is a way of + turning it on for just one command. */ + + if (EQ (Vtransient_mark_mode, Qidentity)) + Vtransient_mark_mode = Qnil; + if (EQ (Vtransient_mark_mode, Qonly)) + Vtransient_mark_mode = Qidentity; + if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) { /* We could also call `deactivate'mark'. */ @@ -1855,16 +1863,6 @@ command_loop_1 () call1 (Vrun_hooks, intern ("activate-mark-hook")); } - /* Setting transient-mark-mode to `only' is a way of - turning it on for just one command. */ - if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks)) - { - if (EQ (Vtransient_mark_mode, Qidentity)) - Vtransient_mark_mode = Qnil; - if (EQ (Vtransient_mark_mode, Qonly)) - Vtransient_mark_mode = Qidentity; - } - finalize: if (current_buffer == prev_buffer -- cgit v1.2.1 From 31141c132b0e914551de73972577d3ae30d435dd Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Sun, 7 Nov 2004 05:57:08 +0000 Subject: editfns.c: Need to include sys/time.h before resource.h on darwin. --- src/ChangeLog | 4 ++++ src/editfns.c | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ea570820e1a..0e3870669c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-06 Steven Tamm + + * editfns.c: Need to include sys/time.h before resource.h on darwin. + 2004-11-06 Richard M. Stallman * callint.c (Fcall_interactively): Avoid reusing EVENT for other data. diff --git a/src/editfns.c b/src/editfns.c index 2e8134d4495..bcffc545b6a 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -40,6 +40,9 @@ Boston, MA 02111-1307, USA. */ #endif #if defined HAVE_SYS_RESOURCE_H +#ifdef MAC_OSX +#include +#endif #include #endif -- cgit v1.2.1 From 21acf124651cdcfd76317649236a25254f57de1b Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Sun, 7 Nov 2004 05:57:58 +0000 Subject: editfns.c: Adding in better patch --- src/editfns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/editfns.c b/src/editfns.c index bcffc545b6a..e7a2372e912 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -39,10 +39,11 @@ Boston, MA 02111-1307, USA. */ #include #endif -#if defined HAVE_SYS_RESOURCE_H -#ifdef MAC_OSX +#ifdef HAVE_SYS_TIME_H #include #endif + +#if defined HAVE_SYS_RESOURCE_H #include #endif -- cgit v1.2.1 From 238a44a8657ff8cf0feee84619262255b354c55d Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 7 Nov 2004 09:13:26 +0000 Subject: * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in comparisons with integers instead of Lisp_Object address. (Fmsdos_set_keyboard): Declare argument allkeys. * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s. * dired.c: extern declare Fmsdos_downcase_filename on MSDOS to avoid int/Lisp_Object mixup. * fileio.c: Ditto. --- src/ChangeLog | 13 +++++++++++++ src/dired.c | 4 ++++ src/dosfns.c | 6 +++--- src/fileio.c | 1 + src/msdos.c | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0e3870669c0..e73fbe12775 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2004-11-07 Jan Dj,Ad(Brv + + * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in + comparisons with integers instead of Lisp_Object address. + (Fmsdos_set_keyboard): Declare argument allkeys. + + * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s. + + * dired.c: extern declare Fmsdos_downcase_filename on MSDOS to avoid + int/Lisp_Object mixup. + + * fileio.c: Ditto. + 2004-11-06 Steven Tamm * editfns.c: Need to include sys/time.h before resource.h on darwin. diff --git a/src/dired.c b/src/dired.c index e833ceb216b..97df606bb29 100644 --- a/src/dired.c +++ b/src/dired.c @@ -116,6 +116,10 @@ extern int completion_ignore_case; extern Lisp_Object Vcompletion_regexp_list; extern Lisp_Object Vfile_name_coding_system, Vdefault_file_name_coding_system; +#ifdef MSDOS +extern Lisp_Object Fmsdos_downcase_filename P_ ((Lisp_Object)); +#endif + Lisp_Object Vcompletion_ignored_extensions; Lisp_Object Qcompletion_ignore_case; Lisp_Object Qdirectory_files; diff --git a/src/dosfns.c b/src/dosfns.c index d9714693507..bd62147ad48 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -110,7 +110,7 @@ Return the updated VECTOR. */) offs = (unsigned long) XINT (address); CHECK_VECTOR (vector); len = XVECTOR (vector)-> size; - if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) + if (len < 1 || len > 2048 || offs < 0 || offs > 0xfffff - len) return Qnil; buf = alloca (len); dosmemget (offs, len, buf); @@ -135,7 +135,7 @@ DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0, offs = (unsigned long) XINT (address); CHECK_VECTOR (vector); len = XVECTOR (vector)-> size; - if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) + if (len < 1 || len > 2048 || offs < 0 || offs > 0xfffff - len) return Qnil; buf = alloca (len); @@ -155,7 +155,7 @@ If the optional argument ALLKEYS is non-nil, the keyboard is mapped for all keys; otherwise it is only used when the ALT key is pressed. The current keyboard layout is available in dos-keyboard-code. */) (country_code, allkeys) - Lisp_Object country_code; + Lisp_Object country_code, allkeys; { CHECK_NUMBER (country_code); if (!dos_set_keyboard (XINT (country_code), !NILP (allkeys))) diff --git a/src/fileio.c b/src/fileio.c index aa37c296eb3..1fd0030a4f7 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -89,6 +89,7 @@ extern int errno; #ifdef MSDOS #include "msdos.h" #include +extern Lisp_Object Fmsdos_downcase_filename P_ ((Lisp_Object)); #if __DJGPP__ >= 2 #include #include diff --git a/src/msdos.c b/src/msdos.c index e0f4527e5ae..d75ea18ea97 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -2320,7 +2320,7 @@ IT_set_frame_parameters (f, alist) /* If we are creating a new frame, begin with the original screen colors used for the initial frame. */ - if (alist == Vdefault_frame_alist + if (EQ (alist, Vdefault_frame_alist) && initial_screen_colors[0] != -1 && initial_screen_colors[1] != -1) { FRAME_FOREGROUND_PIXEL (f) = initial_screen_colors[0]; -- cgit v1.2.1 From b7f349973518f4230643559237363b30f19e1003 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 7 Nov 2004 11:06:32 +0000 Subject: Declare Fmsdos_downcase_filename. --- src/lisp.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/lisp.h b/src/lisp.h index daf23a05f54..7db53961925 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3135,6 +3135,11 @@ extern void syms_of_xterm P_ ((void)); /* Defined in getloadavg.c */ extern int getloadavg P_ ((double [], int)); + +#ifdef MSDOS +/* Defined in msdos.c */ +EXFUN (Fmsdos_downcase_filename, 1); +#endif /* Nonzero means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ -- cgit v1.2.1 From b72915a740baf0b2b2f46230ef3494e1925af4bc Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 7 Nov 2004 11:08:45 +0000 Subject: Don't declare Fmsdos_downcase_filename. --- src/ChangeLog | 6 ++++++ src/dired.c | 4 ---- src/fileio.c | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e73fbe12775..ae4ef621f7e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-11-07 Andreas Schwab + + * lisp.h: Declare Fmsdos_downcase_filename. + * dired.c: Don't declare Fmsdos_downcase_filename. + * fileio.c: Likewise. + 2004-11-07 Jan Dj,Ad(Brv * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in diff --git a/src/dired.c b/src/dired.c index 97df606bb29..e833ceb216b 100644 --- a/src/dired.c +++ b/src/dired.c @@ -116,10 +116,6 @@ extern int completion_ignore_case; extern Lisp_Object Vcompletion_regexp_list; extern Lisp_Object Vfile_name_coding_system, Vdefault_file_name_coding_system; -#ifdef MSDOS -extern Lisp_Object Fmsdos_downcase_filename P_ ((Lisp_Object)); -#endif - Lisp_Object Vcompletion_ignored_extensions; Lisp_Object Qcompletion_ignore_case; Lisp_Object Qdirectory_files; diff --git a/src/fileio.c b/src/fileio.c index 1fd0030a4f7..aa37c296eb3 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -89,7 +89,6 @@ extern int errno; #ifdef MSDOS #include "msdos.h" #include -extern Lisp_Object Fmsdos_downcase_filename P_ ((Lisp_Object)); #if __DJGPP__ >= 2 #include #include -- cgit v1.2.1 From c37caf9d6bd241ec9a2006164441d2b3dd5a5ae8 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sun, 7 Nov 2004 21:59:19 +0000 Subject: * emacs.c (Fdump_emacs): Only output warning on GNU/Linux. --- src/ChangeLog | 4 ++++ src/emacs.c | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ae4ef621f7e..cd1fa804ca2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-07 Jan Dj,Ad(Brv + + * emacs.c (Fdump_emacs): Only output warning on GNU/Linux. + 2004-11-07 Andreas Schwab * lisp.h: Declare Fmsdos_downcase_filename. diff --git a/src/emacs.c b/src/emacs.c index e24b79aa116..3ca1022a08e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2179,16 +2179,19 @@ You must run Emacs in batch mode in order to dump it. */) if (! noninteractive) error ("Dumping Emacs works only in batch mode"); +#ifdef __linux__ if (heap_bss_diff > MAX_HEAP_BSS_DIFF) { fprintf (stderr, "**************************************************\n"); fprintf (stderr, "Warning: Your system has a gap between BSS and the\n"); - fprintf (stderr, "heap. This usually means that exec-shield or\n"); - fprintf (stderr, "something similar is in effect. The dump may fail\n"); - fprintf (stderr, "because of this. See the section about exec-shield\n"); - fprintf (stderr, "in etc/PROBLEMS for more information.\n"); + fprintf (stderr, "heap (%d byte). This usually means that exec-shield\n", + heap_bss_diff); + fprintf (stderr, "or something similar is in effect. The dump may\n"); + fprintf (stderr, "fail because of this. See the section about \n"); + fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n"); fprintf (stderr, "**************************************************\n"); } +#endif /* __linux__ */ /* Bind `command-line-processed' to nil before dumping, so that the dumped Emacs will process its command line -- cgit v1.2.1 From a653f81218951ad4776bdfe3314c76e10f7fb509 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 8 Nov 2004 00:38:48 +0000 Subject: (fontset_pattern_regexp): Cancel my previous change; don't pay attention to '\' before '*'. (fontset_pattern_regexp): Change the meaning of the second arg. (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset. (check_fontset_name): Try NAME as literal at first, and if it failes, try NAME as pattern. --- src/ChangeLog | 9 +++++++++ src/fontset.c | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cd1fa804ca2..b981d8970c1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-11-08 Kenichi Handa + + * fontset.c (fontset_pattern_regexp): Cancel my previous change; + don't pay attention to '\' before '*'. + (fontset_pattern_regexp): Change the meaning of the second arg. + (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset. + (check_fontset_name): Try NAME as literal at first, and if it + failes, try NAME as pattern. + 2004-11-07 Jan Dj,Ad(Brv * emacs.c (Fdump_emacs): Only output warning on GNU/Linux. diff --git a/src/fontset.c b/src/fontset.c index 6d2840ffd26..f3bdc4c235e 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -796,7 +796,7 @@ fontset_pattern_regexp (pattern) { if (*p0 == '-') ndashes++; - else if (*p0 == '*' && p0 > SDATA (pattern) && p0[-1] != '\\') + else if (*p0 == '*') nstars++; } @@ -811,7 +811,7 @@ fontset_pattern_regexp (pattern) *p1++ = '^'; for (p0 = SDATA (pattern); *p0; p0++) { - if (*p0 == '*' && p0 > SDATA (pattern) && p0[-1] != '\\') + if (*p0 == '*') { if (ndashes < 14) *p1++ = '.'; @@ -835,29 +835,33 @@ fontset_pattern_regexp (pattern) } /* Return ID of the base fontset named NAME. If there's no such - fontset, return -1. */ + fontset, return -1. NAME_PATTERN specifies how to treat NAME as this: + 0: pattern containing '*' and '?' as wildcards + 1: regular expression + 2: literal fontset name +*/ int -fs_query_fontset (name, regexpp) +fs_query_fontset (name, name_pattern) Lisp_Object name; - int regexpp; + int name_pattern; { Lisp_Object tem; int i; name = Fdowncase (name); - if (!regexpp) + if (name_pattern != 1) { tem = Frassoc (name, Vfontset_alias_alist); if (CONSP (tem) && STRINGP (XCAR (tem))) name = XCAR (tem); - else + else if (name_pattern == 0) { tem = fontset_pattern_regexp (name); if (STRINGP (tem)) { name = tem; - regexpp = 1; + name_pattern = 1; } } } @@ -872,7 +876,7 @@ fs_query_fontset (name, regexpp) continue; this_name = FONTSET_NAME (fontset); - if (regexpp + if (name_pattern == 1 ? fast_string_match (name, this_name) >= 0 : !strcmp (SDATA (name), SDATA (this_name))) return i; @@ -963,6 +967,7 @@ FONTLIST is an alist of charsets vs corresponding font name patterns. */) { Lisp_Object fontset, elements, ascii_font; Lisp_Object tem, tail, elt; + int id; (*check_window_system_func) (); @@ -970,10 +975,14 @@ FONTLIST is an alist of charsets vs corresponding font name patterns. */) CHECK_LIST (fontlist); name = Fdowncase (name); - tem = Fquery_fontset (name, Qnil); - if (!NILP (tem)) - error ("Fontset `%s' matches the existing fontset `%s'", - SDATA (name), SDATA (tem)); + id = fs_query_fontset (name, 2); + if (id >= 0) + { + fontset = FONTSET_FROM_ID (id); + tem = FONTSET_NAME (fontset); + error ("Fontset `%s' matches the existing fontset `%s'", + SDATA (name), SDATA (tem)); + } /* Check the validity of FONTLIST while creating a template for fontset elements. */ @@ -1048,7 +1057,11 @@ check_fontset_name (name) return Vdefault_fontset; CHECK_STRING (name); - id = fs_query_fontset (name, 0); + /* First try NAME as literal. */ + id = fs_query_fontset (name, 2); + if (id < 0) + /* For backward compatibility, try again NAME as pattern. */ + id = fs_query_fontset (name, 0); if (id < 0) error ("Fontset `%s' does not exist", SDATA (name)); return FONTSET_FROM_ID (id); -- cgit v1.2.1 From 3c14598ca1769373ea8d71a21864f19c93cc5e90 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 8 Nov 2004 12:04:07 +0000 Subject: Move #include "systime.h" before . Don't include explicitly. Include unconditionally, not just on MacOS. --- src/editfns.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/editfns.c b/src/editfns.c index e7a2372e912..45b7caa280b 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */ #include #include +#include #ifdef VMS #include "vms-pwd.h" @@ -33,15 +34,10 @@ Boston, MA 02111-1307, USA. */ #include #endif -/* Without this, sprintf on Mac OS Classic will produce wrong - result. */ -#ifdef MAC_OS8 -#include -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif +/* systime.h includes which, on some systems, is required + for ; thus systime.h must be included before + */ +#include "systime.h" #if defined HAVE_SYS_RESOURCE_H #include @@ -57,8 +53,6 @@ Boston, MA 02111-1307, USA. */ #include "frame.h" #include "window.h" -#include "systime.h" - #ifdef STDC_HEADERS #include #define MAX_10_EXP DBL_MAX_10_EXP -- cgit v1.2.1 From 3f8ea68c981d4264ad7d5107373cfaca0bb9a2e2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 8 Nov 2004 13:02:27 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b981d8970c1..1757c128151 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-11-08 Eli Zaretskii + + * editfns.c: Move #include "systime.h" before . + Don't include explicitly. + Include unconditionally, not just on MacOS. + 2004-11-08 Kenichi Handa * fontset.c (fontset_pattern_regexp): Cancel my previous change; -- cgit v1.2.1 From bae9677d9551a6aa87028478556b23a90949830b Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 22:11:40 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1757c128151..d9150816605 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-08 Kim F. Storm + + * xdisp.c (fast_find_position): Fix start pos if header line present. + 2004-11-08 Eli Zaretskii * editfns.c: Move #include "systime.h" before . @@ -69,7 +73,7 @@ * xmenu.c (popup_get_selection, create_and_show_popup_menu) (create_and_show_dialog): Revert change from 2004-10-31. - + 2004-11-05 Luc Teirlinck * macros.c (syms_of_macros) : Doc fix. -- cgit v1.2.1 From a78bc3c08a389b62d24b95a2d93b69905b2ff824 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 22:12:13 +0000 Subject: (fast_find_position): Fix start pos if header line present. --- src/xdisp.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 2ed455e7f6b..b934e706c59 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20411,19 +20411,20 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop) int past_end = 0; first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); + if (charpos < MATRIX_ROW_START_CHARPOS (first)) + { + *x = first->x; + *y = first->y; + *hpos = 0; + *vpos = MATRIX_ROW_VPOS (first, w->current_matrix); + return 1; + } + row = row_containing_pos (w, charpos, first, NULL, 0); if (row == NULL) { - if (charpos < MATRIX_ROW_START_CHARPOS (first)) - { - *x = *y = *hpos = *vpos = 0; - return 1; - } - else - { - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); - past_end = 1; - } + row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + past_end = 1; } *x = row->x; -- cgit v1.2.1 From b7127aa8d0dfb639356470be604223e887b04695 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 22:24:51 +0000 Subject: *** empty log message *** --- src/ChangeLog | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d9150816605..49bdc6230a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2004-11-08 Kim F. Storm * xdisp.c (fast_find_position): Fix start pos if header line present. + (note_mouse_highlight): Clear mouse face if we move out of text area. 2004-11-08 Eli Zaretskii -- cgit v1.2.1 From 4674c583e22f243af1fddb6246e4044f9431c028 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 22:25:30 +0000 Subject: (note_mouse_highlight): Clear mouse face if we move out of text area. --- src/xdisp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index b934e706c59..c2d903d347d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20970,8 +20970,10 @@ note_mouse_highlight (f, x, y) /* Which window is that in? */ window = window_from_coordinates (f, x, y, &part, 0, 0, 1); - /* If we were displaying active text in another window, clear that. */ - if (! EQ (window, dpyinfo->mouse_face_window)) + /* If we were displaying active text in another window, clear that. + Also clear if we move out of text area in same window. */ + if (! EQ (window, dpyinfo->mouse_face_window) + || (part != ON_TEXT && !NILP (dpyinfo->mouse_face_window))) clear_mouse_face (dpyinfo); /* Not on a window -> return. */ -- cgit v1.2.1 From b6709e77440e2559089c937f2177a4bc2451697d Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 23:32:56 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 49bdc6230a9..3958f9a1153 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-11-09 Kim F. Storm + + * fringe.c (update_window_fringes): Update fringe bitmaps if + cur and row ends_at_zv_p differs. If bitmaps of a row is updated, + also update previous row to get rid of misc. artifacts. + 2004-11-08 Kim F. Storm * xdisp.c (fast_find_position): Fix start pos if header line present. -- cgit v1.2.1 From 81544a1d1471645fc39b68a03062c6d1ab1c8585 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 8 Nov 2004 23:34:12 +0000 Subject: (update_window_fringes): Update fringe bitmaps if cur and row ends_at_zv_p differs. If bitmaps of a row is updated, also update previous row to get rid of misc. artifacts. --- src/fringe.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/fringe.c b/src/fringe.c index 000095f470a..44c36d12b6b 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -930,6 +930,7 @@ update_window_fringes (w, force_p) if (force_p || row->y != cur->y || row->visible_height != cur->visible_height + || row->ends_at_zv_p != cur->ends_at_zv_p || left != cur->left_fringe_bitmap || right != cur->right_fringe_bitmap || left_face_id != cur->left_fringe_face_id @@ -953,6 +954,9 @@ update_window_fringes (w, force_p) row->right_fringe_bitmap = right; row->left_fringe_face_id = left_face_id; row->right_fringe_face_id = right_face_id; + + if (rn > 0 && row->redraw_fringe_bitmaps_p) + row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; } return redraw_p; -- cgit v1.2.1 From d87a9ab8930c5460b3ca510083679351c4178a7c Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 9 Nov 2004 08:19:51 +0000 Subject: * doc.c: New variable Vbuild_files. (Fsnarf_documentation): If Vbuild_files is nil, populate it with file names from buildobh.lst. Only attach docstrings from files that are in Vbuild_files. (syms_of_doc): Defvar Vbuild_files. * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o and w32*.o. (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked. (mostlyclean): rm buildobj.lst * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs is linked. --- src/ChangeLog | 16 +++++++++++ src/Makefile.in | 8 ++++-- src/doc.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++- src/makefile.w32-in | 3 +++ 4 files changed, 100 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 3958f9a1153..1c413d20c5b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2004-11-09 Jan Dj,Ad(Brv + + * doc.c: New variable Vbuild_files. + (Fsnarf_documentation): If Vbuild_files is nil, populate it with + file names from buildobh.lst. Only attach docstrings from files + that are in Vbuild_files. + (syms_of_doc): Defvar Vbuild_files. + + * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o + and w32*.o. + (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked. + (mostlyclean): rm buildobj.lst + + * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs + is linked. + 2004-11-09 Kim F. Storm * fringe.c (update_window_fringes): Update fringe bitmaps if diff --git a/src/Makefile.in b/src/Makefile.in index 758e74ebf64..48952f674bb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -596,8 +596,10 @@ obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \ These go in the DOC file on all machines in case they are needed there. */ SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o \ - xterm.o xfns.o xmenu.o xselect.o xrdb.o \ - mac.o macterm.o macfns.o macmenu.o fontset.o + xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ + mac.o macterm.o macfns.o macmenu.o fontset.o \ + w32.o w32bdf.o w32console.o w32fns.o w32heap.o w32inevt.o \ + w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o #ifdef TERMINFO @@ -944,6 +946,7 @@ ${libsrc}make-docfile${EXEEXT}: #endif temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT} + echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \ -o temacs ${STARTFILES} ${obj} ${otherobj} \ OBJECTS_MACHINE ${LIBES} @@ -1272,6 +1275,7 @@ mostlyclean: rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a rm -f ../etc/DOC rm -f bootstrap-emacs${EXEEXT} + rm -f buildobj.lst clean: mostlyclean rm -f emacs-*${EXEEXT} emacs${EXEEXT} /**/# This is used in making a distribution. diff --git a/src/doc.c b/src/doc.c index 82df9134f61..406773e6797 100644 --- a/src/doc.c +++ b/src/doc.c @@ -51,6 +51,9 @@ Lisp_Object Vdoc_file_name; Lisp_Object Qfunction_documentation; +/* A list of files used to build this Emacs binary. */ +static Lisp_Object Vbuild_files; + extern Lisp_Object Voverriding_local_map; /* For VMS versions with limited file name syntax, @@ -581,6 +584,7 @@ the same file name is found in the `doc-directory'. */) register char *p, *end; Lisp_Object sym; char *name; + int skip_file = 0; CHECK_STRING (filename); @@ -618,6 +622,54 @@ the same file name is found in the `doc-directory'. */) #endif /* VMS4_4 */ #endif /* VMS */ + /* Vbuild_files is nil when temacs is run, and non-nil after that. */ + if (NILP (Vbuild_files)) + { + size_t cp_size = 0; + size_t to_read; + int nr_read; + char *cp = NULL; + char *beg, *end; + + fd = emacs_open ("buildobj.lst", O_RDONLY, 0); + if (fd < 0) + report_file_error ("Opening file buildobj.lst", Qnil); + + filled = 0; + for (;;) + { + cp_size += 1024; + to_read = cp_size - 1 - filled; + cp = xrealloc (cp, cp_size); + nr_read = emacs_read (fd, &cp[filled], to_read); + filled += nr_read; + if (nr_read < to_read) + break; + } + + emacs_close (fd); + cp[filled] = 0; + + for (beg = cp; *beg; beg = end) + { + int len; + + while (*beg && isspace (*beg)) ++beg; + + for (end = beg; *end && ! isspace (*end); ++end) + if (*end == '/') beg = end+1; /* skip directory part */ + + len = end - beg; + if (len > 4 && end[-4] == '.' && end[-3] == 'o') + len -= 2; /* Just take .o if it ends in .obj */ + + if (len > 0) + Vbuild_files = Fcons (make_string (beg, len), Vbuild_files); + } + + xfree (cp); + } + fd = emacs_open (name, O_RDONLY, 0); if (fd < 0) report_file_error ("Opening doc string file", @@ -640,10 +692,28 @@ the same file name is found in the `doc-directory'. */) if (p != end) { end = (char *) index (p, '\n'); + + /* See if this is a file name, and if it is a file in build-files. */ + if (p[1] == 'S' && end - p > 4 && end[-2] == '.' + && (end[-1] == 'o' || end[-1] == 'c')) + { + int len = end - p - 2; + char *fromfile = alloca (len + 1); + strncpy (fromfile, &p[2], len); + fromfile[len] = 0; + if (fromfile[len-1] == 'c') + fromfile[len-1] = 'o'; + + if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil)) + skip_file = 1; + else + skip_file = 0; + } + sym = oblookup (Vobarray, p + 2, multibyte_chars_in_text (p + 2, end - p - 2), end - p - 2); - if (SYMBOLP (sym)) + if (! skip_file && SYMBOLP (sym)) { /* Attach a docstring to a variable? */ if (p[1] == 'V') @@ -919,6 +989,10 @@ syms_of_doc () doc: /* Name of file containing documentation strings of built-in symbols. */); Vdoc_file_name = Qnil; + DEFVAR_LISP ("build-files", &Vbuild_files, + doc: /* A list of files used to build this Emacs binary. */); + Vbuild_files = Qnil; + defsubr (&Sdocumentation); defsubr (&Sdocumentation_property); defsubr (&Ssnarf_documentation); diff --git a/src/makefile.w32-in b/src/makefile.w32-in index a7efcc4cae5..5a232e28362 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -168,6 +168,9 @@ temacs: $(BLD) $(TEMACS) $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16 + echo $(OBJ0) > $(BLD)/buildobj.lst + echo $(OBJ1) >> $(BLD)/buildobj.lst + echo $(WIN32OBJ) >> $(BLD)/buildobj.lst bootstrap: bootstrap-emacs -- cgit v1.2.1 From a8b16c80cd186806837a96ef101a0c4040ba44f0 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 9 Nov 2004 08:23:44 +0000 Subject: * .cvsignore: Add buildobj.lst. --- src/.gitignore | 1 + src/ChangeLog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/.gitignore b/src/.gitignore index 406ff7cd5e2..48c78a4f3a6 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -17,3 +17,4 @@ obj prefix-args stamp-oldxmenu temacs +buildobj.lst diff --git a/src/ChangeLog b/src/ChangeLog index 1c413d20c5b..f04cb427831 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2004-11-09 Jan Dj,Ad(Brv + * .cvsignore: Add buildobj.lst. + * doc.c: New variable Vbuild_files. (Fsnarf_documentation): If Vbuild_files is nil, populate it with file names from buildobh.lst. Only attach docstrings from files -- cgit v1.2.1 From cdb805a93521d865839ed31a30d3752b2dc3e9e4 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 09:40:07 +0000 Subject: *** empty log message *** --- src/ChangeLog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f04cb427831..bc7954f12d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-11-09 Kim F. Storm + + * process.c (Fmake_network_process): Remove kludge for interrupted + connects on BSD. If connect is interrupted, just close socket and + start over rather than sleeping and retry with same socket. + 2004-11-09 Jan Dj,Ad(Brv * .cvsignore: Add buildobj.lst. @@ -11,7 +17,7 @@ * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o and w32*.o. (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked. - (mostlyclean): rm buildobj.lst + (mostlyclean): rm buildobj.lst * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs is linked. -- cgit v1.2.1 From 4e9dd03b8c61ea20314b74691d5a2f74302e6953 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 09:40:37 +0000 Subject: (Fmake_network_process): Remove kludge for interrupted connects on BSD. If connect is interrupted, just close socket and start over rather than sleeping and retry with same socket. --- src/process.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index bebcd577e9e..00bac03dc2b 100644 --- a/src/process.c +++ b/src/process.c @@ -3023,6 +3023,8 @@ usage: (make-network-process &rest ARGS) */) { int optn, optbits; + retry_connect: + s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); if (s < 0) { @@ -3101,8 +3103,6 @@ usage: (make-network-process &rest ARGS) */) break; } - retry_connect: - immediate_quit = 1; QUIT; @@ -3144,22 +3144,13 @@ usage: (make-network-process &rest ARGS) */) immediate_quit = 0; - if (xerrno == EINTR) - goto retry_connect; - if (xerrno == EADDRINUSE && retry < 20) - { - /* A delay here is needed on some FreeBSD systems, - and it is harmless, since this retrying takes time anyway - and should be infrequent. */ - Fsleep_for (make_number (1), Qnil); - retry++; - goto retry_connect; - } - /* Discard the unwind protect closing S. */ specpdl_ptr = specpdl + count1; emacs_close (s); s = -1; + + if (xerrno == EINTR) + goto retry_connect; } if (s >= 0) -- cgit v1.2.1 From 16bf4e3264ebe086f5a86b16f3adb3e9fdf7dbce Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Tue, 9 Nov 2004 10:59:49 +0000 Subject: * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies to ${OLDXMENU}. --- src/ChangeLog | 7 ++++++- src/Makefile.in | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index bc7954f12d1..74903bd1a3e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-11-09 Jan Dj,Ad(Brv + + * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies + to ${OLDXMENU}. + 2004-11-09 Kim F. Storm * process.c (Fmake_network_process): Remove kludge for interrupted @@ -5,7 +10,7 @@ start over rather than sleeping and retry with same socket. 2004-11-09 Jan Dj,Ad(Brv - + * .cvsignore: Add buildobj.lst. * doc.c: New variable Vbuild_files. diff --git a/src/Makefile.in b/src/Makefile.in index 48952f674bb..3fd63fe5251 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -962,7 +962,7 @@ prefix-args${EXEEXT}: prefix-args.c $(config_h) #define OLDXMENU_OPTIONS #endif -#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) +#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (HAVE_GTK) /* We use stamp-xmenu with these two deps to both ensure that lwlib gets remade based on its dependencies @@ -1018,12 +1018,12 @@ really-oldXMenu: @true /* make -t should not create really-oldXMenu. */ .PHONY: really-oldXMenu #endif /* not USE_X_TOOLKIT */ -#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS) */ +#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! HAVE_GTK) */ /* We don\'t really need this, but satisfy the dependency. */ stamp-oldxmenu: touch stamp-oldxmenu -#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS) */ +#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! HAVE_GTK) */ ../config.status:: epaths.in @echo "The file epaths.h needs to be set up from epaths.in." -- cgit v1.2.1 From eb943af0455393ec4340555312d47a6df0f1ab61 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 11:15:46 +0000 Subject: (Fmake_network_process): Remove unused var 'retry'. --- src/process.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index 00bac03dc2b..ec07e95c34a 100644 --- a/src/process.c +++ b/src/process.c @@ -2722,7 +2722,6 @@ usage: (make-network-process &rest ARGS) */) int xerrno = 0; int s = -1, outch, inch; struct gcpro gcpro1; - int retry = 0; int count = SPECPDL_INDEX (); int count1; Lisp_Object QCaddress; /* one of QClocal or QCremote */ -- cgit v1.2.1 From d0c38d631d0e7a1979921c0c4efe2f31ff6d7c3b Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 11:16:32 +0000 Subject: Fix commentary. --- src/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index aae7a9f951e..0c08a662380 100644 --- a/src/window.c +++ b/src/window.c @@ -204,7 +204,7 @@ static int window_initialized; Lisp_Object Qwindow_configuration_change_hook; Lisp_Object Vwindow_configuration_change_hook; -/* Nonzero means scroll commands try to put point +/* Non-nil means scroll commands try to put point at the same screen height as previously. */ Lisp_Object Vscroll_preserve_screen_position; @@ -4523,7 +4523,7 @@ window_scroll_pixel_based (window, n, whole, noerror) start = it.current.pos; } - /* If scroll_preserve_screen_position is non-zero, we try to set + /* If scroll_preserve_screen_position is non-nil, we try to set point in the same window line as it is now, so get that line. */ if (!NILP (Vscroll_preserve_screen_position)) { -- cgit v1.2.1 From 0faf68065e0f08d7f2987e77195d1f5df27c4035 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:18:39 +0000 Subject: *** empty log message *** --- src/ChangeLog | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 74903bd1a3e..221911121b5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,38 @@ +2004-11-09 Kim F. Storm + + * xselect.c: Include and (for getpid). + Fix various comments referring to XEvents instead of input events. + (x_queue_event): Fix format strings. + (x_stop_queuing_selection_requests): Likewise. + + * xdisp.c (produce_image_glyph): Remove unused variable 'face_ascent'. + (pint2hrstr): Add extra braces to silence compiler. + + * print.c (print_object): Fix format string. + + * lread.c (read1): Fix next_char matching. + + * lisp.h (Fdelete): Add EXFUN. + (replace_range_2): Add prototype. + + * keyboard.c (read_avail_input): Remove unused variable 'discard'. + + * intervals.h (NULL_INTERVAL_P): Add separate version when + ENABLE_CHECKING is not defined to silence compiler. + (compare_string_intervals): Add prototype. + + * fringe.c (destroy_fringe_bitmap): Fix return type. + (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'. + + * emacs.c (Fdump_emacs): Fix format string. + + * doc.c: Include . + (Fsubstitute_command_keys): Remove unused variable 'firstkey'. + + * data.c (store_symval_forwarding): Remove unused variables. + + * callint.c (Fcall_interactively): Remove unused variable 'funcar'. + 2004-11-09 Jan Dj,Ad(Brv * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies @@ -10,7 +45,7 @@ start over rather than sleeping and retry with same socket. 2004-11-09 Jan Dj,Ad(Brv - + * .cvsignore: Add buildobj.lst. * doc.c: New variable Vbuild_files. -- cgit v1.2.1 From 33247f0c3af678831a4e80bde904996bfff69f5c Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:18:58 +0000 Subject: (Fcall_interactively): Remove unused variable 'funcar'. --- src/callint.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/callint.c b/src/callint.c index 2b8ae86f16f..bb71ad50f44 100644 --- a/src/callint.c +++ b/src/callint.c @@ -265,7 +265,6 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) Lisp_Object *args, *visargs; unsigned char **argstrings; Lisp_Object fun; - Lisp_Object funcar; Lisp_Object specs; Lisp_Object filter_specs; Lisp_Object teml; -- cgit v1.2.1 From 43e50e40db437972c1eb9ca87f89968cb393d316 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:19:11 +0000 Subject: (store_symval_forwarding): Remove unused variables. --- src/data.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/data.c b/src/data.c index 92487f82ddb..2e3378cf319 100644 --- a/src/data.c +++ b/src/data.c @@ -908,8 +908,6 @@ store_symval_forwarding (symbol, valcontents, newval, buf) register Lisp_Object valcontents, newval; struct buffer *buf; { - int offset; - switch (SWITCH_ENUM_CAST (XTYPE (valcontents))) { case Lisp_Misc: @@ -941,7 +939,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) - (char *) &buffer_defaults); int idx = PER_BUFFER_IDX (offset); - Lisp_Object tail, buf; + Lisp_Object tail; if (idx <= 0) break; -- cgit v1.2.1 From 9f77d2aaefd4301e49d9c2dcce5475dfbed1fc63 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:23:00 +0000 Subject: Include . (Fsubstitute_command_keys): Remove unused variable 'firstkey'. --- src/doc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/doc.c b/src/doc.c index 406773e6797..f306caed36a 100644 --- a/src/doc.c +++ b/src/doc.c @@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */ #include #include /* Must be after sys/types.h for USG and BSD4_1*/ +#include #ifdef HAVE_FCNTL_H #include @@ -826,7 +827,6 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int } else if (strp[0] == '\\' && strp[1] == '[') { - Lisp_Object firstkey; int start_idx; changed = 1; -- cgit v1.2.1 From 9b33d5960f6dc5bd0e41d679841661096dbd7f30 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:23:13 +0000 Subject: (Fdump_emacs): Fix format string. --- src/emacs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/emacs.c b/src/emacs.c index 3ca1022a08e..fc158693e47 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2184,7 +2184,7 @@ You must run Emacs in batch mode in order to dump it. */) { fprintf (stderr, "**************************************************\n"); fprintf (stderr, "Warning: Your system has a gap between BSS and the\n"); - fprintf (stderr, "heap (%d byte). This usually means that exec-shield\n", + fprintf (stderr, "heap (%lu byte). This usually means that exec-shield\n", heap_bss_diff); fprintf (stderr, "or something similar is in effect. The dump may\n"); fprintf (stderr, "fail because of this. See the section about \n"); -- cgit v1.2.1 From c3c69bb62580a1f4f77afdcf2dee92fc3f867fec Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:23:32 +0000 Subject: (destroy_fringe_bitmap): Fix return type. (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'. --- src/fringe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/fringe.c b/src/fringe.c index 44c36d12b6b..3f1b74a78e8 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -1060,7 +1060,7 @@ compute_fringe_widths (f, redraw) /* Free resources used by a user-defined bitmap. */ -int +void destroy_fringe_bitmap (n) int n; { @@ -1371,7 +1371,6 @@ Return nil if POS is not visible in WINDOW. */) Lisp_Object pos, window; { struct window *w; - struct buffer *old_buffer = NULL; struct glyph_row *row; int textpos; -- cgit v1.2.1 From 825e0e0b5388ca6a9247d216e10c52dec3835636 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:23:42 +0000 Subject: (NULL_INTERVAL_P): Add separate version when ENABLE_CHECKING is not defined to silence compiler. (compare_string_intervals): Add prototype. --- src/intervals.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/intervals.h b/src/intervals.h index 060731be64e..1c9a4708bdb 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -84,9 +84,14 @@ struct interval #define INT_LISPLIKE(i) (BUFFERP ((Lisp_Object){(EMACS_INT)(i)}) \ || STRINGP ((Lisp_Object){(EMACS_INT)(i)})) #endif + +#ifdef ENABLE_CHECKING #define NULL_INTERVAL_P(i) \ (CHECK (!INT_LISPLIKE (i), "non-interval"), (i) == NULL_INTERVAL) /* old #define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL || INT_LISPLIKE (i)) */ +#else +#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) +#endif /* True if this interval has no right child. */ #define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) @@ -289,6 +294,7 @@ extern INTERVAL balance_intervals P_ ((INTERVAL)); extern INLINE void copy_intervals_to_string P_ ((Lisp_Object, struct buffer *, int, int)); extern INTERVAL copy_intervals P_ ((INTERVAL, int, int)); +extern int compare_string_intervals P_ ((Lisp_Object, Lisp_Object)); extern Lisp_Object textget P_ ((Lisp_Object, Lisp_Object)); extern Lisp_Object lookup_char_property P_ ((Lisp_Object, Lisp_Object, int)); extern void move_if_not_intangible P_ ((int)); -- cgit v1.2.1 From caa5a925ae893570c394170871c50a8475aa616d Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:23:55 +0000 Subject: (read_avail_input): Remove unused variable 'discard'. --- src/keyboard.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index e2c21793c6c..90da03256c9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6627,7 +6627,6 @@ read_avail_input (expected) if (read_socket_hook) { - int discard = 0; int nr; struct input_event hold_quit; -- cgit v1.2.1 From e870dd8926361dc10bd72cbde04794d9d92e7aa7 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:24:07 +0000 Subject: (Fdelete): Add EXFUN. (replace_range_2): Add prototype. --- src/lisp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lisp.h b/src/lisp.h index 7db53961925..8aaeae0e3e2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2278,6 +2278,7 @@ EXFUN (Felt, 2); EXFUN (Fmember, 2); EXFUN (Frassq, 2); EXFUN (Fdelq, 2); +EXFUN (Fdelete, 2); EXFUN (Fsort, 2); EXFUN (Freverse, 1); EXFUN (Fnreverse, 1); @@ -2369,6 +2370,7 @@ extern void adjust_after_replace P_ ((int, int, Lisp_Object, int, int)); extern void adjust_after_replace_noundo P_ ((int, int, int, int, int, int)); extern void adjust_after_insert P_ ((int, int, int, int, int)); extern void replace_range P_ ((int, int, Lisp_Object, int, int, int)); +extern void replace_range_2 P_ ((int, int, int, int, char *, int, int, int)); extern void syms_of_insdel P_ ((void)); /* Defined in dispnew.c */ -- cgit v1.2.1 From 95af0924b48a0ac6efe95a0f337f2ac0ee855ff0 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:24:19 +0000 Subject: (read1): Fix next_char matching. --- src/lread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lread.c b/src/lread.c index db83623e054..e87dba53128 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2374,7 +2374,7 @@ read1 (readcharfun, pch, first_in_list) c = 0; else if (c == (CHAR_CTL | '?')) c = 127; - + if (c & CHAR_SHIFT) { /* Shift modifier is valid only with [A-Za-z]. */ @@ -2459,9 +2459,9 @@ read1 (readcharfun, pch, first_in_list) if (next_char <= 040 || (next_char < 0200 - && index ("\"';([#?", next_char) - || (!first_in_list && next_char == '`') - || (new_backquote_flag && next_char == ','))) + && (index ("\"';([#?", next_char) + || (!first_in_list && next_char == '`') + || (new_backquote_flag && next_char == ',')))) { *pch = c; return Qnil; @@ -3681,7 +3681,7 @@ init_lread () /* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is almost never correct, thereby causing a warning to be printed out that confuses users. Since PATH_LOADSEARCH is always overridden by the - EMACSLOADPATH environment variable below, disable the warning on NT. + EMACSLOADPATH environment variable below, disable the warning on NT. Also, when using the "self-contained" option for Carbon Emacs for MacOSX, the "standard" paths may not exist and would be overridden by EMACSLOADPATH as on NT. Since this depends on how the executable -- cgit v1.2.1 From 44455197d9af613b377f15da7e3ac35c712640cd Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:24:35 +0000 Subject: (print_object): Fix format string. --- src/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/print.c b/src/print.c index 76c648b9a2e..8bb55f21248 100644 --- a/src/print.c +++ b/src/print.c @@ -2087,7 +2087,7 @@ print_object (obj, printcharfun, escapeflag) case Lisp_Misc_Save_Value: strout ("#pointer, XSAVE_VALUE (obj)->integer); strout (buf, -1, -1, printcharfun, 0); -- cgit v1.2.1 From 0162fa4ea6d03373d08d778ebd9731c3c2c4a222 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:26:01 +0000 Subject: (produce_image_glyph): Remove unused variable 'face_ascent'. (pint2hrstr): Add extra braces to silence compiler. --- src/xdisp.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index c2d903d347d..e953771b1cf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16041,27 +16041,31 @@ pint2hrstr (buf, width, d) { tenths = remainder / 100; if (50 <= remainder % 100) - if (tenths < 9) - tenths++; - else - { - quotient++; - if (quotient == 10) - tenths = -1; - else - tenths = 0; - } + { + if (tenths < 9) + tenths++; + else + { + quotient++; + if (quotient == 10) + tenths = -1; + else + tenths = 0; + } + } } else if (500 <= remainder) - if (quotient < 999) - quotient++; - else - { - quotient = 1; - exponent++; - tenths = 0; - } + { + if (quotient < 999) + quotient++; + else + { + quotient = 1; + exponent++; + tenths = 0; + } + } } /* Calculate the LENGTH of QUOTIENT.TENTHS as a string. */ @@ -18348,7 +18352,7 @@ produce_image_glyph (it) { struct image *img; struct face *face; - int face_ascent, glyph_ascent; + int glyph_ascent; struct glyph_slice slice; xassert (it->what == IT_IMAGE); @@ -18431,7 +18435,7 @@ produce_image_glyph (it) #if 0 /* this breaks image tiling */ /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ - face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); + int face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); if (face_ascent > it->ascent) it->ascent = it->phys_ascent = face_ascent; #endif -- cgit v1.2.1 From 678b3958be7b8c502160cb67af3d5663447e2314 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 9 Nov 2004 13:26:58 +0000 Subject: Include and (for getpid). Fix various comments referring to XEvents instead of input events. (x_queue_event): Fix format strings. (x_stop_queuing_selection_requests): Likewise. --- src/xselect.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/xselect.c b/src/xselect.c index e3698bae9a6..c89347be2cd 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -24,6 +24,14 @@ Boston, MA 02111-1307, USA. */ #include #include /* termhooks.h needs this */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + #include "lisp.h" #include "xterm.h" /* for all of the X includes */ #include "dispextern.h" /* frame.h seems to want this */ @@ -174,7 +182,8 @@ static Lisp_Object x_get_window_property_as_lisp_data (); -/* Define a queue to save up SelectionRequest events for later handling. */ +/* Define a queue to save up SELECTION_REQUEST_EVENT events for later + handling. */ struct selection_event_queue { @@ -184,11 +193,11 @@ struct selection_event_queue static struct selection_event_queue *selection_queue; -/* Nonzero means queue up certain events--don't process them yet. */ +/* Nonzero means queue up SELECTION_REQUEST_EVENT events. */ static int x_queue_selection_requests; -/* Queue up an X event *EVENT, to be processed later. */ +/* Queue up an SELECTION_REQUEST_EVENT *EVENT, to be processed later. */ static void x_queue_event (event) @@ -196,12 +205,14 @@ x_queue_event (event) { struct selection_event_queue *queue_tmp; - /* Don't queue repeated requests */ + /* Don't queue repeated requests. + This only happens for large requests which uses the incremental protocol. */ for (queue_tmp = selection_queue; queue_tmp; queue_tmp = queue_tmp->next) { if (!bcmp (&queue_tmp->event, event, sizeof (*event))) { - TRACE1 ("IGNORE DUP SELECTION EVENT %08x", (unsigned long)queue_tmp); + TRACE1 ("DECLINE DUP SELECTION EVENT %08lx", (unsigned long)queue_tmp); + x_decline_selection_request (event); return; } } @@ -211,14 +222,14 @@ x_queue_event (event) if (queue_tmp != NULL) { - TRACE1 ("QUEUE SELECTION EVENT %08x", (unsigned long)queue_tmp); + TRACE1 ("QUEUE SELECTION EVENT %08lx", (unsigned long)queue_tmp); queue_tmp->event = *event; queue_tmp->next = selection_queue; selection_queue = queue_tmp; } } -/* Start queuing SelectionRequest events. */ +/* Start queuing SELECTION_REQUEST_EVENT events. */ static void x_start_queuing_selection_requests () @@ -230,7 +241,7 @@ x_start_queuing_selection_requests () TRACE1 ("x_start_queuing_selection_requests %d", x_queue_selection_requests); } -/* Stop queuing SelectionRequest events. */ +/* Stop queuing SELECTION_REQUEST_EVENT events. */ static void x_stop_queuing_selection_requests () @@ -244,7 +255,7 @@ x_stop_queuing_selection_requests () while (selection_queue != NULL) { struct selection_event_queue *queue_tmp = selection_queue; - TRACE1 ("RESTORE SELECTION EVENT %08x", (unsigned long)queue_tmp); + TRACE1 ("RESTORE SELECTION EVENT %08lx", (unsigned long)queue_tmp); kbd_buffer_unget_event (&queue_tmp->event); selection_queue = queue_tmp->next; xfree ((char *)queue_tmp); @@ -869,7 +880,9 @@ x_handle_selection_request (event) struct x_display_info *dpyinfo = x_display_info_for_display (SELECTION_EVENT_DISPLAY (event)); - TRACE0 ("x_handle_selection_request"); + TRACE2 ("x_handle_selection_request, from=0x%08lx time=%lu", + (unsigned long) SELECTION_EVENT_REQUESTOR (event), + (unsigned long) SELECTION_EVENT_TIME (event)); local_selection_data = Qnil; target_symbol = Qnil; -- cgit v1.2.1 From 32e2fb042912d91fdb27290fb2c1ec76b45582a1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 10 Nov 2004 22:35:21 +0000 Subject: (Fkeymap_prompt): Accept symbol keymaps. --- src/ChangeLog | 32 ++++++++++++++++++-------------- src/keymap.c | 6 +++--- 2 files changed, 21 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 221911121b5..e7d9d37aa3a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-10 Stefan Monnier + + * keymap.c (Fkeymap_prompt): Accept symbol keymaps. + 2004-11-09 Kim F. Storm * xselect.c: Include and (for getpid). @@ -164,8 +168,8 @@ (x_stop_queuing_selection_requests): Add new queue for selection input events to replace previous XEvent queue in xterm.c. (queue_selection_requests_unwind): Adapt to new queue. - (x_reply_selection_request): Adapt to new queue. Unexpect - wait_object in case of x errors (memory leak). + (x_reply_selection_request): Adapt to new queue. + Unexpect wait_object in case of x errors (memory leak). (x_handle_selection_request, x_handle_selection_clear): Make static. (x_handle_selection_event): New function. May queue selection events. (wait_for_property_change_unwind): Use save_value instead of cons. @@ -218,7 +222,7 @@ * gtkutil.h: Declare use_old_gtk_file_dialog. * gtkutil.c: Make use_old_gtk_file_dialog non-static. - (xg_initialize): Moved DEFVAR_BOOL for use_old_gtk_file_dialog ... + (xg_initialize): Move DEFVAR_BOOL for use_old_gtk_file_dialog ... * xfns.c (syms_of_xfns): ... to here. * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if @@ -293,20 +297,20 @@ * lisp.h: Fx_file_dialog takes 5 parameters. - * xfns.c (Fx_file_dialog): Both Motif and GTK version: Add - parameter only_dir_p. + * xfns.c (Fx_file_dialog): Both Motif and GTK version: + Add parameter only_dir_p. In Motif version, don't put DEFAULT_FILENAME in filter part of the dialog, just text field part. Do not add DEFAULT_FILENAME to list of files if it isn't there. In GTK version, pass only_dir_p parameter to xg_get_file_name. - * macfns.c (Fx_file_dialog): Add parameter only_dir_p. Check - only_dir_p instead of comparing prompt to "Dired". When using + * macfns.c (Fx_file_dialog): Add parameter only_dir_p. + Check only_dir_p instead of comparing prompt to "Dired". When using a save dialog, add option kNavDontConfirmReplacement, change title to "Enter name", change text for save button to "Ok". - * w32fns.c (Fx_file_dialog): Add parameter only_dir_p. Check - only_dir_p instead of comparing prompt to "Dired". + * w32fns.c (Fx_file_dialog): Add parameter only_dir_p. + Check only_dir_p instead of comparing prompt to "Dired". * gtkutil.c (xg_get_file_with_chooser) (xg_get_file_with_selection): New functions, only defined ifdef @@ -323,8 +327,8 @@ 2004-11-01 Kim F. Storm - * process.c (connect_wait_mask, num_pending_connects): Only - declare and use them if NON_BLOCKING_CONNECT is defined. + * process.c (connect_wait_mask, num_pending_connects): + Only declare and use them if NON_BLOCKING_CONNECT is defined. (init_process): Initialize them if NON_BLOCKING_CONNECT defined. (IF_NON_BLOCKING_CONNECT): New helper macro. (wait_reading_process_output): Only declare and use local vars @@ -339,8 +343,8 @@ * xmenu.c: Add prototypes for forward function declarations. (popup_get_selection): Remove parameter do_timers, remove call to timer_check. - (create_and_show_popup_menu, create_and_show_dialog): Remove - parameter do_timers from call to popup_get_selection. + (create_and_show_popup_menu, create_and_show_dialog): + Remove parameter do_timers from call to popup_get_selection. * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to tool_bar_items and assign the result to f->tool_bar_items if @@ -359,7 +363,7 @@ * macterm.c: allow user to assign key modifiers to the Mac Option key via a 'mac-option-modifier' variable. -2004-10-28 Stefan +2004-10-28 Stefan Monnier * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions): Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks. diff --git a/src/keymap.c b/src/keymap.c index 105a5b95793..a0d5c3b5be5 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -213,13 +213,13 @@ when reading a key-sequence to be looked-up in this keymap. */) (map) Lisp_Object map; { + map = get_keymap (map, 0, 0); while (CONSP (map)) { - register Lisp_Object tem; - tem = Fcar (map); + Lisp_Object tem = XCAR (map); if (STRINGP (tem)) return tem; - map = Fcdr (map); + map = XCDR (map); } return Qnil; } -- cgit v1.2.1 From c3438661cbfac6a4622ea16c25c237a4ecd43009 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 12 Nov 2004 08:33:51 +0000 Subject: * xmenu.c (x_menu_wait_for_event): New function. (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event to handle timers. (xmenu_show): Call XMenuActivateSetWaitFunction so that x_menu_wait_for_event is called by XMenuActivate. --- src/ChangeLog | 8 ++++++ src/xmenu.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 76 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e7d9d37aa3a..7f66e82bfc6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-11-12 Jan Dj,Ad(Brv + + * xmenu.c (x_menu_wait_for_event): New function. + (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event + to handle timers. + (xmenu_show): Call XMenuActivateSetWaitFunction so that + x_menu_wait_for_event is called by XMenuActivate. + 2004-11-10 Stefan Monnier * keymap.c (Fkeymap_prompt): Accept symbol keymaps. diff --git a/src/xmenu.c b/src/xmenu.c index 9868902f3f3..9b9de8aa16d 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "charset.h" #include "coding.h" +#include "sysselect.h" #ifdef MSDOS #include "msdos.h" @@ -157,8 +158,6 @@ static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object, static void list_of_panes P_ ((Lisp_Object)); static void list_of_items P_ ((Lisp_Object)); -extern EMACS_TIME timer_check P_ ((int)); - /* This holds a Lisp vector that holds the results of decoding the keymaps or alist-of-alists that specify a menu. @@ -1115,6 +1114,60 @@ on the left of the dialog box and all following items on the right. } #endif } + + +#ifndef MSDOS + +/* Wait for an X event to arrive or for a timer to expire. */ + +static void +x_menu_wait_for_event (void *data) +{ + extern EMACS_TIME timer_check P_ ((int)); + + /* Another way to do this is to register a timer callback, that can be + done in GTK and Xt. But we have to do it like this when using only X + anyway, and with callbacks we would have three variants for timer handling + instead of the small ifdefs below. */ + + while ( +#ifdef USE_X_TOOLKIT + XtAppPending (Xt_app_con) +#elif defined USE_GTK + ! gtk_events_pending () +#else + ! XPending ((Display*) data) +#endif + ) + { + EMACS_TIME next_time = timer_check (1); + long secs = EMACS_SECS (next_time); + long usecs = EMACS_USECS (next_time); + SELECT_TYPE read_fds; + struct x_display_info *dpyinfo; + int n = 0; + + FD_ZERO (&read_fds); + for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) + { + int fd = ConnectionNumber (dpyinfo->display); + FD_SET (fd, &read_fds); + if (fd > n) n = fd; + } + + if (secs < 0 || (secs == 0 && usecs == 0)) + { + /* Sometimes timer_check returns -1 (no timers) even if there are + timers. So do a timeout anyway. */ + EMACS_SET_SECS (next_time, 1); + EMACS_SET_USECS (next_time, 0); + } + + select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, &next_time); + } +} +#endif /* ! MSDOS */ + #if defined (USE_X_TOOLKIT) || defined (USE_GTK) @@ -1140,17 +1193,16 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) while (popup_activated_flag) { - /* If we have no events to run, consider timers. */ - if (do_timers && !XtAppPending (Xt_app_con)) - timer_check (1); - if (initial_event) { event = *initial_event; initial_event = 0; } else - XtAppNextEvent (Xt_app_con, &event); + { + if (do_timers) x_menu_wait_for_event (0); + XtAppNextEvent (Xt_app_con, &event); + } /* Make sure we don't consider buttons grabbed after menu goes. And make sure to deactivate for any ButtonRelease, @@ -1196,13 +1248,15 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) /* Loop util popup_activated_flag is set to zero in a callback. Used for popup menus and dialogs. */ static void -popup_widget_loop () +popup_widget_loop (do_timers) + int do_timers; { ++popup_activated_flag; /* Process events in the Gtk event loop until done. */ while (popup_activated_flag) { + if (do_timers) x_menu_wait_for_event (0); gtk_main_iteration (); } } @@ -2402,7 +2456,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) two. show_help_echo uses this to detect popup menus. */ popup_activated_flag = 1; /* Process events that apply to the menu. */ - popup_widget_loop (); + popup_widget_loop (0); gtk_widget_destroy (menu); @@ -2811,7 +2865,7 @@ create_and_show_dialog (f, first_wv) gtk_widget_show_all (menu); /* Process events that apply to the menu. */ - popup_widget_loop (); + popup_widget_loop (1); gtk_widget_destroy (menu); } @@ -3323,6 +3377,10 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) XMenuSetFreeze (menu, TRUE); pane = selidx = 0; +#ifndef MSDOS + XMenuActivateSetWaitFunction (x_menu_wait_for_event, FRAME_X_DISPLAY (f)); +#endif + /* Help display under X won't work because XMenuActivate contains a loop that doesn't give Emacs a chance to process it. */ menu_help_frame = f; -- cgit v1.2.1 From df00f4364c61cb4d813a158d6f7d4f31e1ea4adf Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 12 Nov 2004 09:36:55 +0000 Subject: (popup_widget_loop): Add argument do_timers. (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for do_timers to popup_widget_loop. (create_and_show_popup_menu): Pass 1 for do_timers to popup_get_selection. --- src/ChangeLog | 5 +++++ src/xmenu.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7f66e82bfc6..b680abe8d4f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,8 +3,13 @@ * xmenu.c (x_menu_wait_for_event): New function. (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event to handle timers. + (popup_widget_loop): Add argument do_timers. + (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for + do_timers to popup_widget_loop. (xmenu_show): Call XMenuActivateSetWaitFunction so that x_menu_wait_for_event is called by XMenuActivate. + (create_and_show_popup_menu): Pass 1 for do_timers to + popup_get_selection. 2004-11-10 Stefan Monnier diff --git a/src/xmenu.c b/src/xmenu.c index 9b9de8aa16d..d8ab2eb58aa 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2456,7 +2456,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) two. show_help_echo uses this to detect popup menus. */ popup_activated_flag = 1; /* Process events that apply to the menu. */ - popup_widget_loop (0); + popup_widget_loop (1); gtk_widget_destroy (menu); @@ -2544,7 +2544,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) popup_activated_flag = 1; /* Process events that apply to the menu. */ - popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0, 0); + popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 1, 0); /* fp turned off the following statement and wrote a comment that it is unnecessary--that the menu has already disappeared. -- cgit v1.2.1 From f1d1cd24db8ab975bbe9bf0c4260bd8025e8bd75 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 12 Nov 2004 10:34:36 +0000 Subject: (pop_down_menu): New function. (popup_get_selection, popup_widget_loop): Unwind protect to pop_down_menu. (popup_widget_loop): Add argument widget. (create_and_show_popup_menu, create_and_show_dialog): Pass new argument widget to popup_widget_loop. --- src/ChangeLog | 6 ++++++ src/xmenu.c | 44 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 45 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b680abe8d4f..89002eaadd1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -10,6 +10,12 @@ x_menu_wait_for_event is called by XMenuActivate. (create_and_show_popup_menu): Pass 1 for do_timers to popup_get_selection. + (pop_down_menu): New function. + (popup_get_selection, popup_widget_loop): Unwind protect to + pop_down_menu. + (popup_widget_loop): Add argument widget. + (create_and_show_popup_menu, create_and_show_dialog): Pass new + argument widget to popup_widget_loop. 2004-11-10 Stefan Monnier diff --git a/src/xmenu.c b/src/xmenu.c index d8ab2eb58aa..d7551cd7e45 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1132,7 +1132,7 @@ x_menu_wait_for_event (void *data) while ( #ifdef USE_X_TOOLKIT - XtAppPending (Xt_app_con) + ! XtAppPending (Xt_app_con) #elif defined USE_GTK ! gtk_events_pending () #else @@ -1171,6 +1171,15 @@ x_menu_wait_for_event (void *data) #if defined (USE_X_TOOLKIT) || defined (USE_GTK) +#ifdef USE_X_TOOLKIT + +static Lisp_Object +pop_down_menu (dummy) + int dummy; +{ + popup_activated_flag = 0; +} + /* Loop in Xt until the menu pulldown or dialog popup has been popped down (deactivated). This is used for x-popup-menu and x-popup-dialog; it is not used for the menu bar. @@ -1180,7 +1189,6 @@ x_menu_wait_for_event (void *data) NOTE: All calls to popup_get_selection should be protected with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ -#ifdef USE_X_TOOLKIT static void popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) XEvent *initial_event; @@ -1191,6 +1199,9 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) { XEvent event; + int specpdl_count = SPECPDL_INDEX (); + record_unwind_protect (pop_down_menu, Qnil); + while (popup_activated_flag) { if (initial_event) @@ -1240,6 +1251,8 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) x_dispatch_event (&event, event.xany.display); } + + unbind_to (specpdl_count, Qnil); } #endif /* USE_X_TOOLKIT */ @@ -1247,10 +1260,29 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) #ifdef USE_GTK /* Loop util popup_activated_flag is set to zero in a callback. Used for popup menus and dialogs. */ +static GtkWidget *current_menu; + +static Lisp_Object +pop_down_menu (dummy) + int dummy; +{ + if (current_menu) + { + gtk_widget_unmap (current_menu); + current_menu = 0; + popup_activated_flag = 0; + } +} + static void -popup_widget_loop (do_timers) +popup_widget_loop (do_timers, widget) int do_timers; + GtkWidget *widget; { + int specpdl_count = SPECPDL_INDEX (); + current_menu = widget; + record_unwind_protect (pop_down_menu, Qnil); + ++popup_activated_flag; /* Process events in the Gtk event loop until done. */ @@ -1259,6 +1291,8 @@ popup_widget_loop (do_timers) if (do_timers) x_menu_wait_for_event (0); gtk_main_iteration (); } + + unbind_to (specpdl_count, Qnil); } #endif @@ -2456,7 +2490,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) two. show_help_echo uses this to detect popup menus. */ popup_activated_flag = 1; /* Process events that apply to the menu. */ - popup_widget_loop (1); + popup_widget_loop (1, 0); gtk_widget_destroy (menu); @@ -2865,7 +2899,7 @@ create_and_show_dialog (f, first_wv) gtk_widget_show_all (menu); /* Process events that apply to the menu. */ - popup_widget_loop (1); + popup_widget_loop (1, menu); gtk_widget_destroy (menu); } -- cgit v1.2.1 From b9de078aa68bc403b9da6c801cdbd37eb77af44a Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 12 Nov 2004 13:47:13 +0000 Subject: (pop_down_menu): Return nil. --- src/ChangeLog | 6 +++++- src/xmenu.c | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 89002eaadd1..43283cc83e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-12 Kim F. Storm + + * xmenu.c (pop_down_menu): Return nil. + 2004-11-12 Jan Dj,Ad(Brv * xmenu.c (x_menu_wait_for_event): New function. @@ -8,7 +12,7 @@ do_timers to popup_widget_loop. (xmenu_show): Call XMenuActivateSetWaitFunction so that x_menu_wait_for_event is called by XMenuActivate. - (create_and_show_popup_menu): Pass 1 for do_timers to + (create_and_show_popup_menu): Pass 1 for do_timers to popup_get_selection. (pop_down_menu): New function. (popup_get_selection, popup_widget_loop): Unwind protect to diff --git a/src/xmenu.c b/src/xmenu.c index d7551cd7e45..3b813927281 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -524,7 +524,7 @@ single_menu_item (key, item, dummy, skp_v) return; /* Not a menu item. */ map = XVECTOR (item_properties)->contents[ITEM_PROPERTY_MAP]; - + if (skp->notreal) { /* We don't want to make a menu, just traverse the keymaps to @@ -1098,7 +1098,7 @@ on the left of the dialog box and all following items on the right. the dialog. Also, the lesstif/motif version crashes if there are no buttons. */ contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); - + list_of_panes (Fcons (contents, Qnil)); /* Display them in a dialog box. */ @@ -1178,6 +1178,7 @@ pop_down_menu (dummy) int dummy; { popup_activated_flag = 0; + return Qnil; } /* Loop in Xt until the menu pulldown or dialog popup has been @@ -1272,6 +1273,7 @@ pop_down_menu (dummy) current_menu = 0; popup_activated_flag = 0; } + return Qnil; } static void @@ -2417,7 +2419,7 @@ menu_position_func (menu, x, y, push_in, user_data) GtkRequisition req; int disp_width = FRAME_X_DISPLAY_INFO (data->f)->width; int disp_height = FRAME_X_DISPLAY_INFO (data->f)->height; - + *x = data->x; *y = data->y; -- cgit v1.2.1 From 381f7091f64d97deb26781de0b24b30844b8e2bc Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 12 Nov 2004 14:21:27 +0000 Subject: *** empty log message *** --- src/ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 43283cc83e3..cc9e71290d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,36 @@ 2004-11-12 Kim F. Storm + * dispextern.h (struct glyph_row): New member extra_line_spacing. + (struct it): New member max_extra_line_spacing. + (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP) + (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. + (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible + part of last line is only extra line spacing (so the text on the + line is fully visible). Use helper macros. + Add W arg (to use them). All callers changed. + (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) + (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. + + * window.c (window_scroll_pixel_based, Frecenter): Use + move_it_vertically_backward directly. + (Frecenter): Fix calculation of new start pos for negative arg. + Before, the new start pos was sometimes chosen too far back, so + the last line became only partially visible, and thus would be + either only semi-visible or automatically scrolled to the middle + of the window by redisplay. + + * xdisp.c (init_iterator): Clear it.max_extra_line_spacing. + (move_it_vertically_backward): Don't recure to move further back. + (move_it_vertically): Remove superfluous condition. + (move_it_by_lines): Clear last_height when moved 0 lines. + (resize_mini_window): use it.max_extra_line_spacing. + (display_tool_bar_line): Clear row->extra_line_spacing. + (try_scrolling): Use move_it_vertically_backward directly. + (redisplay_window): Likewise. + (compute_line_metrics): Set row->extra_line_spacing. + (display_line, display_string): Likewise. + (x_produce_glyphs): Update it->max_extra_line_spacing. + * xmenu.c (pop_down_menu): Return nil. 2004-11-12 Jan Dj,Ad(Brv -- cgit v1.2.1 From db0c5a7d08be0a760d02831a788f7b6111f9496f Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 12 Nov 2004 14:26:34 +0000 Subject: (struct glyph_row): New member extra_line_spacing. (struct it): New member max_extra_line_spacing. (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP) (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible part of last line is only extra line spacing (so the text on the line is fully visible). Use helper macros. Add W arg (to use them). All callers changed. (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. --- src/dispextern.h | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/dispextern.h b/src/dispextern.h index d6c93cb270e..7e8d15d8e8f 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -694,6 +694,10 @@ struct glyph_row frames. It may be < 0 in case of completely invisible rows. */ int visible_height; + /* Extra line spacing added after this row. Do not consider this + in last row when checking if row is fully visible. */ + int extra_line_spacing; + /* Hash code. This hash code is available as soon as the row is constructed, i.e. after a call to display_line. */ unsigned hash; @@ -916,22 +920,39 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); #define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p) + +/* Helper macros */ + +#define MR_PARTIALLY_VISIBLE(ROW) \ + ((ROW)->height != (ROW)->visible_height) + +#define MR_PARTIALLY_VISIBLE_AT_TOP(W, ROW) \ + ((ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W))) + +#define MR_PARTIALLY_VISIBLE_AT_BOTTOM(W, ROW) \ + (((ROW)->y + (ROW)->height - (ROW)->extra_line_spacing) \ + > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W))) + /* Non-zero if ROW is not completely visible in window W. */ -#define MATRIX_ROW_PARTIALLY_VISIBLE_P(ROW) \ - ((ROW)->height != (ROW)->visible_height) +#define MATRIX_ROW_PARTIALLY_VISIBLE_P(W, ROW) \ + (MR_PARTIALLY_VISIBLE ((ROW)) \ + && (MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW)) \ + || MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW)))) + + /* Non-zero if ROW is partially visible at the top of window W. */ #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ - (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ - && (ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W))) + (MR_PARTIALLY_VISIBLE ((ROW)) \ + && MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW))) /* Non-zero if ROW is partially visible at the bottom of window W. */ -#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ - (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ - && (ROW)->y + (ROW)->height > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W))) +#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ + (MR_PARTIALLY_VISIBLE ((ROW)) \ + && MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW))) /* Return the bottom Y + 1 of ROW. */ @@ -1990,10 +2011,13 @@ struct it line, if the window has one. */ int last_visible_y; - /* Additional space in pixels between lines (for window systems - only.) */ + /* Default amount of additional space in pixels between lines (for + window systems only.) */ int extra_line_spacing; + /* Max extra line spacing added in this row. */ + int max_extra_line_spacing; + /* Override font height information for this glyph. Used if override_ascent >= 0. Cleared after this glyph. */ int override_ascent, override_descent, override_boff; -- cgit v1.2.1 From f204989e2e4cfb5d3744c30efe3ef408fa80fe08 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 12 Nov 2004 14:26:53 +0000 Subject: (window_scroll_pixel_based, Frecenter): Use move_it_vertically_backward directly. (Frecenter): Fix calculation of new start pos for negative arg. Before, the new start pos was sometimes chosen too far back, so the last line became only partially visible, and thus would be either only semi-visible or automatically scrolled to the middle of the window by redisplay. --- src/window.c | 55 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index 0c08a662380..24be93a3943 100644 --- a/src/window.c +++ b/src/window.c @@ -4506,7 +4506,7 @@ window_scroll_pixel_based (window, n, whole, noerror) results for variable height lines. */ init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); it.current_y = it.last_visible_y; - move_it_vertically (&it, - window_box_height (w) / 2); + move_it_vertically_backward (&it, window_box_height (w) / 2); /* The function move_iterator_vertically may move over more than the specified y-distance. If it->w is small, e.g. a @@ -4516,7 +4516,7 @@ window_scroll_pixel_based (window, n, whole, noerror) if (it.current_y <= 0) { init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); - move_it_vertically (&it, 0); + move_it_vertically_backward (&it, 0); it.current_y = 0; } @@ -5185,7 +5185,7 @@ and redisplay normally--don't erase and redraw the frame. */) SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); - move_it_vertically (&it, - window_box_height (w) / 2); + move_it_vertically_backward (&it, window_box_height (w) / 2); charpos = IT_CHARPOS (it); bytepos = IT_BYTEPOS (it); } @@ -5193,29 +5193,62 @@ and redisplay normally--don't erase and redraw the frame. */) { struct it it; struct text_pos pt; - int y0, y1, h, nlines; + int nlines = - XINT (arg); + int extra_line_spacing; + int h = window_box_height (w); SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); - y0 = it.current_y; + + /* Be sure we have the exact height of the full line containing PT. */ + move_it_by_lines (&it, 0, 1); /* The amount of pixels we have to move back is the window height minus what's displayed in the line containing PT, and the lines below. */ - nlines = - XINT (arg) - 1; + it.current_y = 0; + it.vpos = 0; move_it_by_lines (&it, nlines, 1); - y1 = line_bottom_y (&it); + if (it.vpos == nlines) + h -= it.current_y; + else + { + /* Last line has no newline */ + h -= line_bottom_y (&it); + it.vpos++; + } + + /* Don't reserve space for extra line spacing of last line. */ + extra_line_spacing = it.max_extra_line_spacing; /* If we can't move down NLINES lines because we hit the end of the buffer, count in some empty lines. */ if (it.vpos < nlines) - y1 += (nlines - it.vpos) * FRAME_LINE_HEIGHT (it.f); - - h = window_box_height (w) - (y1 - y0); + { + nlines -= it.vpos; + extra_line_spacing = it.extra_line_spacing; + h -= nlines * (FRAME_LINE_HEIGHT (it.f) + extra_line_spacing); + } + if (h <= 0) + return Qnil; + /* Now find the new top line (starting position) of the window. */ start_display (&it, w, pt); - move_it_vertically (&it, - h); + it.current_y = 0; + move_it_vertically_backward (&it, h); + + /* If extra line spacing is present, we may move too far + back. This causes the last line to be only partially + visible (which triggers redisplay to recenter that line + in the middle), so move forward. + But ignore extra line spacing on last line, as it is not + considered to be part of the visible height of the line. + */ + h += extra_line_spacing; + while (-it.current_y > h) + move_it_by_lines (&it, 1, 1); + charpos = IT_CHARPOS (it); bytepos = IT_BYTEPOS (it); } -- cgit v1.2.1 From 546f98b8385d2c264c845e6dc773dbdfb2199b64 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 12 Nov 2004 14:27:07 +0000 Subject: (init_iterator): Clear it.max_extra_line_spacing. (move_it_vertically_backward): Don't recure to move further back. (move_it_vertically): Remove superfluous condition. (move_it_by_lines): Clear last_height when moved 0 lines. (resize_mini_window): use it.max_extra_line_spacing. (display_tool_bar_line): Clear row->extra_line_spacing. (try_scrolling): Use move_it_vertically_backward directly. (redisplay_window): Likewise. (compute_line_metrics): Set row->extra_line_spacing. (display_line, display_string): Likewise. (x_produce_glyphs): Update it->max_extra_line_spacing. --- src/xdisp.c | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index e953771b1cf..614bb898ed8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2075,6 +2075,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) * FRAME_LINE_HEIGHT (it->f)); else if (it->f->extra_line_spacing > 0) it->extra_line_spacing = it->f->extra_line_spacing; + it->max_extra_line_spacing = 0; } /* If realized faces have been removed, e.g. because of face @@ -6067,10 +6068,13 @@ move_it_vertically_backward (it, dy) { int nlines, h; struct it it2, it3; - int start_pos = IT_CHARPOS (*it); + int start_pos; + move_further_back: xassert (dy >= 0); + start_pos = IT_CHARPOS (*it); + /* Estimate how many newlines we must move back. */ nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f)); @@ -6136,13 +6140,13 @@ move_it_vertically_backward (it, dy) a line height of 13 pixels each, recentering with point on the bottom line will try to move -39/2 = 19 pixels backward. Try to avoid moving into the first line. */ - && it->current_y - target_y > line_height / 3 * 2 + && it->current_y - target_y > line_height * 2 / 3 && IT_CHARPOS (*it) > BEGV) { TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", target_y - it->current_y)); - move_it_vertically (it, target_y - it->current_y); - xassert (IT_CHARPOS (*it) >= BEGV); + dy = it->current_y - target_y; + goto move_further_back; } else if (target_y >= it->current_y + line_height && IT_CHARPOS (*it) < ZV) @@ -6183,7 +6187,7 @@ move_it_vertically (it, dy) { if (dy <= 0) move_it_vertically_backward (it, -dy); - else if (dy > 0) + else { TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy)); move_it_to (it, ZV, -1, it->current_y + dy, -1, @@ -6280,6 +6284,8 @@ move_it_by_lines (it, dvpos, need_y_p) /* DVPOS == 0 means move to the start of the screen line. */ move_it_vertically_backward (it, 0); xassert (it->current_x == 0 && it->hpos == 0); + /* Let next call to line_bottom_y calculate real line height */ + last_height = 0; } else if (dvpos > 0) move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); @@ -7423,7 +7429,7 @@ resize_mini_window (w, exact_p) height = it.current_y + last_height; else height = it.current_y + it.max_ascent + it.max_descent; - height -= it.extra_line_spacing; + height -= min (it.extra_line_spacing, it.max_extra_line_spacing); height = (height + unit - 1) / unit; } @@ -8701,6 +8707,7 @@ display_tool_bar_line (it) { row->height = row->phys_height = it->last_visible_y - row->y; row->ascent = row->phys_ascent = 0; + row->extra_line_spacing = 0; } row->full_width_p = 1; @@ -10889,7 +10896,7 @@ make_cursor_line_fully_visible (w, force_p) row = MATRIX_ROW (matrix, w->cursor.vpos); /* If the cursor row is not partially visible, there's nothing to do. */ - if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) + if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)) return 1; /* If the row the cursor is in is taller than the window's height, @@ -11043,7 +11050,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, { start_display (&it, w, scroll_margin_pos); if (this_scroll_margin) - move_it_vertically (&it, - this_scroll_margin); + move_it_vertically_backward (&it, this_scroll_margin); if (extra_scroll_margin_lines) move_it_by_lines (&it, - extra_scroll_margin_lines, 0); scroll_margin_pos = it.current.pos; @@ -11163,7 +11170,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, if (amount_to_scroll <= 0) return SCROLLING_FAILED; - move_it_vertically (&it, - amount_to_scroll); + move_it_vertically_backward (&it, amount_to_scroll); startp = it.current.pos; } } @@ -11467,7 +11474,7 @@ try_cursor_movement (window, startp, scroll_step) /* if PT is not in the glyph row, give up. */ rc = CURSOR_MOVEMENT_MUST_SCROLL; } - else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) + else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)) { if (PT == MATRIX_ROW_END_CHARPOS (row) && !row->ends_at_zv_p @@ -12042,7 +12049,7 @@ redisplay_window (window, just_this_one_p) if (it.current_y <= 0) { init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); - move_it_vertically (&it, 0); + move_it_vertically_backward (&it, 0); xassert (IT_CHARPOS (it) <= PT); it.current_y = 0; } @@ -12391,7 +12398,7 @@ try_window_reusing_current_matrix (w) /* Give up if old or new display is scrolled vertically. We could make this function handle this, but right now it doesn't. */ start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); - if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)) + if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)) return 0; /* The variable new_start now holds the new window start. The old @@ -12439,7 +12446,7 @@ try_window_reusing_current_matrix (w) start = start_row->start.pos; /* If there are no more rows to try, or just one, give up. */ if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1 - || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row) + || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row) || CHARPOS (start) == ZV) { clear_glyph_matrix (w->desired_matrix); @@ -14233,6 +14240,7 @@ compute_line_metrics (it) row->height = it->max_ascent + it->max_descent; row->phys_ascent = it->max_phys_ascent; row->phys_height = it->max_phys_ascent + it->max_phys_descent; + row->extra_line_spacing = it->max_extra_line_spacing; } /* Compute the width of this line. */ @@ -14276,6 +14284,7 @@ compute_line_metrics (it) row->pixel_width -= it->truncation_pixel_width; row->ascent = row->phys_ascent = 0; row->height = row->phys_height = row->visible_height = 1; + row->extra_line_spacing = 0; } /* Compute a hash code for this row. */ @@ -14612,6 +14621,7 @@ display_line (it) row->height = it->max_ascent + it->max_descent; row->phys_ascent = it->max_phys_ascent; row->phys_height = it->max_phys_ascent + it->max_phys_descent; + row->extra_line_spacing = it->max_extra_line_spacing; /* Loop generating characters. The loop is left with IT on the next character to display. */ @@ -14677,6 +14687,8 @@ display_line (it) row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); + row->extra_line_spacing = max (row->extra_line_spacing, + it->max_extra_line_spacing); set_iterator_to_next (it, 1); continue; } @@ -14705,6 +14717,8 @@ display_line (it) row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); + row->extra_line_spacing = max (row->extra_line_spacing, + it->max_extra_line_spacing); if (it->current_x - it->pixel_width < it->first_visible_x) row->x = x - it->first_visible_x; } @@ -14856,6 +14870,8 @@ display_line (it) row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); + row->extra_line_spacing = max (row->extra_line_spacing, + it->max_extra_line_spacing); /* End of this display line if row is continued. */ if (row->continued_p || row->ends_at_zv_p) @@ -16767,6 +16783,7 @@ display_string (string, lisp_string, face_string, face_string_pos, row->height = it->max_ascent + it->max_descent; row->phys_ascent = it->max_phys_ascent; row->phys_height = it->max_phys_ascent + it->max_phys_descent; + row->extra_line_spacing = it->max_extra_line_spacing; /* This condition is for the case that we are called with current_x past last_visible_x. */ @@ -16826,6 +16843,8 @@ display_string (string, lisp_string, face_string, face_string_pos, row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); + row->extra_line_spacing = max (row->extra_line_spacing, + it->max_extra_line_spacing); x += glyph->pixel_width; ++i; } @@ -19448,7 +19467,11 @@ x_produce_glyphs (it) it->current_x += it->pixel_width; if (extra_line_spacing > 0) - it->descent += extra_line_spacing; + { + it->descent += extra_line_spacing; + if (extra_line_spacing > it->max_extra_line_spacing) + it->max_extra_line_spacing = extra_line_spacing; + } it->max_ascent = max (it->max_ascent, it->ascent); it->max_descent = max (it->max_descent, it->descent); -- cgit v1.2.1