summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
Commit message (Collapse)AuthorAge
* Merge from origin/emacs-29Eli Zaretskii2023-04-15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5ef7ff05736 ; Start a new ChangeLog.4 file. 11126c6d30a Fix 'C-h k' for "Paste from Kill Menu" in context menus 74ddfe811f9 ; * doc/misc/calc.texi (Rewrites Tutorial): Fix a typo (b... 08cda286c3f Improve the documentation of the XDS support 14d1c00e806 Allow reindentation of images inserted by 'mm-inline-image' b63a9eda01c Fix "C-h k" and "C-h c" with Paste from Kill Menu b36c21e27dc Change cursor color on NS port when it matches the face b... 96714c106b7 Improve documentation of image-related commands 6a2863ca016 Fix handling of sliced images 5be79fd05a5 ; * etc/NEWS: Announce 'cyrillic-mongolian' IM. ca1a0fda98a ; Fix last change. ce63462dbda Add cyrillic-mongolian input method 58801792706 ; Minor addition to the Emacs FAQ 88847dee125 Jsonrpc: don't bind inhibit-read-only to t so early cb8c87a423a Allow active region when IM is used # Conflicts: # etc/NEWS
| * Fix 'C-h k' for "Paste from Kill Menu" in context menusEli Zaretskii2023-04-08
| | | | | | | | | | | | * lisp/mouse.el (context-menu-region): Make the entries be symbols, not just integers, to prevent "C-h c" from interpreting them as character keys. (Bug#62626)
* | Merge from origin/emacs-29Eli Zaretskii2023-01-01
|\| | | | | | | | | | | | | | | | | | | | | cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
| * ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
| |
* | New option for selecting symbols by double-clickingEli Zaretskii2022-12-16
|/ | | | | | | * lisp/mouse.el (mouse-1-double-click-prefer-symbols): New user option. (mouse-skip-word): If 'mouse-1-double-click-prefer-symbols' is non-nil, skip over the entire symbol at point. (Bug#60080)
* Avoid signaling args-out-of-range in mouse.elEli Zaretskii2022-11-23
| | | | | | * lisp/mouse.el (mouse-posn-property): Avoid signaling args-out-of-range errors when mode-line format uses min-width 'display' property. (Bug#59452)
* Fix some no-X build warningsLars Ingebrigtsen2022-08-22
| | | | | | | | | | | | | | * lisp/cus-edit.el (fringe-bitmap-p): Autoload. * lisp/image.el (clear-image-cache): Declare. * lisp/mouse.el (dnd-begin-file-dram): Autoload. * lisp/thumbs.el (image-supported-file-p): Declare (bug#57342). * lisp/mail/rmailmm.el (rmail-mime-set-bulk-data): * lisp/emacs-lisp/icons.el (icons--create): Avoid warnings on no-X builds.
* ; * lisp/mouse.el: Delete stale comment.Stefan Kangas2022-08-09
|
* ; Fix typos.Mattias EngdegÄrd2022-07-02
|
* Make <mouse-2> in mode line more careful as wellVisuwesh2022-06-26
| | | | | | * lisp/mouse.el (mouse-delete-other-windows): Only delete other windows if the user didn't move the cursor off the mode-line (bug#56198).
* Make <mouse-3> in the mode line more carefulVisuwesh2022-06-26
| | | | | | * lisp/mouse.el (mouse-delete-window): Only delete the window if the user hasn't moved point out of the mode line before releasing the button (bug#56198).
* Allow appending to the kill ring with mouse selectionsLars Ingebrigtsen2022-06-20
| | | | | | | | | * lisp/bindings.el (ignore-preserving-kill-region): New function. (global-map): Use it. * lisp/mouse.el (mouse-set-region, mouse-drag-region) (mouse-drag-track): Allow appending to kill ring with mouse selections (bug#32747).
* New setting for mouse-drag-copy-region to not put "" onto kill ringLars Ingebrigtsen2022-06-09
| | | | | | | * doc/emacs/frames.texi (Mouse Commands): Document it. * lisp/mouse.el (mouse-drag-copy-region): Add value (bug#17211) for not putting "" strings onto the kill ring. (mouse-set-region, mouse-save-then-kill): Use the new value.
* Disable tooltip timeouts for drag-and-drop tooltipsPo Lu2022-06-09
| | | | | * lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip): Don't time out the created tooltip.
* Note caveats of `follow-tooltip' with system tooltipsPo Lu2022-06-09
| | | | | | | * 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.
* Also show mouse DND tooltip contents during interprogram drag-and-dropPo Lu2022-06-09
| | | | | | | | | | | | | | | | | | | | | | * 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.
* Don't display mouse face during mouse drag-and-dropPo Lu2022-06-07
| | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Don't display mouse face, since it leads to a lot of flicker.
* Improve doc of `mouse-drag-mode-line-buffer'Po Lu2022-06-04
| | | | | | | * doc/emacs/frames.texi (Mouse Commands): Document `mouse-drag-mode-line-buffer'. * etc/NEWS: Explain where that option is supported. * lisp/mouse.el (mouse-drag-mode-line-buffer): Likewise.
* Add new user option `mouse-drag-mode-line-buffer'Po Lu2022-06-03
| | | | | | | * etc/NEWS: Announce new option. Also add missing entries for an earlier change. * lisp/mouse.el (mouse-drag-mode-line-buffer): New user option. (mouse-drag-mode-line): Implement that option.
* Fix help-echo tooltips interfering with mouse drag-and-dropPo Lu2022-06-02
| | | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Disable tooltip-mode while mouse drag-and-drop is in progress. Also restore state correctly in some more cases.
* Improve mouse draggingPo Lu2022-05-12
| | | | | | * lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip): Respect foreground and background parameters. (mouse-drag-and-drop-region): Enable fine grained tracking.
* Fix handling double-click-time nil or tStefan Kangas2022-05-02
| | | | | | | | | | | | | | * lisp/mouse.el (mouse-double-click-time): New function to always return a number for `double-click-time'. * lisp/emulation/viper-mous.el (viper-multiclick-timeout): * lisp/foldout.el (foldout-mouse-swallow-events): * lisp/help.el (help--read-key-sequence): * lisp/org/org-mouse.el (org-mouse-show-context-menu): Use 'mouse-double-click-time' instead of 'double-click-time'. * src/keyboard.c (syms_of_keyboard): Mention 'mouse-double-click-time' in doc string of 'double-click-time'. * test/lisp/mouse-tests.el (mouse-test-mouse-double-click-time): New test.
* Make isearch respond to 'mouse-yank-at-point'Lars Ingebrigtsen2022-04-27
| | | | | | | | * doc/emacs/killing.texi (Secondary Selection): Document it. * lisp/isearch.el (isearch-mouse-2): Make isearch respond to mouse-yank-at-point (bug#7787). * lisp/mouse.el (mouse-yank-at-point): Mention it.
* Respect new DND options when dragging to ourselves on HaikuPo Lu2022-04-05
| | | | | | | | | | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Allow dragging to the current frame if we know `return-frame' doesn't work. * lisp/term/haiku-win.el (haiku-dnd-drag-handler): New function. * src/haiku_support.cc (MouseMoved): Don't send drag motion events for the drag frame. * src/haikuselect.c (haiku_note_drag_motion_1) (haiku_note_drag_motion_2, haiku_note_drag_motion): New functions. (syms_of_haikuselect): New variable `haiku-drag-track-function'. * src/haikuterm.c (haiku_read_socket): Note mouse motion in that case.q * src/haikuterm.h: Update prototypes.
* Improve behavior of dragging text to windows on top of framesPo Lu2022-04-04
| | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new meaning of `return-frame' in `x-begin-drag'. * lisp/mouse.el (mouse-drag-and-drop-region): Use `now' when calling `x-begin-drag'. * src/xfns.c (Fx_begin_drag): Update doc string. * src/xterm.c (x_dnd_begin_drag_and_drop): Accept return_frame as a Lisp_Object and handle Qnow correctly. (XTmouse_position): Ignore tooltip frames when processing `drag-source'. (syms_of_xterm): New defsym `now'. * src/xterm.h: Update prototypes.
* Make dragging stuff to a window above a frame workPo Lu2022-04-03
| | | | | | | | | | | | | | | * doc/lispref/frames.texi (Mouse Tracking): * etc/NEWS: Announce new `drag-source' value of `track-mouse'. * lisp/mouse.el (mouse-drag-and-drop-region): Use new value of `track-mouse' during interprogram drag and drop. * src/keyboard.c (make_lispy_position): Handle nil values of f correctly. * src/xdisp.c (define_frame_cursor1): Ignore if `drag-source' as well. (syms_of_xdisp): New defsym `drag-source'. * src/xterm.c (XTmouse_position): Implement `drag-source'. (mouse_or_wdesc_frame): Likewise.
* Fix error on mouse move over something not a window while dragging textPo Lu2022-04-02
| | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Handle non-window values of `posn-window' correctly.
* ; * lisp/mouse.el (mouse-drag-and-drop-region-scroll-margin): Fix type.Po Lu2022-04-02
|
* Add new option `mouse-drag-and-drop-region-scroll-margin'Po Lu2022-04-02
| | | | | | | | * etc/NEWS: Announce new user option. * lisp/mouse.el (mouse-drag-and-drop-region-scroll-margin): New user option. (mouse-drag-and-drop-region): Implement "scroll margin" like behavior during mouse movement.
* Implement DELETE selection target for cross program dragsPo Lu2022-04-02
| | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Make sure mark stays deactivated if a "cut" operation was performed. * lisp/select.el (xselect-convert-to-delete): Don't clear selection contents if it's the XdndSelection.
* Handle quitting correctly during interprogram drag-and-dropPo Lu2022-03-23
| | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Handle quit correctly by exiting the cross program drag and drop.
* Fix two no-X compilation warningsLars Ingebrigtsen2022-03-22
| | | | | | | | * lisp/mouse.el (x-hide-tip, x-show-tip): Declare to avoid no-X build compilation warnings (bug#54524). * lisp/term/pgtk-win.el (window-system-initialization): Avoid no-X compilation warning.
* Display drag-and-drop messages in echo area on non-graphics displaysPo Lu2022-03-17
| | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip) (mouse-drag-and-drop-region-hide-tooltip): New functions. (mouse-drag-and-drop-region): Use them instead of calling `x-hide-tip' and `x-show-tip' directly.
* Fix minor bugs with XDND supportPo Lu2022-03-16
| | | | | | | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Report more selection targets for the benefit of Qt and Mozilla. * lisp/select.el (xselect--encode-string) (selection-converter-alist): Add new selection targets. * src/xterm.c (x_dnd_get_window_proxy): New function. (x_dnd_get_target_window): New argument proto_out, and return first window with XdndAware instead of bottommost window. (handle_one_xevent): Use new argument `proto_out'.
* Fix tooltip text properties showing up in dragged textPo Lu2022-03-16
| | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Directly call x-show-tip and x-hide-tip instead of going through tooltip-show.
* Better handle drag-and-drop from one Emacs frame to anotherPo Lu2022-03-16
| | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new parameter `return-frame' to `x-begin-drag'. * lisp/mouse.el (mouse-drag-and-drop-region): Utilize new feature. * src/xfns.c (Fx_begin_drag): New parameter `return-frame'. * src/xterm.c (x_dnd_begin_drag_and_drop): New parameter return_frame_p. (handle_one_xevent): Set new flags and return frame whenever appropriate. * src/xterm.h: Update prototypes.
* Add support for dragging text from Emacs to other programsPo Lu2022-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This still probably needs some more protection from malfunctioning clients which delete windows at random, but I don't know if that's a problem in practice. * doc/emacs/frames.texi (Drag and Drop): * doc/lispref/frames.texi (Drag and Drop): Document new features. * etc/NEWS: Announce new function `x-begin-drag' and new user option `mouse-drag-and-drop-region-cross-program'. * lisp/mouse.el (mouse-drag-and-drop-region-cross-program): New user option. (x-begin-drag): New variable declaration. (mouse-drag-and-drop-region): If the mouse moves out of an Emacs frame, begin a window system drag. * lisp/x-dnd.el (x-dnd-handle-xdnd): Remove left-over debugging code. * src/xfns.c (Fx_set_mouse_absolute_pixel_position): Fix indentation of opening paren. (Fx_begin_drag): New function. (syms_of_xfns): Define new subr. * src/xselect.c (x_timestamp_for_selection): New function. * src/xterm.c (X_DND_SUPPORTED_VERSION): New preprocessor declaration. (x_dnd_get_window_proto, x_dnd_send_enter, x_dnd_send_position) (x_dnd_send_leave, x_dnd_send_drop, x_set_dnd_targets) (x_dnd_begin_drag_and_drop): New functions. (handle_one_xevent): Handle drag-and-drop motion and button events when active. (x_free_frame_resources): If f is the DND source, stop drag-and-drop. (x_term_init): Intern new atoms. (syms_of_xterm): New symbol QXdndSelection. * src/xterm.h (struct x_display_info): New atoms Xatom_XdndAware, Xatom_XdndSelection, Xatom_XdndTypeList, Xatom_XdndActionCopy, Xatom_XdndActionMove, Xatom_XdndActionLink, Xatom_XdndActionAsk, Xatom_XdndActionPrivate, Xatom_XdndActionList, Xatom_XdndActionDescription, Xatom_XdndProxy, Xatom_XdndEnter, Xatom_XdndPosition, Xatom_XdndStatus, Xatom_XdndLeave, Xatom_XdndDrop, and Xatom_XdndFinished.
* * lisp/mouse.el (context-menu-entry): Remove help-buffer-under-preparation.Juri Linkov2022-02-20
| | | | (bug#53910)
* * lisp/mouse.el (context-menu-entry): Don't create menu for Help commands.Juri Linkov2022-02-17
| | | | | | | | | Help commands that describe keybindings call context-menu-entry bound to a key. This causes too much trouble when trying to build the context menu in a temporary Help buffer that is not displayed in a window. OTOH, there is no information in context menus useful for Help commands. So `help-buffer-under-preparation' is added to filter out such calls. (bug#53910)
* * lisp/mouse.el (context-menu-map): Select only unselected window (bug#53910)Juri Linkov2022-02-10
|
* Improve selection of fonts available from `mouse-set-font'Po Lu2022-02-09
| | | | | | | | | | | | | People get confused on a build without font dialogs (such as a Lucid build) if `menu-set-font' and `mouse-set-font' don't present them a list of the fonts actually available on their system. * lisp/mouse.el (mouse-generate-font-name-for-menu) (mouse-generate-font-menu): New functions. (mouse-select-font): Allow the user to select from all fonts available on the system. (mouse-set-font): Use `mouse-select-font' to display font menu.
* * lisp/mouse.el (context-menu-map): Select clicked window (bug#53249).Juri Linkov2022-01-15
|
* More fixes for recently committed context-menu additions from bug#52973Juri Linkov2022-01-15
| | | | | | | | | | | * lisp/hi-lock.el (highlight-symbol-at-mouse): New defalias. (hi-lock-face-symbol-at-mouse): Rename from hi-lock-symbol-at-mouse. (hi-lock-context-menu): Use thing-at-mouse and middle-separator. * lisp/man.el (Man-context-menu): Fix Man-at-mouse and use middle-separator. * lisp/mouse.el (context-menu-functions): Remove context-menu-online-search. Add occur-context-menu and dictionary-context-menu (bug#50552).
* Revert "Add command to invoke a search engine"Lars Ingebrigtsen2022-01-15
| | | | | | This reverts commit 3f36d0836274a01d3cfc73f53ddbc76afc1d8a5e. Similar functionality has been added to webjump, so this commit duplicated that.
* Add new context menu functions to the context-menu-functions typeLars Ingebrigtsen2022-01-14
| | | | | * lisp/mouse.el (context-menu-functions): Add new menu functions to the defcustom type list (bug#52973).
* Add command to invoke a search enginePhilip Kaludercic2022-01-14
| | | | | | * mouse.el (context-menu-online-search): Add new function (eww-search-prefix): Declare variable from eww.el (mouse-online-search-at-point): Add new command
* Prevent further cases of duplicated separators in context menusJim Porter2022-01-04
| | | | | | | | | | | | | In some cases, context menu items are added before the overall prompt string. This could cause multiple consecutive separators to appear if they "surround" the prompt string. (Bug#52293) * lisp/mouse.el (context-menu-map): Improve the de-duplication logic to ignore non-menu-items when checking for consecutive separators. * test/lisp/mouse-tests.el (context-menu-map-remove-consecutive-separators) (context-menu-map-remove-separators-at-beginning-or-end): New tests.
* Merge from origin/emacs-28Eli Zaretskii2022-01-01
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| |
* | lisp/mouse.el: Fix some lambdas quoted with ` or 'Stefan Monnier2021-12-08
| | | | | | | | | | | | | | | | | | | | Also prefer #' to quote named functions. * lisp/mouse.el (minor-mode-menu-from-indicator, context-menu-entry) ([C-down-mouse-3]): Don't abuse lambda lists for functions. (context-menu-mode): Remove redundant `:group`. (mouse-drag-line): Remove unused var `draggable`. (mouse-yank-primary): Make it work for non-mouse events.