commit f28166dc9a56111606be8ac50ad38179a66ea636 (HEAD, refs/remotes/origin/master) Author: Federico Tedin Date: Mon Mar 30 21:44:47 2020 +0200 Copy INSIDE_EMACS env variable to subprocesses in Eshell (Bug#25496) * lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS variable to buffer-local value of eshell-variable-aliases-alist. (eshell-inside-emacs): Add new constant used for INSIDE_EMACS. * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc string; remove mention of eshell-user-aliases-list and explain that variables can optionally be copied to subprocesses' environments. * test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var): Add test for the INSIDE_EMACS variable. * etc/NEWS: Announce changes. diff --git a/etc/NEWS b/etc/NEWS index 4acf0f4820..7e578f89db 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -164,6 +164,12 @@ functions accessible to the user through the existing single function hook Modes should use the new hook instead of this user option to register their backends. +** Eshell + +--- +*** Environment variable INSIDE_EMACS is now copied to subprocesses. +Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. + ** Tramp +++ diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 1949e5dc8f..51df6fa1d5 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -168,6 +168,9 @@ Thus, this does not include the current directory.") (defvar eshell-last-dir-ring nil "The last directory that Eshell was in.") +(defconst eshell-inside-emacs (format "%s,eshell" emacs-version) + "Value for the `INSIDE_EMACS' environment variable.") + ;;; Functions: (defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft! @@ -191,6 +194,8 @@ Thus, this does not include the current directory.") (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0)))) + t) + ("INSIDE_EMACS" eshell-inside-emacs t)))) (when eshell-cd-on-directory diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 327a1def46..3093abd830 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -179,10 +179,9 @@ if they are quoted with a backslash." (eshell-apply-indices eshell-command-arguments indices))))) "This list provides aliasing for variable references. -It is very similar in concept to what `eshell-user-aliases-list' does -for commands. Each member of this defines the name of a command, -and the Lisp value to return for that variable if it is accessed -via the syntax `$NAME'. +Each member defines the name of a variable, and a Lisp value used to +compute the string value that will be returned when the variable is +accessed via the syntax `$NAME'. If the value is a function, that function will be called with two arguments: the list of the indices that was used in the reference, and @@ -190,7 +189,21 @@ whether the user is requesting the length of the ultimate element. For example, a reference of `$NAME[10][20]' would result in the function for alias `NAME' being called (assuming it were aliased to a function), and the arguments passed to this function would be the list -'(10 20)', and nil." +'(10 20)', and nil. + +If the value is a string, the value for the variable with that name in +the current environment will be returned. If no variable with that +name exists in the environment, but if a symbol with that same name +exists and has a value bound to it, then that value will be used. You +can prioritize symbol values over environment values by setting +`eshell-prefer-lisp-variables' to t. + +If the value is a symbol, the value bound to that symbol will be used. + +If the value has any other type, `error' will be signaled. + +Additionally, each member may specify if it should be copied to the +environment of created subprocesses." :type '(repeat (list string sexp (choice (const :tag "Copy to environment" t) (const :tag "Use only in Eshell" nil))))) diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 026818ab06..ce8d728833 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -169,6 +169,13 @@ e.g. \"{(+ 1 2)} 3\" => 3" (eshell-command-result-p "+ 1 2; + $_ 4" "3\n6\n"))) +(ert-deftest eshell-test/inside-emacs-var () + "Test presence of \"INSIDE_EMACS\" in subprocesses" + (with-temp-eshell + (eshell-command-result-p "env" + (format "INSIDE_EMACS=%s,eshell" + emacs-version)))) + (ert-deftest eshell-test/escape-nonspecial () "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a special character." commit adfcc17e6ff9e66e9f9bf8d9f5d3236aef4ba4e0 Author: Juri Linkov Date: Fri Apr 3 01:08:09 2020 +0300 * lisp/vc/vc-dir.el: Commands to mark un/registered files (bug#34949) * lisp/vc/vc-dir.el (vc-dir-mark-state-files): New function. (vc-dir-mark-registered-files) (vc-dir-mark-unregistered-files): New commands. (vc-dir-mode-map): Bind vc-dir-mark-registered-files to '* r'. (vc-dir-menu-map): Add menu entries for vc-dir-mark-registered-files and vc-dir-mark-unregistered-files. diff --git a/etc/NEWS b/etc/NEWS index 765a923bf7..4acf0f4820 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -115,6 +115,9 @@ directories with the help of new command 'dired-vc-next-action'. *** New command 'vc-dir-root' uses the root directory without asking. +*** New commands 'vc-dir-mark-registered-files' (bound to '* r') and +'vc-dir-mark-unregistered-files'. + ** Gnus --- diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index ab5943917b..0c9e656add 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -147,6 +147,12 @@ See `run-hooks'." '(menu-item "Unmark Previous " vc-dir-unmark-file-up :help "Move to the previous line and unmark the file")) + (define-key map [mark-unregistered] + '(menu-item "Mark Unregistered" vc-dir-mark-unregistered-files + :help "Mark all files in the unregistered state")) + (define-key map [mark-registered] + '(menu-item "Mark Registered" vc-dir-mark-registered-files + :help "Mark all files in the state edited, added or removed")) (define-key map [mark-all] '(menu-item "Mark All" vc-dir-mark-all-files :help "Mark all files that are in the same state as the current file\ @@ -310,6 +316,10 @@ See `run-hooks'." (define-key branch-map "l" 'vc-print-branch-log) (define-key branch-map "s" 'vc-retrieve-tag)) + (let ((mark-map (make-sparse-keymap))) + (define-key map "*" mark-map) + (define-key mark-map "r" 'vc-dir-mark-registered-files)) + ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] `(menu-item @@ -707,6 +717,27 @@ MARK-FILES should be a list of absolute filenames." t)) vc-ewoc)) +(defun vc-dir-mark-state-files (states) + "Mark files that are in the state specified by the list in STATES." + (unless (listp states) + (setq states (list states))) + (ewoc-map + (lambda (filearg) + (when (memq (vc-dir-fileinfo->state filearg) states) + (setf (vc-dir-fileinfo->marked filearg) t) + t)) + vc-ewoc)) + +(defun vc-dir-mark-registered-files () + "Mark files that are in one of registered state: edited, added or removed." + (interactive) + (vc-dir-mark-state-files '(edited added removed))) + +(defun vc-dir-mark-unregistered-files () + "Mark files that are in unregistered state." + (interactive) + (vc-dir-mark-state-files 'unregistered)) + (defun vc-dir-unmark-file () ;; Unmark the current file and move to the next line. (let* ((crt (ewoc-locate vc-ewoc)) commit bb729496f9b699896fed8d65bf499a193a7c4886 Author: Juri Linkov Date: Fri Apr 3 00:50:19 2020 +0300 * lisp/window.el (display-buffer): Extend doc with body-function (bug#39822) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 00142d87dc..af2f3acd46 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3053,10 +3053,11 @@ action function that cares about this entry. @item body-function The value must be a function taking one argument (a displayed window). This function can be used to fill the displayed window's body with -some contents. It is called @emph{after} the buffer is displayed, and -@emph{before} the entries @code{window-height}, @code{window-width} -and @code{preserve-size} are applied that could resize the window -to fit it to the inserted contents. +some contents that might depend on dimensions of the displayed window. +It is called @emph{after} the buffer is displayed, and @emph{before} +the entries @code{window-height}, @code{window-width} and +@code{preserve-size} are applied that could resize the window to fit +it to the inserted contents. @end table By convention, the entries @code{window-height}, @code{window-width} diff --git a/lisp/window.el b/lisp/window.el index 0121a78191..8512a0e2f9 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7405,6 +7405,12 @@ Action alist entries are: parameters to give the chosen window. `allow-no-window' -- A non-nil value means that `display-buffer' may not display the buffer and return nil immediately. + `body-function' -- A function called with one argument - the + displayed window. It is called after the buffer is + displayed, and before `window-height', `window-width' + and `preserve-size' are applied. The function is supposed + to fill the window body with some contents that might depend + on dimensions of the displayed window. The entries `window-height', `window-width' and `preserve-size' are applied only when the window used for displaying the buffer commit 7e243a87904a036473c6ac87229d4ed652d1e49b Author: Michael Albinus Date: Thu Apr 2 10:00:32 2020 +0200 ; * test/lisp/net/tramp-tests.el (tramp-test30-make-process): Instrument. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 2deab9af25..7722219780 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4333,6 +4333,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; `make-process' supports file name handlers since Emacs 27. (skip-unless (tramp--test-emacs27-p)) + (tramp--test-instrument-test-case 10 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (let ((default-directory tramp-test-temporary-file-directory) (tmp-name1 (tramp--test-make-temp-name nil quoted)) @@ -4493,7 +4494,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Cleanup. (ignore-errors (delete-process proc)) - (ignore-errors (delete-file tmpfile))))))) + (ignore-errors (delete-file tmpfile)))))))) (ert-deftest tramp-test31-interrupt-process () "Check `interrupt-process'." commit 34ae2d0c220c945443e94a43d043a4a63c444bf4 Author: Alexandre Adolphe Date: Sat Aug 10 22:57:24 2019 +0200 Allow negative line width for :box face attribute Separate values for box line width and height and allow both to be negative which makes the visual width and height of the boxed string unchanged (Bug#13011). * doc/lispref/display.texi (Face Attributes): Modify :box attribute description to reflect the new possibilities. * lisp/cus-face.el (custom-face-attributes): Set box attribute to get two integer to set vertical and horizontal width and modify pre-filter to accept dotted list of two int as valid box attribute. * src/dispextern.h (face): Use two int for box horizontal and vertical line width. * src/nsfont.m (nsfont_draw): Use new face attributes. * src/nsterm.m (ns_draw_box, ns_draw_relief): Support separated horizontal and vertical box line width. (ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background) (ns_dumpglyphs_image, ns_draw_glyph_string_foreground) (ns_draw_composite_glyph_string_foreground): Use new face attributes. * src/w32term.c (w32_draw_box_rect, w32_draw_relief_rect): Support separated horizontal and vertical box line width. (x_draw_glyph_string_background, x_draw_glyph_string_foreground) (x_draw_composite_glyph_string_foreground) (x_draw_glyphless_glyph_string_foreground, x_draw_glyph_string_box) (x_draw_image_foreground, x_draw_image_relief) (w32_draw_image_foreground_1, x_draw_image_glyph_string): Use new face attributes. * src/xfaces.c (Sinternal_set_lisp_face_attribute, realize_x_face): Accept box attribute as a list of two ints. * src/xdisp.c (estimate_mode_line_height, produce_image_glyph) (produce_xwidget_glyph, x_produce_glyphs): Use new face attributes. * src/xterm.c (x_draw_box_rect, x_draw_relief_rect): Support separated horizontal and vertical box line width. (x_draw_glyph_string_background, x_draw_glyph_string_foreground) (x_draw_composite_glyph_string_foreground) (x_draw_glyphless_glyph_string_foreground, x_draw_glyph_string_box) (x_draw_image_foreground, x_draw_image_relief, x_draw_image_foreground_1) (x_draw_image_glyph_string): Use new face attributes. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9fbf995d7e..132a3c8535 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2444,12 +2444,15 @@ Draw a box with lines of width 1, in the foreground color. @item @var{color} Draw a box with lines of width 1, in color @var{color}. -@item @code{(:line-width @var{width} :color @var{color} :style @var{style})} -This way you can explicitly specify all aspects of the box. The value -@var{width} specifies the width of the lines to draw; it defaults to -1. A negative width @minus{}@var{n} means to draw a line of width @var{n} -whose top and bottom parts occupy the space of the underlying text, -thus avoiding any increase in the character height. +@item @code{(:line-width (@var{vwidth} . @var{hwidth}) :color @var{color} :style @var{style})} +This way you can explicitly specify all aspects of the box. The values +@var{vwidth} and @var{hwidth} specifies respectively the width of the +vertical and horizontal lines to draw; they default to (1 . 1). +A negative horizontal or vertical width @minus{}@var{n} means to draw a line +of width @var{n} that occupies the space of the underlying text, thus +avoiding any increase in the character height or width. For simplification +the width could be specified with only a single number @var{n} instead +of a list, such case is equivalent to @code{((abs @var{n}) . @var{n})}. The value @var{color} specifies the color to draw with. The default is the foreground color of the face for simple boxes, and the background diff --git a/lisp/cus-face.el b/lisp/cus-face.el index ed4cf046fc..cc766aa450 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -166,9 +166,11 @@ :help-echo "Control box around text." (const :tag "Off" nil) (list :tag "Box" - :value (:line-width 2 :color "grey75" :style released-button) - (const :format "" :value :line-width) - (integer :tag "Width") + :value (:line-width (2 . 2) :color "grey75" :style released-button) + (const :format "" :value :line-width) + (cons :tag "Width" :extra-offset 2 + (integer :tag "Vertical") + (integer :tag "Horizontal")) (const :format "" :value :color) (choice :tag "Color" (const :tag "*" nil) color) (const :format "" :value :style) @@ -181,15 +183,19 @@ (and real-value (let ((lwidth (or (and (consp real-value) - (plist-get real-value :line-width)) + (if (listp (cdr real-value)) + (plist-get real-value :line-width) + real-value)) (and (integerp real-value) real-value) - 1)) + '(1 . 1))) (color (or (and (consp real-value) (plist-get real-value :color)) (and (stringp real-value) real-value) nil)) (style (and (consp real-value) (plist-get real-value :style)))) + (if (integerp lwidth) + (setq lwidth (cons (abs lwidth) lwidth))) (list :line-width lwidth :color color :style style)))) ;; filter to make customized-value suitable for storing (lambda (cus-value) diff --git a/src/dispextern.h b/src/dispextern.h index 08380f1f17..555946f84c 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1693,12 +1693,17 @@ struct face int fontset; /* Non-zero means characters in this face have a box of that - thickness around them. If this value is negative, its absolute - value indicates the thickness, and the horizontal (top and - bottom) borders of box are drawn inside of the character glyphs' - area. The vertical (left and right) borders of the box are drawn - in the same way as when this value is positive. */ - int box_line_width; + thickness around them. Vertical (left and right) and horizontal + (top and bottom) borders size can be set separatedly using an + associated list of two ints in the form + (vertical_size . horizontal_size). In case one of the value is + negative, its absolute value indicates the thickness, and the + borders of box are drawn inside of the character glyphs' area + potentially over the glyph itself but the glyph drawing size is + not increase. If a (signed) int N is use instead of a list, it + is the same as setting ( abs(N) . N ) values. */ + int box_vertical_line_width; + int box_horizontal_line_width; /* Type of box drawn. A value of FACE_NO_BOX means no box is drawn around text in this face. A value of FACE_SIMPLE_BOX means a box diff --git a/src/nsfont.m b/src/nsfont.m index 9bec369178..e41a698a2f 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -1043,7 +1043,7 @@ is false when (FROM > 0 || TO < S->nchars). */ r.origin.x = s->x; if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - r.origin.x += abs (s->face->box_line_width); + r.origin.x += max (s->face->box_vertical_line_width, 0); r.origin.y = s->y; r.size.height = FONT_HEIGHT (font); @@ -1105,7 +1105,7 @@ is false when (FROM > 0 || TO < S->nchars). */ { NSRect br = r; int fibw = FRAME_INTERNAL_BORDER_WIDTH (s->f); - int mbox_line_width = max (s->face->box_line_width, 0); + int mbox_line_width = max (s->face->box_vertical_line_width, 0); if (s->row->full_width_p) { @@ -1129,9 +1129,10 @@ is false when (FROM > 0 || TO < S->nchars). */ } else { - int correction = abs (s->face->box_line_width)+1; + int correction = abs (s->face->box_horizontal_line_width)+1; br.origin.y += correction; br.size.height -= 2*correction; + correction = abs (s->face->box_vertical_line_width)+1; br.origin.x += correction; br.size.width -= 2*correction; } diff --git a/src/nsterm.m b/src/nsterm.m index 04fc051223..3ce223307b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3639,8 +3639,8 @@ larger if there are taller display elements (e.g., characters } static void -ns_draw_box (NSRect r, CGFloat thickness, NSColor *col, - char left_p, char right_p) +ns_draw_box (NSRect r, CGFloat hthickness, CGFloat vthickness, + NSColor *col, char left_p, char right_p) /* -------------------------------------------------------------------------- Draw an unfilled rect inside r, optionally leaving left and/or right open. Note we can't just use an NSDrawRect command, because of the possibility @@ -3651,28 +3651,28 @@ larger if there are taller display elements (e.g., characters [col set]; /* top, bottom */ - s.size.height = thickness; + s.size.height = hthickness; NSRectFill (s); - s.origin.y += r.size.height - thickness; + s.origin.y += r.size.height - hthickness; NSRectFill (s); s.size.height = r.size.height; s.origin.y = r.origin.y; /* left, right (optional) */ - s.size.width = thickness; + s.size.width = vthickness; if (left_p) NSRectFill (s); if (right_p) { - s.origin.x += r.size.width - thickness; + s.origin.x += r.size.width - vthickness; NSRectFill (s); } } static void -ns_draw_relief (NSRect r, int thickness, char raised_p, +ns_draw_relief (NSRect r, int hthickness, int vthickness, char raised_p, char top_p, char bottom_p, char left_p, char right_p, struct glyph_string *s) /* -------------------------------------------------------------------------- @@ -3722,27 +3722,27 @@ larger if there are taller display elements (e.g., characters /* TODO: mitering. Using NSBezierPath doesn't work because of color switch. */ /* top */ - sr.size.height = thickness; + sr.size.height = hthickness; if (top_p) NSRectFill (sr); /* left */ sr.size.height = r.size.height; - sr.size.width = thickness; + sr.size.width = vthickness; if (left_p) NSRectFill (sr); [(raised_p ? darkCol : lightCol) set]; /* bottom */ sr.size.width = r.size.width; - sr.size.height = thickness; - sr.origin.y += r.size.height - thickness; + sr.size.height = hthickness; + sr.origin.y += r.size.height - hthickness; if (bottom_p) NSRectFill (sr); /* right */ sr.size.height = r.size.height; sr.origin.y = r.origin.y; - sr.size.width = thickness; - sr.origin.x += r.size.width - thickness; + sr.size.width = vthickness; + sr.origin.x += r.size.width - vthickness; if (right_p) NSRectFill (sr); } @@ -3758,7 +3758,7 @@ Function modeled after x_draw_glyph_string_box (). char left_p, right_p; struct glyph *last_glyph; NSRect r; - int thickness; + int hthickness, vthickness; struct face *face; if (s->hl == DRAW_MOUSE_FACE) @@ -3771,7 +3771,8 @@ Function modeled after x_draw_glyph_string_box (). else face = s->face; - thickness = face->box_line_width; + vthickness = face->box_vertical_line_width; + hthickness = face->box_horizontal_line_width; NSTRACE ("ns_dumpglyphs_box_or_relief"); @@ -3796,14 +3797,15 @@ Function modeled after x_draw_glyph_string_box (). /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. */ if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color) { - ns_draw_box (r, abs (thickness), + ns_draw_box (r, abs (hthickness), abs (vthickness), ns_lookup_indexed_color (face->box_color, s->f), - left_p, right_p); + left_p, right_p); } else { - ns_draw_relief (r, abs (thickness), s->face->box == FACE_RAISED_BOX, - 1, 1, left_p, right_p, s); + ns_draw_relief (r, abs (hthickness), abs (vthickness), + s->face->box == FACE_RAISED_BOX, + 1, 1, left_p, right_p, s); } } @@ -3819,7 +3821,7 @@ Function modeled after x_draw_glyph_string_box (). if (!s->background_filled_p/* || s->hl == DRAW_MOUSE_FACE*/) { - int box_line_width = max (s->face->box_line_width, 0); + int box_line_width = max (s->face->box_horizontal_line_width, 0); if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font dimensions, since the actual glyphs might be much @@ -3870,7 +3872,7 @@ Function modeled after x_draw_glyph_string_box (). -------------------------------------------------------------------------- */ { EmacsImage *img = s->img->pixmap; - int box_line_vwidth = max (s->face->box_line_width, 0); + int box_line_vwidth = max (s->face->box_horizontal_line_width, 0); int x = s->x, y = s->ybase - image_ascent (s->img, s->face, &s->slice); int bg_x, bg_y, bg_height; int th; @@ -3883,7 +3885,7 @@ Function modeled after x_draw_glyph_string_box (). if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += abs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); bg_x = x; bg_y = s->slice.y == 0 ? s->y : s->y + box_line_vwidth; @@ -4003,7 +4005,7 @@ Function modeled after x_draw_glyph_string_box (). r.origin.y = y - th; r.size.width = s->slice.width + 2*th-1; r.size.height = s->slice.height + 2*th-1; - ns_draw_relief (r, th, raised_p, + ns_draw_relief (r, th, th, raised_p, s->slice.y == 0, s->slice.y + s->slice.height == s->img->height, s->slice.x == 0, @@ -4017,7 +4019,7 @@ Function modeled after x_draw_glyph_string_box (). { int thickness = abs (s->img->relief); if (thickness == 0) thickness = 1; - ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); + ns_draw_box (br, thickness, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); } } @@ -4100,7 +4102,7 @@ overwriting cursor (usually when cursor on a tab) */ of S to the right of that box line. */ if (s->face && s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -4126,7 +4128,7 @@ overwriting cursor (usually when cursor on a tab) */ of S to the right of that box line. */ if (s->face && s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -4142,7 +4144,7 @@ overwriting cursor (usually when cursor on a tab) */ if (s->cmp_from == 0) { NSRect r = NSMakeRect (s->x, s->y, s->width-1, s->height -1); - ns_draw_box (r, 1, FRAME_CURSOR_COLOR (s->f), 1, 1); + ns_draw_box (r, 1, 1, FRAME_CURSOR_COLOR (s->f), 1, 1); } } else if (! s->first_glyph->u.cmp.automatic) diff --git a/src/w32term.c b/src/w32term.c index 76cf6bd696..5fa77d58e1 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -888,10 +888,10 @@ static void w32_draw_image_foreground_1 (struct glyph_string *, HBITMAP); static void w32_clear_glyph_string_rect (struct glyph_string *, int, int, int, int); static void w32_draw_relief_rect (struct frame *, int, int, int, int, - int, int, int, int, int, int, + int, int, int, int, int, int, int, RECT *); static void w32_draw_box_rect (struct glyph_string *, int, int, int, int, - int, bool, bool, RECT *); + int, int, bool, bool, RECT *); /* Set S->gc to a suitable GC for drawing glyph string S in cursor @@ -1160,7 +1160,7 @@ w32_draw_glyph_string_background (struct glyph_string *s, bool force_p) shouldn't be drawn in the first place. */ if (!s->background_filled_p) { - int box_line_width = max (s->face->box_line_width, 0); + int box_line_width = max (s->face->box_horizontal_line_width, 0); #if 0 /* TODO: stipple */ if (s->stippled_p) @@ -1206,7 +1206,7 @@ w32_draw_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -1264,7 +1264,7 @@ w32_draw_composite_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face && s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -1361,7 +1361,7 @@ w32_draw_glyphless_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -1617,7 +1617,7 @@ w32_setup_relief_colors (struct glyph_string *s) static void w32_draw_relief_rect (struct frame *f, int left_x, int top_y, int right_x, int bottom_y, - int width, int raised_p, + int hwidth, int vwidth, int raised_p, int top_p, int bot_p, int left_p, int right_p, RECT *clip_rect) { @@ -1634,14 +1634,14 @@ w32_draw_relief_rect (struct frame *f, /* Top. */ if (top_p) - for (i = 0; i < width; ++i) + for (i = 0; i < hwidth; ++i) w32_fill_area (f, hdc, gc.foreground, left_x + i * left_p, top_y + i, right_x - left_x - i * (left_p + right_p ) + 1, 1); /* Left. */ if (left_p) - for (i = 0; i < width; ++i) + for (i = 0; i < vwidth; ++i) w32_fill_area (f, hdc, gc.foreground, left_x + i, top_y + (i + 1) * top_p, 1, bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); @@ -1653,14 +1653,14 @@ w32_draw_relief_rect (struct frame *f, /* Bottom. */ if (bot_p) - for (i = 0; i < width; ++i) + for (i = 0; i < hwidth; ++i) w32_fill_area (f, hdc, gc.foreground, left_x + i * left_p, bottom_y - i, right_x - left_x - i * (left_p + right_p) + 1, 1); /* Right. */ if (right_p) - for (i = 0; i < width; ++i) + for (i = 0; i < vwidth; ++i) w32_fill_area (f, hdc, gc.foreground, right_x - i, top_y + (i + 1) * top_p, 1, bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); @@ -1680,31 +1680,31 @@ w32_draw_relief_rect (struct frame *f, static void w32_draw_box_rect (struct glyph_string *s, - int left_x, int top_y, int right_x, int bottom_y, int width, - bool left_p, bool right_p, RECT *clip_rect) + int left_x, int top_y, int right_x, int bottom_y, int hwidth, + int vwidth, bool left_p, bool right_p, RECT *clip_rect) { w32_set_clip_rectangle (s->hdc, clip_rect); /* Top. */ w32_fill_area (s->f, s->hdc, s->face->box_color, - left_x, top_y, right_x - left_x + 1, width); + left_x, top_y, right_x - left_x + 1, hwidth); /* Left. */ if (left_p) { w32_fill_area (s->f, s->hdc, s->face->box_color, - left_x, top_y, width, bottom_y - top_y + 1); + left_x, top_y, vwidth, bottom_y - top_y + 1); } /* Bottom. */ w32_fill_area (s->f, s->hdc, s->face->box_color, - left_x, bottom_y - width + 1, right_x - left_x + 1, width); + left_x, bottom_y - hwidth + 1, right_x - left_x + 1, hwidth); /* Right. */ if (right_p) { w32_fill_area (s->f, s->hdc, s->face->box_color, - right_x - width + 1, top_y, width, bottom_y - top_y + 1); + right_x - vwidth + 1, top_y, vwidth, bottom_y - top_y + 1); } w32_set_clip_rectangle (s->hdc, NULL); @@ -1716,7 +1716,7 @@ w32_draw_box_rect (struct glyph_string *s, static void w32_draw_glyph_string_box (struct glyph_string *s) { - int width, left_x, right_x, top_y, bottom_y, last_x; + int hwidth, vwidth, left_x, right_x, top_y, bottom_y, last_x; bool left_p, right_p, raised_p; struct glyph *last_glyph; RECT clip_rect; @@ -1730,7 +1730,8 @@ w32_draw_glyph_string_box (struct glyph_string *s) ? s->first_glyph : s->first_glyph + s->nchars - 1); - width = eabs (s->face->box_line_width); + vwidth = eabs (s->face->box_vertical_line_width); + hwidth = eabs (s->face->box_horizontal_line_width); raised_p = s->face->box == FACE_RAISED_BOX; left_x = s->x; right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p @@ -1751,13 +1752,13 @@ w32_draw_glyph_string_box (struct glyph_string *s) get_glyph_string_clip_rect (s, &clip_rect); if (s->face->box == FACE_SIMPLE_BOX) - w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, - left_p, right_p, &clip_rect); + w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, left_p, right_p, &clip_rect); else { w32_setup_relief_colors (s); - w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, - width, raised_p, 1, 1, left_p, right_p, &clip_rect); + w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, raised_p, 1, 1, left_p, right_p, &clip_rect); } } @@ -1795,7 +1796,7 @@ w32_draw_image_foreground (struct glyph_string *s) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -1982,7 +1983,7 @@ w32_draw_image_relief (struct glyph_string *s) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -2034,7 +2035,7 @@ w32_draw_image_relief (struct glyph_string *s) w32_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); - w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, + w32_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p, top_p, bot_p, left_p, right_p, &r); } @@ -2054,7 +2055,7 @@ w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -2167,8 +2168,8 @@ static void w32_draw_image_glyph_string (struct glyph_string *s) { int x, y; - int box_line_hwidth = eabs (s->face->box_line_width); - int box_line_vwidth = max (s->face->box_line_width, 0); + int box_line_hwidth = max (s->face->box_vertical_line_width, 0); + int box_line_vwidth = max (s->face->box_horizontal_line_width, 0); int height, width; HBITMAP pixmap = 0; diff --git a/src/xdisp.c b/src/xdisp.c index 61c798c59e..cbdef7ad11 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2061,8 +2061,8 @@ estimate_mode_line_height (struct frame *f, enum face_id face_id) { if (face->font) height = normal_char_height (face->font, -1); - if (face->box_line_width > 0) - height += 2 * face->box_line_width; + if (face->box_horizontal_line_width > 0) + height += 2 * face->box_horizontal_line_width; } } @@ -28900,18 +28900,21 @@ produce_image_glyph (struct it *it) if (face->box != FACE_NO_BOX) { - if (face->box_line_width > 0) + if (face->box_horizontal_line_width > 0) { if (slice.y == 0) - it->ascent += face->box_line_width; + it->ascent += face->box_horizontal_line_width; if (slice.y + slice.height == img->height) - it->descent += face->box_line_width; + it->descent += face->box_horizontal_line_width; } - if (it->start_of_box_run_p && slice.x == 0) - it->pixel_width += eabs (face->box_line_width); - if (it->end_of_box_run_p && slice.x + slice.width == img->width) - it->pixel_width += eabs (face->box_line_width); + if (face->box_vertical_line_width > 0) + { + if (it->start_of_box_run_p && slice.x == 0) + it->pixel_width += face->box_vertical_line_width; + if (it->end_of_box_run_p && slice.x + slice.width == img->width) + it->pixel_width += face->box_vertical_line_width; + } } take_vertical_position_into_account (it); @@ -29009,15 +29012,18 @@ produce_xwidget_glyph (struct it *it) if (face->box != FACE_NO_BOX) { - if (face->box_line_width > 0) + if (face->box_horizontal_line_width > 0) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + it->ascent += face->box_horizontal_line_width; + it->descent += face->box_horizontal_line_width; } - if (it->start_of_box_run_p) - it->pixel_width += eabs (face->box_line_width); - it->pixel_width += eabs (face->box_line_width); + if (face->box_vertical_line_width > 0) + { + if (it->start_of_box_run_p) + it->pixel_width += face->box_vertical_line_width; + it->pixel_width += face->box_vertical_line_width; + } } take_vertical_position_into_account (it); @@ -29780,6 +29786,31 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym) } +/* If face has a box, add the box thickness to the character + height. If character has a box line to the left and/or + right, add the box line width to the character's width. */ +#define IT_APPLY_FACE_BOX(it, face) \ + do { \ + if (face->box != FACE_NO_BOX) \ + { \ + int thick = face->box_horizontal_line_width; \ + if (thick > 0) \ + { \ + it->ascent += thick; \ + it->descent += thick; \ + } \ + \ + thick = face->box_vertical_line_width; \ + if (thick > 0) \ + { \ + if (it->start_of_box_run_p) \ + it->pixel_width += thick; \ + if (it->end_of_box_run_p) \ + it->pixel_width += thick; \ + } \ + } \ + } while (false) + /* RIF: Produce glyphs/get display metrics for the display element IT is loaded with. See the description of struct it in dispextern.h @@ -29895,26 +29926,7 @@ gui_produce_glyphs (struct it *it) if (stretched_p) it->pixel_width *= XFLOATINT (it->space_width); - /* If face has a box, add the box thickness to the character - height. If character has a box line to the left and/or - right, add the box line width to the character's width. */ - if (face->box != FACE_NO_BOX) - { - int thick = face->box_line_width; - - if (thick > 0) - { - it->ascent += thick; - it->descent += thick; - } - else - thick = -thick; - - if (it->start_of_box_run_p) - it->pixel_width += thick; - if (it->end_of_box_run_p) - it->pixel_width += thick; - } + IT_APPLY_FACE_BOX(it, face); /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ @@ -30029,10 +30041,10 @@ gui_produce_glyphs (struct it *it) if ((it->max_ascent > 0 || it->max_descent > 0) && face->box != FACE_NO_BOX - && face->box_line_width > 0) + && face->box_horizontal_line_width > 0) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + it->ascent += face->box_horizontal_line_width; + it->descent += face->box_horizontal_line_width; } if (!NILP (height) && XFIXNUM (height) > it->ascent + it->descent) @@ -30439,23 +30451,7 @@ gui_produce_glyphs (struct it *it) it->pixel_width = cmp->pixel_width; it->ascent = it->phys_ascent = cmp->ascent; it->descent = it->phys_descent = cmp->descent; - if (face->box != FACE_NO_BOX) - { - int thick = face->box_line_width; - - if (thick > 0) - { - it->ascent += thick; - it->descent += thick; - } - else - thick = - thick; - - if (it->start_of_box_run_p) - it->pixel_width += thick; - if (it->end_of_box_run_p) - it->pixel_width += thick; - } + IT_APPLY_FACE_BOX(it, face); /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ @@ -30489,23 +30485,8 @@ gui_produce_glyphs (struct it *it) it->glyph_row->contains_overlapping_glyphs_p = true; it->ascent = it->phys_ascent = metrics.ascent; it->descent = it->phys_descent = metrics.descent; - if (face->box != FACE_NO_BOX) - { - int thick = face->box_line_width; + IT_APPLY_FACE_BOX(it, face); - if (thick > 0) - { - it->ascent += thick; - it->descent += thick; - } - else - thick = - thick; - - if (it->start_of_box_run_p) - it->pixel_width += thick; - if (it->end_of_box_run_p) - it->pixel_width += thick; - } /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) diff --git a/src/xfaces.c b/src/xfaces.c index 711ec48bbd..bab142ade0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3128,6 +3128,8 @@ FRAME 0 means change the face on all frames, and change the default valid_p = XFIXNUM (value) != 0; else if (STRINGP (value)) valid_p = SCHARS (value) > 0; + else if (CONSP (value) && FIXNUMP (XCAR (value)) && FIXNUMP (XCDR (value))) + valid_p = true; else if (CONSP (value)) { Lisp_Object tem; @@ -3146,7 +3148,9 @@ FRAME 0 means change the face on all frames, and change the default if (EQ (k, QCline_width)) { - if (!FIXNUMP (v) || XFIXNUM (v) == 0) + if ((!CONSP(v) || !FIXNUMP (XCAR (v)) || XFIXNUM (XCAR (v)) == 0 + || !FIXNUMP (XCDR (v)) || XFIXNUM (XCDR (v)) == 0) + && (!FIXNUMP (v) || XFIXNUM (v) == 0)) break; } else if (EQ (k, QCcolor)) @@ -5815,7 +5819,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->box_color = load_color (f, face, attrs[LFACE_BOX_INDEX], LFACE_BOX_INDEX); face->box = FACE_SIMPLE_BOX; - face->box_line_width = 1; + face->box_vertical_line_width = face->box_horizontal_line_width = 1; } else if (FIXNUMP (box)) { @@ -5823,9 +5827,19 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face. */ eassert (XFIXNUM (box) != 0); face->box = FACE_SIMPLE_BOX; - face->box_line_width = XFIXNUM (box); + face->box_vertical_line_width = eabs(XFIXNUM (box)); + face->box_horizontal_line_width = XFIXNUM (box); + face->box_color = face->foreground; + face->box_color_defaulted_p = true; + } + else if (CONSP (box) && FIXNUMP (XCAR (box)) && FIXNUMP (XCDR (box))) + { + /* `(VWIDTH . HWIDTH)'. */ + face->box = FACE_SIMPLE_BOX; face->box_color = face->foreground; face->box_color_defaulted_p = true; + face->box_vertical_line_width = XFIXNUM (XCAR (box)); + face->box_horizontal_line_width = XFIXNUM (XCDR (box)); } else if (CONSP (box)) { @@ -5834,7 +5848,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->box = FACE_SIMPLE_BOX; face->box_color = face->foreground; face->box_color_defaulted_p = true; - face->box_line_width = 1; + face->box_vertical_line_width = face->box_horizontal_line_width = 1; while (CONSP (box)) { @@ -5850,8 +5864,14 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] if (EQ (keyword, QCline_width)) { - if (FIXNUMP (value) && XFIXNUM (value) != 0) - face->box_line_width = XFIXNUM (value); + if (CONSP (value) && FIXNUMP (XCAR (value)) && FIXNUMP (XCDR (value))) { + face->box_vertical_line_width = XFIXNUM (XCAR (value)); + face->box_horizontal_line_width = XFIXNUM (XCDR (value)); + } + else if (FIXNUMP (value) && XFIXNUM (value) != 0) { + face->box_vertical_line_width = eabs (XFIXNUM (value)); + face->box_horizontal_line_width = XFIXNUM (value); + } } else if (EQ (keyword, QCcolor)) { diff --git a/src/xterm.c b/src/xterm.c index d7d992c91b..fc68c77048 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1754,7 +1754,7 @@ x_draw_glyph_string_background (struct glyph_string *s, bool force_p) shouldn't be drawn in the first place. */ if (!s->background_filled_p) { - int box_line_width = max (s->face->box_line_width, 0); + int box_line_width = max (s->face->box_horizontal_line_width, 0); if (s->stippled_p) { @@ -1799,7 +1799,7 @@ x_draw_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -1849,7 +1849,7 @@ x_draw_glyph_string_foreground (struct glyph_string *s) if (!(s->for_overlaps || (s->background_filled_p && s->hl != DRAW_CURSOR))) { - int box_line_width = max (s->face->box_line_width, 0); + int box_line_width = max (s->face->box_horizontal_line_width, 0); if (s->stippled_p) { @@ -1893,7 +1893,7 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face && s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -2004,7 +2004,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) of S to the right of that box line. */ if (s->face && s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + eabs (s->face->box_line_width); + x = s->x + max (s->face->box_vertical_line_width, 0); else x = s->x; @@ -2769,7 +2769,7 @@ x_setup_relief_colors (struct glyph_string *s) static void x_draw_relief_rect (struct frame *f, int left_x, int top_y, int right_x, int bottom_y, - int width, bool raised_p, bool top_p, bool bot_p, + int hwidth, int vwidth, bool raised_p, bool top_p, bool bot_p, bool left_p, bool right_p, XRectangle *clip_rect) { @@ -2794,7 +2794,7 @@ x_draw_relief_rect (struct frame *f, if (left_p) { x_fill_rectangle (f, top_left_gc, left_x, top_y, - width, bottom_y + 1 - top_y); + vwidth, bottom_y + 1 - top_y); if (top_p) corners |= 1 << CORNER_TOP_LEFT; if (bot_p) @@ -2802,8 +2802,8 @@ x_draw_relief_rect (struct frame *f, } if (right_p) { - x_fill_rectangle (f, bottom_right_gc, right_x + 1 - width, top_y, - width, bottom_y + 1 - top_y); + x_fill_rectangle (f, bottom_right_gc, right_x + 1 - vwidth, top_y, + vwidth, bottom_y + 1 - top_y); if (top_p) corners |= 1 << CORNER_TOP_RIGHT; if (bot_p) @@ -2813,25 +2813,25 @@ x_draw_relief_rect (struct frame *f, { if (!right_p) x_fill_rectangle (f, top_left_gc, left_x, top_y, - right_x + 1 - left_x, width); + right_x + 1 - left_x, hwidth); else x_fill_trapezoid_for_relief (f, top_left_gc, left_x, top_y, - right_x + 1 - left_x, width, 1); + right_x + 1 - left_x, hwidth, 1); } if (bot_p) { if (!left_p) - x_fill_rectangle (f, bottom_right_gc, left_x, bottom_y + 1 - width, - right_x + 1 - left_x, width); + x_fill_rectangle (f, bottom_right_gc, left_x, bottom_y + 1 - hwidth, + right_x + 1 - left_x, hwidth); else x_fill_trapezoid_for_relief (f, bottom_right_gc, - left_x, bottom_y + 1 - width, - right_x + 1 - left_x, width, 0); + left_x, bottom_y + 1 - hwidth, + right_x + 1 - left_x, hwidth, 0); } - if (left_p && width != 1) + if (left_p && vwidth > 1) x_fill_rectangle (f, bottom_right_gc, left_x, top_y, 1, bottom_y + 1 - top_y); - if (top_p && width != 1) + if (top_p && hwidth > 1) x_fill_rectangle (f, bottom_right_gc, left_x, top_y, right_x + 1 - left_x, 1); if (corners) @@ -2865,12 +2865,12 @@ x_draw_relief_rect (struct frame *f, /* Top. */ if (top_p) { - if (width == 1) + if (hwidth == 1) XDrawLine (dpy, drawable, gc, left_x + left_p, top_y, right_x + !right_p, top_y); - for (i = 1; i < width; ++i) + for (i = 1; i < hwidth; ++i) XDrawLine (dpy, drawable, gc, left_x + i * left_p, top_y + i, right_x + 1 - i * right_p, top_y + i); @@ -2879,13 +2879,10 @@ x_draw_relief_rect (struct frame *f, /* Left. */ if (left_p) { - if (width == 1) + if (vwidth == 1) XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y); - x_clear_area(f, left_x, top_y, 1, 1); - x_clear_area(f, left_x, bottom_y, 1, 1); - - for (i = (width > 1 ? 1 : 0); i < width; ++i) + for (i = 1; i < vwidth; ++i) XDrawLine (dpy, drawable, gc, left_x + i, top_y + (i + 1) * top_p, left_x + i, bottom_y + 1 - (i + 1) * bot_p); @@ -2898,26 +2895,25 @@ x_draw_relief_rect (struct frame *f, gc = f->output_data.x->white_relief.gc; XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); - if (width > 1) - { - /* Outermost top line. */ - if (top_p) - XDrawLine (dpy, drawable, gc, - left_x + left_p, top_y, - right_x + !right_p, top_y); + /* Outermost top line. */ + if (top_p && hwidth > 1) + XDrawLine (dpy, drawable, gc, + left_x + left_p, top_y, + right_x + !right_p, top_y); - /* Outermost left line. */ - if (left_p) - XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y); - } + /* Outermost left line. */ + if (left_p && vwidth > 1) + XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y); /* Bottom. */ if (bot_p) { - XDrawLine (dpy, drawable, gc, - left_x + left_p, bottom_y, - right_x + !right_p, bottom_y); - for (i = 1; i < width; ++i) + if (hwidth >= 1) + XDrawLine (dpy, drawable, gc, + left_x + left_p, bottom_y, + right_x + !right_p, bottom_y); + + for (i = 1; i < hwidth; ++i) XDrawLine (dpy, drawable, gc, left_x + i * left_p, bottom_y - i, right_x + 1 - i * right_p, bottom_y - i); @@ -2926,9 +2922,7 @@ x_draw_relief_rect (struct frame *f, /* Right. */ if (right_p) { - x_clear_area(f, right_x, top_y, 1, 1); - x_clear_area(f, right_x, bottom_y, 1, 1); - for (i = 0; i < width; ++i) + for (i = 0; i < vwidth; ++i) XDrawLine (dpy, drawable, gc, right_x - i, top_y + (i + 1) * top_p, right_x - i, bottom_y + 1 - (i + 1) * bot_p); @@ -2949,8 +2943,8 @@ x_draw_relief_rect (struct frame *f, static void x_draw_box_rect (struct glyph_string *s, - int left_x, int top_y, int right_x, int bottom_y, int width, - bool left_p, bool right_p, XRectangle *clip_rect) + int left_x, int top_y, int right_x, int bottom_y, int hwidth, + int vwidth, bool left_p, bool right_p, XRectangle *clip_rect) { Display *display = FRAME_X_DISPLAY (s->f); XGCValues xgcv; @@ -2961,21 +2955,21 @@ x_draw_box_rect (struct glyph_string *s, /* Top. */ x_fill_rectangle (s->f, s->gc, - left_x, top_y, right_x - left_x + 1, width); + left_x, top_y, right_x - left_x + 1, hwidth); /* Left. */ if (left_p) x_fill_rectangle (s->f, s->gc, - left_x, top_y, width, bottom_y - top_y + 1); + left_x, top_y, vwidth, bottom_y - top_y + 1); /* Bottom. */ x_fill_rectangle (s->f, s->gc, - left_x, bottom_y - width + 1, right_x - left_x + 1, width); + left_x, bottom_y - hwidth + 1, right_x - left_x + 1, hwidth); /* Right. */ if (right_p) x_fill_rectangle (s->f, s->gc, - right_x - width + 1, top_y, width, bottom_y - top_y + 1); + right_x - vwidth + 1, top_y, vwidth, bottom_y - top_y + 1); XSetForeground (display, s->gc, xgcv.foreground); x_reset_clip_rectangles (s->f, s->gc); @@ -2987,7 +2981,7 @@ x_draw_box_rect (struct glyph_string *s, static void x_draw_glyph_string_box (struct glyph_string *s) { - int width, left_x, right_x, top_y, bottom_y, last_x; + int hwidth, vwidth, left_x, right_x, top_y, bottom_y, last_x; bool raised_p, left_p, right_p; struct glyph *last_glyph; XRectangle clip_rect; @@ -3001,7 +2995,8 @@ x_draw_glyph_string_box (struct glyph_string *s) ? s->first_glyph : s->first_glyph + s->nchars - 1); - width = eabs (s->face->box_line_width); + vwidth = eabs (s->face->box_vertical_line_width); + hwidth = eabs (s->face->box_horizontal_line_width); raised_p = s->face->box == FACE_RAISED_BOX; left_x = s->x; right_x = (s->row->full_width_p && s->extends_to_end_of_line_p @@ -3022,13 +3017,13 @@ x_draw_glyph_string_box (struct glyph_string *s) get_glyph_string_clip_rect (s, &clip_rect); if (s->face->box == FACE_SIMPLE_BOX) - x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, - left_p, right_p, &clip_rect); + x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, left_p, right_p, &clip_rect); else { x_setup_relief_colors (s); - x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, - width, raised_p, true, true, left_p, right_p, + x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, raised_p, true, true, left_p, right_p, &clip_rect); } } @@ -3086,7 +3081,7 @@ x_draw_image_foreground (struct glyph_string *s) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -3205,7 +3200,7 @@ x_draw_image_relief (struct glyph_string *s) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -3273,7 +3268,7 @@ x_draw_image_relief (struct glyph_string *s) x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); - x_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, + x_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p, top_p, bot_p, left_p, right_p, &r); } @@ -3292,7 +3287,7 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap) if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p && s->slice.x == 0) - x += eabs (s->face->box_line_width); + x += max (s->face->box_vertical_line_width, 0); /* If there is a margin around the image, adjust x- and y-position by that margin. */ @@ -3394,8 +3389,8 @@ x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h) static void x_draw_image_glyph_string (struct glyph_string *s) { - int box_line_hwidth = eabs (s->face->box_line_width); - int box_line_vwidth = max (s->face->box_line_width, 0); + int box_line_hwidth = max (s->face->box_vertical_line_width, 0); + int box_line_vwidth = max (s->face->box_horizontal_line_width, 0); int height; #ifndef USE_CAIRO Display *display = FRAME_X_DISPLAY (s->f); commit b538cd88b484e54d9afa970dc7bdd93ba39ad03d Author: Andreas Schwab Date: Wed Apr 1 17:26:14 2020 +0200 Fix compilation with CHECK_STRUCTS * src/pdumper.c (dump_buffer): Update hash of struct buffer. diff --git a/src/pdumper.c b/src/pdumper.c index b5861950c9..63424c5734 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2769,7 +2769,7 @@ dump_hash_table (struct dump_context *ctx, static dump_off dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) { -#if CHECK_STRUCTS && !defined HASH_buffer_375A10F5E5 +#if CHECK_STRUCTS && !defined HASH_buffer_5DC36DBD42 # error "buffer changed. See CHECK_STRUCTS comment in config.h." #endif struct buffer munged_buffer = *in_buffer; commit 953b5b4a6d2b47bd762df4edfc4764b3d518dda9 Author: Glenn Morris Date: Wed Apr 1 06:26:50 2020 -0700 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 8776e9ba70..10dc78d628 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -4480,7 +4480,6 @@ Returns non-nil if any false statements are found. ;;;### (autoloads nil "checkdoc" "emacs-lisp/checkdoc.el" (0 0 0 ;;;;;; 0)) ;;; Generated autoloads from emacs-lisp/checkdoc.el -(push (purecopy '(checkdoc 0 6 2)) package--builtin-versions) (put 'checkdoc-force-docstrings-flag 'safe-local-variable #'booleanp) (put 'checkdoc-force-history-flag 'safe-local-variable #'booleanp) (put 'checkdoc-permit-comma-termination-flag 'safe-local-variable #'booleanp) @@ -5492,7 +5491,9 @@ doesn't have enough contents to decide, this is identical to See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode', `conf-ppd-mode' and `conf-xdefaults-mode'. -\\{conf-mode-map}" t nil) +\\{conf-mode-map} + +\(fn)" t nil) (autoload 'conf-unix-mode "conf-mode" "\ Conf Mode starter for Unix style Conf files. @@ -6469,7 +6470,6 @@ Mode used for cvs status output. ;;;### (autoloads nil "cwarn" "progmodes/cwarn.el" (0 0 0 0)) ;;; Generated autoloads from progmodes/cwarn.el -(push (purecopy '(cwarn 1 3 1)) package--builtin-versions) (autoload 'cwarn-mode "cwarn" "\ Minor mode that highlights suspicious C and C++ constructions. @@ -14250,6 +14250,10 @@ DELAY is a string, giving the length of the time. Possible values are: * hh:mm for a specific time. Use 24h format. If it is later than this time, then the deadline is tomorrow, else today. +The value of `message-draft-headers' determines which headers are +generated when the article is delayed. Remaining headers are +generated when the article is sent. + \(fn DELAY)" t nil) (autoload 'gnus-delay-send-queue "gnus-delay" "\ @@ -15727,6 +15731,21 @@ keymap value. \(fn KEYMAP)" t nil) +(autoload 'describe-mode "help-fns" "\ +Display documentation of current major mode and minor modes. +A brief summary of the minor modes comes first, followed by the +major mode description. This is followed by detailed +descriptions of the minor modes, each on a separate page. + +For this to work correctly for a minor mode, the mode's indicator +variable (listed in `minor-mode-alist') must also be a function +whose documentation describes the minor mode. + +If called from Lisp with a non-nil BUFFER argument, display +documentation for the major and minor modes of that buffer. + +\(fn &optional BUFFER)" t nil) + (autoload 'doc-file-to-man "help-fns" "\ Produce an nroff buffer containing the doc-strings from the DOC file. @@ -16403,7 +16422,6 @@ See `highlight-changes-mode' for more information on Highlight-Changes mode. ;;;### (autoloads nil "hippie-exp" "hippie-exp.el" (0 0 0 0)) ;;; Generated autoloads from hippie-exp.el -(push (purecopy '(hippie-exp 1 6)) package--builtin-versions) (defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\ The list of expansion functions tried in order by `hippie-expand'. @@ -16825,7 +16843,6 @@ If optional arg OTHER-WINDOW is non-nil, then use another window. ;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (0 0 0 ;;;;;; 0)) ;;; Generated autoloads from calendar/icalendar.el -(push (purecopy '(icalendar 0 19)) package--builtin-versions) (autoload 'icalendar-export-file "icalendar" "\ Export diary file to iCalendar format. @@ -19518,7 +19535,6 @@ generations (this defaults to 1). ;;;### (autoloads nil "linum" "linum.el" (0 0 0 0)) ;;; Generated autoloads from linum.el -(push (purecopy '(linum 0 9 24)) package--builtin-versions) (autoload 'linum-mode "linum" "\ Toggle display of line numbers in the left margin (Linum mode). @@ -20424,7 +20440,6 @@ Default bookmark handler for Man buffers. ;;;### (autoloads nil "master" "master.el" (0 0 0 0)) ;;; Generated autoloads from master.el -(push (purecopy '(master 1 0 2)) package--builtin-versions) (autoload 'master-mode "master" "\ Toggle Master mode. @@ -24582,7 +24597,7 @@ Mark the installed package as selected by adding it to When called from Lisp and optional argument DONT-SELECT is non-nil, install the package but do not add it to -`package-select-packages'. +`package-selected-packages'. If PKG is a `package-desc' and it is already installed, don't try to install it but still mark it as selected. @@ -26151,14 +26166,16 @@ recognized." t nil) (autoload 'project-search "project" "\ Search for REGEXP in all the files of the project. Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]. +To continue searching for the next match, use the +command \\[fileloop-continue]. \(fn REGEXP)" t nil) (autoload 'project-query-replace-regexp "project" "\ -Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]. +Query-replace REGEXP in all the files of the project. +Stops when a match is found and prompts for whether to replace it. +If you exit the query-replace, you can later continue the query-replace +loop using the command \\[fileloop-continue]. \(fn FROM TO)" t nil) @@ -27476,7 +27493,6 @@ This means the number of non-shy regexp grouping constructs ;;;### (autoloads nil "remember" "textmodes/remember.el" (0 0 0 0)) ;;; Generated autoloads from textmodes/remember.el -(push (purecopy '(remember 2 0)) package--builtin-versions) (autoload 'remember "remember" "\ Remember an arbitrary piece of data. @@ -27528,7 +27544,6 @@ to turn the *scratch* buffer into your notes buffer. ;;;### (autoloads nil "repeat" "repeat.el" (0 0 0 0)) ;;; Generated autoloads from repeat.el -(push (purecopy '(repeat 0 51)) package--builtin-versions) (autoload 'repeat "repeat" "\ Repeat most recently executed command. @@ -28403,7 +28418,6 @@ Major mode for editing Ruby code. ;;;### (autoloads nil "ruler-mode" "ruler-mode.el" (0 0 0 0)) ;;; Generated autoloads from ruler-mode.el -(push (purecopy '(ruler-mode 1 6)) package--builtin-versions) (defvar ruler-mode nil "\ Non-nil if Ruler mode is enabled. @@ -30585,7 +30599,9 @@ enable the mode if ARG is omitted or nil, and toggle it if ARG is (autoload 'smerge-start-session "smerge-mode" "\ Turn on `smerge-mode' and move point to first conflict marker. -If no conflict maker is found, turn off `smerge-mode'." t nil) +If no conflict maker is found, turn off `smerge-mode'. + +\(fn &optional INTERACTIVELY)" t nil) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "smerge-mode" '("smerge-"))) @@ -32669,16 +32685,17 @@ WHERE is provided the cell and table at that location is reported. (autoload 'table-generate-source "table" "\ Generate source of the current table in the specified language. LANGUAGE is a symbol that specifies the language to describe the -structure of the table. It must be either `html', `latex' or `cals'. -The resulted source text is inserted into DEST-BUFFER and the buffer -object is returned. When DEST-BUFFER is omitted or nil the default -buffer specified in `table-dest-buffer-name' is used. In this case -the content of the default buffer is erased prior to the generation. -When DEST-BUFFER is non-nil it is expected to be either a destination -buffer or a name of the destination buffer. In this case the -generated result is inserted at the current point in the destination -buffer and the previously existing contents in the buffer are -untouched. +structure of the table. It must be either `html', `latex', `cals', +`wiki', or `mediawiki'. +The function inserts the resulting source text into DEST-BUFFER, and +returns the buffer object. When DEST-BUFFER is omitted or nil, the +function uses the default buffer specified in `table-dest-buffer-name'. +In this case, the function erases the default buffer prior to the +source generation. +When DEST-BUFFER is non-nil, it should be either a destination +buffer or a name of the destination buffer. In that case, the +function inserts the generated result at point in the destination +buffer, and leaves the previous contents of the buffer untouched. References used for this implementation: @@ -33239,7 +33256,7 @@ Should show the queue(s) that \\[tex-print] puts jobs on.") (custom-autoload 'tex-show-queue-command "tex-mode" t) -(defvar tex-default-mode 'latex-mode "\ +(defvar tex-default-mode #'latex-mode "\ Mode to enter for a new file that might be either TeX or LaTeX. This variable is used when it can't be determined whether the file is plain TeX or LaTeX or what because the file contains no commands. @@ -33259,11 +33276,14 @@ String inserted by typing \\[tex-insert-quote] to close a quotation.") (autoload 'tex-mode "tex-mode" "\ Major mode for editing files of input for TeX, LaTeX, or SliTeX. +This is the shared parent mode of several submodes. Tries to determine (by looking at the beginning of the file) whether this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode', -`latex-mode', or `slitex-mode', respectively. If it cannot be determined, +`latex-mode', or `slitex-mode', accordingly. If it cannot be determined, such as if there are no commands in the file, the value of `tex-default-mode' -says which mode to use." t nil) +says which mode to use. + +\(fn)" t nil) (defalias 'TeX-mode 'tex-mode) @@ -36093,7 +36113,7 @@ with its diffs (if the underlying VCS supports that). \(fn &optional LIMIT REVISION)" t nil) (autoload 'vc-print-branch-log "vc" "\ -Show the change log for BRANCH in a window. +Show the change log for BRANCH root in a window. \(fn BRANCH)" t nil) @@ -36317,6 +36337,11 @@ Name of the format file in a .bzr directory.") ;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (0 0 0 0)) ;;; Generated autoloads from vc/vc-dir.el +(autoload 'vc-dir-root "vc-dir" "\ +Run `vc-dir' in the repository root directory without prompt. +If the default directory of the current buffer is +not under version control, prompt for a directory." t nil) + (autoload 'vc-dir "vc-dir" "\ Show the VC status for \"interesting\" files in and below DIR. This allows you to mark files and perform VC operations on them. @@ -37745,7 +37770,6 @@ this is equivalent to `display-warning', using ;;;### (autoloads nil "wdired" "wdired.el" (0 0 0 0)) ;;; Generated autoloads from wdired.el -(push (purecopy '(wdired 2 0)) package--builtin-versions) (autoload 'wdired-change-to-wdired-mode "wdired" "\ Put a Dired buffer in Writable Dired (WDired) mode. @@ -38344,6 +38368,11 @@ Display the next buffer in the same window. \(fn &optional ARG)" t nil) +(autoload 'windmove-display-new-frame "windmove" "\ +Display the next buffer in a new frame. + +\(fn &optional ARG)" t nil) + (autoload 'windmove-display-new-tab "windmove" "\ Display the next buffer in a new tab. @@ -38456,7 +38485,6 @@ you can press `C-c ' (calling `winner-redo'). ;;;### (autoloads nil "woman" "woman.el" (0 0 0 0)) ;;; Generated autoloads from woman.el -(push (purecopy '(woman 0 551)) package--builtin-versions) (defvar woman-locale nil "\ String specifying a manual page locale, or nil. commit e2165eef3d6f37aca83ea592e928fdb1cac5b569 Author: Michael Albinus Date: Wed Apr 1 12:09:29 2020 +0200 Avoid error messages loading trampver.el * lisp/net/trampver.el (tramp-repository-branch) (tramp-repository-version): Bind `debug-on-error' to nil. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 0a92e0d320..8d21133b3b 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -48,6 +48,7 @@ ;; Suppress message from `emacs-repository-get-branch'. We must ;; also handle out-of-tree builds. (let ((inhibit-message t) + (debug-on-error nil) (dir (or (locate-dominating-file (locate-library "tramp") ".git") source-directory))) ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. @@ -61,6 +62,7 @@ ;; Suppress message from `emacs-repository-get-version'. We must ;; also handle out-of-tree builds. (let ((inhibit-message t) + (debug-on-error nil) (dir (or (locate-dominating-file (locate-library "tramp") ".git") source-directory))) (and (stringp dir) (file-directory-p dir)