]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoSeparate bytecode stack
Mattias Engdegård [Sun, 13 Mar 2022 16:26:05 +0000 (17:26 +0100)]
Separate bytecode stack

Use a dedicated stack for bytecode, instead of using the C stack.
Stack frames are managed explicitly and we stay in the same
exec_byte_code activation throughout bytecode function calls and
returns.  In other words, exec_byte_code no longer uses recursion
for calling bytecode functions.

This results in better performance, and bytecode recursion is no
longer limited by the size of the C stack.  The bytecode stack is
currently of fixed size but overflow is handled gracefully by
signalling a Lisp error instead of the hard crash that we get now.

In addition, GC marking of the stack is now faster and more precise.
Full precision could be attained if desired.

* src/alloc.c (ATTRIBUTE_NO_SANITIZE_ADDRESS): Make non-static.
* src/bytecode.c (enum stack_frame_index, BC_STACK_SIZE)
(sf_get_ptr, sf_set_ptr, sf_get_lisp_ptr, sf_set_lisp_ptr)
(sf_get_saved_pc, sf_set_saved_pc, init_bc_thread, free_bc_thread)
(mark_bytecode, Finternal_stack_stats, valid_sp): New.
(exec_byte_code): Adapt to use the new bytecode stack.
(syms_of_bytecode): Add defsubr.
* src/eval.c (unwind_to_catch): Restore saved stack frame.
(push_handler_nosignal): Save stack frame.
* src/lisp.h (struct handler): Add act_rec member.
(get_act_rec, set_act_rec): New.
* src/thread.c (mark_one_thread): Call mark_bytecode.
(finalize_one_thread): Free bytecode thread state.
(Fmake_thread, init_threads): Set up bytecode thread state.
* src/thread.h (struct bc_thread_state): New.
(struct thread_state): Add bytecode thread state.

3 years agoSimplify exec_byte_code arguments
Mattias Engdegård [Tue, 18 Jan 2022 12:10:05 +0000 (13:10 +0100)]
Simplify exec_byte_code arguments

Pass the function object and encoded arity, not the other components.
This speeds up several call paths and is necessary for improvements to
come.

* src/bytecode.c (Fbyte_code): Make a new byte code object for
execution.  This is slower but performance isn't critical here.
(exec_byte_code): Retrieve components from the passed function.
* src/eval.c (fetch_and_exec_byte_code):
* src/lisp.h (exec_byte_code): Update signature.

3 years ago* lisp/net/ange-ftp.el (ange-ftp-ls): Make a loop when sanitizing LSARGS.
Michael Albinus [Sun, 13 Mar 2022 15:50:14 +0000 (16:50 +0100)]
* lisp/net/ange-ftp.el (ange-ftp-ls): Make a loop when sanitizing LSARGS.

3 years agoAdd cl-defgeneric to find-func, too
Lars Ingebrigtsen [Sun, 13 Mar 2022 14:07:59 +0000 (15:07 +0100)]
Add cl-defgeneric to find-func, too

* lisp/emacs-lisp/find-func.el (find-function-regexp): Add
cl-defgeneric, too (bug#54343).

3 years agoAllow overscrolling on Haiku scroll bars that are full
Po Lu [Sun, 13 Mar 2022 12:56:55 +0000 (12:56 +0000)]
Allow overscrolling on Haiku scroll bars that are full

* src/haiku_support.cc (MouseMoved): Allow overscrolling even if
portion is less than 1.0.

3 years agoFix pointer event tracking on top of Haiku scroll bars
Po Lu [Sun, 13 Mar 2022 12:53:01 +0000 (12:53 +0000)]
Fix pointer event tracking on top of Haiku scroll bars

* src/haiku_support.cc (MouseDown): Set correct mouse event mask
in case the scroll bar widget decides to not do that.

3 years agoFix splurious button events being generated on Haiku
Po Lu [Sun, 13 Mar 2022 12:32:15 +0000 (12:32 +0000)]
Fix splurious button events being generated on Haiku

* src/haiku_support.cc (MouseDown, MouseUp): Don't process if
the grab is not appropriate for the buttons that were pressed.

3 years agoFix setting IM spot after key press events
Po Lu [Sun, 13 Mar 2022 10:58:42 +0000 (18:58 +0800)]
Fix setting IM spot after key press events

* src/xterm.c (handle_one_xevent): Check f is not NULL before
trying to set its status area and set preedit spot location
after KeyPress events.

3 years agoFix esh-proc-tests on macOS
Mattias Engdegård [Sun, 13 Mar 2022 10:01:59 +0000 (11:01 +0100)]
Fix esh-proc-tests on macOS

* test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline):
Add pattern matching output when killing a process on macOS (and
possibly other BSDs).

3 years ago; * etc/NEWS: Fix typo.
Eli Zaretskii [Sun, 13 Mar 2022 09:40:55 +0000 (11:40 +0200)]
; * etc/NEWS: Fix typo.

3 years ago; * etc/NEWS: Cleanups as followup to bug#50143.
Eli Zaretskii [Sun, 13 Mar 2022 08:20:37 +0000 (10:20 +0200)]
; * etc/NEWS: Cleanups as followup to bug#50143.

3 years ago* quail.el (quail-define-package): Describe VAR form in DOCSTRING better.
Visuwesh [Sun, 13 Mar 2022 07:01:16 +0000 (12:31 +0530)]
* quail.el (quail-define-package): Describe VAR form in DOCSTRING better.

Bug#50143

Copyright-paperwork-exempt: yes

3 years agoFollow contemporary practices in the Tamil input methods
Visuwesh [Sun, 13 Mar 2022 05:46:38 +0000 (11:16 +0530)]
Follow contemporary practices in the Tamil input methods

* lisp/language/ind-util.el (indian-tml-base-digits-table): New table
to translate digits.
(indian-tml-base-table): Don't translate digits.
(indian-tml-itrans-digits-v5-hash): Hashtable that translates digits.

* lisp/leim/quail/indian.el (quail-tamil-itrans-compute-signs-table)
(quail-tamil-itrans-various-signs-table)
(quail-tamil-itrans-various-signs-and-digits-table): Separate out the
digits from the signs table using the function
'quail-tamil-itrans-compute-signs-table'.
(tamil-itrans-digits, tamil-inscript-digits): New input methods that
translates digits.
(tamil-itrans, tamil-inscript): Fix table inclusion.

* etc/NEWS: Announce the change.

Fixes bug#50143.

Copyright-paperwork-exempt: yes

3 years agoFix small regression for horizontal scroll bars
Po Lu [Sun, 13 Mar 2022 07:27:24 +0000 (07:27 +0000)]
Fix small regression for horizontal scroll bars

* src/haikuterm.c (haiku_read_socket): Restore previous
horizontal scrollbar code, since the change it was intended for
was never made.

3 years agoImprove overscrolling support on Haiku
Po Lu [Sun, 13 Mar 2022 07:22:59 +0000 (07:22 +0000)]
Improve overscrolling support on Haiku

* src/haiku_support.cc (class EmacsScrollBar): New field
`real_max_value'.
(MessageReceived): Set real max value.
(MouseMoved): Get rid of magic numbers by using real max value
instead.

3 years ago; * haiku_support.cc (MessageReceived): Fix 32-bit build.
Po Lu [Sun, 13 Mar 2022 06:50:12 +0000 (06:50 +0000)]
; * haiku_support.cc (MessageReceived): Fix 32-bit build.

3 years agoAllow dragging scroll bar for overscroll on Haiku
Po Lu [Sun, 13 Mar 2022 06:41:58 +0000 (06:41 +0000)]
Allow dragging scroll bar for overscroll on Haiku

* src/haiku_support.cc (class EmacsScrollBar): New fields
`in_overscroll', `can_overscroll', `last_overscroll',
`last_reported_overscroll_value' and `max_value'.
(ValueChanged): Make very sure extraneous value are not
generated.
(MouseUp): Clear overscroll if enabled.
(MouseMoved): If overscroll is enabled and dragging downwards
fails to dislodge the maximum value, enable overscrolling.
(BView_scroll_bar_update): New parameter `can_overscroll'
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_set_scroll_bar_thumb)
(haiku_set_horizontal_scroll_bar_thumb): Adjust parameters to
scroll bar update functions.
(haiku_read_socket): Take ceiling of bar position if
horizontal.

3 years ago; Merge from origin/emacs-28
Stefan Kangas [Sun, 13 Mar 2022 05:30:42 +0000 (06:30 +0100)]
; Merge from origin/emacs-28

The following commit was skipped:

5ba9c8c364 Emacs pretest 28.0.92

3 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 13 Mar 2022 05:30:41 +0000 (06:30 +0100)]
Merge from origin/emacs-28

e5b191465d ; * admin/authors.el (authors-canonical-file-name): Remove...
6b0fdf73cf ; Fix data structures in authors.el

3 years agoFlocate_file_internal: Protect from `.eln` remapping
Stefan Monnier [Sun, 13 Mar 2022 04:51:22 +0000 (23:51 -0500)]
Flocate_file_internal: Protect from `.eln` remapping

Don't use `openp`s functionality to remap `.elc` files to `.eln` files
since `locate-file` is not specific to ELisp files.
This should be not just simpler but more robust than the current
hack which tries to undo the damage after the fact.

* src/lread.c (Flocate_file_internal): Don't map `.elc` to `.eln`.
* lisp/files.el (locate-file): Simplify accordingly.

3 years agoImprove reliaibility of scroll bar dimensions adjustment on GTK 3
Po Lu [Sun, 13 Mar 2022 01:28:58 +0000 (09:28 +0800)]
Improve reliaibility of scroll bar dimensions adjustment on GTK 3

* src/gtkutil.c (xg_scroll_bar_size_allocate_cb): New function.
(xg_finish_scroll_bar_creation): Attach new signal.
(xg_update_scrollbar_pos)
(xg_update_horizontal_scrollbar_pos): Also set window dimensions
for the event box.
* src/xterm.c (x_scroll_bar_configure): New function.
* src/xterm.h: Update prototypes.

3 years agoFurther locate-file fixes on nativecomp
Lars Ingebrigtsen [Sat, 12 Mar 2022 21:54:28 +0000 (22:54 +0100)]
Further locate-file fixes on nativecomp

* lisp/files.el (locate-file): Fix up previous locate-file change
-- don't unconditionally return .elc on nativecomp.

3 years agoDisable esh-proc-test/kill-pipeline on EMBA
Lars Ingebrigtsen [Sat, 12 Mar 2022 21:45:28 +0000 (22:45 +0100)]
Disable esh-proc-test/kill-pipeline on EMBA

Test esh-proc-test/kill-pipeline condition:
    (ert-test-failed
     ((should
       (string-match-p
(rx ...)
(buffer-substring-no-properties output-start ...)))
      :form
      (string-match-p "\\(?:\\(?:interrupt\\|killed\\)\n\\)" "")

3 years agoFix EMBA failure for ert-test-record-backtrace
Lars Ingebrigtsen [Sat, 12 Mar 2022 21:40:49 +0000 (22:40 +0100)]
Fix EMBA failure for ert-test-record-backtrace

* test/lisp/emacs-lisp/ert-tests.el (ert-test-record-backtrace): Make
  this work with AOT.

3 years agoReturn the same file from locate-file in nativecomp and non
Lars Ingebrigtsen [Sat, 12 Mar 2022 21:32:08 +0000 (22:32 +0100)]
Return the same file from locate-file in nativecomp and non

* lisp/files.el (locate-file): Return the .elc file (if it exists)
in nativecomp, too, to mimic the behaviour from non-nativecomp
builds (bug#51308).

3 years agoMake find-function-regexp also find cl-defun/defmethod
Lars Ingebrigtsen [Sat, 12 Mar 2022 17:53:36 +0000 (18:53 +0100)]
Make find-function-regexp also find cl-defun/defmethod

* lisp/emacs-lisp/find-func.el (find-function-regexp): Also find
cl-defun and cl-defmethod (bug#54343).

3 years ago* lisp/progmodes/python.el: Account for new keywords.
Colin Woodbury [Sat, 12 Mar 2022 17:46:55 +0000 (18:46 +0100)]
* lisp/progmodes/python.el: Account for new keywords.

* lisp/progmodes/python.el (python-font-lock-keywords-level-2): As
of Python 3.10, Python has structured pattern matching. This adds
two new keywords which need to be highlighted (bug#54345).

3 years agoFacilitate Customisation of Message-Mode Header Completion Behaviour
Alexander Adolf [Sat, 12 Mar 2022 17:15:24 +0000 (18:15 +0100)]
Facilitate Customisation of Message-Mode Header Completion Behaviour

* lisp/gnus/message.el (message-email-recipient-header-regexp):
New user option.
(message-completion-alist): Use it here.

3 years ago; * src/eval.c: (grow_specpdl): Remove another redundant declaration
Mattias Engdegård [Sat, 12 Mar 2022 16:53:29 +0000 (17:53 +0100)]
; * src/eval.c: (grow_specpdl): Remove another redundant declaration

3 years agoMark tramp-test30-make-process unstable on EMBA
Lars Ingebrigtsen [Sat, 12 Mar 2022 16:49:42 +0000 (17:49 +0100)]
Mark tramp-test30-make-process unstable on EMBA

* test/lisp/net/tramp-tests.el (tramp-test30-make-process): This times
  out on EMBA.

3 years ago; * src/lisp.h: Remove redundant declaration
Mattias Engdegård [Sat, 12 Mar 2022 16:46:38 +0000 (17:46 +0100)]
; * src/lisp.h: Remove redundant declaration

3 years agoRemove never-used relative jump opcodes
Mattias Engdegård [Thu, 3 Mar 2022 18:50:46 +0000 (19:50 +0100)]
Remove never-used relative jump opcodes

* src/bytecode.c (BYTE_CODES, exec_byte_code):
Remove relative jump opcodes that seem to have been a short-lived
experiment, never used in a release.

3 years agoRemove debug code for opcodes long gone
Mattias Engdegård [Thu, 3 Mar 2022 18:46:13 +0000 (19:46 +0100)]
Remove debug code for opcodes long gone

* src/bytecode.c (BYTE_CODES, enum byte_code_op, exec_byte_code):
Don't display custom messages in debug mode for Bscan_buffer and
Bset_mark which were removed long ago.

3 years agoFaster bytecode immediate argument fetching
Mattias Engdegård [Thu, 3 Mar 2022 12:57:26 +0000 (13:57 +0100)]
Faster bytecode immediate argument fetching

* src/bytecode.c (FETCH2):
Use `|` instead of `+` to combine the bytes forming a 16-bit immediate
argument so that GCC (prior to version 12) recognises the idiom and
generates a 16-bit load.  This applies for little-endian machines with
cheap unaligned accesses such as x86[-64], arm64 and power64le.

This 1-character change results in a measurable speed gain on many
kinds of Lisp code, as 16-bit immediates are used by all jump
instructions.

Clang performs this optimisation for both `+` and `|` from version 10.

3 years agoMaintain end of specpdl instead of size
Mattias Engdegård [Sat, 26 Feb 2022 11:49:02 +0000 (12:49 +0100)]
Maintain end of specpdl instead of size

Keep track of the end of specpdl explicitly since that is what we are
comparing against on critical code paths.

* src/eval.c (init_eval_once_for_pdumper, signal_or_quit)
(grow_specpdl_allocation):
* src/fileio.c (Fdo_auto_save):
* src/lisp.h (grow_specpdl):
* src/thread.c (run_thread, Fmake_thread):
* src/thread.h (struct thread_state):
Replace specpdl_size with specpdl_end, according to the equation
specpdl_end = specpdl + specpdl_size.

3 years agoInline record_in_backtrace
Mattias Engdegård [Wed, 16 Feb 2022 15:52:07 +0000 (16:52 +0100)]
Inline record_in_backtrace

It's critical in several function call paths.

* src/eval.c (grow_specpdl_allocation): Make non-static.
(grow_specpdl, record_in_backtrace): Move from here...
* src/lisp.h (grow_specpdl, record_in_backtrace): ... to here,
and declare inline.

3 years agoFix the PGTK build
Po Lu [Sat, 12 Mar 2022 12:58:18 +0000 (20:58 +0800)]
Fix the PGTK build

* src/gtkutil.c (xg_finish_scroll_bar_creation): Fix ifdefs
preventing x_window from being correctly set.
(xg_get_scroll_id_for_window): Ifdef out unused function.

3 years agoTry really hard to make GTK 3 scroll bars fit
Po Lu [Sat, 12 Mar 2022 12:33:18 +0000 (20:33 +0800)]
Try really hard to make GTK 3 scroll bars fit

* src/gtkutil.c (xg_get_widget_from_map): New argument DISPLAY.
All callers changed.
(find_scrollbar_cb): New function.
(xg_finish_scroll_bar_creation, xg_remove_scroll_bar)
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_scroll_bar_thumb)
(xg_set_toolkit_horizontal_scroll_bar_thumb, xg_initialize):
Stop using id_to_widget_map on X builds with GTK 3 and set the
event box as the x_window instead.
* src/xterm.c (x_window_to_scroll_bar): Don't look for ID on GTK
3.
(handle_one_xevent): If a ConfigureNotify event is found for a
scroll bar and the dimensions are wrong, resize the X window to
the right ones.

3 years agoEmacs pretest 28.0.92 emacs-28.0.92
Eli Zaretskii [Sat, 12 Mar 2022 09:44:46 +0000 (04:44 -0500)]
Emacs pretest 28.0.92

* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 28.0.92.

* etc/AUTHORS:
* lisp/ldefs-boot.el: Update for pretest 28.0.92.

* ChangeLog.3: Regenerate.

3 years ago; * admin/authors.el (authors-canonical-file-name): Remove debug leftover.
Eli Zaretskii [Sat, 12 Mar 2022 08:32:47 +0000 (03:32 -0500)]
; * admin/authors.el (authors-canonical-file-name): Remove debug leftover.

3 years ago; Fix data structures in authors.el
Eli Zaretskii [Sat, 12 Mar 2022 08:28:45 +0000 (03:28 -0500)]
; Fix data structures in authors.el

* admin/authors.el (authors-aliases, authors-renamed-files-alist):
Update and correct the databases.
(authors-renamed-files-alist): Add commentary explaining how to
add entries for renamed/moved files.
(authors-canonical-file-name): Clarify the semantics of the
arguments.

3 years agoMerge from origin/emacs-28
Stefan Kangas [Sat, 12 Mar 2022 05:34:05 +0000 (06:34 +0100)]
Merge from origin/emacs-28

dbe6a3ecf7 Fix regression in 'custom-prompt-customize-unsaved-options'
a9920473f6 Improve documentation of 'map-charset-chars'

3 years agoFix some issues with input methods that depend on button state
Po Lu [Sat, 12 Mar 2022 05:02:28 +0000 (13:02 +0800)]
Fix some issues with input methods that depend on button state

* src/xterm.c (handle_one_xevent): Translate button state before
filtering events.

3 years agoFix horizontal scroll bar updating on Haiku
Po Lu [Sat, 12 Mar 2022 03:16:00 +0000 (03:16 +0000)]
Fix horizontal scroll bar updating on Haiku

* src/haikuterm.c (haiku_set_horizontal_scroll_bar_thumb): Just
take portion and position without adjustments.

3 years agoUse more reasonable default timeouts in Haiku menu loop
Po Lu [Sat, 12 Mar 2022 03:02:03 +0000 (03:02 +0000)]
Use more reasonable default timeouts in Haiku menu loop

* src/haiku_support.cc (BMenu_run): Set default timeout to 10
seconds.

3 years agoMake C-mouse-3 on scroll bars work on Haiku
Po Lu [Sat, 12 Mar 2022 02:47:03 +0000 (02:47 +0000)]
Make C-mouse-3 on scroll bars work on Haiku

* src/haiku_support.cc (class EmacsScrollBar): New field
`handle_button'.
(MouseDown, MouseUp): Pass button events with ControlMask to
parent view.

3 years agoSlightly improve scrollbar position accounting on Haiku
Po Lu [Sat, 12 Mar 2022 00:46:39 +0000 (00:46 +0000)]
Slightly improve scrollbar position accounting on Haiku

* src/haiku_support.cc (MessageReceived): Use floats for
calculating portion and subtract proportion directly.
* src/haikuterm.c (haiku_set_scroll_bar_thumb): Take ceiling of
value instead of rounding it.

3 years agoEUDC: Support querying all servers
Thomas Fitzsimmons [Fri, 11 Mar 2022 23:04:53 +0000 (18:04 -0500)]
EUDC: Support querying all servers

* lisp/net/eudc.el (eudc-expand-try-all): New command.
(eudc-expand-inline): Add `try-all-servers' optional argument.
Update `eudc-query-with-words' call.
(eudc-query-with-words): Add `try-all-servers' optional argument.
Move response formatting into main query loop.  Query next server
if `try-all-servers' is non-nil.
(eudc-tail-menu): Add "Expand Inline Query Trying All Servers"
menu item.
* doc/misc/eudc.texi (Installation): Recommend
eudc-expand-try-all.
(Emacs-only Configuration): Likewise.
(Inline Query Expansion, Inline Query Expansion): Likewise.
Document `eudc-expand-try-all'.
* etc/NEWS (EUDC): Describe new 'eudc-expand-try-all' command.

3 years agoEUDC: Update save-query-as-kill name and docstring
Thomas Fitzsimmons [Fri, 11 Mar 2022 22:40:18 +0000 (17:40 -0500)]
EUDC: Update save-query-as-kill name and docstring

* lisp/net/eudc-vars.el (eudc-server): Fix quoting for checkdoc.
(eudc-expansion-save-query-as-kill): Rename from
`eudc-expansion-overwrites-query'.  Define obsolete variable
alias.  Update comment and documentation.
* lisp/net/eudc.el (eudc-expand-inline): Rename `replace' argument
to `save-query-as-kill'.  Update argument documentation.
* doc/misc/eudc.texi (Inline Query Expansion): Rename
`eudc-expand-inline' argument.
* etc/NEWS (EUDC): Document `eudc-expansion-overwrites-query'
rename to `eudc-expansion-save-query-as-kill'.

3 years agoFix a crash inside Haiku popup menus
Po Lu [Fri, 11 Mar 2022 12:41:30 +0000 (12:41 +0000)]
Fix a crash inside Haiku popup menus

* src/haiku_support.cc (BMenu_run): Handle B_WOULD_BLOCK from
wait_for_objects loop.

3 years agoFix initial values of scroll bar foreground and background on GTK 3
Po Lu [Fri, 11 Mar 2022 12:11:57 +0000 (20:11 +0800)]
Fix initial values of scroll bar foreground and background on GTK 3

* src/gtkutil.c (xg_create_frame_widgets): Stop creating
scrollbar stylesheet providers.
* src/xfns.c (Fx_create_frame): Create scroll bar stylesheet
providers here instead.
(x_set_scroll_bar_background):
(x_set_scroll_bar_foreground): Ignore tooltip frames.

3 years agoImplement customization of scroll bar colors on GTK 3
Po Lu [Fri, 11 Mar 2022 12:07:52 +0000 (20:07 +0800)]
Implement customization of scroll bar colors on GTK 3

* src/gtkutil.c (xg_create_frame_widgets): Create CSS providers
for scroll bars.
(xg_finish_scroll_bar_creation): Attach created CSS providers.
* src/xfns.c (x_set_scroll_bar_foreground):
(x_set_scroll_bar_background): Put appropriate content into CSS
providers.
* src/xterm.c (x_free_frame_resources): Free CSS providers.
* src/xterm.h (struct x_output): New fields for scroll bar
stylesheet providers.

3 years ago* src/frame.c (scroll_bar_adjust_thumb_portion_p): Adjust doc string.
Po Lu [Fri, 11 Mar 2022 11:38:45 +0000 (19:38 +0800)]
* src/frame.c (scroll_bar_adjust_thumb_portion_p): Adjust doc string.

3 years agoImprove scroll bar treatment on Haiku
Po Lu [Fri, 11 Mar 2022 10:44:33 +0000 (10:44 +0000)]
Improve scroll bar treatment on Haiku

* src/haiku_support.cc (MessageReceived): Subtract portion from
range of scroll bar.
* src/haikuterm.c (BE_SB_MAX): Adjust values for better
rounding.
(haiku_set_scroll_bar_thumb): Round values instead of
truncating them.

3 years agoFix inconsistent thumb position on Haiku scroll bars
Po Lu [Fri, 11 Mar 2022 08:56:54 +0000 (08:56 +0000)]
Fix inconsistent thumb position on Haiku scroll bars

* src/haikuterm.c (haiku_set_scroll_bar_thumb): If
scroll_bar_adjust_thumb_portion is nil, directly calculate thumb
portions without setting page_size.

3 years agoHandle Wayland displays correctly in browse-url
Po Lu [Fri, 11 Mar 2022 08:36:11 +0000 (16:36 +0800)]
Handle Wayland displays correctly in browse-url

* lisp/net/browse-url.el (browse-url-process-environment): Use
WAYLAND_DISPLAY as the display environment variable on
PGTK.  (bug#54333)

3 years agoAllow C-mouse-2 to split windows on XInput 2 builds
Po Lu [Fri, 11 Mar 2022 05:59:42 +0000 (13:59 +0800)]
Allow C-mouse-2 to split windows on XInput 2 builds

* src/xterm.c (handle_one_xevent): Use x_scroll_bar_handle_click
if ControlMask is set.

3 years agoFix scroll bar portion on Haiku scroll bars
Po Lu [Fri, 11 Mar 2022 01:33:24 +0000 (01:33 +0000)]
Fix scroll bar portion on Haiku scroll bars

* src/haiku_support.cc (EmacsScrollBar): Set steps to
appropriate value.
(ValueChanged): Test new value against old value before sending
value event.
(MessageReceived): Handle portion and range.
(BView_scroll_bar_update): New argument for portion.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_set_scroll_bar_thumb):
(haiku_set_horizontal_scroll_bar_thumb): New functions.
(haiku_set_horizontal_scroll_bar):
(haiku_set_vertical_scroll_bar): Use those functions to set
scroll bar values.
(haiku_read_socket): Handle new meanings of scroll bar values.
* src/haikuterm.h (struct scroll_bar):

3 years agoFix NS toolbar identifier (bug#54326)
Alan Third [Thu, 10 Mar 2022 21:23:55 +0000 (21:23 +0000)]
Fix NS toolbar identifier (bug#54326)

* src/nsterm.m ([EmacsWindow createToolbar:]): Set the identifier to
something that will always be unique to that frame.

3 years agoFix regression in 'custom-prompt-customize-unsaved-options'
Eli Zaretskii [Thu, 10 Mar 2022 18:26:13 +0000 (20:26 +0200)]
Fix regression in 'custom-prompt-customize-unsaved-options'

* lisp/cus-edit.el (custom-prompt-customize-unsaved-options):
Don't depend on the value returned by 'customize-unsaved'.  Fix
the doc string.  Patch by Sebastian Miele <iota@whxvd.name>.
(Bug#54329)

3 years agoSupport remote home directories via connection property
Michael Albinus [Thu, 10 Mar 2022 11:31:22 +0000 (12:31 +0100)]
Support remote home directories via connection property

* doc/misc/tramp.texi (Home directories): New section.
(Top, Usage): Add it to the menue.
(Predefined connection information): Mention "~".
(Multi-hops, File name syntax): Fix typos.

* lisp/net/tramp.el (tramp-handle-expand-file-name): Check for
remote home directory.  (Bug#53847)

3 years agoFix display of minibuffer prompts in some circumstances on Haiku
Po Lu [Thu, 10 Mar 2022 10:39:03 +0000 (10:39 +0000)]
Fix display of minibuffer prompts in some circumstances on Haiku

* src/haikuterm.c (haiku_flush): Always flip buffers as long as
buffer flipping is not blocked.

3 years agoImprove documentation of 'map-charset-chars'
Eli Zaretskii [Thu, 10 Mar 2022 07:29:29 +0000 (09:29 +0200)]
Improve documentation of 'map-charset-chars'

* doc/lispref/nonascii.texi (Character Sets):
* src/charset.c (Fmap_charset_chars): Clarify the codepoint issue
in using 'map-charset-chars'.

3 years agoFix menu bar activation on PGTK
Po Lu [Thu, 10 Mar 2022 03:48:12 +0000 (11:48 +0800)]
Fix menu bar activation on PGTK

* src/gtkutil.c (menu_bar_button_pressed_cb): Only update menu
bar if no menu is active, and the event window is not the widget
window itself.  Also make menu in use.
* src/pgtkmenu.c (popup_deactivate_callback): Make menu not in
use.
* src/xdisp.c (redisplay_internal): Return if popup_activated
also on PGTK.

3 years agoFix stray button release events being reported on GTK 2
Po Lu [Thu, 10 Mar 2022 01:16:39 +0000 (09:16 +0800)]
Fix stray button release events being reported on GTK 2

* src/xterm.c (handle_one_xevent): Drop ButtonRelease events
that are destined for a popup menu.

3 years agoFix menu bar event detection on XI2 builds using Core Input
Po Lu [Thu, 10 Mar 2022 01:12:59 +0000 (09:12 +0800)]
Fix menu bar event detection on XI2 builds using Core Input

* src/gtkutil.c (xg_get_gdk_scale): Always return 1 on GTK+ 2.
(xg_event_is_for_menubar): Fix some ifdefs.
* src/xterm.c (handle_one_xevent): Update a comment.

3 years agoFix regression in vtable-goto-object
Lars Ingebrigtsen [Wed, 9 Mar 2022 16:37:36 +0000 (17:37 +0100)]
Fix regression in vtable-goto-object

* lisp/emacs-lisp/vtable.el (vtable-goto-object): Fix moving to
the object.

3 years agoFix some issues with GTK native input and modifiers on GTK 2
Po Lu [Wed, 9 Mar 2022 13:33:48 +0000 (21:33 +0800)]
Fix some issues with GTK native input and modifiers on GTK 2

* src/gtkutil.c (xg_widget_key_press_event_cb): Manually ignore
modifier keys on GTK 2.

3 years agoMake XInput 2 features work on GTK 2 builds
Po Lu [Wed, 9 Mar 2022 13:29:17 +0000 (21:29 +0800)]
Make XInput 2 features work on GTK 2 builds

* src/xfns.c (setup_xi_event_mask): On GTK 2, select for
button, motion, entry/exit and key events.
* src/xmenu.c (create_and_show_popup_menu): Clear XI grab if
appropriate.
* src/xterm.c (handle_one_xevent): Pass some kinds of input
extension events to GTK manually on versions of GTK+ that don't
understand them.

3 years agoFix GTK widgets not appearing inside child frames
Po Lu [Wed, 9 Mar 2022 12:43:59 +0000 (20:43 +0800)]
Fix GTK widgets not appearing inside child frames

* src/xfns.c (x_set_parent_frame): Disable GTK's own frame
synchronization in child frames.

3 years agoFix error when creating frames on NS with no main window
Po Lu [Wed, 9 Mar 2022 08:28:33 +0000 (16:28 +0800)]
Fix error when creating frames on NS with no main window

* nsfns.m (Fx_create_frame): If main window is not present,
center frame window instead of cascading it.

3 years agoDon't update Haiku menu bar if nothing changed
Po Lu [Wed, 9 Mar 2022 06:58:01 +0000 (06:58 +0000)]
Don't update Haiku menu bar if nothing changed

* haikumenu.c (set_frame_menubar): If Lisp-level contents didn't
change, refrain from actually updating the menu bar.

3 years agoFix flicker during frame resize on Haiku
Po Lu [Wed, 9 Mar 2022 03:50:16 +0000 (03:50 +0000)]
Fix flicker during frame resize on Haiku

* haikuterm.c (haiku_update_end): Call BWindow_Flush directly.
(haiku_set_vertical_scroll_bar): Stop calling flush_frame.
(haiku_flush): Only flip buffer of tooltip frames.

3 years agoFix the MS-DOS build
Po Lu [Wed, 9 Mar 2022 03:29:05 +0000 (11:29 +0800)]
Fix the MS-DOS build

* sed1v2.inp: Update for recent changes.

3 years agoImprove handling of tooltips inside menus on Haiku
Po Lu [Wed, 9 Mar 2022 03:21:36 +0000 (03:21 +0000)]
Improve handling of tooltips inside menus on Haiku

* src/haiku_support.cc (BMenu_run): Make
`process_pending_signals_function' return a struct timespec.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (haiku_process_pending_signals_for_menu):
Return result of `timer_run'.
* src/haikuterm.c (haiku_flush): Flip buffers if frame is dirty.

3 years agoDecouple mod-test.c from Gnulib
Paul Eggert [Wed, 9 Mar 2022 02:46:47 +0000 (18:46 -0800)]
Decouple mod-test.c from Gnulib

mod-test.c should not use Gnulib code, as that creates
unnecessary coupling between Emacs internals and this test module.
Also Gnulib code is compiled without -fPIC whereas mod-test.c
needs -fPIC and recompiling Gnulib with -fPIC would be too painful.
* src/Makefile.in (LIB_NANOSLEEP): New macro.
(LIBES): Use it.
* test/Makefile.in (REPLACE_FREE, FREE_SOURCE_0, FREE_SOURCE_0):
Remove.  All uses removed.
(LIB_CLOCK_GETTIME, LIB_NANOSLEEP): New macros.
(MODULE_CFLAGS): Do not -I from lib as that would include Gnulib
modifications to standard .h files (e.g., "#define nanosleep
rpl_nanosleep") and we don’t want the Gnulib replacements.
Instead, for gmp.h (on platforms lacking <gmp.h>) simply '-I.'
with a suitable gmp.h.
(gmp.h): New rule to create a suitable gmp.h.
($(test_module)): Depend on config.h since the code uses config.h.
Depend on gmp.h if we need to create a suitable one.
If compiling mini-gmp.h, compile the original one and not
the Emacs-specific one, to lessen coupling with Emacs internals.
Link with LIB_CLOCK_GETTIME and LIB_NANOSLEEP.
(clean): Remove gmp.h.
* test/src/emacs-module-resources/mod-test.c: Don’t include timespec.h.
All uses of timespec.h APIs changed to use system-supplied APIs.
Change _Static_assert to plain assert, so that we needn’t rely
on Gnulib’s _Static_assert.
(timespec_le) [CLOCK_REALTIME]: New function.
Change use of timespec_cmp changed to use this instead.
(Fmod_test_sleep_until, Fmod_test_nanoseconds):
Define these functions and their Lisp names mod-test-sleep-until
and mod-test-nanoseconds only if CLOCK_REALTIME,
since they now won’t work on platforms lacking CLOCK_REALTIME.
(Fmod_test_nanoseconds): Just use _Static_assert since it
should work on all platforms.
* test/src/emacs-module-tests.el (mod-test-sleep-until)
(mod-test-nanoseconds, mod-test-double):
Skip test if the corresponding functione is not defined.

3 years agoDo not include <attribute.h> from <config.h>
Paul Eggert [Wed, 9 Mar 2022 02:46:47 +0000 (18:46 -0800)]
Do not include <attribute.h> from <config.h>

This is because mod-test.c shouldn’t use source code from lib,
but it does need to include <config.h>.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/seccomp-filter.c, src/dynlib.h, src/lisp.h:
* src/syssignal.h, src/sysstdio.h, src/systhread.h, src/tparam.h:
Include <attribute.h>.
* src/conf_post.h: Do not include <attribute.h>.
All uses of attribute.h macros replaced with their _GL_ equivalents.

3 years ago* src/xterm.c (handle_one_xevent): Add more dead keys.
Po Lu [Wed, 9 Mar 2022 00:50:24 +0000 (08:50 +0800)]
* src/xterm.c (handle_one_xevent): Add more dead keys.

3 years agoMark tramp test unstable on EMBA
Lars Ingebrigtsen [Tue, 8 Mar 2022 20:11:18 +0000 (21:11 +0100)]
Mark tramp test unstable on EMBA

* test/lisp/net/tramp-tests.el
(tramp-test44-asynchronous-requests): Mark timed-out EMBA test as
unstable.

3 years agoImplement abbreviate-file-name in Tramp for Google drive
Michael Albinus [Tue, 8 Mar 2022 16:28:30 +0000 (17:28 +0100)]
Implement abbreviate-file-name in Tramp for Google drive

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-get-home-directory):
Implement for Google drive.

3 years agoSupport applying indices to more Eshell dollar expansions
Jim Porter [Sat, 5 Mar 2022 19:45:49 +0000 (11:45 -0800)]
Support applying indices to more Eshell dollar expansions

For example, '${echo -e "hi\nbye"}[1]' should expand to "bye".

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Support applying
indices to '${}', '$()', and '$<>' forms.
(Bug#54227)

* lisp/eshell/esh-var-tests.el (esh-var-test/interp-lisp-indices)
(esh-var-test/interp-cmd-indices)
(esh-var-test/interp-cmd-external-indices)
(esh-var-test/quoted-interp-lisp-indices)
(esh-var-test/quoted-interp-cmd-indices): New tests.

3 years agoImprove wording of Eshell variable interpolation code/documentation
Jim Porter [Thu, 3 Mar 2022 17:37:25 +0000 (09:37 -0800)]
Improve wording of Eshell variable interpolation code/documentation

* lisp/eshell/esh-arg.el (eshell-unescape-inner-double-quote): Rename
from 'eshell-parse-inner-double-quote'.

* lisp/eshell/esh-cmd.el (eshell-with-temp-command): Improve
docstring.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Use
'eshell-unescape-inner-double-quote' and improve robustness of quoted
variable name matching.
(eshell-parse-indices): Use 'eshell-unescape-inner-double-quote'.

* doc/misc/eshell.texi (Dollars Expansion): Improve wording of
subscript notation.

3 years agoMerge from origin/emacs-28
Eli Zaretskii [Tue, 8 Mar 2022 13:41:46 +0000 (15:41 +0200)]
Merge from origin/emacs-28

d184773 Avoid assertion violations in 'bidi_resolve_brackets'

3 years agoAvoid assertion violations in 'bidi_resolve_brackets'
Eli Zaretskii [Tue, 8 Mar 2022 13:35:39 +0000 (15:35 +0200)]
Avoid assertion violations in 'bidi_resolve_brackets'

* src/bidi.c (bidi_resolve_brackets): Move assertion to where it
really matters.  (Bug#54295)

3 years agoHandle XI focus change events that specify implicit focus correctly
Po Lu [Tue, 8 Mar 2022 13:25:37 +0000 (21:25 +0800)]
Handle XI focus change events that specify implicit focus correctly

* src/xterm.c (x_detect_focus_change): If detail is
XINotifyPointer, set focus type to implicit.

3 years agoFix detection of modifier keys on XInput 2
Po Lu [Tue, 8 Mar 2022 10:31:12 +0000 (18:31 +0800)]
Fix detection of modifier keys on XInput 2

* src/xterm.c (handle_one_xevent): Fix iteration over sets of
modifiers.

3 years agoHandle bug#54294 in Tramp
Michael Albinus [Tue, 8 Mar 2022 07:52:57 +0000 (08:52 +0100)]
Handle bug#54294 in Tramp

* lisp/net/tramp.el (tramp-handle-file-locked-p, tramp-handle-lock-file):
Use `tramp-system-name'.  (Bug#54294)

3 years agoFix more uses of opaque Visual structure
Po Lu [Tue, 8 Mar 2022 07:19:37 +0000 (15:19 +0800)]
Fix more uses of opaque Visual structure

* src/image.c (x_kill_gs_process):
* src/xfaces.c (x_free_colors):
(x_free_dpy_colors):
* src/xfns.c (Fxw_display_color_p):
(Fx_display_grayscale_p):
(Fx_display_visual_class):
* src/xterm.c (x_copy_color):
* src/xterm.h (x_mutable_colormap): Stop using private fields of
Visual.

3 years agoReturn actual color cell count in x-display-color-cells
Po Lu [Tue, 8 Mar 2022 06:15:01 +0000 (14:15 +0800)]
Return actual color cell count in x-display-color-cells

* src/xfns.c (Fx_display_color_cells): Return the actual amount
of color cells, or the amount of individual combinations of
components.

3 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 8 Mar 2022 05:32:57 +0000 (06:32 +0100)]
Merge from origin/emacs-28

80736aef90 Fix which-func-update doc string
d9e5ae5e20 Improve wording of 'dired-jump's description

3 years ago(cl-macro-list): Simplify by unifying the variants
Stefan Monnier [Tue, 8 Mar 2022 03:27:19 +0000 (22:27 -0500)]
(cl-macro-list): Simplify by unifying the variants

* lisp/emacs-lisp/cl-macs.el (cl-macro-list): Add the &whole and the
dotted tail cases from `cl-macro-list1`.
(cl-macro-list1, cl-define-compiler-macro-list): Delete edebug elem specs.
(cl-destructuring-bind, cl-define-compiler-macro): Use `cl-macro-list`
instead, now that it covers all the cases we need.

3 years agoAvoid color leaks while better ensuring a close color is found
Po Lu [Tue, 8 Mar 2022 01:14:41 +0000 (09:14 +0800)]
Avoid color leaks while better ensuring a close color is found

* src/xterm.c (x_alloc_nearest_color_1): Verify nearest can be
allocated, and use that color value.

3 years agoFix choice of visuals for XPM icon
Po Lu [Tue, 8 Mar 2022 00:41:15 +0000 (08:41 +0800)]
Fix choice of visuals for XPM icon

* src/xterm.c (x_bitmap_icon): Allow using XPM icon on
StaticColor and StaticGray as well.

3 years agoRemove lock file in --no-build-details, too
Lars Ingebrigtsen [Mon, 7 Mar 2022 17:03:14 +0000 (18:03 +0100)]
Remove lock file in --no-build-details, too

* src/filelock.c (current_lock_owner): Make file writes work when
using --no-build-details (bug#54294).

3 years agoMark ert-test-run-tests-batch-expensive unstable on EMBA
Lars Ingebrigtsen [Mon, 7 Mar 2022 16:39:00 +0000 (17:39 +0100)]
Mark ert-test-run-tests-batch-expensive unstable on EMBA

3 years agoAdd user stylesheet option for doc-view EPUB support
Kjartan Oli Agustsson [Mon, 7 Mar 2022 16:29:38 +0000 (17:29 +0100)]
Add user stylesheet option for doc-view EPUB support

* lisp/doc-view.el (doc-view-start-process): Add user stylesheet to
process arguments when appropriate.

* lisp/doc-view.el (doc-view-mutool-user-stylesheet): New user option.

Copyright-paperwork-exempt: yes

3 years agoFix which-func-update doc string
Lars Ingebrigtsen [Mon, 7 Mar 2022 15:19:19 +0000 (16:19 +0100)]
Fix which-func-update doc string

* lisp/progmodes/which-func.el (which-func-update): Make the doc
string match the code (bug#54288).

3 years ago* lisp/emacs-lisp/seq.el (seq-concatenate): Accept non-`sequencep` sequences
Stefan Monnier [Mon, 7 Mar 2022 14:59:43 +0000 (09:59 -0500)]
* lisp/emacs-lisp/seq.el (seq-concatenate): Accept non-`sequencep` sequences

3 years agoCorrectly handle exposure in oldXMenu
Po Lu [Mon, 7 Mar 2022 13:36:25 +0000 (21:36 +0800)]
Correctly handle exposure in oldXMenu

* oldXMenu/Activate.c (XMenuActivate): Call set expose_func if
no pane was found.
(XMenuActivateSetExposeFunction): New function.
* oldXMenu/XMenu.h: New typedef `expose_func'.  Update
prototypes.
* src/xmenu.c (x_menu_expose_event): New function.
(x_menu_show): Set expose event handler.
* src/xterm.c (x_dispatch_event): Make `static' only on GTK.
* src/xterm.h: Expose `x_dispatch_event' on no-toolkit builds.

3 years agoImprove color handling on colormapped displays
Po Lu [Mon, 7 Mar 2022 13:08:07 +0000 (21:08 +0800)]
Improve color handling on colormapped displays

* src/xfns.c (select_visual): Set `visual_info' field whenever
appropriate.
(x_create_tip_frame, XDisplayCells): Don't access private fields
of Visual.

* src/xterm.c (x_color_cells, x_alloc_nearest_color_1): Use
colormap_size instead of default cell count.
(XTflash, x_bitmap_icon, x_term_init):
* src/xterm.h (struct x_display_info, FRAME_X_VISUAL_INFO): Stop
accessing private fields of Visual.