commit acec59c9f9c6d552c54ad448f4be898d8ee36f31 (HEAD, refs/remotes/origin/master) Author: YAMAMOTO Mitsuharu Date: Wed Apr 17 09:46:34 2019 +0900 Use cairo_scaled_font_t object for text drawing and metrics calculation * src/ftfont.h (struct font_info): Replace member cr_font_face of type cairo_font_face_t * with cr_scaled_font of type cairo_scaled_font_t *. * src/ftcrfont.c: Include math.h for floor, ceiling, and lround. (ftcrfont_glyph_extents): Use cairo_scaled_font_glyph_extents. (ftcrfont_open): Create cairo_scaled_font_t object and set it to cr_scaled_font member of struct font_info. (ftcrfont_close): Use cairo_scaled_font_destroy. (ftcrfont_draw): Use cairo_set_scaled_font. diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 3a98e78d63..31ff8e87c0 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -19,6 +19,7 @@ along with GNU Emacs. If not, see . */ #include #include +#include #include #include "lisp.h" @@ -73,7 +74,18 @@ ftcrfont_glyph_extents (struct font *font, cache = ftcrfont_info->metrics[row] + col; if (METRICS_STATUS (cache) == METRICS_INVALID) - ftfont_text_extents (font, &glyph, 1, cache); + { + cairo_glyph_t cr_glyph = {.index = glyph, .x = 0, . y = 0}; + cairo_text_extents_t extents; + + cairo_scaled_font_glyph_extents (ftcrfont_info->cr_scaled_font, + &cr_glyph, 1, &extents); + cache->lbearing = floor (extents.x_bearing); + cache->rbearing = ceil (extents.width + extents.x_bearing); + cache->width = lround (extents.x_advance); + cache->ascent = ceil (extents.y_bearing); + cache->descent = ceil (extents.height - extents.y_bearing); + } if (metrics) *metrics = *cache; @@ -126,8 +138,16 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) FT_New_Size (ft_face, &ftcrfont_info->ft_size_draw); FT_Activate_Size (ftcrfont_info->ft_size_draw); FT_Set_Pixel_Sizes (ft_face, 0, font->pixel_size); - ftcrfont_info->cr_font_face = + cairo_font_face_t *font_face = cairo_ft_font_face_create_for_ft_face (ft_face, 0); + cairo_matrix_t font_matrix, ctm; + cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size); + cairo_matrix_init_identity (&ctm); + cairo_font_options_t *options = cairo_font_options_create (); + ftcrfont_info->cr_scaled_font = + cairo_scaled_font_create (font_face, &font_matrix, &ctm, options); + cairo_font_face_destroy (font_face); + cairo_font_options_destroy (options); ftcrfont_info->metrics = NULL; ftcrfont_info->metrics_nrows = 0; unblock_input (); @@ -151,7 +171,7 @@ ftcrfont_close (struct font *font) if (ftcrfont_info->metrics) xfree (ftcrfont_info->metrics); FT_Done_Size (ftcrfont_info->ft_size_draw); - cairo_font_face_destroy (ftcrfont_info->cr_font_face); + cairo_scaled_font_destroy (ftcrfont_info->cr_scaled_font); unblock_input (); ftfont_close (font); @@ -230,10 +250,7 @@ ftcrfont_draw (struct glyph_string *s, } x_set_cr_source_with_gc_foreground (f, s->gc); - cairo_set_font_face (cr, ftcrfont_info->cr_font_face); - cairo_set_font_size (cr, s->font->pixel_size); - /* cairo_set_font_matrix */ - /* cairo_set_font_options */ + cairo_set_scaled_font (cr, ftcrfont_info->cr_scaled_font); FT_Activate_Size (ftcrfont_info->ft_size_draw); cairo_show_glyphs (cr, glyphs, len); diff --git a/src/ftfont.h b/src/ftfont.h index b6b0c5ba47..327cd085ac 100644 --- a/src/ftfont.h +++ b/src/ftfont.h @@ -57,7 +57,7 @@ struct font_info FT_Matrix matrix; #ifdef USE_CAIRO - cairo_font_face_t *cr_font_face; + cairo_scaled_font_t *cr_scaled_font; /* To prevent cairo from cluttering the activated FT_Size maintained in ftfont.c, we activate this special FT_Size before drawing. */ FT_Size ft_size_draw; commit 6f8fe0d5acf0aa62a39b274217ac28fc1764840e Author: Andrii Kolomoiets Date: Tue Feb 19 23:57:07 2019 +0200 Make python-shell-prompt-block-regexp match IPython prompt * lisp/progmodes/python.el (python-shell-prompt-block-regexp): Match also IPython's multiline prompt. It allows to correctly disable non-native completions during multiline statement in inferior-python-mode that runs IPython interpreter (Bug#34582). Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b05f9a33e9..5193501f71 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2003,7 +2003,7 @@ position, else returns nil." It should not contain a caret (^) at the beginning." :type 'string) -(defcustom python-shell-prompt-block-regexp "\\.\\.\\. " +(defcustom python-shell-prompt-block-regexp "\\.\\.\\.:? " "Regular expression matching block input prompt of Python shell. It should not contain a caret (^) at the beginning." :type 'string) commit 6fe81676f314c0ba7ef627e864dea27f57953eec Author: Juri Linkov Date: Wed Apr 17 00:04:30 2019 +0300 * etc/NEWS: Mention new xref faces (bug#23179) diff --git a/etc/NEWS b/etc/NEWS index 272da3d800..5e5d942d89 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -706,6 +706,9 @@ if set before 'xref.el' was loaded. *** xref-find-definitions now sets the mark at the buffer position where it was invoked +--- +*** New xref faces 'xref-file-header', 'xref-line-number', 'xref-match' + ** Ecomplete *** The ecomplete sorting has changed to a decay-based algorithm. @@ -1072,7 +1075,7 @@ variable for remote shells. It still defaults to "/bin/sh". --- *** 'shell-command-width' defines the number of display columns -available for output of asynchronous shell commands. +available for output of asynchronous or remote shell commands. ** Pcomplete commit 292e817aad806cc405bd72ae53eb32281bcc2636 Author: Juri Linkov Date: Tue Apr 16 23:51:51 2019 +0300 * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Erase buffer before inserting file contents to *diff-syntax-file*. Use absolute file names. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 1d5a2cf69a..a26e9eef82 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2439,6 +2439,7 @@ When OLD is non-nil, highlight the hunk from the old source." (when (and diff-vc-backend (not (eq diff-font-lock-syntax 'hunk-only))) (let* ((file (diff-find-file-name old t)) + (file (and file (expand-file-name file))) (revision (and file (if (not old) (nth 1 diff-vc-revisions) (or (nth 0 diff-vc-revisions) (vc-working-revision file)))))) @@ -2447,7 +2448,7 @@ When OLD is non-nil, highlight the hunk from the old source." ;; Get properties from the current working revision (when (and (not old) (file-readable-p file) (file-regular-p file)) - (let ((buf (get-file-buffer (expand-file-name file)))) + (let ((buf (get-file-buffer file))) ;; Try to reuse an existing buffer (if buf (with-current-buffer buf @@ -2460,13 +2461,13 @@ When OLD is non-nil, highlight the hunk from the old source." ;; Same file as last-time, unmodified. ;; Reuse buffer as-is. (setq file nil) + (erase-buffer) (insert-file-contents file) (setq diff--syntax-file-attributes attrs))) (diff-syntax-fontify-props file text line-nb))))) ;; Get properties from a cached revision (let* ((buffer-name (format " *diff-syntax:%s.~%s~*" - (expand-file-name file) - revision)) + file revision)) (buffer (get-buffer buffer-name))) (if buffer ;; Don't re-initialize the buffer (which would throw @@ -2474,7 +2475,7 @@ When OLD is non-nil, highlight the hunk from the old source." (setq file nil) (setq buffer (ignore-errors (vc-find-revision-no-save - (expand-file-name file) revision + file revision diff-vc-backend (get-buffer-create buffer-name))))) (when buffer commit d0da7ee82e6b0f952eae1069ec592bb466f71ed3 Author: Paul Eggert Date: Tue Apr 16 11:04:16 2019 -0700 * GNUmakefile: Update comment. diff --git a/GNUmakefile b/GNUmakefile index e878dbbb55..a67624e1f7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -27,10 +27,10 @@ # newly-built Makefile. If the source tree is already configured, # this file defers to the existing Makefile. -# If you are using a non-GNU 'make', or if you want non-default build -# options, or if you want to build in an out-of-source tree, please -# run "configure" by hand. But run autogen.sh first, if the source -# was checked out directly from the repository. +# If you want non-default build options, or if you want to build in an +# out-of-source tree, you should run 'configure' before running 'make'. +# But run 'autogen.sh' first, if the source was checked out directly +# from the repository. # If a Makefile already exists, just use it. commit d07863fd6e61894490e8c588f290b2a5dae76494 Author: Glenn Morris Date: Tue Apr 16 08:09:47 2019 -0700 * make-dist (possibly_non_vc_files): Remove recently deleted file. diff --git a/make-dist b/make-dist index 821895a005..74660032e9 100755 --- a/make-dist +++ b/make-dist @@ -367,7 +367,6 @@ possibly_non_vc_files=" MANIFEST aclocal.m4 configure admin/charsets/jisx2131-filter src/config.in src/emacs-module.h - src/fingerprint.c "$( find admin doc etc lisp \ \( -name '*.el' -o -name '*.elc' -o -name '*.map' -o -name '*.stamp' \