1. 04 Dec, 2019 3 commits
    • Philipp Stephani's avatar
      Use new function encode_string_utf_8 for the module API, too · 0e774d4f
      Philipp Stephani authored
      * src/emacs-module.c (module_encode): Remove.
      (module_copy_string_contents): Use encode_string_utf_8.
      (syms_of_module): Define symbol 'unicode-string-p'.
    • Philipp Stephani's avatar
    • Philipp Stephani's avatar
      Change module interface to no longer use GMP objects directly. · 096be9c4
      Philipp Stephani authored
      As described in the new comment added to emacs-module.c, using GMP
      directly in the module interface has significant downsides: it couples
      the module interface directly to the implementation and requires
      module authors to link their module against the same GMP library as
      Emacs itself, which is often difficult and an unnecessary burden.  By
      picking a representation for the magnitude that often matches the one
      used by GMP, we can avoid overhead when converting from and to GMP in
      most cases.
      Loading the test module in test/data/emacs-module and evaluating
      (dotimes (_ 10000)
        (mod-test-double (* 2 most-negative-fixnum)))
      under Callgrind shows that on my (GNU/Linux) machine Emacs only spends
      10% of the CPU time of mod-test-double in mpz_import and mpz_export
      combined, even though that function does little else.  (By contrast,
      30% is spent in allocate_pseudovector.)
      * src/emacs-module.h.in: Don't check EMACS_MODULE_GMP.  Don't include
      gmp.h.  Remove emacs_mpz structure.  Instead, define type alias
      emacs_limb_t and macro EMACS_LIMB_MAX.
      * src/module-env-27.h: Change interface of extract_big_integer and
      make_big_integer to take a sign-magnitude representation instead of
      * src/emacs-module.c: Don't check EMACS_MODULE_GMP or
      EMACS_MODULE_HAVE_MPZ_T.  Add a comment about the chosen
      (module_extract_big_integer, module_make_big_integer): Reimplement
      without using mpz_t in the interface.
      * doc/lispref/internals.texi (Module Values): Adapt function
      documentation and example.  Stop mentioning GMP and EMACS_MODULE_GMP.
      * test/data/emacs-module/mod-test.c: Don't define EMACS_MODULE_GMP or
      (memory_full, extract_big_integer, make_big_integer): New helper
      functions, identical to example in the Info documentation.
      (Fmod_test_nanoseconds, Fmod_test_double): Adapt to new interface.
  2. 03 Dec, 2019 2 commits
  3. 30 Nov, 2019 1 commit
  4. 29 Nov, 2019 1 commit
    • Alan Third's avatar
      Fix image scaling with masks (bug#38109) · 3e9c82d9
      Alan Third authored
      * src/image.c (lookup_image): Move call to image_set_transform after
      (image_create_x_image_and_pixmap_1): Use new function.
      (image_set_transform): Apply the transform to the mask too.
      (x_create_xrender_picture): New function.
      (xpm_load): Use new function.
      * src/xterm.c (x_composite_image): Use PictOpOver when there is a mask
      so the transparency is honoured.
      (x_draw_image_foreground_1): Use x_composite_image.
  5. 28 Nov, 2019 3 commits
    • Noam Postavsky's avatar
      Stop signaling an error when reading "smart quotes" in symbols · 85f586f3
      Noam Postavsky authored
      Revert commits from 2018-01-28 "Fix round tripping of read->print for
      symbols with strange quotes", and 2017-07-22 "Signal error for symbol
      names with strange quotes (Bug#2967)".
      * etc/NEWS: Remove corresponding entries.
      * src/character.c (confusable_symbol_character_p):
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove.
      * src/lread.c (read1): Don't signal error on confusable character.
      * src/print.c (print_object): Don't escape confusable characters.
    • Eli Zaretskii's avatar
      Allow disabling the BPA part of bidi reordering · 5629af9c
      Eli Zaretskii authored
      * src/xdisp.c (syms_of_xdisp): New variable 'bidi-inhibit-bpa'.
      * src/bidi.c (bidi_paired_bracket_type): If 'bidi-inhibit-bpa'
      is non-nil, return BIDI_BRACKET_NONE for all characters.
      * lisp/frame.el: Add 'bidi-inhibit-bpa' to the list of
      variables whose changes require redisplay.  (Bug#38407)
    • Robert Pluim's avatar
      Support wlan in network-interface-list on pre-Vista Windows · b05aa8d7
      Robert Pluim authored
      * src/w32.c (network_interface_list): Check for 'Wireless' in
      adapter description to support pre-Vista Windows.
  6. 27 Nov, 2019 3 commits
    • Eli Zaretskii's avatar
      ; Fix recent change in w32.c · 39b3bc00
      Eli Zaretskii authored
      * src/w32.c (network_interface_list): Correct an embarrassing
      typo and cleanup the code.
    • Mattias Engdegård's avatar
      Mouse rectangular region selection (bug#38013) · 4eb7db5d
      Mattias Engdegård authored
      Make it possible to select a rectangular region using the mouse.
      The standard binding is C-M-mouse-1.
      * lisp/mouse.el (mouse-scroll-subr): Add ADJUST argument.
      (mouse-drag-region-rectangle): New.
      * lisp/rect.el (rectangle--reset-point-crutches): New.
      (rectangle--reset-crutches): Use 'rectangle--reset-point-crutches'.
      * src/xdisp.c (remember_mouse_glyph, syms_of_xdisp):
      Add 'mouse-fine-grained-tracking'.
      * doc/lispref/commands.texi (Motion Events):
      Document 'mouse-fine-grained-tracking'.
      * doc/emacs/frames.texi (Mouse Commands):
      * doc/emacs/killing.texi (Rectangles):
      * etc/NEWS: Document rectangular selection with the mouse.
    • Mattias Engdegård's avatar
      Fine-grained NS modifier key settings (bug#38296) · 215f678c
      Mattias Engdegård authored
      For the ns-KEY-modifier and ns-right-KEY-modifier variables, KEY
      being 'control', 'command', 'alternate' and 'function', allow
      values on the form (:ordinary SYMBOL :function :SYMBOL :mouse SYMBOL),
      so that the key can be used for different modifiers (or none) in
      different contexts.  This is particularly useful for using the macOS
      Option key for extended character entry while still using it as an
      Emacs modifier for function keys and mouse clicks.
      * src/nsterm.m (mod_of_kind, right_mod, nil_or_none): Helper functions.
      (EV_MODIFIERS2): Add KIND argument.
      (EV_MODIFIERS): Adapt call to EV_MODIFIERS2.
      (ns_get_shifted_character): Use correct event kind for modifiers.
      (ns-alternate-modifier, ns-right-alternate-modifier)
      (ns-command-modifier, ns-right-command-modifier)
      (ns-control-modifier, ns-right-control-modifier)
      (ns-function-modifier): Rewrite doc strings for new data format.
      (QCordinary, QCfunction, QCmouse): Define symbols.
      * lisp/cus-start.el: Conform to new data types.
      * doc/emacs/macos.texi (Mac / GNUstep Basics)
      (Mac / GNUstep Customization): Improved documentation.
      * etc/NEWS: Mention the change.
  7. 26 Nov, 2019 5 commits
    • Juri Linkov's avatar
      message uses minibuffer-message in the active minibuffer (bug#17272 bug#19064) · aa89c84e
      Juri Linkov authored
      * doc/lispref/display.texi (Displaying Messages): Explain the
      behavior of using minibuffer-message if the minibuffer is active.
      * src/editfns.c (Fmessage_in_echo_area): New function with body
      copied from Fmessage.
      (Fmessage): Call minibuffer-message in the active minibuffer,
      otherwise call Fmessage_in_echo_area.
      (message-in-echo-area): New variable.
      * lisp/isearch.el (isearch--momentary-message, isearch-message):
      * lisp/minibuffer.el (minibuffer-message, minibuffer-completion-help):
      Use 'message-in-echo-area' instead of 'message' where necessary.
      * lisp/autorevert.el (auto-revert-handler):
      * lisp/man.el (Man-bgproc-sentinel):
      * lisp/subr.el (do-after-load-evaluation):
      Revert recent changes that replaced 'message' with 'minibuffer-message'.
      This is not needed anymore since 'message' uses 'minibuffer-message'
      in the active minibuffer.
    • Juri Linkov's avatar
      Allow recursive minibuffers for yes-or-no-p and y-or-n-p (bug#17272 bug#19064) · b3c0fb21
      Juri Linkov authored
      * lisp/subr.el (y-or-n-p): Let-bind enable-recursive-minibuffers to t.
      * src/fns.c (Fyes_or_no_p): Specbind Qenable_recursive_minibuffers to Qt.
    • Eli Zaretskii's avatar
      Support ':extend' in faces defined by list of key/value pairs · d4515f3c
      Eli Zaretskii authored
      * src/xfaces.c: Update and improve commentary at the beginning
      of the file.
      (face_attr_sym): New static array.
      (init_xfaces): Initialize 'face_attr_sym'.
      (merge_face_ref): Handle the :extend attribute in faces
      specified as lists of key/value pairs.  (Bug#37774)
    • Eli Zaretskii's avatar
      Fix MS-Windows build with mingw.org's MinGW · 094eb04c
      Eli Zaretskii authored
      mingw.org's MinGW by default targets Windows 9X, so
      _WIN32_WINNT is set to a value that bypasses declarations
      in system headers we need to compile network_interface_list.
      Also, the code needed a workaround for Windows XP, where
      some functionality is missing from the GetAdaptersAddresses
      * src/w32.c (_WIN32_WINNT): Define to 0x0501, if the value is
      lower, temporarily while processing iphlpapi.h.
      (address_prefix_match): New helper function.
      (network_interface_list): Work around the fact that the
      OnLinkPrefixLength member of IP_ADAPTER_UNICAST_ADDRESS is not
      available when _WIN32_WINNT < 0x0600.  On Windows XP use
      special code that calls address_prefix_match to compute the
      network prefix length.
    • Robert Pluim's avatar
      Extend network-interface-list to return IPv6 and network info · 650a514e
      Robert Pluim authored
      * src/process.c (Fnetwork_interface_list): Extend argument list to
      allow requesting full network info and/or IPv4/IPv6 info.
      (network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve
      interface IP addresses.
      * src/process.h: Update prototype of network_interface_list.
      * src/w32.c (g_b_init_get_adapters_addresses): New init flag.
      (globals_of_w32): Initialize it.
      (GetAdaptersAddresses_Proc): New function typedef.
      (get_adapters_addresses): New wrapper function.
      (init_winsock): Load htonl and ntohl.
      (sys_htonl, sys_ntohl): New wrapper functions.
      (network_interface_list): Implement in terms of
      * nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes.
      * etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list.
      * doc/lispref/processes.texi (Misc Network): Document updated arglist
      and return values for network-interface-list.
  8. 25 Nov, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix face merging when some have :extend non-nil and some are inherited · 19aecd34
      Eli Zaretskii authored
      * src/xfaces.c (face_inherited_attr): New function.
      (merge_named_face): Call 'face_inherited_attr' when testing
      whether a face that inherits from another fits the filtering
      criteria specified by ATTR_FILTER.
      (merge_face_vectors): Revert the changes made in this function
      for filtering by ATTR_FILTER, and remove that argument as
      well.  These tests are now completely done by the caller, see
      'merge_named_face'.  (Bug#37774)
  9. 23 Nov, 2019 4 commits
    • Paul Eggert's avatar
      Add eassert check for bad default face · 5a3e96b1
      Paul Eggert authored
      * src/xdisp.c (append_space_for_newline): Add an eassert check
      that default_face is not null, by calling FACE_FROM_ID instead of
      FACE_FROM_ID_OR_NULL.  Initialize a local only if needed.
    • Paul Eggert's avatar
      Port gnutls.c to --enable-gcc-warnings --without-gnutls · 603a7c8a
      Paul Eggert authored
      * src/gnutls.c: Move the "#ifdef HAVE_GNUTLS" earlier, so
      that "./configure --enable-gcc-warnings --without-gnutls"
      does not complain about macros being defined but never used.
      Indent "#" directives more consistently.
    • Eli Zaretskii's avatar
      Fix cursor display at EOL before extended face · 1265e947
      Eli Zaretskii authored
      * src/xdisp.c (extend_face_to_end_of_line): Make sure the
      character position of the stretch glyph inserted to extend the
      face is zero, as various other parts of the display code rely
      on that.  (Bug#38330)
    • Eli Zaretskii's avatar
      Fix and speed up en/decoding of UTF-8 strings · c26556bd
      Eli Zaretskii authored
      * src/coding.c (get_char_bytes, encode_string_utf_8)
      (decode_string_utf_8): Fix commentary.
      (encode_string_utf_8): Return the original ASCII string only
      if NOCOPY is non-zero.
      (decode_string_utf_8): Accept 2 additional arguments STR and
      STR_LEN, which allow to pass the input text as a C string.
      (make_string_from_utf8): Delegate the job to decode_string_utf_8.
      * src/coding.h: Update the prototype of decode_string_utf_8.
      * src/json.c (json_encode): Call encode_string_utf_8.
  10. 21 Nov, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix file notifications on macOS · 4f6980ad
      Eli Zaretskii authored
      * src/kqueue.c (Fkqueue_add_watch): Don't use encoded file
      names in objects and APIs that expect decoded multibyte
      strings.  (Bug#38287)
  11. 20 Nov, 2019 2 commits
  12. 19 Nov, 2019 1 commit
    • Robert Pluim's avatar
      Remember the full GTK font description · b6db2ed1
      Robert Pluim authored
      Remember the full font description instead of just the family so that
      size/style/weight settings are preserved.
      * gtkutil.c (xg_get_font) [HAVE_GTK3]: Use the pango font
      description to set/get the current font (Bug#28901).
  13. 18 Nov, 2019 2 commits
  14. 17 Nov, 2019 2 commits
    • Lars Ingebrigtsen's avatar
      Handle FC_CHARCELL in xftfont_open · 1c29ba03
      Lars Ingebrigtsen authored
      * src/xftfont.c (xftfont_open): FC_CHARCELL is apparently an alias
      for FC_DUAL used in some east Asian fonts (bug#35079).  Modelled
      after a patch suggested by Kenichi Handa.
    • Eli Zaretskii's avatar
      Support more font weight values on MS-Windows · b31f1987
      Eli Zaretskii authored
      * src/w32font.c (w32_to_fc_weight): Support a few more weight
      values, for compatibility with the GTK font selection widget
      (see gtkutil.c:XG_WEIGHT_TO_SYMBOL).  (Bug#24226)
  15. 16 Nov, 2019 3 commits
  16. 15 Nov, 2019 4 commits
    • Paul Eggert's avatar
      Port hexdigit init to non-GCC + pdumper · e68912ea
      Paul Eggert authored
      The old code assumed that hexdigit initialization (needed by
      non-GCC) could be done in syms_of_character, but that is no longer
      true with pdumper.  Instead, simplify hexdigit init so that it can
      be done statically on all C99 platforms.  Problem discovered on
      Solaris 10 sparc + Oracle Solaris Studio 12.6.
      * src/character.c (hexdigit): Add 1 to every value; all uses
      changed.  This simplifies the initialization so that it can be
      done statically on any C99 compiler.  hexdigit is now always const.
      (syms_of_character): Omit no-longer-necessary initialization.
      * src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST):
      Remove.  All uses removed.
    • Eli Zaretskii's avatar
      Improve documentation of 'add-variable-watcher' · 0114bb96
      Eli Zaretskii authored
      * doc/lispref/variables.texi (Watching Variables): Clarify the
      documentation of 'add-variable-watcher' and fix markup.
      * src/data.c (Fadd_variable_watcher): Clarify the doc string.
    • Eli Zaretskii's avatar
      Fix a recent change in xdisp.c · 81d3f1b6
      Eli Zaretskii authored
      * src/xdisp.c (tty_handle_tab_bar_click): Revert the last
      change which made this work only in the HAVE_NTGUI build.
      This function is needed by any build which supports a  mouse
      on TTY frames.
    • Paul Eggert's avatar
      Handle weird cases like (ceil 0 0.0) · 8b848def
      Paul Eggert authored
      * src/floatfns.c (double_integer_scale): Distinguish Inf from NaN.
      (rounding_driver): Handle (ceil 0 0.0) and (ceil 0 1.0e+INF).
      * test/src/floatfns-tests.el (special-round): Add tests for
      weird cases like this.
      Avoid crash with (floor 0 0.0)
      * src/floatfns.c (rounding_driver): Signal an arithmetic
      error if divisor is 0.0 or -0.0, instead of crashing.
  17. 14 Nov, 2019 2 commits
    • Paul Eggert's avatar
      Fix byte-counting error in ‘format’ · c2cd8e62
      Paul Eggert authored
      Problem reported by Paul Pogonyshev (Bug#38191).
      * src/editfns.c (styled_format): When checking for adjacent
      %-sequences, use byte position rather than character position.
      * test/src/editfns-tests.el (format-properties): Test for fix.
    • Paul Eggert's avatar
      In Cairo builds, omit some unnecessary functions · 2241f7ca
      Paul Eggert authored
      * src/font.c (fset_font_data, font_put_frame_data)
      * src/ftfont.c (ftfont_open, ftfont_close)
      (ftfont_encode_char, ftfont_glyph_metrics)
      (ftfont_text_extents, ftfont_driver):
      Define only if USE_CAIRO.
      * src/xdisp.c (tty_handle_tab_bar_click):
      Define only if HAVE_NTGUI && !CYGWIN.