1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 08:31:35 -08:00
Commit graph

41379 commits

Author SHA1 Message Date
YAMAMOTO Mitsuharu
64767008f7 Support font driver supersession
* src/font.c (font_update_drivers): If argument NEW_DRIVERS is t, then don't
use superseded drivers.
(syms_of_font) <Qfont_driver_superseded_by>: New DEFSYM.

* src/ftfont.c (syms_of_ftfont) [HAVE_HARFBUZZ]:
* src/ftcrfont.c (syms_of_ftcrfont) [HAVE_HARFBUZZ]:
* src/w32font.c (syms_of_w32font) [HAVE_HARFBUZZ]:
* src/xftfont.c (syms_of_xftfont) [HAVE_HARFBUZZ]: Make Harfbuzz variants
supersede non-Harfbuzz ones.

* src/w32fns.c (Fx_create_frame, w32_create_tip_frame): Remove font backend
determination code.
2019-06-18 10:21:06 +09:00
Paul Eggert
7c8cb70fa3 * src/image.c (image_set_rotation): Do negation at compile-time. 2019-06-17 15:46:54 -07:00
YAMAMOTO Mitsuharu
8c56eb0525 Avoid rounding error in image rotation
* src/image.c (image_set_rotation): Halve translations as double values.
2019-06-17 10:43:31 +09:00
Lars Ingebrigtsen
fd9cff0279 Fix up the --no-print-directory changes in src/Makefile.in
* src/Makefile.in (AM_V_NO_PD): New macro written by Andreas
Schwab that can be either --no-print-directory or "".
(%.elc): Use it instead if the if statement.
2019-06-17 00:33:59 +02:00
Juanma Barranquero
4156dd384a Bump up max_specpdl_size to 1500. (Bug#36216)
* src/eval.c (init_eval_once): Set max_specpdl_size to 1500.
* doc/lispref/variables.texi (Local Variables): Document it.
2019-06-16 23:14:51 +02:00
Alan Third
beb572a7dd Revert "Simplify image transforms"
This reverts commit cf3081d208.

; Pushed in error.
2019-06-16 20:46:42 +01:00
Alan Third
cf3081d208 Simplify image transforms
* src/image.c: (image_set_rotation, image_set_size,
image_set_transform): Combine into image_set_transform.
(image_set_crop): Remove function.
(lookup_image): Remove calls to removed functions and remove
transform_matrix.
* test/manual/image-transforms-tests.el (test-cropping): Remove
function.
(test-transforms): Remove reference to test-cropping.
2019-06-16 20:24:53 +01:00
Alan Third
11b0e33462 Document image transforms
* doc/lispref/display.texi (Image Descriptors): Document :crop and
update :rotation.
* src/image.c: Describe the image transform matrix layout.
* test/manual/image-transforms-tests.el: New file.
2019-06-16 20:24:53 +01:00
Philipp Stephani
7e53f4f2da * src/xfaces.c (dump_realized_face): Fix incorrect format string. 2019-06-15 19:02:25 +02:00
Philipp Stephani
d67a7987c0 * src/xfaces.c (dump_realized_face): Fix format specifier. 2019-06-15 18:59:54 +02:00
Philipp Stephani
9f0af50538 * src/nsterm.m (ns_row_rect): Remove unused variable ‘f.’ 2019-06-15 18:59:54 +02:00
Eli Zaretskii
ca0b4edf13 Update hash value in pdumper.c
* src/pdumper.c (dump_fwd_buffer_obj) [CHECK_STRUCTS]: Update
the hash in HASH_Lisp_Buffer_Objfwd.  (Bug#36225)
2019-06-15 19:46:45 +03:00
Eli Zaretskii
34f01bf8f7 Improve error message when dmpstruct.h needs to be updated
* src/pdumper.c (dump_cons, dump_interval_tree, dump_string)
(dump_marker, dump_overlay, dump_finalizer)
(dump_bignum, dump_float, dump_fwd_int, dump_fwd_bool)
(dump_fwd_obj, dump_fwd_buffer_obj, dump_fwd_kboard_obj)
(dump_fwd, dump_blv, dump_symbol, dump_vectorlike_generic)
(dump_hash_table, dump_buffer, dump_bool_vector, dump_subr)
(dump_vectorlike, dump_object, dump_charset) [CHECK_STRUCTS]:
Make the error message more specific where to find the comment
to CHECK_STRUCTS.
2019-06-15 19:28:51 +03:00
Lars Ingebrigtsen
826e63e73d Avoid printing entering/leaving messages in second stage bootstrap
* src/Makefile.in (%.elc): Default to not printing the
entering/leaving lines when compiling .el files in the second
stage of bootstrapping Emacs.  V=1 will output them.
2019-06-15 16:29:29 +02:00
Eli Zaretskii
333170348b Improve documentation of hash-code functions
* src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal):
* doc/lispref/hash.texi (Defining Hash): Warn against assuming
that sxhash returns consistent results.
2019-06-15 11:16:49 +03:00
YAMAMOTO Mitsuharu
1c3e8684c8 Remove non-Xdbe double-buffering code on cairo
* src/xterm.c (x_begin_cr_clip, x_update_end) [USE_CAIRO]: Don't do
handcrafted double-buffering with image surface.
2019-06-15 12:44:56 +09:00
YAMAMOTO Mitsuharu
703b9d652b Rework x_scroll_run on cairo
* src/xterm.c (x_scroll_run) [USE_CAIRO]: Use FRAME_CR_CONTEXT or surface type
for conditions to call XCopyArea rather than FRAME_X_DOUBLE_BUFFERED_P.
Set compositing operator to CAIRO_OPERATOR_SOURCE when copying image.
2019-06-15 12:36:26 +09:00
Eli Zaretskii
769e9fa5ae Fix text shaping of precomposed characters with HarfBuzz
* src/hbfont.c (hbfont_shape): Fix setting TO of lglyph for
the case when Lisp shape-gstring function performed some
compositions by itself.  This happens with hebrew.el.  See
https://lists.freedesktop.org/archives/harfbuzz/2019-June/007396.html
for the details of the problem this solves.
2019-06-13 11:49:30 +03:00
Glenn Morris
e17cda4942 Merge from origin/emacs-26
758e9a8 Revert "Don't mark main_thread (Bug#36155)"
1877b7b Don't mark main_thread (Bug#36155)
4904fb3 More quotation fixes (Bug#35885)
4cc4b5d ; * src/keyboard.c (tool_bar_items): Fix a typo.  (Bug#36143)
b58ecaf Minor copyedits in efaq-w32
48422af Tiny improvement of documentation of major mode conventions
25d44d2 * nt/addpm.c (main): Fix buffer overflow
2019-06-11 08:38:34 -07:00
Eli Zaretskii
c42c4e9c56 Fix shaping of Arabic test when the region is extended
* src/xdisp.c (compute_stop_pos): Set the limit for searching
for changes in text properties such that the limit is never in
the middle of composable text.  (Bug#28312)
2019-06-11 17:45:23 +03:00
Andreas Schwab
758e9a8ed4 Revert "Don't mark main_thread (Bug#36155)"
This reverts commit 1877b7b4d7.
2019-06-10 12:52:21 +02:00
Andreas Schwab
1877b7b4d7 Don't mark main_thread (Bug#36155)
* thread.c (mark_threads_callback): Don't mark main_thread.
2019-06-10 12:35:35 +02:00
Juanma Barranquero
e214da2dac * src/editfns.c (Fngettext): Fix typos in docstring. 2019-06-10 06:15:09 +02:00
YAMAMOTO Mitsuharu
e4f12a1b1f Document exporting/printing text with X core fonts to outline images on cairo
* src/xfns.c (Fx_export_frames) [USE_CAIRO]:
(Fx_print_frames_dialog) [USE_CAIRO && USE_GTK]: Add notes on x font backend.
2019-06-10 10:08:53 +09:00
Paul Eggert
179b9c44c5 * src/fns.c (cmpfn_eql): Simplify. 2019-06-09 09:18:24 -07:00
Paul Eggert
1e6396ec3d Fix int overflow bug in ‘equal’
* src/fns.c (internal_equal):
Fix bug when vector lengths exceed INT_MAX.
2019-06-08 23:38:40 -07:00
Paul Eggert
5abaea334c Tune base64 decoding
This improves performance of base64-decode-region by about 7.5% on
my platform, and gets rid of some macros.
* src/fns.c (IS_ASCII, IS_BASE64, IS_BASE64_IGNORABLE)
(READ_QUADRUPLET_BYTE): Remove.
(base64_value_to_char, base64_char_to_value):
Now an array of two arrays.  All uses changed.
(base64url_value_to_char, base64url_char_to_value):
Remove.  All uses changed to the other array.
(base64_char_to_value): Entries are now of type signed char, not
short, since we can assume C99.  Use C99 initializers; this is
clearer and caters to the (theoretical) possibility of systems
that do not use ASCII or do not have 8-bit bytes.  Allow any index
in the range 0..UCHAR_MAX instead of limiting it to 0..127, so
that uses need not check for in-range indexes.  Also record
padding chars.  All uses changed.
(base64_decode_1): Always store number of chars in *NCHARS_RETURN,
for simplicity.  All callers changed.  Speed up the byte-fetching.
2019-06-08 23:32:23 -07:00
Stefan Kangas
4cc4b5d6d7 ; * src/keyboard.c (tool_bar_items): Fix a typo. (Bug#36143) 2019-06-09 09:22:56 +03:00
Eli Zaretskii
1cc90d21d6 Minor fixes for the last commits
* src/fns.c (Fbase64url_encode_region)
(Fbase64url_encode_string, Fbase64_decode_region)
(Fbase64_decode_string): Fix doc strings.
(base64_decode_1): Minor stylistic code changes.

* doc/lispref/text.texi (Base 64): Fix typos and improve
wording of the last committed text.
2019-06-08 11:14:31 +03:00
Pierre Téchoueyres
7541b06872 Add support for base64url variant of base-64 encoding/decoding
Implement the RFC4648 variant of base64 encoding used by URLs.
* doc/lispref/text.texi (base64url-encode-region,
base64url-encode-string): Document new functions.
(base64-decode-region, base64-decode-string): Document new optional
parameter 'base64url' used to use url variant when decoding data.

* src/fns.c (base64url-encode-region, base64url-encode-region): New
functions to manage url variant.
(base64-decode-region, base64-decode-string): Add optional
parameter to indicate use of url-variant.
(base64_encode_region_1, base64_encode_string_1): Internal functions
with extracted code from 'base64_encode_region' and
'base64_encode_string' and optional parameters to manage padding and
url variant.
(base64-encode-region, base64-encode-string) : Use
base64_encode_region_1 and base64_encode_string_1.
(base64-encode-1): Add parameters to manage padding and url variant.
(base64-decode-1): Add parameter to manage url variant.

* test/src/fns-tests.el (fns-tests--with-region): New helper macro to
test region variant of base64 encode / decode functions.
(fns-tests--string-repeat): Helper function used in base64 tests.
(fns-tests-base64-encode-region, fns-tests-base64-encode-string):
Tests for standard base64 function.
(fns-test-base64url-encode-region,
fns-test-base64url-encode-string): Tests for url variant.
(fns-tests-base64-decode-string): Tests for decoding part.
2019-06-08 10:49:35 +03:00
YAMAMOTO Mitsuharu
faf10bd8eb Support X core font driver on cairo (Bug#28236)
* configure.ac (HAVE_X_WINDOWS): Add xfont.o to FONT_OBJ if HAVE_CAIRO.

* doc/lispref/frames.texi (Font and Color Parameters): Mention X core font
driver with Cairo drawing.

* src/font.c (syms_of_font) [HAVE_X_WINDOWS && USE_CAIRO]: Call syms_of_xfont.

* src/xfns.c (x_create_tip_frame) [USE_CAIRO]: Register xfont_driver.

* src/xterm.c (x_cr_gc_clip) [USE_CAIRO]: New function extracted from
x_begin_cr_clip.
(x_begin_cr_clip) [USE_CAIRO]: Use it.
(xlib_surface_key, saved_drawable_key) [USE_CAIRO]: New variables.
(x_cr_destroy_xlib_surface, x_try_cr_xlib_drawable)
(x_end_cr_xlib_drawable) [USE_CAIRO]: New functions.
(x_draw_composite_glyph_string_foreground)
(x_draw_glyph_string_foreground) [USE_CAIRO]: Get Xlib surface when drawing
text with X core fonts into bitmap surfaces.  Add fallback code for drawing
into outline surfaces.
2019-06-08 14:05:49 +09:00
YAMAMOTO Mitsuharu
88c49ac318 Implement native image rotation and cropping on cairo
* src/dispextern.h (struct image) [USE_CAIRO]:
* src/image.c (free_image, image_clear_image_1)
(image_set_crop, image_set_size, image_set_rotation)
(image_create_x_image_and_pixmap) [USE_CAIRO]: #ifdef out HAVE_XRENDER part.

* src/image.c (cr_create_surface_from_pix_containers) [USE_CAIRO]: Rename
from cr_create_surface_from_pix_containers.  Change arguments to pair of
Emacs_Pix_Container:s.  Move block_input and unblock_input to caller.
(cr_put_image_to_cr_data) [USE_CAIRO]: New function.
(prepare_image_for_display) [USE_CAIRO]: Use it.
(image_set_transform) [USE_CAIRO]: Create dummy solid color pattern equipped
with transformation matrix and set it to img->cr_data.

* src/xterm.c (fringe_bmp) [USE_CAIRO]: Change type to cairo_pattern_t **.
(x_cr_define_fringe_bitmap, x_cr_destroy_fringe_bitmap) [USE_CAIRO]: Create
or destroy cairo pattern.
(x_cr_draw_image) [USE_CAIRO]: Remove arguments image_width and image_height.
Change type of image to cairo pattern.  All callers changed.

* src/gtkutil.c (xg_get_image_for_pixmap) [USE_CAIRO]: Get cairo surface
from img->cr_data, which is of cairo pattern now.
2019-06-08 13:05:15 +09:00
Paul Eggert
58cde92341 Fix commentary about fixnums and hashes. 2019-06-07 16:48:56 -07:00
Paul Eggert
8553af84db Fix minor ssize_t / ptrdiff_t confusion
* src/fileio.c (Fcopy_file): This limit is because of ssize_t,
so use TYPE_MAXIMUM (ssize_t) not PTRDIFF_MAX.
2019-06-07 16:48:56 -07:00
Paul Eggert
de46a6a448 Use machine pointer width for face hashes
* src/dispextern.h (struct face):
* src/xfaces.c (hash_string_case_insensitive, lface_hash)
(cache_face, lookup_face): Use uintptr_t for face hashes
instead of discarding the upper pointer bits on 64-bit machines.
2019-06-07 16:48:56 -07:00
Eli Zaretskii
77f96e2cc1 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2019-06-07 22:06:01 +03:00
Eli Zaretskii
4ebfec02f0 Merge remote-tracking branch 'origin/harfbuzz' 2019-06-07 17:52:16 +03:00
Glenn Morris
348657cc21 Merge from origin/emacs-26
9254885 (origin/emacs-26) Resurrect display-line-number-mode in clien...
aecbbd5 * src/fns.c (Fmapconcat): Doc fix.  (Bug#35710)
8e5fc38 Fix typo
ee21b40 * lisp/term/w32-win.el ([noname]): Bind to 'ignore'.  (Bug#36...
f68b33f Fix styling of Unicode codepoints in manuals
ff7ec6f Fix a few uses of quotes in user manual
b67042b More minor copyedits in the Emacs manual
9734b5c Fix minor issues in the Emacs manual
c153250 Try to improve text on atomic windows in Elisp manual
fb314ba Don't recommend insert-before-markers in process filters
2019-06-07 07:50:49 -07:00
Eli Zaretskii
aecbbd57c1 * src/fns.c (Fmapconcat): Doc fix. (Bug#35710) 2019-06-07 15:59:50 +03:00
YAMAMOTO Mitsuharu
3a1f92d09b Fix image_set_crop yet again
* src/image.c (image_set_crop) [HAVE_NATIVE_TRANSFORMS]: Don't call
compute_image_size, as it is already called from image_set_size.
(image_set_size, image_set_crop) [HAVE_NATIVE_TRANSFORMS]: Use harmless
matrix transformation code also for USE_CAIRO and HAVE_NTGUI cases,
though image_set_transform is not yet implemented on them.
2019-06-07 17:44:03 +09:00
Paul Eggert
cfb592fd4b Fix recently-introduced image_set_crop typo
* src/image.c (image_set_crop) [!HAVE_NATIVE_TRANSFORMS]:
Don’t call compute_image_size, as it does not exist and its
result is not needed.
2019-06-07 00:44:45 -07:00
Paul Eggert
486a81f387 Use copy_file_range to copy files
The copy_file_range syscall (introduced in Linux kernel
version 4.5) can copy files more efficiently via server-side
copy etc.
* admin/merge-gnulib (GNULIB_MODULES): Add copy-file-range.
* lib/copy-file-range.c, m4/copy-file-range.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/fileio.c (Fcopy_file): Try copy_file_range first,
falling back on read+write only if copy_file_range failed or
if the input is empty and so could be a /proc file.
2019-06-07 00:44:45 -07:00
Paul Eggert
7c26e0b18d Fix overflow issues in image rotation
Also, do some refactoring to simplify code.
* src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): Remove.
* src/image.c (matrix3x3): New type, replacing all uses of 3x3 double.
(matrix3x3_copy, matrix3x3_mult): New functions, replacing
COPY_MATRIX, MULT_MATRICES.  Replace INIT_MATRIX by C initializers.
(image_set_rotation): Use Fmod to avoid undefined behavior on
double-to-int conversion and to reduce bignum rotations correctly.
(image_set_crop): Finish up previous correction, by not re-setting
width and height if compute_image_size has set them.
Prefer shifting right by 1 to dividing by 2 if either will do.
2019-06-06 08:10:31 -07:00
Eli Zaretskii
e29fb7dfba Fix redisplay glitches with RTL composed text
* src/xdisp.c (init_to_row_end): Fail if the first visible
position on the line following ROW is bidi-reordered and could
be composed.  (Bug#35811)
2019-06-06 17:12:57 +03:00
Mark A. Hershberger
c8123b45f7
Restore height and with from that were accidentally removed
See 610fb73ab6
USE_CARIO needs these.
2019-06-06 09:07:36 -04:00
Alan Third
610fb73ab6 Add native image rotation and cropping
* lisp/image.el (image--get-imagemagick-and-warn): Only fallback to
ImageMagick if native transforms aren't available.
* src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): New
macros for matrix manipulation.
(HAVE_NATIVE_SCALING, HAVE_NATIVE_TRANSFORMS): Rename and change all
relevant locations.
* src/image.c (x_set_image_rotation):
(x_set_transform): New functions.
(x_set_image_size): Use transform matrix for resizing under X and NS.
(x_set_image_crop): New function.
(lookup_image): Use the new transform functions.
(Fimage_scaling_p, Fimage_transforms_p): Rename and update all
callers.
* src/nsimage.m (ns_load_image): Remove rotation code.
(ns_image_set_transform): New function.
([EmacsImage dealloc]): Release the saved transform.
([EmacsImage rotate:]): Remove unneeded method.
([EmacsImage setTransform:]): New method.
* src/nsterm.h (EmacsImage): Add transform property and update method
definitions.
* src/nsterm.m (ns_dumpglyphs_image): Use the transform to draw the
image correctly.
* src/xterm.c (x_composite_image): Use PictOpSrc as we don't care
about alpha values here.
* doc/lispref/display.texi (Image Descriptors): Add :rotation.
(ImageMagick Images): Remove :rotation.
2019-06-05 22:28:46 +01:00
Paul Eggert
741d04a879 Adjust comments/debug to match C bignum code
* doc/lispintro/emacs-lisp-intro.texi (Digression into C):
Adjust to match current C code.
* lisp/emacs-lisp/ert.el (ert--force-message-log-buffer-truncation):
Simplify.
* src/.gdbinit (Lisp_Object_Printer.to_string): Return
a string that says "make_fixnum", not "make_number".
2019-06-04 08:34:16 -07:00
Paul Eggert
7f4558e3d9 Always allow at least double-precision bignums
Without this fix, Emacs can get into a tight loop reporting
a range error when calculating timestamps.
* doc/lispref/numbers.texi (Integer Basics):
* src/alloc.c (syms_of_alloc): Document this.
* src/bignum.c (make_bignum_bits): Always allow bignums
of at least twice the width of (u)intmax_t.
2019-06-04 08:34:15 -07:00
YAMAMOTO Mitsuharu
512f036404 * src/xterm.c (x_scroll_run) [USE_CAIRO]: Dirty only destination rectangle. 2019-06-04 16:19:54 +09:00
YAMAMOTO Mitsuharu
f6e928105b * src/image.c (cr_create_cr_surface_from_image): Add const to variable `key'. 2019-06-04 16:15:35 +09:00