diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/lispref/edebug.texi | 1 | ||||
-rw-r--r-- | doc/lispref/internals.texi | 8 | ||||
-rw-r--r-- | doc/lispref/os.texi | 25 | ||||
-rw-r--r-- | doc/lispref/windows.texi | 20 | ||||
-rw-r--r-- | src/conf_post.h | 8 | ||||
-rw-r--r-- | src/dispnew.c | 7 | ||||
-rw-r--r-- | src/gtkutil.c | 3 | ||||
-rw-r--r-- | src/nsterm.m | 1 | ||||
-rw-r--r-- | src/window.c | 4 | ||||
-rw-r--r-- | src/xdisp.c | 58 |
11 files changed, 83 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac index df910280b43..bfd9d5d177c 100644 --- a/configure.ac +++ b/configure.ac @@ -361,7 +361,7 @@ OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts]) OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support]) OPTION_DEFAULT_ON([m17n-flt],[don't use m17n-flt for text shaping]) -OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars]) +OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif/Xaw3d/GTK toolkit scroll bars]) OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d]) OPTION_DEFAULT_ON([xim],[at runtime, default X11 XIM to off]) AC_ARG_WITH([ns],[AS_HELP_STRING([--with-ns], diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index b1a65117167..2aace03a681 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -1319,7 +1319,6 @@ succeeds. @item &define @c @kindex &define @r{(Edebug)} - Indicates that the specification is for a defining form. Edebug's definition of a defining form is a form containing one or more code forms which are saved and executed later, after the execution of the diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 0679537844e..27bfbe8bd85 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1176,12 +1176,12 @@ it does when Lisp code encounters the same situations. @end deftypefn After writing your C code for a module function, you should make a -Lisp function object from it using @code{make_function}. This is +Lisp function object from it using the @code{make_function} function, +whose pointer is provided in the environment (recall that the pointer +to the environment is returned by @code{get_environment}). This is normally done in the module initialization function (@pxref{module initialization function}), after verifying the @acronym{API} -compatibility, and uses the pointer to @code{make_function} provided -in the environment (recall that the pointer to the environment is -returned by @code{get_environment}). +compatibility. @deftypefn Function emacs_value make_function (emacs_env *@var{env}, ptrdiff_t @var{min_arity}, ptrdiff_t @var{max_arity}, subr @var{func}, const char *@var{docstring}, void *@var{data}) @vindex emacs_variadic_function diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index d74fec5cfd9..cb337573259 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -112,24 +112,29 @@ activate the packages in the latter case, @code{package-activate-all} should be called explicitly (e.g., via the @samp{--funcall} option). @vindex initial-window-system@r{, and startup} -@vindex window-system-initialization-alist +@findex window-system-initialization @item If not running in batch mode, it initializes the window system that the variable @code{initial-window-system} specifies (@pxref{Window -Systems, initial-window-system}). The initialization function for -each supported window system is specified by -@code{window-system-initialization-alist}. If the value -of @code{initial-window-system} is @var{windowsystem}, then the -appropriate initialization function is defined in the file -@file{term/@var{windowsystem}-win.el}. This file should have been -compiled into the Emacs executable when it was built. +Systems, initial-window-system}). The initialization function, +@code{window-system-initialization}, is a @dfn{generic function} +(@pxref{Generic Functions}) whose actual implementation is different +for each supported window system. If the value of +@code{initial-window-system} is @var{windowsystem}, then the +appropriate implementation of the initialization function is defined +in the file @file{term/@var{windowsystem}-win.el}. This file should +have been compiled into the Emacs executable when it was built. @item It runs the normal hook @code{before-init-hook}. @item -If appropriate, it creates a graphical frame. This is not done in -batch (noninteractive) or daemon mode. +If appropriate, it creates a graphical frame. As part of creating the +graphical frame, it initializes the window system specified by +@code{initial-frame-alist} and @code{default-frame-alist} +(@pxref{Initial Parameters}) for the graphical frame, by calling the +@code{window-system-initialization} function for that window system. +This is not done in batch (noninteractive) or daemon mode. @item It initializes the initial frame's faces, and sets up the menu bar diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 7cfa5ead5f1..52bfbde41c6 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4212,18 +4212,20 @@ point at the middle, top, and bottom of the window. @cindex vertical scroll position @dfn{Vertical fractional scrolling} means shifting text in a window -up or down by a specified multiple or fraction of a line. Each window -has a @dfn{vertical scroll position}, which is a number, never less than -zero. It specifies how far to raise the contents of the window. -Raising the window contents generally makes all or part of some lines -disappear off the top, and all or part of some other lines appear at the -bottom. The usual value is zero. +up or down by a specified multiple or fraction of a line. Emacs uses +it, for example, on images and screen lines which are taller than the +window. Each window has a @dfn{vertical scroll position}, which is a +number, never less than zero. It specifies how far to raise the +contents of the window when displaying them. Raising the window +contents generally makes all or part of some lines disappear off the +top, and all or part of some other lines appear at the bottom. The +usual value is zero. The vertical scroll position is measured in units of the normal line height, which is the height of the default font. Thus, if the value is -.5, that means the window contents are scrolled up half the normal line -height. If it is 3.3, that means the window contents are scrolled up -somewhat over three times the normal line height. +.5, that means the window contents will be scrolled up half the normal +line height. If it is 3.3, that means the window contents are scrolled +up somewhat over three times the normal line height. What fraction of a line the vertical scrolling covers, or how many lines, depends on what the lines contain. A value of .5 could scroll a diff --git a/src/conf_post.h b/src/conf_post.h index 683a96f9368..2f8b26491b5 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -55,9 +55,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #endif /* The type of bool bitfields. Needed to compile Objective-C with - standard GCC. It was also needed to port to pre-C99 compilers, - although we don't care about that any more. */ -#if NS_IMPL_GNUSTEP + standard GCC, and to make sure adjacent bool_bf fields are packed + into the same 1-, 2-, or 4-byte allocation unit in the MinGW + builds. It was also needed to port to pre-C99 compilers, although + we don't care about that any more. */ +#if NS_IMPL_GNUSTEP || defined(__MINGW32__) typedef unsigned int bool_bf; #else typedef bool bool_bf; diff --git a/src/dispnew.c b/src/dispnew.c index 798413d091c..8742d584930 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4123,7 +4123,12 @@ scrolling_window (struct window *w, bool header_line_p) } #ifdef HAVE_XWIDGETS - /* Currently this seems needed to detect xwidget movement reliably. */ + /* Currently this seems needed to detect xwidget movement reliably. + This is most probably because an xwidget glyph is represented in + struct glyph's 'union u' by a pointer to a struct, which takes 8 + bytes in 64-bit builds, and thus the comparison of u.val values + done by GLYPH_EQUAL_P doesn't work reliably, since it assumes the + size of the union is 4 bytes. FIXME. */ return 0; #endif diff --git a/src/gtkutil.c b/src/gtkutil.c index 6212e1af4e8..da4a0ae13df 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1509,6 +1509,7 @@ xg_set_background_color (struct frame *f, unsigned long bg) block_input (); xg_set_widget_bg (f, FRAME_GTK_WIDGET (f), FRAME_BACKGROUND_PIXEL (f)); +#ifdef USE_TOOLKIT_SCROLL_BARS Lisp_Object bar; for (bar = FRAME_SCROLL_BARS (f); !NILP (bar); @@ -1519,7 +1520,7 @@ xg_set_background_color (struct frame *f, unsigned long bg) GtkWidget *webox = gtk_widget_get_parent (scrollbar); xg_set_widget_bg (f, webox, FRAME_BACKGROUND_PIXEL (f)); } - +#endif unblock_input (); } } diff --git a/src/nsterm.m b/src/nsterm.m index 68ad64660ca..1ef7f5ab516 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2848,6 +2848,7 @@ ns_copy_bits (struct frame *f, NSRect src, NSRect dest) [FRAME_NS_VIEW (f) scrollRect: src by: NSMakeSize (dest.origin.x - src.origin.x, dest.origin.y - src.origin.y)]; + [FRAME_NS_VIEW (f) setNeedsDisplay:YES]; } } diff --git a/src/window.c b/src/window.c index 6cdc52f90e6..20084a15c16 100644 --- a/src/window.c +++ b/src/window.c @@ -7362,6 +7362,8 @@ value. */) DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, doc: /* Return the amount by which WINDOW is scrolled vertically. +This takes effect when displaying tall lines or images. + If WINDOW is omitted or nil, it defaults to the selected window. Normally, value is a multiple of the canonical character height of WINDOW; optional second arg PIXELS-P means value is measured in pixels. */) @@ -7384,6 +7386,8 @@ optional second arg PIXELS-P means value is measured in pixels. */) DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, 2, 3, 0, doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. +This takes effect when displaying tall lines or images. + WINDOW nil means use the selected window. Normally, VSCROLL is a non-negative multiple of the canonical character height of WINDOW; optional third arg PIXELS-P non-nil means that VSCROLL is in pixels. diff --git a/src/xdisp.c b/src/xdisp.c index d61d421f08a..7b0ca477220 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2302,7 +2302,10 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row, ascent value, lest the hollow cursor looks funny. */ y = w->phys_cursor.y; ascent = row->ascent; - if (row->ascent < glyph->ascent) + /* The test for row at ZV is for when line numbers are displayed and + point is at EOB: the cursor could then be smaller or larger than + the default face's font. */ + if (!row->ends_at_zv_p && row->ascent < glyph->ascent) { y -= glyph->ascent - row->ascent; ascent = glyph->ascent; @@ -2312,6 +2315,9 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row, h0 = min (FRAME_LINE_HEIGHT (f), row->visible_height); h = max (h0, ascent + glyph->descent); + /* Don't let the cursor exceed the dimensions of the row, so that + the upper/lower side of the box aren't clipped. */ + h = min (h, row->height); h0 = min (h0, ascent + glyph->descent); y0 = WINDOW_HEADER_LINE_HEIGHT (w); @@ -21232,14 +21238,11 @@ maybe_produce_line_number (struct it *it) for (const char *p = lnum_buf; *p; p++) { /* For continuation lines and lines after ZV, instead of a line - number, produce a blank prefix of the same width. Use the - default face for the blank field beyond ZV. */ - if (beyond_zv) - tem_it.face_id = it->base_face_id; - else if (lnum_face_id != current_lnum_face_id - && (EQ (Vdisplay_line_numbers, Qvisual) - ? this_line == 0 - : this_line == it->pt_lnum)) + number, produce a blank prefix of the same width. */ + if (lnum_face_id != current_lnum_face_id + && (EQ (Vdisplay_line_numbers, Qvisual) + ? this_line == 0 + : this_line == it->pt_lnum)) tem_it.face_id = current_lnum_face_id; else tem_it.face_id = lnum_face_id; @@ -21292,23 +21295,30 @@ maybe_produce_line_number (struct it *it) } } - /* Update IT's metrics due to glyphs produced for line numbers. */ - if (it->glyph_row) + /* Update IT's metrics due to glyphs produced for line numbers. + Don't do that for rows beyond ZV, to avoid displaying a cursor of + different dimensions there. */ + if (!beyond_zv) { - struct glyph_row *row = it->glyph_row; + if (it->glyph_row) + { + struct glyph_row *row = it->glyph_row; - it->max_ascent = max (row->ascent, tem_it.max_ascent); - it->max_descent = max (row->height - row->ascent, tem_it.max_descent); - it->max_phys_ascent = max (row->phys_ascent, tem_it.max_phys_ascent); - it->max_phys_descent = max (row->phys_height - row->phys_ascent, - tem_it.max_phys_descent); - } - else - { - it->max_ascent = max (it->max_ascent, tem_it.max_ascent); - it->max_descent = max (it->max_descent, tem_it.max_descent); - it->max_phys_ascent = max (it->max_phys_ascent, tem_it.max_phys_ascent); - it->max_phys_descent = max (it->max_phys_descent, tem_it.max_phys_descent); + it->max_ascent = max (row->ascent, tem_it.max_ascent); + it->max_descent = max (row->height - row->ascent, tem_it.max_descent); + it->max_phys_ascent = max (row->phys_ascent, tem_it.max_phys_ascent); + it->max_phys_descent = max (row->phys_height - row->phys_ascent, + tem_it.max_phys_descent); + } + else + { + it->max_ascent = max (it->max_ascent, tem_it.max_ascent); + it->max_descent = max (it->max_descent, tem_it.max_descent); + it->max_phys_ascent = max (it->max_phys_ascent, + tem_it.max_phys_ascent); + it->max_phys_descent = max (it->max_phys_descent, + tem_it.max_phys_descent); + } } it->line_number_produced_p = true; |