1. 07 Dec, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix fallout from fixing bug#37782 · 1161c7d8
      Eli Zaretskii authored
      * src/keyboard.c (read_key_sequence): Modify the fix for
      bug#37782 so that it applies only to keyboard keys, not to
      other events, such as a new buffer.  (Bug#38132)
      1161c7d8
  2. 06 Dec, 2019 1 commit
  3. 05 Dec, 2019 4 commits
    • Eli Zaretskii's avatar
      Another fix for :extend when :inherit is used · 5ee43ba0
      Eli Zaretskii authored
      * src/xfaces.c (face_inherited_attr): Support also values of
      :inherit which are lists.  (Bug#37774)
      5ee43ba0
    • Federico Tedin's avatar
      Make HIST arg of read-from-minibuffer work with buffer-local vars · 3586fef2
      Federico Tedin authored
      * lisp/simple.el (minibuffer-history-values): New function, should be
      used to access the minibuffer input history variable when the
      minibuffer might be active.  If the variable is buffer-local, the
      previous buffer's value will be used.
      (goto-history-element): Use the new function to access the minibuffer
      history.
      (minibuffer-history-isearch-wrap): Use the new function to access the
      minibuffer history.
      * src/minibuf.c (read_minibuf): Switch to previous buffer temporarily
      before updating history list (Bug#38317).
      (read-from-minibuffer): Extend documentation to mention that the
      result of using the command will be added to the history list by
      default.
      * doc/lispref/minibuf.texi (Minibuffer History): Mention the
      possibility of using a buffer-local variable as history.
      * etc/NEWS: Announce changes.
      3586fef2
    • Paul Eggert's avatar
      Pacify GCC 9.2.1 with recent module changes · 90270847
      Paul Eggert authored
      * src/emacs-module.c (module_encode): Remove unused decl.
      (module_extract_big_integer): Pacify gcc -Wenum-compare.
      90270847
    • Philipp Stephani's avatar
      Fix small bugs introduced in commit 096be9c4 · 4472b053
      Philipp Stephani authored
      * src/module-env-27.h:
      * src/emacs-module.c (module_make_big_integer): Use 'emacs_limb_t'
      instead of 'unsigned long' consistently
      4472b053
  4. 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'.
      0e774d4f
    • 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
      mpz_t.
      
      * src/emacs-module.c: Don't check EMACS_MODULE_GMP or
      EMACS_MODULE_HAVE_MPZ_T.  Add a comment about the chosen
      implementation.
      (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
      EMACS_MODULE_HAVE_MPZ_T.
      (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.
      096be9c4
  5. 03 Dec, 2019 2 commits
  6. 30 Nov, 2019 1 commit
  7. 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
      postprocess_image.
      (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.
      (Create_Pixmap_From_Bitmap_Data):
      (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.
      3e9c82d9
  8. 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.
      85f586f3
    • 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)
      5629af9c
    • 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.
      b05aa8d7
  9. 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.
      39b3bc00
    • 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.
      4eb7db5d
    • 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.
      215f678c
  10. 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.
      aa89c84e
    • 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.
      b3c0fb21
    • 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)
      d4515f3c
    • 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
      API.
      
      * 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.
      094eb04c
    • Robert Pluim's avatar
      Extend network-interface-list to return IPv6 and network info · 650a514e
      Robert Pluim authored
      Bug#38218
      
      * 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
      get_adapters_addresses.
      
      * 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.
      650a514e
  11. 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)
      19aecd34
  12. 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.
      5a3e96b1
    • 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.
      603a7c8a
    • 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)
      1265e947
    • 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.
      c26556bd
  13. 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)
      4f6980ad
  14. 20 Nov, 2019 2 commits
  15. 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).
      b6db2ed1
  16. 18 Nov, 2019 2 commits
  17. 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.
      1c29ba03
    • 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)
      b31f1987
  18. 16 Nov, 2019 3 commits