]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoFix recalculation of `icon-title-format' after a frame is iconified
Po Lu [Thu, 9 Jun 2022 13:48:19 +0000 (21:48 +0800)]
Fix recalculation of `icon-title-format' after a frame is iconified

Previously it would only happen upon the next mode line
redisplay, meaning that just pressing C-z would not update the
implicit title, since C-z doesn't cause a redisplay.

* src/dispextern.h: Update prototypes.
* src/frame.h (SET_FRAME_ICONIFIED): De-slugify.  Call
`gui_consider_frame_title', since `icon-title-format' might be
different from the current frame title.
* src/xdisp.c (gui_consider_frame_title): Export (also in
dispextern.h).  (bug#55850)

2 years agoMake `line-number-at-pos' work more like in earlier Emacs versions
Lars Ingebrigtsen [Thu, 9 Jun 2022 12:42:31 +0000 (14:42 +0200)]
Make `line-number-at-pos' work more like in earlier Emacs versions

* src/fns.c (Fline_number_at_pos): Allow calling with position
outside the region if called with ABSOLUTE non-nil (bug#55847).
This isn't announced in the doc string, but makes function
compatible with the version in earlier Emacs versions.

2 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Po Lu [Thu, 9 Jun 2022 11:44:31 +0000 (19:44 +0800)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

2 years agoNever return tooltip frames from ns-begin-drag
Po Lu [Thu, 9 Jun 2022 11:42:56 +0000 (19:42 +0800)]
Never return tooltip frames from ns-begin-drag

* src/nsterm.m ([EmacsWindow draggedImage:movedTo:]):
([EmacsWindow beginDrag:forPasteboard...]): Don't return frame
if tooltip.

2 years ago; Fix typos in Kharoshthi script support
Eli Zaretskii [Thu, 9 Jun 2022 10:27:34 +0000 (13:27 +0300)]
; Fix typos in Kharoshthi script support

* etc/HELLO:
* lisp/leim/quail/misc-lang.el ("kharoshthi"):
* lisp/language/misc-lang.el ("Kharoshthi"): Fix typos.

2 years agoHandle monitor attribute updates during drag-and-drop
Po Lu [Thu, 9 Jun 2022 10:20:59 +0000 (18:20 +0800)]
Handle monitor attribute updates during drag-and-drop

* src/xterm.c (x_monitors_changed_cb):
(handle_one_xevent): Set x_dnd_monitors during monitor changes.

2 years agoAdd support for the Kharoshthi script
Stefan Baums [Sun, 5 Jun 2022 17:18:23 +0000 (19:18 +0200)]
Add support for the Kharoshthi script

* etc/NEWS: Announce the new language environment and script.
* etc/HELLO: Add Kharoshthi greeting.

* lisp/leim/quail/misc-lang.el ("kharoshthi"): New input method.
* lisp/language/misc-lang.el ("Kharoshthi"): New language
environment.  Set up composition rules for Kharoshthi.
(Bug#55539)

2 years agoSatisfy GCC warnings on the GNUstep build
Po Lu [Thu, 9 Jun 2022 08:48:17 +0000 (16:48 +0800)]
Satisfy GCC warnings on the GNUstep build

* src/nsfns.m (ns_move_tooltip_to_mouse_location):
* src/nsterm.m ([EmacsWindow draggedImage:movedTo:]): Pacify GCC.

2 years agoDisable tooltip timeouts for drag-and-drop tooltips
Po Lu [Thu, 9 Jun 2022 08:43:29 +0000 (16:43 +0800)]
Disable tooltip timeouts for drag-and-drop tooltips

* lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip):
Don't time out the created tooltip.

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 9 Jun 2022 08:38:08 +0000 (11:38 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoImplement `follow-tooltip' on NS as well
Po Lu [Thu, 9 Jun 2022 08:34:18 +0000 (16:34 +0800)]
Implement `follow-tooltip' on NS as well

* lisp/term/ns-win.el (x-begin-drag): Pass `follow-tooltip'.
* src/nsfns.m (Fx_show_tip): Record last dx and dy.
(syms_of_nsfns): New staticpros.
* src/nsmenu.m ([EmacsTooltip moveTo:]): New method.

* src/nsselect.m (Fns_begin_drag): New parameter
`follow-tooltip'.

* src/nsterm.h (@interface EmacsWindow):
(EmacsTooltip): Update prototypes.
* src/nsterm.m ([EmacsWindow draggedImage:movedTo:]): Move any
tooltip to the right location.
([EmacsWindow beginDrag:forPasteboard...]): New parameter
`followTooltip'.

2 years agoNote caveats of `follow-tooltip' with system tooltips
Po Lu [Thu, 9 Jun 2022 07:44:51 +0000 (15:44 +0800)]
Note caveats of `follow-tooltip' with system tooltips

* lisp/mouse.el (mouse-drag-and-drop-region): Turn off system
tooltips inside.
* src/xfns.c (Fx_begin_drag): Say that follow-tooltip doesn't
work with system tooltips.

2 years ago; * doc/lispref/processes.texi (Bindat Types): Fix wording. (Bug#55815)
Eli Zaretskii [Thu, 9 Jun 2022 07:28:25 +0000 (10:28 +0300)]
; * doc/lispref/processes.texi (Bindat Types): Fix wording.  (Bug#55815)

2 years agobindat: Improve str, strz documentation
Richard Hansen [Fri, 3 Jun 2022 01:05:40 +0000 (21:05 -0400)]
bindat: Improve str, strz documentation

* doc/lispref/processes.texi (Bindat Types): Expand the documentation
for the `str' and `strz' types to clarify expectations and explain
edge case behavior.

2 years agoImplement `follow-tooltip' for DND on Haiku
Po Lu [Thu, 9 Jun 2022 07:20:22 +0000 (07:20 +0000)]
Implement `follow-tooltip' for DND on Haiku

* lisp/term/haiku-win.el (x-begin-drag): Implement
`follow-tooltip'.
* src/haikufns.c (Fx_show_tip): Record last dx and dy.
(syms_of_haikufns): New staticpros.

* src/haikuselect.c (haiku_unwind_drag_message): Clear new flag.
(Fhaiku_drag_message): New argument `follow-tooltip'.  Set new
flag.
(haiku_dnd_compute_tip_xy): New function.
(haiku_note_drag_motion): Move tooltip if flag is true.

* src/haikuterm.c (haiku_read_socket): Don't generate help event
if mouse moves onto a tooltip during DND.
* src/haikuterm.h: Update prototypes.

2 years agoAccount for remapped faces in $COLUMNS and $LINES in Eshell
Jim Porter [Fri, 3 Jun 2022 04:12:04 +0000 (21:12 -0700)]
Account for remapped faces in $COLUMNS and $LINES in Eshell

* src/window.h (window_body_unit): New enum...
(window_body_width): ... use it.

* src/window.c (window_body_unit_from_symbol): New function.
(window_body_height, window_body_width): Make PIXELWISE a
'window_body_unit'.
(window-body-height, window-body-width): Accept 'remap' for PIXELWISE.
(window-lines-pixel-dimensions, window_change_record_windows)
(run_window_change_functions, resize_frame_windows, grow_mini_window)
(shrink_mini_window, scroll-left, scroll-right): Update calls to
'window_body_height' and 'window_body_width'.

* src/indent.c (compute_motion): Update calls to 'window_body_width'.

* lisp/eshell/em-ls.el (eshell-ls-find-column-widths)
(eshell-ls-find-column-lengths): Use 'window-body-width'.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Use
'window-body-width' and 'window-body-height'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/window-height)
(esh-var-test/window-width): Rename to...
(esh-var-test/lines-var, esh-var-test/columns-var): ... and update
expected value.

* doc/lispref/windows.texi (Window Sizes): Document new behavior of
PIXELWISE argument for 'window-body-width' and 'window-body-height'.

* etc/NEWS: Announce this change (bug#55696).

2 years agoRevert "* src/comp.c (Fcomp_el_to_eln_filename): Update error message."
Eli Zaretskii [Thu, 9 Jun 2022 06:56:59 +0000 (09:56 +0300)]
Revert "* src/comp.c (Fcomp_el_to_eln_filename): Update error message."

This reverts commit ec987e3e1786d06ffd306e5717b4d7fd118f05ac.
This change was installed on the emacs-28 branch instead.

2 years agoAllow C-x 4 4, C-x 5 5, C-x t t to handle commands that use switch-to-buffer
Juri Linkov [Thu, 9 Jun 2022 06:40:52 +0000 (09:40 +0300)]
Allow C-x 4 4, C-x 5 5, C-x t t to handle commands that use switch-to-buffer

* lisp/window.el (display-buffer-override-next-command):
Temporarily set switch-to-buffer-obey-display-actions to t,
and revert back to the original value afterwards.
This allows other-window-prefix, other-frame-prefix, other-tab-prefix,
windmove-display-in-direction to override the default behavior of
commands that use switch-to-buffer.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00483.html

2 years ago* src/comp.c (Fcomp_el_to_eln_filename): Update error message.
Jeff Walsh [Thu, 9 Jun 2022 00:02:01 +0000 (10:02 +1000)]
* src/comp.c (Fcomp_el_to_eln_filename): Update error message.

2 years agoAlso show mouse DND tooltip contents during interprogram drag-and-drop
Po Lu [Thu, 9 Jun 2022 05:11:08 +0000 (13:11 +0800)]
Also show mouse DND tooltip contents during interprogram drag-and-drop

* doc/lispref/frames.texi (Drag and Drop): Document new
parameter to `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Don't hide tooltip
when initiating interprogram drag-and-drop.
* lisp/term/haiku-win.el (x-begin-drag):
* lisp/term/ns-win.el (x-begin-drag): Add stubs for new
parameter.
* src/xfns.c (Fx_begin_drag): New parameter `follow-tooltip'.
(Fx_show_tip, syms_of_xfns): Add records of the last dx and dy
given to `x-show-tip'.
* src/xterm.c (x_clear_dnd_monitors): New function.
(x_dnd_begin_drag_and_drop): Save monitor attributes list if
appropriate.
(x_dnd_compute_tip_xy, x_dnd_update_tooltip_position): New
function.
(x_dnd_update_state, handle_one_xevent): Update tooltip position
during DND mouse movement.
(syms_of_xterm): Update staticpros.
* src/xterm.h: Update prototypes.

2 years agoFix dnd-tests on builds without X
Po Lu [Thu, 9 Jun 2022 02:22:14 +0000 (10:22 +0800)]
Fix dnd-tests on builds without X

* test/lisp/dnd-tests.el (x-get-selection-internal): New
function declaration.

2 years agoIgnore tooltip frames when looking for DND target
Po Lu [Thu, 9 Jun 2022 02:05:54 +0000 (10:05 +0800)]
Ignore tooltip frames when looking for DND target

* src/xterm.c (x_dnd_get_target_window): When not using client
lists, look beneath any tooltip frame.

2 years agoMake use of faster atom intern functions in xselect.c
Po Lu [Thu, 9 Jun 2022 01:52:21 +0000 (09:52 +0800)]
Make use of faster atom intern functions in xselect.c

* src/xselect.c (symbol_to_x_atom):
(x_atom_to_symbol): Use x_get_atom_name and
x_intern_cached_atom.

2 years ago* lisp/rect.el: Return correct positions of region-beginning/end (bug#55234)
Juri Linkov [Wed, 8 Jun 2022 17:10:12 +0000 (20:10 +0300)]
* lisp/rect.el: Return correct positions of region-beginning/end (bug#55234)

(rectangle-mark-mode): Add advices for region-beginning and region-end.
(rectangle--region-beginning, rectangle--region-end): New advices.
(rectangle--extract-region): Let-bind rectangle-mark-mode around
region-beginning and region-end to use the original functions.

2 years agoAdd more super and subscript characters to latin input methods
Robert Pluim [Wed, 8 Jun 2022 12:48:27 +0000 (14:48 +0200)]
Add more super and subscript characters to latin input methods

* lisp/leim/quail/latin-post.el ("latin-postfix", "latin-prefix"): Add
mssing super and subscript characters.  (Bug#55722)

2 years agoAdd fractions to latin-post input method
Robert Pluim [Wed, 8 Jun 2022 12:40:03 +0000 (14:40 +0200)]
Add fractions to latin-post input method

* lisp/leim/quail/latin-post.el ("latin-postfix"): Add fractions.

2 years agoAdd more ways to enter trade mark and registered sign
Robert Pluim [Mon, 6 Jun 2022 16:30:01 +0000 (18:30 +0200)]
Add more ways to enter trade mark and registered sign

* lisp/international/iso-transl.el (iso-transl-char-map): Add sequence
for TRADE MARK.
* lisp/leim/quail/latin-post.el ("latin-postfix"): Add REGISTERED SIGN
and TRADE MARK.
* lisp/leim/quail/latin-pre.el ("latin-prefix"): Add TRADE MARK.

2 years agoAllow running some DND tests interactively
Po Lu [Wed, 8 Jun 2022 12:33:42 +0000 (20:33 +0800)]
Allow running some DND tests interactively

* src/xselect.c (x_get_local_selection): Respect new variable.
(syms_of_xselect): New variable
`x-treat-local-requests-remotely'.

* test/lisp/dnd-tests.el (x-begin-drag, gui-set-selection):
Don't redefine these functions under X.
(dnd-tests-verify-selection-data): Use
`x-get-selection-internal' under X.
(dnd-tests-extract-selection-data): New function.
(dnd-tests-begin-text-drag): Update accordingly.
(dnd-tests-begin-file-drag, dnd-tests-begin-drag-files):
Temporarily skip these tests under X.

2 years agoRevert "Give ,@ a prefix syntax in elisp-mode"
Lars Ingebrigtsen [Wed, 8 Jun 2022 12:27:14 +0000 (14:27 +0200)]
Revert "Give ,@ a prefix syntax in elisp-mode"

This reverts commit d003848b5e3ad2dfbe84cc62b99776fdc6734325.

This leads to hangs in edebug-tests.

2 years agoDon't split Eshell expansions by line when using split-subscript operator
Jim Porter [Tue, 7 Jun 2022 02:53:39 +0000 (19:53 -0700)]
Don't split Eshell expansions by line when using split-subscript operator

* lisp/eshell/esh-var.el (eshell-apply-indices): Use
'eshell-convert-to-number' instead of 'eshell-convert'.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/interp-convert-var-split-indices): Expand test
(bug#55838).

2 years ago* doc/man/emacs.1.in: Add --init-directory.
Nicholas Vollmer [Wed, 8 Jun 2022 12:10:04 +0000 (14:10 +0200)]
* doc/man/emacs.1.in: Add --init-directory.

* doc/man/emacs.1.in: Document --init-directory (bug#55839).

2 years agoSimplify XDND toplevel freeing code
Po Lu [Wed, 8 Jun 2022 12:04:26 +0000 (20:04 +0800)]
Simplify XDND toplevel freeing code

* src/xterm.c (x_free_dnd_toplevels): New function.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop): Record
an unwind function to free DND toplevels instead of doing that
manually everywhere.

2 years agoFix last-modified meaning in bookmark.el
Manuel Giraud [Wed, 8 Jun 2022 11:51:41 +0000 (13:51 +0200)]
Fix last-modified meaning in bookmark.el

* lisp/bookmark.el (bookmark-update-last-modified): New function
to update the last-modified field.
(bookmark-send-edited-annotation, bookmark-relocate)
(bookmark-rename): Use `bookmark-update-last-modified' in
annotations editing, relocation and renaming.

2 years agoicomplete-in-buffer doc fix
Lars Ingebrigtsen [Wed, 8 Jun 2022 11:48:48 +0000 (13:48 +0200)]
icomplete-in-buffer doc fix

* lisp/icomplete.el (icomplete-in-buffer): dabbrev now uses
icomplete-in-buffer (bug#45764).

2 years agoFactor out test configuration for remote files
Michael Albinus [Wed, 8 Jun 2022 10:06:56 +0000 (12:06 +0200)]
Factor out test configuration for remote files

* lisp/emacs-lisp/ert-x.el (tramp-methods)
(tramp-default-host-alist): Declare.
(ert-remote-temporary-file-directory): New defconst.

* test/README: Mention dnd-tests.el.

* test/lisp/autorevert-tests.el
(auto-revert-test-remote-temporary-file-directory): Remove.
Replace all uses by `ert-remote-temporary-file-directory'.

* test/lisp/dnd-tests.el (ert-x): Require.
(dnd-tests-temporary-file-directory): Remove.  Replace all uses by
`ert-remote-temporary-file-directory'.

* test/lisp/filenotify-tests.el
(file-notify-test-remote-temporary-file-directory): Remove.
Replace all uses by `ert-remote-temporary-file-directory'.

* test/lisp/shadowfile-tests.el (ert-x): Require.
(shadow-test-remote-temporary-file-directory): Remove.  Replace
all uses by `ert-remote-temporary-file-directory'.

* test/lisp/net/tramp-tests.el: Don't require ert.
(ert-remote-temporary-file-directory): Define if it doesn't exist.
(tramp-test-temporary-file-directory): Remove.  Replace all uses
by `ert-remote-temporary-file-directory'.

2 years agoPreserve doc string in `byte-compile` (bug#55830)
Mattias Engdegård [Wed, 8 Jun 2022 08:03:55 +0000 (10:03 +0200)]
Preserve doc string in `byte-compile` (bug#55830)

* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function):
Don't transpose doc string and interactive spec, which must come
in this order.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-function-attributes): New test.

2 years agoMake responding to selection requests work inside popups
Po Lu [Wed, 8 Jun 2022 07:08:09 +0000 (15:08 +0800)]
Make responding to selection requests work inside popups

* src/xfns.c (Fx_file_dialog):
* src/xmenu.c (x_menu_wait_for_event, create_and_show_popup_menu)
(create_and_show_dialog, x_menu_show): Defer selection requests.
* src/xselect.c (x_get_foreign_selection)
(x_handle_selection_notify): Add some more info to selection
trace.

* src/xterm.c (x_defer_selection_requests): Make non-static.
(x_release_selection_requests_and_flush): New function.
(x_dnd_begin_drag_and_drop): Use DEFER_SELECTIONS instead.
(x_wait_for_cell_change): Fix initial value of rc for pushed
back events.
(handle_one_xevent): Allow GTK to respond to selections in its
windows too.

* src/xterm.h (DEFER_SELECTIONS): New slug of code.

2 years agoFix quitting in one go out of `mouse-drag-and-drop-region'
Po Lu [Wed, 8 Jun 2022 05:03:57 +0000 (13:03 +0800)]
Fix quitting in one go out of `mouse-drag-and-drop-region'

* src/xterm.c (x_dnd_begin_drag_and_drop): Make sure
handle_interrupt is called inside the nested event loop upon a
quit event.

2 years agoFix crash with outdated selection requests
Po Lu [Wed, 8 Jun 2022 02:54:07 +0000 (10:54 +0800)]
Fix crash with outdated selection requests

* src/xselect.c (x_handle_selection_request): Don't store into
stack if it wasn't previously pushed.

2 years agoImprove drag-and-drop tests
Po Lu [Wed, 8 Jun 2022 02:40:20 +0000 (10:40 +0800)]
Improve drag-and-drop tests

* lisp/dnd.el (dnd-begin-file-drag, dnd-begin-drag-files): Fix
type of `x-xdnd-username'.
* lisp/select.el (selection-converter-alist): Fix declaration of
_DT_NETFILE converter.

* test/lisp/dnd-tests.el (dnd-tests-verify-selection-data):
Handle "compound" selection converters.
(dnd-tests-parse-tt-netfile): New function.
(dnd-tests-begin-file-drag, dnd-tests-begin-drag-files): Verify
validity of file selection data.

2 years agoMore fixes to mouse event reporting during drag-and-drop
Po Lu [Wed, 8 Jun 2022 00:49:51 +0000 (08:49 +0800)]
More fixes to mouse event reporting during drag-and-drop

* src/xterm.c (x_dnd_begin_drag_and_drop): Don't reset
dpyinfo->grabbed when quitting.
(handle_one_xevent): Keep track of dpyinfo->grabbed as well
inside the drag-and-drop event loop.

2 years agopcomplete-parse-arguments: Fix last change
Dmitry Gutov [Tue, 7 Jun 2022 22:08:22 +0000 (01:08 +0300)]
pcomplete-parse-arguments: Fix last change

* lisp/pcomplete.el (pcomplete-parse-arguments):
Throw the previous value of 'pcomplete-stub' (a list) rather than
the newly constructed one (bug#50470).

2 years ago* doc/emacs/vc1-xtra.texi (Customizing VC): Remove deprecated Mtn.
Juri Linkov [Tue, 7 Jun 2022 18:47:51 +0000 (21:47 +0300)]
* doc/emacs/vc1-xtra.texi (Customizing VC): Remove deprecated Mtn.

2 years agoGive ,@ a prefix syntax in elisp-mode
Lars Ingebrigtsen [Tue, 7 Jun 2022 18:28:05 +0000 (20:28 +0200)]
Give ,@ a prefix syntax in elisp-mode

* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize):
Give ,@ a prefix syntax so that we can properly identify symbols
that follow it, i.e., ,@foo (bug#44418).

2 years agoDemote extended attribute errors in basic-save-buffer-2
Lars Ingebrigtsen [Tue, 7 Jun 2022 18:03:41 +0000 (20:03 +0200)]
Demote extended attribute errors in basic-save-buffer-2

* lisp/files.el (basic-save-buffer-2): Give demoted errors when
reading extended attributes that fail (bug#43723).

2 years agoRegenerated ldefs-boot.el
Lars Ingebrigtsen [Tue, 7 Jun 2022 16:59:44 +0000 (18:59 +0200)]
Regenerated ldefs-boot.el

This is the first check-in after the loaddefs-gen.el rewrite.

2 years agoRemove Mtn from vc-handled-backends
Lars Ingebrigtsen [Tue, 7 Jun 2022 16:59:04 +0000 (18:59 +0200)]
Remove Mtn from vc-handled-backends

* lisp/vc/vc-hooks.el (vc-handled-backends): Remove the deprecate
vc-mtn backend.

2 years agoFix loaddefs-generate--rubric recorded name
Lars Ingebrigtsen [Tue, 7 Jun 2022 16:51:15 +0000 (18:51 +0200)]
Fix loaddefs-generate--rubric recorded name

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Fix
the name that's recorded in the file -- this is only used by
loaddefs-gen now, I think.

2 years agoMake artist-mode work in zoomed buffers
Lars Ingebrigtsen [Tue, 7 Jun 2022 16:35:00 +0000 (18:35 +0200)]
Make artist-mode work in zoomed buffers

* lisp/textmodes/artist.el (artist-mouse-draw-continously):
(artist-mouse-draw-continously):
(artist-mouse-draw-poly):
(artist-mouse-draw-1point):
(artist-mouse-draw-2points):
(artist-mouse-draw-2points): Work better when the window is zoomed
(bug#46035).

2 years agoAllow posn-col-row to return data on a per-window basis
Lars Ingebrigtsen [Tue, 7 Jun 2022 16:34:20 +0000 (18:34 +0200)]
Allow posn-col-row to return data on a per-window basis

* doc/lispref/commands.texi (Accessing Mouse): Document it.
* lisp/subr.el (posn-col-row): Extend to use window data.

2 years agoAllow hooks to alter the process in prolog-ensure-process
Lars Ingebrigtsen [Tue, 7 Jun 2022 14:38:55 +0000 (16:38 +0200)]
Allow hooks to alter the process in prolog-ensure-process

* lisp/progmodes/prolog.el (prolog-ensure-process): Start the mode
after starting the process, so that the mode hook can talk to the
process (bug#46003).

2 years agofind-func.el: Fix bug#41104
Stefan Monnier [Tue, 7 Jun 2022 14:30:47 +0000 (10:30 -0400)]
find-func.el: Fix bug#41104

* lisp/emacs-lisp/find-func.el (find-function-advised-original): Look
at the actual function definition rather than
`advice--symbol-function` which sometimes returns only the advice.

* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--find-library-verbose): Add test.

2 years agoAdd selection stuff to DND tests
Po Lu [Tue, 7 Jun 2022 13:45:17 +0000 (21:45 +0800)]
Add selection stuff to DND tests

* test/lisp/dnd-tests.el (dnd-tests-selection-table): New
defvar.
(gui-set-selection): Actually implement in a way that validates
the local value and stores it for future use.
(dnd-tests-verify-selection-data): New function.
(dnd-tests-begin-text-drag): Add tests for the contents of
various selections.

2 years agoFix coding style of some Haiku files
Po Lu [Tue, 7 Jun 2022 12:13:10 +0000 (12:13 +0000)]
Fix coding style of some Haiku files

* src/haiku_support.cc: (FrameResized):
(class EmacsView, AfterResize): Fix coding and initializer
style.

* src/haiku_support.h (struct haiku_resize_event): Rename
confusingly named fields.
* src/haikuterm.c (haiku_read_socket): Update accordingly.

2 years agoSimplify mode line for vc-print-root-log
Lars Ingebrigtsen [Tue, 7 Jun 2022 11:23:22 +0000 (13:23 +0200)]
Simplify mode line for vc-print-root-log

* lisp/vc/vc.el (vc-print-root-log): Don't display "from <file>"
(bug#45007).

2 years agoFix more bugs with DND selection handling
Po Lu [Tue, 7 Jun 2022 10:23:52 +0000 (18:23 +0800)]
Fix more bugs with DND selection handling

* src/xterm.c (x_defer_selection_requests)
(x_release_selection_requests): New functions.
(x_dnd_begin_drag_and_drop): Use those functions to defer
selections instead.  Fix error signalled when ownership of
XdndSelection is lost.
(handle_one_xevent): Likewise.

2 years agoClarify highlight-changes-rotate-faces doc string
Lars Ingebrigtsen [Tue, 7 Jun 2022 10:21:53 +0000 (12:21 +0200)]
Clarify highlight-changes-rotate-faces doc string

* lisp/hilit-chg.el (highlight-changes-rotate-faces): Doc string
clarification (bug#44150).

2 years agoRemove mentions of GNOME MediaKeys from dbus documentation examples
Po Lu [Tue, 7 Jun 2022 07:44:05 +0000 (15:44 +0800)]
Remove mentions of GNOME MediaKeys from dbus documentation examples

* doc/misc/dbus.texi (Properties and Annotations):
* lisp/net/dbus.el (dbus-get-all-managed-objects): Remove
mentions of obsolete GNOME APIs from example text.

2 years agoImprove compatibility with some clients of the Motif drop protocol
Po Lu [Tue, 7 Jun 2022 05:49:41 +0000 (13:49 +0800)]
Improve compatibility with some clients of the Motif drop protocol

* lisp/select.el (x-dnd-targets-list): New defvar.
(xselect-convert-to-targets): Convert XdndSelection based on the
DND targets list.
* src/xfns.c (Fx_begin_drag): Pass new argument.
* src/xselect.c (struct x_selection_request): New struct.
(x_push_current_selection_request):
(x_pop_current_selection_request): New functions.
(x_selection_request_lisp_error, x_reply_selection_request)
(x_handle_selection_request, x_convert_selection)
(syms_of_xselect_for_pdumper): Correctly handle recursive
requests for MULTIPLE by maintaining a stack of selection
requests, converted selections, and other data.
* src/xterm.c (x_dnd_begin_drag_and_drop): New argument
`selection_target_list'.  Bind it to the DND targets list.
(syms_of_xterm): New defvar and associated defsym.
* src/xterm.h: Update prototypes.

2 years agoAdd new drag-and-drop test
Po Lu [Tue, 7 Jun 2022 05:07:26 +0000 (13:07 +0800)]
Add new drag-and-drop test

* test/lisp/dnd-tests.el (dnd-tests-get-local-file-uri): New
test.

2 years agoFix leak of event data on GTK+ 2.x
Po Lu [Tue, 7 Jun 2022 04:59:37 +0000 (12:59 +0800)]
Fix leak of event data on GTK+ 2.x

* src/xterm.c (handle_one_xevent): Fix goto XI_OTHER for
valuator motion events generated on scroll bars.

2 years agoUpdate Haiku drag-and-drop code
Po Lu [Tue, 7 Jun 2022 02:44:08 +0000 (02:44 +0000)]
Update Haiku drag-and-drop code

* lisp/term/haiku-win.el (haiku-drag-and-drop): Don't allow
dropping on places other than the text area (it doesn't work).
Also respect mouse-yank-at-point.

2 years agoDon't allow dropping on invalid drop sites
Po Lu [Tue, 7 Jun 2022 02:39:55 +0000 (10:39 +0800)]
Don't allow dropping on invalid drop sites

* lisp/x-dnd.el (x-dnd-drop-data): If dropping on something
other than the text area, don't set point.
(x-dnd-handle-xdnd, x-dnd-handle-motif): Don't pretend dropping
on the mode line is ok.

2 years agoDon't display mouse face during mouse drag-and-drop
Po Lu [Tue, 7 Jun 2022 02:27:03 +0000 (10:27 +0800)]
Don't display mouse face during mouse drag-and-drop

* lisp/mouse.el (mouse-drag-and-drop-region): Don't display
mouse face, since it leads to a lot of flicker.

2 years agoPrevent crashes with very large Motif targets tables
Po Lu [Tue, 7 Jun 2022 01:45:41 +0000 (09:45 +0800)]
Prevent crashes with very large Motif targets tables

* src/xterm.c (xm_setup_dnd_targets): Catch errors around
xm_write_targets_table lest we get a BadAlloc error.

2 years agoFix two crashes when a display connection is lost
Po Lu [Tue, 7 Jun 2022 01:26:15 +0000 (09:26 +0800)]
Fix two crashes when a display connection is lost

This fixes errors caused by invalid error traps being left on
the error handler stack if an IO error causes a non-local exit
out of the protected code, and another crash caused by
delete_frame trying to read async input.

* src/eval.c (unwind_to_catch, push_handler_nosignal): Save and
restore the X error handler stack.
* src/lisp.h (struct handler): [HAVE_X_WINDOWS]: New field
`x_error_handler_depth'.

* src/xterm.c (struct x_error_message_stack): Make string a
regular string.
(x_unwind_errors_to): New function.
(x_error_catcher, x_catch_errors_with_handler)
(x_uncatch_errors_after_check, x_uncatch_errors): Update the
stack depth.
(x_check_errors): Stop manually unwinding since unwind_to_catch
now does that for us.
(x_had_errors_p, x_clear_errors): Update for new type of
`string'.
(x_connection_closed): Block input between just before
delete_frame to when the terminal is unlinked.

* src/xterm.h: Update prototypes.

2 years agoFix execute-extended-command help text for remapped commands
Lars Ingebrigtsen [Mon, 6 Jun 2022 14:43:12 +0000 (16:43 +0200)]
Fix execute-extended-command help text for remapped commands

* lisp/simple.el (execute-extended-command): Don't provide
misleading help text for remapped commands (bug#23543).

2 years agoAllow using xref buttons in non-*Help* buffers
Stephen Berman [Mon, 6 Jun 2022 14:11:50 +0000 (16:11 +0200)]
Allow using xref buttons in non-*Help* buffers

* lisp/help-mode.el (help-buffer): Allow using the xref buttons in
non-*Help* buffers (bug#8147) (but display the result in a *Help*
buffer).

2 years ago; * lisp/emacs-lisp/lisp.el (raise-sexp): Doc fix. (Bug#55788)
Eli Zaretskii [Mon, 6 Jun 2022 14:10:21 +0000 (17:10 +0300)]
; * lisp/emacs-lisp/lisp.el (raise-sexp): Doc fix.  (Bug#55788)

2 years agoMake find-file-noselect not pick buffers with broken symlinks
Lars Ingebrigtsen [Mon, 6 Jun 2022 13:49:36 +0000 (15:49 +0200)]
Make find-file-noselect not pick buffers with broken symlinks

* lisp/files.el (find-buffer-visiting): Improve doc string.
(find-file-noselect): Don't pick buffers with broken symlinks,
because that's too confusing (bug#41414).

2 years agoImprove scheme-mode syntax-rules indentation
Lars Ingebrigtsen [Mon, 6 Jun 2022 13:32:03 +0000 (15:32 +0200)]
Improve scheme-mode syntax-rules indentation

* lisp/progmodes/scheme.el (syntax-rules): Indent syntax-rules
with a parameter better (bug#40869).

2 years agoImprove find-sibling-file error reporting
Lars Ingebrigtsen [Mon, 6 Jun 2022 12:34:41 +0000 (14:34 +0200)]
Improve find-sibling-file error reporting

* lisp/files.el (find-sibling-file): Improve error reporting.

2 years agoUpdate comments in X error handling code
Po Lu [Mon, 6 Jun 2022 12:23:20 +0000 (20:23 +0800)]
Update comments in X error handling code

* src/xterm.c (struct x_error_message_stack, x_error_message)
(x_error_catcher, x_catch_errors, x_had_errors_p)
(x_clear_errors): Long-overdue comment update.  Describe the
fields of the error message stack, and the fact that
`x_error_message' is a stack, not a pointer to a string (which
has been true since 2006).  Also describe the updated conditions
used to find an applicable error handler and to call
x_uncatch_errors_after_check.

2 years agoAdd drag-and-drop API tests
Po Lu [Mon, 6 Jun 2022 11:51:47 +0000 (19:51 +0800)]
Add drag-and-drop API tests

* test/lisp/dnd-tests.el: New file.
(dnd-tests-begin-text-drag):
(dnd-tests-begin-file-drag):
(dnd-tests-begin-drag-files): New tests.

2 years agoImprove handling of remote files during drag-and-drop
Po Lu [Mon, 6 Jun 2022 11:05:36 +0000 (19:05 +0800)]
Improve handling of remote files during drag-and-drop

* lisp/dnd.el (dnd-begin-drag-files): Don't fail if one remote
file couldn't be downloaded.

2 years agoTest warning suppressions with lexical binding
Mattias Engdegård [Mon, 6 Jun 2022 08:47:42 +0000 (10:47 +0200)]
Test warning suppressions with lexical binding

* test/lisp/emacs-lisp/bytecomp-tests.el
(test-byte-comp-compile-and-load): Add lexical cookie to file being
compiled as part of the test.
(bytecomp-test--with-suppressed-warnings): Comment out the test
for suppressing warnings when attempting to let-bind `nil`,
as that (1) doesn't work and (2) is a silly thing to do anyway.

2 years agoFix several more issues with running Lisp during drag-and-drop
Po Lu [Mon, 6 Jun 2022 08:01:41 +0000 (16:01 +0800)]
Fix several more issues with running Lisp during drag-and-drop

* src/xterm.c (handle_one_xevent): Fix _NET_WM_PING cycle again
and set mouse_moved flags during drag-and-drop so reading mouse
events from Lisp continues to work.

2 years agoSignal an error XdndSelection was lost during drag-and-drop
Po Lu [Mon, 6 Jun 2022 04:48:40 +0000 (12:48 +0800)]
Signal an error XdndSelection was lost during drag-and-drop

* src/xselect.c (x_handle_selection_clear): Signal an error if
ownership of XdndSelection was lost during drag-and-drop.

2 years agoMake mouse input work properly inside the debugger during DND
Po Lu [Mon, 6 Jun 2022 04:33:41 +0000 (12:33 +0800)]
Make mouse input work properly inside the debugger during DND

* src/xterm.c (x_dnd_begin_drag_and_drop): Set
`x_dnd_recursion_depth'.
(handle_one_xevent): If the recursive edit level is higher than
when DND started, handle mouse events normally.

2 years agocl-typep: Emit warning when using a type not known to be a type
Stefan Monnier [Mon, 6 Jun 2022 04:04:00 +0000 (00:04 -0400)]
cl-typep: Emit warning when using a type not known to be a type

`cl-typep` has used a heuristic that if there's a `<foo>-p` function,
then <foo> can be used as a type.  This made sense in the past where
most types were not officially declared to be (cl-)types, but nowadays
this just encourages abuses such as using `cl-typecase` with
"types" like `fbound`.  It's also a problem for EIEIO objects, where
for historical reasons `<foo>-p` tests if the object is of type
exactly `<foo>` whereas (cl-typep OBJ <foo>) should instead test
if OBJ is a *subtype* of `<foo>`.

So we change `cl-typep` to emit a warning whenever this "-p" heuristic
is used, to discourage abuses, encourage the use of explicit
`cl-deftype` declarations, and try and detect some misuses of
`<foo>-p` for EIEIO objects.

* lisp/emacs-lisp/eieio.el (defclass): Define as type not only at
run-time but also for the current compilation unit.

* lisp/emacs-lisp/eieio-core.el (class, eieio-object): Define as types.

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't abuse the
"-p" heuristic.

* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies):
Add entries for frames, windows, markers, and overlays.
(cl-typep): Emit a warning when using a predicate that is not known to
correspond to a type.

* lisp/files.el (file-relative-name): Fix error that can trigger if
there's an(other) error between loading `files.el` and loading
`minibuffer.el`.

2 years agoRework X selections to make it safe to run the debugger inside converters
Po Lu [Mon, 6 Jun 2022 03:08:19 +0000 (11:08 +0800)]
Rework X selections to make it safe to run the debugger inside converters

* src/keyboard.c (prev_kbd_event): Delete function.
(readable_events): Return 1 if
x_detect_pending_selection_requests returns true.
(kbd_buffer_unget_event): Also delete function, since nested
selection requests are really handled correctly.
(kbd_buffer_get_event): Handle events from the special X
deferred selection queue as well.

* src/keyboard.h: Update prototypes.

* src/xselect.c (struct selection_event_queue)
(selection_input_event_equal, x_queue_event)
(x_start_queuing_selection_requests)
(x_stop_queuing_selection_requests): Delete structs, since they
are no longer required.
(x_handle_selection_request, x_handle_selection_event): Allow
nested selection events.

* src/xterm.c (struct x_selection_request_event): New struct.
(x_handle_pending_selection_requests_1)
(x_handle_pending_selection_requests): Handle all events in the
new selection event queue.
(x_push_selection_request, x_detect_pending_selection_requests):
New functions.
(x_dnd_begin_drag_and_drop): Drain the selection queue here as
well.
(handle_one_xevent): When inside a nested event loop, just push
selections to that queue.
(XTread_socket): Allow reading X events if x_dnd_unwind_flag is
true, even though DND is in progress.
(x_delete_display): Delete pending selection events for the
display that is going away.

* src/xterm.h: Update prototypes.

2 years agopcomplete.el: Fix part of bug#50470
Stefan Monnier [Sun, 5 Jun 2022 23:51:29 +0000 (19:51 -0400)]
pcomplete.el: Fix part of bug#50470

Try and handle the case where `pcomplete-parse-arguments-function`
directly returns a list of completions.

* lisp/pcomplete.el (pcomplete-parse-arguments): Don't modify the
buffer if we're not allowed to.  Instead use the buffer's current
content as the "pattern to be completed" and return the list
of completions as is.  Also, use `try-completions` to simplify the
previous code.

2 years agoAdd nohandle-guide images for tree-widget
Lars Ingebrigtsen [Sun, 5 Jun 2022 22:42:56 +0000 (00:42 +0200)]
Add nohandle-guide images for tree-widget

These are copies of the guide.* files

2 years agoRe-re-fix previous describe-function change
Lars Ingebrigtsen [Sun, 5 Jun 2022 20:52:59 +0000 (22:52 +0200)]
Re-re-fix previous describe-function change

* lisp/help-fns.el (describe-function): Put back binding removed
by mistake in previous change.

2 years agoFix key binding buffer issue in describe-function better
Lars Ingebrigtsen [Sun, 5 Jun 2022 20:48:28 +0000 (22:48 +0200)]
Fix key binding buffer issue in describe-function better

* lisp/help-fns.el (describe-function): Revert previous change here.
(describe-function-1): Just use describe-function-orig-buffer
instead of the key-buffer binding -- this will also make the
rendering results correct when hitting `g' and `l'.

2 years agoClarify syntax-ppss doc string
Lars Ingebrigtsen [Sun, 5 Jun 2022 20:37:32 +0000 (22:37 +0200)]
Clarify syntax-ppss doc string

* lisp/emacs-lisp/syntax.el (syntax-ppss): Clarify doc string.

2 years agoSimplify set-goal-column
Lars Ingebrigtsen [Sun, 5 Jun 2022 20:29:08 +0000 (22:29 +0200)]
Simplify set-goal-column

* lisp/simple.el (set-goal-column): Simplify the code.

2 years agoMake `C-h f' look up key bindings in the current buffer again
Lars Ingebrigtsen [Sun, 5 Jun 2022 19:48:21 +0000 (21:48 +0200)]
Make `C-h f' look up key bindings in the current buffer again

* lisp/help-fns.el (describe-function): Pass in the correct buffer
to look up key bindings in.
(describe-function-1): Use it.

2 years agoMake the goal column work for the scrolling commands, too
Lars Ingebrigtsen [Sun, 5 Jun 2022 19:35:56 +0000 (21:35 +0200)]
Make the goal column work for the scrolling commands, too

* doc/emacs/basic.texi (Moving Point): Document it.
* lisp/simple.el (set-goal-column): Update doc string.

* lisp/window.el (scroll-up-command, scroll-down-command): Make
the goal column take effect for these commands, too (bug#17346).

2 years agoMove two more variables from autoload.el to loaddefs-gen.el
Lars Ingebrigtsen [Sun, 5 Jun 2022 18:32:01 +0000 (20:32 +0200)]
Move two more variables from autoload.el to loaddefs-gen.el

* lisp/emacs-lisp/loaddefs-gen.el (generated-autoload-file)
(generated-autoload-load-name): Move the remaining two autoload.el
variables used by loaddefs-gen.el from autoload.el.

2 years agoMake finder/cus-dep scraping use generate-lisp-file functions
Lars Ingebrigtsen [Sun, 5 Jun 2022 18:17:30 +0000 (20:17 +0200)]
Make finder/cus-dep scraping use generate-lisp-file functions

* lisp/finder.el (finder-compile-keywords):
* lisp/cus-dep.el (custom-make-dependencies): Use
generate-lisp-file functions directly instead of piggy-backing on
the autoload.el functions.  (This is part of making autoload.el obsolete.)

2 years agoDon't generate separate autoload file for htmlfontify
Stefan Kangas [Sun, 5 Jun 2022 16:23:17 +0000 (18:23 +0200)]
Don't generate separate autoload file for htmlfontify

* lisp/hfy-cmap.el: Update file local to no longer put htmlfontify
autoloads in htmlfontify-loaddefs.el.
* lisp/htmlfontify.el (htmlfontify-loaddefs): Don't require.
* test/lisp/htmlfontify-tests.el (htmlfontify-autoload): Delete
test (bug#52400).

2 years agoRename generate-file to generate-lisp-file
Lars Ingebrigtsen [Sun, 5 Jun 2022 15:48:29 +0000 (17:48 +0200)]
Rename generate-file to generate-lisp-file

* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header)
(miscdic-convert):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Adjust callers.

* lisp/emacs-lisp/generate-lisp-file.el: Renamed from
generate-file.el.  Also rename some keyword parameters and require
a generator function.

2 years ago; * etc/NEWS: Fix wording of entry about 'file-expand-wildcards'.
Eli Zaretskii [Sun, 5 Jun 2022 14:53:43 +0000 (17:53 +0300)]
; * etc/NEWS: Fix wording of entry about 'file-expand-wildcards'.

2 years agoAdd convenience functions for generating Emacs Lisp files
Lars Ingebrigtsen [Sun, 5 Jun 2022 14:36:25 +0000 (16:36 +0200)]
Add convenience functions for generating Emacs Lisp files

* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric)

* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Use the new functions.

* lisp/emacs-lisp/generate-file.el: New file to provide
convenience functions for generated files.  It's not always
trivial to know which parts of the trailer that has to be
obfuscated to avoid not getting byte-compiled etc, and some parts
of the headers/trailers are usually forgotten when hand-coding
these.

2 years ago; * lisp/international/fontset.el (setup-default-fontset): Fix comment.
Eli Zaretskii [Sun, 5 Jun 2022 14:08:49 +0000 (17:08 +0300)]
; * lisp/international/fontset.el (setup-default-fontset): Fix comment.

2 years agoAdd a fallback font for Tamil Supplement characters
समीर सिंह Sameer Singh [Sun, 5 Jun 2022 11:39:40 +0000 (17:09 +0530)]
Add a fallback font for Tamil Supplement characters

* lisp/international/fontset.el (setup-default-fontset): Add
and entry for "Noto Sans Tamil Supplement".  (Bug#55807)

2 years agoMake the Unicode tree widget prettier
JD Smith [Sun, 5 Jun 2022 13:59:37 +0000 (15:59 +0200)]
Make the Unicode tree widget prettier

* lisp/tree-widget.el (tree-widget-nohandle-guide): New widget:
"One small change is needed to accommodate this
style. `tree-widget-guide’ specifies a single vertical bar “guide”
widget. In the unicode tree, two separate vertical bars are needed
— one “plain” (│), and one which connects to the horizontal
“handle” preceding the node (├)."
(tree-widget--cursors):
(tree-widget):
(tree-widget-value-create): Use it.

Copyright-paperwork-exempt: yes

2 years agoAdd new command find-sibling-file
Lars Ingebrigtsen [Sun, 5 Jun 2022 13:43:38 +0000 (15:43 +0200)]
Add new command find-sibling-file

* doc/emacs/files.texi (Visiting): Document it.
* lisp/files.el (file-expand-wildcards): Fix up the regexp expansion.
(find-sibling-rules, find-sibling-file): New user option and command.
(find-sibling-file--search): New helper function.

2 years agoFix file name encoding of Motif drop protocol file selections
Po Lu [Sun, 5 Jun 2022 13:16:09 +0000 (21:16 +0800)]
Fix file name encoding of Motif drop protocol file selections

* lisp/select.el (xselect-convert-to-filename):
(xselect-convert-to-dt-netfile): Encode in the file name coding
system instead of `raw-text-unix'.