summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/mouse.el (context-menu-map): Fix when menu is a command (bug#50851)Juri Linkov2021-09-281-1/+1
| | | | | * lisp/help.el (help--analyze-key): Get information at the position of mouse click such as 'C-h k' on a context menu item (bug#50067).
* * lisp/mouse.el (context-menu-region): Check for nil for char-after at eobp.Juri Linkov2021-09-271-2/+3
|
* New thing-at-point target 'string' used in context-menu-regionJuri Linkov2021-09-241-6/+11
| | | | | | | | | | | | * lisp/mouse.el (context-menu-region): Use separate "List" and "String". * lisp/thingatpt.el (string): New target 'string'. (thing-at-point-bounds-of-string-at-point): New function. (thing-at-point-bounds-of-list-at-point): Revert previous commit by removing optional args 'escape-strings' and 'no-syntax-crossing'. (list-or-string): Remove recently added target 'list-or-string'. (thing-at-point-bounds-of-list-or-string-at-point): Remove function. https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01737.html
* * lisp/mouse.el (context-menu-region): Use save-excursion for syntax-ppss.Juri Linkov2021-09-231-1/+2
|
* New thing-at-point target 'list-or-string' used in context-menu-regionJuri Linkov2021-09-231-11/+13
| | | | | | | | | | | * lisp/mouse.el (context-menu-region): Rearrange the order to All>Defun>List>Line>Symbol. Show title either "List" or "String" depending on syntax-ppss, then use thing 'list-or-string' (bug#9054). * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Add optional args 'escape-strings' and 'no-syntax-crossing' like in 'up-list'. (list-or-string): New target 'list-or-string'. (thing-at-point-bounds-of-list-or-string-at-point): New function.
* ; More minor stylistic fixes found by checkdocStefan Kangas2021-09-221-1/+1
|
* Many improvements for Context Menus (bug#9054)Juri Linkov2021-09-221-13/+64
| | | | | | | | | | | | | | | | | | | * lisp/menu-bar.el (menu-bar-showhide-menu): Add "Context Menus". * lisp/mouse.el (context-menu-undo): Add "in Region" to the titles when the region is active. (context-menu-region): Use 'mouse-yank-from-menu' in menu items created from 'yank-menu' for submenu "Paste from Kill Menu". (context-menu-region): Add submenu "Select" with things to mark. (mark-thing-at-mouse, mouse-yank-from-menu): New functions. * lisp/thingatpt.el (bounds-of-thing-at-mouse): New function. * lisp/progmodes/elisp-mode.el (elisp-context-menu): * lisp/progmodes/prog-mode.el (prog-context-menu): Use full symbol/identifier names in :help strings. Suggested by Martin Rudalics <rudalics@gmx.at>
* Add docstrings to context menu functions, and add middle-separatorJuri Linkov2021-09-151-13/+29
| | | | | | | | | | | | * lisp/mouse.el (context-menu-functions): Add context-menu-middle-separator to default values. (context-menu-middle-separator): New function. * lisp/replace.el (occur-context-menu): Use middle-separator. * lisp/progmodes/elisp-mode.el (elisp-context-menu): * lisp/progmodes/prog-mode.el (prog-context-menu): Use middle-separator and reorder menu items correspondingly.
* Allow region-related context menu to be used on selected region with one clickJuri Linkov2021-09-121-2/+9
| | | | | | | * lisp/mouse.el (mouse-drag-track): Don't deactivate the mark for the context menu invoked by down-mouse-3. https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg01577.html
* * lisp/mouse.el (context-menu-map): Add 'click' arg to called funs (bug#50256)Juri Linkov2021-09-121-23/+24
| | | | | | | | | | | | | (context-menu-toolbar, context-menu-global, context-menu-local) (context-menu-minor, context-menu-buffers, context-menu-vc) (context-menu-undo, context-menu-region, context-menu-ffap): Add 'click' arg. * lisp/dired.el (dired-context-menu): * lisp/help-mode.el (help-mode-context-menu): * lisp/info.el (Info-context-menu): * lisp/net/eww.el (eww-context-menu): * lisp/net/goto-addr.el (goto-address-context-menu): * lisp/progmodes/prog-mode.el (prog-context-menu): Add 'click' arg.
* * lisp/mouse.el (context-menu-map): Remove duplicate separators (bug#50067).Juri Linkov2021-09-121-59/+61
| | | | | | | * lisp/mouse.el (context-menu-undo, context-menu-region): * lisp/progmodes/prog-mode.el (prog-context-menu): Use 'when' instead of ':visible' that allows to remove duplicate separators created between empty submenus.
* Merge branch 'feature/tab-bar-events'Juri Linkov2021-09-091-3/+4
|\
| * Redesign tab-bar event processing (bug#41342, bug#41343)Juri Linkov2021-08-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of emitting menu-item keys like [tab-1], emit normal mouse events like [mouse-1] and [down-mouse-3] for all mouse clicks issued on the tab-bar. * lisp/mouse.el (mouse-posn-property): Handle 'tab-bar' posn-area. * lisp/tab-bar.el (tab--key-to-number): New internal function. (tab-bar-handle-mouse): Use tab key to select/close tab. (tab-bar-mouse-select-tab, tab-bar-mouse-close-tab) (tab-bar-mouse-context-menu): New commands. (tab-bar-map): Bind [down-mouse-1] to tab-bar-mouse-select-tab, [down-mouse-2] to tab-bar-mouse-close-tab, [down-mouse-3] to tab-bar-mouse-context-menu. (tab-bar-keymap-cache): Remove. (tab-bar-make-keymap): Don't use cache. (tab-bar--format-tab): Remove default bindings from menu items. (tab-bar-make-keymap-1): Prepend tab-bar-map. * src/keyboard.c (make_lispy_event): Append event->arg to position for Qtab_bar. * src/term.c (handle_one_term_event): Simplify to set event arg. * src/w32inevt.c (do_mouse_event): Set emacs_ev->arg to the value returned from tty_handle_tab_bar_click. * src/w32term.c (w32_handle_tab_bar_click): Return value from handle_tab_bar_click. (w32_read_socket): Set tab_bar_key to value returned from w32_handle_tab_bar_click, and set event arg from it. * src/xdisp.c (handle_tab_bar_click): Instead of emitting event, return a list with Qtab_bar and tab caption with text properties that contain Qmenu_item with key and binding. (tty_handle_tab_bar_click): Simplify to return a list of Qtab_bar, key and close_p, instead of emitting event. * src/xterm.c (handle_one_xevent): Set tab_bar_key to value returned from handle_tab_bar_click, and set event arg from it.
* | Replace flyspell-use-mouse-3-for-menu with context-menu-mode (bug#50067)Juri Linkov2021-08-271-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/fixit.texi (Spelling): Replace mentions of flyspell-use-mouse-3-for-menu with context-menu-mode. * lisp/mouse.el (context-menu-map): Use the function from the text property context-menu-function at mouse click event. * lisp/textmodes/flyspell.el (flyspell--set-use-mouse-3-for-menu): Remove function. (flyspell-use-mouse-3-for-menu): Remove defcustom added recently in 28.1. (flyspell-context-menu): New function. (flyspell-mode): Don't call flyspell--set-use-mouse-3-for-menu. (flyspell-mode-on): Replace flyspell-use-mouse-3-for-menu with context-menu-mode. (make-flyspell-overlay): When context-menu-mode is non-nil, put overlay context-menu-function with flyspell-context-menu instead of using keymap flyspell-mouse-map.
* | Define a substitute for <menu> on MS-WindowsEli Zaretskii2021-08-261-0/+2
| | | | | | | | | | * lisp/mouse.el (context-menu-mode-map): On w32, use <apps> in addition to (the mostly non-existent) <menu>.
* | * lisp/mouse.el (context-menu-mode-map): Bind [menu] to context-menu-open.Ergus2021-08-241-0/+1
| | | | | | | | https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg01004.html
* | * lisp/mouse.el (context-menu-buffers): New function (bug#50067).Juri Linkov2021-08-241-0/+12
| | | | | | | | (context-menu-functions): Add context-menu-buffers to the choice list.
* | * lisp/mouse.el (context-menu-open): New command bound to [S-f10].Juri Linkov2021-08-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | * doc/emacs/frames.texi (Menu Mouse Clicks): Mention S-F10 to pop up the context menu. * src/callint.c (Fcall_interactively): Use inhibit_mouse_event_check for the case 'e'. (inhibit-mouse-event-check): New variable. https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00733.html
* | * lisp/mouse.el (context-menu-toolbar): New function.Juri Linkov2021-08-231-1/+13
| | | | | | | | | | | | | | (context-menu-functions): Add context-menu-toolbar to choice. (context-menu-region): Bind "Paste" to mouse-yank-at-click instead of mouse-yank-primary. https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00735.html
* | * lisp/mouse.el (context-menu-mode-map): New variable.Ergus2021-08-221-30/+10
| | | | | | | | | | | | (context-menu--saved-bindings, context-menu--bind-mouse) (context-menu--restore-bindings): Remove. (context-menu-mode): Don't use removed functions.
* | Don't show menu titles with the text property 'hide' (bug#50067)Juri Linkov2021-08-221-1/+1
| | | | | | | | | | | | | | | | * lisp/mouse.el (context-menu-map): Add menu title "Context Menu" propertized with the text property 'hide'. * src/menu.c (x_popup_menu_1): Don't show the title with the non-nil text property 'hide' on GTK and NS.
* | ; * lisp/mouse.el: Fix typos in previous changeMattias Engdegård2021-08-201-2/+2
| |
* | Use C-mouse-1 for context menu on NSMattias Engdegård2021-08-201-16/+29
| | | | | | | | | | | | | | | | | | | | | | The Mac platform convention is to use control-left-click for context menus (as a synonym to right-click). * lisp/mouse.el (context-menu--old-bindings): Remove. (context-menu--saved-bindings) (context-menu--bind-mouse, context-menu--reset-bindings): New. (context-menu-mode): Use new functions, with C-mouse-1 as extra binding on NS.
* | * lisp/mouse.el: More fixes for context-menu.Juri Linkov2021-08-181-2/+2
| | | | | | | | | | | | (context-menu-map): Remove menu title "Context Menu" (bug#50067). (context-menu-minor): Reverse sub-menus to display exactly in the same order as on the menu bar.
* | * lisp/mouse.el (context-menu-filter-function): Fix type.Glenn Morris2021-08-171-1/+1
|/
* Merge branch 'feature/context-menu'Juri Linkov2021-08-171-0/+188
|\
| * Use map-keymap in context-menu-global, context-menu-local, context-menu-minorJuri Linkov2021-08-151-14/+17
| |
| * Improve handling of context menus for global, local, minor-mode menusJuri Linkov2021-08-031-12/+8
| | | | | | | | | | * lisp/mouse.el (context-menu-global, context-menu-local, context-menu-minor): Better handling of possibly nested menu maps.
| * Improve :type of defcustom 'context-menu-functions' and add documentation.Juri Linkov2021-07-281-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/frames.texi (Menu Mouse Clicks): Describe context-menu-mode and context-menu-functions instead of suggesting global-set-key. (Menu Bars): Mention context-menu-mode and context-menu-functions. * etc/NEWS: Add context-menu-mode and context-menu-functions. * lisp/mouse.el (context-menu-functions): Use :type with repeat/function-item. (context-menu-minor, context-menu-undo, context-menu-region) (context-menu-ffap): Improve docstrings displayed for function-item in defcustom of context-menu-functions.
| * Add new context-menu options for menus "File At Point" and "Version Control".Juri Linkov2021-07-271-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/mouse.el (context-menu-functions): Add more options. (context-menu-global, context-menu-local): Fix separators. (context-menu-minor): Rewrite to support list of submenus. (context-menu-vc, context-menu-ffap): New functions. (context-menu-undo, context-menu-region): Fix separators. * lisp/dired.el (dired-context-menu): * lisp/info.el (Info-context-menu): * lisp/net/goto-addr.el (goto-address-context-menu): * lisp/net/eww.el (eww-context-menu): * lisp/progmodes/prog-mode.el (prog-context-menu): Fix separators.
| * Improve docstring of context-menu-functions and add eww-context-menuJuri Linkov2021-07-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/mouse.el (context-menu-functions): Explain function args in docstring. * lisp/net/eww.el (eww-context-menu): New function. (eww-mode): Add it to context-menu-functions. * lisp/info.el (Info-context-menu): Move history items higher. * lisp/progmodes/prog-mode.el (prog-context-menu): Add menu items in the middle of the menu after the region menu items.
| * Change the order of context-menu-functions and add more context menus.Juri Linkov2021-07-211-23/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/mouse.el (context-menu-functions): Update default list. (context-menu-overriding-function): Remove variable. (context-menu-map): Reverse the order. (context-menu-global, context-menu-local, context-menu-minor): New functions. (context-menu-undo, context-menu-region): Add separators. Use define-key-after instead of bindings--define-key. (context-menu-entry): New variable. (context-menu-mode): Use it. * lisp/dired.el (dired-context-menu): New function. (dired-mode): Add it to context-menu-functions. * lisp/info.el (Info-context-menu): Reorder. * lisp/net/goto-addr.el (goto-address-at-mouse): Rename from goto-address-at-click. (goto-address-context-menu): Use goto-address-at-mouse. * lisp/progmodes/prog-mode.el (prog-context-menu): New function. (prog-mode): Add it to context-menu-functions.
| * Add new mode context-menu-mode and use it in info.el and goto-addr.elJuri Linkov2021-07-201-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/mouse.el (context-menu-functions): New defcustom. (context-menu-overriding-function): New function. (context-menu-filter-function): New defcustom. (context-menu-map): New function. (context-menu-undo, context-menu-region): New menu functions. (context-menu-mode): New mode. * lisp/info.el (Info-context-menu): New function. (Info-mode): Add Info-context-menu to context-menu-functions. * lisp/net/goto-addr.el (goto-address-context-menu): New function. (goto-address-at-click): New command. (goto-address-mode): Add goto-address-context-menu to context-menu-functions.
* | Use string-replace instead of replace-regexp-in-stringMattias Engdegård2021-08-081-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `string-replace` is easier to understand, less error-prone, much faster, and results in shorter Lisp and byte code. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-scan-change-log): * lisp/autoinsert.el (auto-insert-alist): * lisp/calc/calc-prog.el (calc-edit-macro-combine-alg-ent) (calc-edit-macro-combine-ext-command) (calc-edit-macro-combine-var-name): * lisp/calc/calc-units.el (math-make-unit-string): * lisp/calendar/cal-html.el (cal-html-comment): * lisp/calendar/cal-tex.el (cal-tex-comment): * lisp/calendar/icalendar.el (icalendar--convert-string-for-export) (icalendar--convert-string-for-import): * lisp/calendar/iso8601.el (iso8601--concat-regexps) (iso8601--full-time-match, iso8601--combined-match): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/todo-mode.el (todo-filter-items-filename): * lisp/cedet/cedet-files.el (cedet-directory-name-to-file-name) (cedet-file-name-to-directory-name): * lisp/comint.el (comint-watch-for-password-prompt): * lisp/dired-aux.el (dired-do-chmod): * lisp/dired-x.el (dired-man): * lisp/dired.el (dired-insert-directory, dired-goto-file-1): * lisp/emacs-lisp/comp.el (comp-c-func-name): * lisp/emacs-lisp/re-builder.el (reb-copy): * lisp/erc/erc-dcc.el (erc-dcc-unquote-filename): * lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy) (erc-update-mode-line-buffer, erc-message-english-PART): * lisp/files.el (make-backup-file-name-1, files--transform-file-name) (read-file-modes): * lisp/fringe.el (fringe-mode): * lisp/gnus/gnus-art.el (gnus-button-handle-info-url): * lisp/gnus/gnus-group.el (gnus-group-completing-read): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-search.el (gnus-search-query-parse-date) (gnus-search-transform-expression, gnus-search-run-search): * lisp/gnus/gnus-start.el (gnus-dribble-enter): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-mode-string-quote): * lisp/gnus/message.el (message-put-addresses-in-ecomplete) (message-parse-mailto-url, message-mailto-1): * lisp/gnus/mml-sec.el (mml-secure-epg-sign): * lisp/gnus/mml-smime.el (mml-smime-epg-verify): * lisp/gnus/mml2015.el (mml2015-epg-verify): * lisp/gnus/nnmaildir.el (nnmaildir--system-name) (nnmaildir-request-list, nnmaildir-retrieve-groups) (nnmaildir-request-group, nnmaildir-retrieve-headers): * lisp/gnus/nnrss.el (nnrss-node-text): * lisp/gnus/spam-report.el (spam-report-gmane-internal) (spam-report-user-mail-address): * lisp/ibuffer.el (name): * lisp/image-dired.el (image-dired-pngnq-thumb) (image-dired-pngcrush-thumb, image-dired-optipng-thumb) (image-dired-create-thumb-1): * lisp/info.el (Info-set-mode-line): * lisp/international/mule-cmds.el (describe-language-environment): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rfc2368.el (rfc2368-parse-mailto-url): * lisp/mail/rmail.el (rmail-insert-inbox-text) (rmail-simplified-subject-regexp): * lisp/mail/rmailout.el (rmail-output-body-to-file): * lisp/mail/undigest.el (rmail-digest-rfc1153): * lisp/man.el (Man-default-man-entry): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc--debug): * lisp/net/browse-url.el (browse-url-mail): * lisp/net/eww.el (eww-update-header-line-format): * lisp/net/newst-backend.el (newsticker-save-item): * lisp/net/rcirc.el (rcirc-sentinel): * lisp/net/soap-client.el (soap-decode-date-time): * lisp/nxml/rng-cmpct.el (rng-c-literal-2-re): * lisp/nxml/xmltok.el (let*): * lisp/obsolete/nnir.el (nnir-run-swish-e, nnir-run-hyrex) (nnir-run-find-grep): * lisp/play/dunnet.el (dun-doassign): * lisp/play/handwrite.el (handwrite): * lisp/proced.el (proced-format-args): * lisp/profiler.el (profiler-report-header-line-format): * lisp/progmodes/gdb-mi.el (gdb-mi-quote): * lisp/progmodes/make-mode.el (makefile-bsdmake-rule-action-regex) (makefile-make-font-lock-keywords): * lisp/progmodes/prolog.el (prolog-guess-fill-prefix): * lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): * lisp/progmodes/sql.el (sql-remove-tabs-filter, sql-str-literal): * lisp/progmodes/which-func.el (which-func-current): * lisp/replace.el (query-replace-read-from) (occur-engine, replace-quote): * lisp/select.el (xselect--encode-string): * lisp/ses.el (ses-export-tab): * lisp/subr.el (shell-quote-argument): * lisp/term/pc-win.el (msdos-show-help): * lisp/term/w32-win.el (w32--set-selection): * lisp/term/xterm.el (gui-backend-set-selection): * lisp/textmodes/picture.el (picture-tab-search): * lisp/thumbs.el (thumbs-call-setroot-command): * lisp/tooltip.el (tooltip-show-help-non-mode): * lisp/transient.el (transient-format-key): * lisp/url/url-mailto.el (url-mailto): * lisp/vc/log-edit.el (log-edit-changelog-ours-p): * lisp/vc/vc-bzr.el (vc-bzr-status): * lisp/vc/vc-hg.el (vc-hg--glob-to-pcre): * lisp/vc/vc-svn.el (vc-svn-after-dir-status): * lisp/xdg.el (xdg-desktop-strings): * test/lisp/electric-tests.el (defun): * test/lisp/term-tests.el (term-simple-lines): * test/lisp/time-stamp-tests.el (formatz-mod-del-colons): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-unfinished-edit-01): * test/src/json-tests.el (json-parse-with-custom-null-and-false-objects): Use `string-replace` instead of `replace-regexp-in-string`.
* Don't turn mouse-1 into mouse-2 when clicking on the tab-line (bug#49247)Juri Linkov2021-07-081-2/+2
| | | | | * lisp/tab-line.el (tab-line-tab-name-format-default): For 'tab-line-tab-map' add the property 'follow-link' with the value 'ignore'.
* New frame parameter 'drag-with-tab-line' (Bug#49247)Martin Rudalics2021-07-021-0/+15
| | | | | | | | | | | | | | | The new frame parameter 'drag-with-tab-line' allows to move frames by dragging their topmost windows' tab line with the mouse thus achieving a behavior similar to that provided by the 'drag-with-header-line' parameter. * lisp/mouse.el (mouse-drag-tab-line): New function. (mouse-drag-frame-resize, mouse-drag-frame-move) ([tab-line down-mouse-1]): Handle tab line dragging in various keymaps. * doc/lispref/frames.texi (Mouse Dragging Parameters): Describe new parameter 'drag-with-tab-line'. * etc/NEWS: Add entry for 'drag-with-tab-line'.
* Fix dragging dividers in terminal Emacs when there's marginsJared Finder2021-06-151-2/+4
| | | | | | * lisp/mouse.el (mouse-drag-line): Do the right thing in the presence of margins (bug#41156). (mouse-drag-line): Bind left-margin/right-margin in the map, too.
* Merge from origin/emacs-27Glenn Morris2021-03-121-1/+3
|\ | | | | | | | | 02a5cfce47 (origin/emacs-27) * lisp/mouse.el: Fix mouse-1-clock-follo... c881e990e3 * lisp/emacs-lisp/gv.el (edebug-after): Don't run the gett...
| * * lisp/mouse.el: Fix mouse-1-clock-follows-mouse = doubleStefan Monnier2021-03-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | This functionality was broken by commit 3d5e31eceb9dc1fb62b2b2, the problem being that we end up considering as distinct the events `down-double-mouse-1` and `double-down-mouse-1`. Reported by Eyal Soha <eyalsoha@gmail.com> (mouse--click-1-maybe-follows-link): Make sure the last element of the list passed to `event-convert-list` is indeed a "basic" event.
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Make libraries works with xterm-mouse-mode.Jared Finder2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change calls from 'read-event' to 'read-key' in libraries expecting mouse events. Do this only when 'xterm-mouse-mode' is enabled. That way those libraries read decoded mouse events instead of the underlying escape sequence. Add a parameter to 'read-key' that avoids running any of the unbound fallbacks in 'read-key-sequence' so the libraries can read mouse button-down events. For backward compatibility purposes, the above logic is contained in a new internal-only function: 'read--potential-mouse-event'. * doc/lispref/commands.texi (Reading One Event): Document new parameter to 'read-key'. Mention that non-character events on terminals need 'read-key'. * lisp/subr.el (read-key-full-map): Add new keymap used by 'read-key'. (read-key): Add new parameter 'fallbacks-disabled' to prevent running any of the unbound fallbacks normally run by 'read-key-sequence'. (read--potential-mouse-event): Add new function that calls 'read-key' or 'read-event' depending on if 'xterm-mouse-mode' is set. * lisp/foldout.el (foldout-mouse-swallow-events): * lisp/isearch.el (isearch-pre-command-hook): * lisp/mouse-drag.el (mouse-drag-throw, mouse-drag-drag): * lisp/mouse.el (mouse-drag-secondary): * lisp/ruler-mode.el (ruler-mode-mouse-grab-any-column) (ruler-mode-mouse-drag-any-column-iteration): * lisp/strokes.el (strokes-read-stroke, strokes-read-complex-stroke): * lisp/textmodes/artist.el (artist-mouse-draw-continously) (artist-mouse-draw-poly, artist-mouse-draw-2points): * lisp/vc/ediff-wind.el (ediff-get-window-by-clicking): * lisp/wid-edit.el (widget-button--check-and-call-button) (widget-button-click): Call 'read--potential-mouse-event' instead of 'read-event'. * lisp/wid-edit.el (widget-key-sequence-read-event): Call 'read-key' with 'fallbacks-disabled' set instead of 'read-event'. Unlike above changes, this is unconditionally applied so it works for function keys too. Apply 'local-function-key-map' instead of 'function-key-map' as that contains the full terminal translations. * lisp/vc/ediff.el (ediff-windows): Use 'display-mouse-p' to check if a mouse is available. * src/lread.c (Fread_event): Recommend 'read-key' in docstring for 'read-event' for non-character events.
* | Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | ; shorten https://lists.gnu.org/archive/html/... linksStefan Kangas2020-10-091-1/+1
| |
* | Don't quote lambdas in several placesStefan Kangas2020-10-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/find-gc.el (find-gc-unsafe): * lisp/align.el (align-rules-list): * lisp/comint.el (comint-arguments): * lisp/double.el (isearch-mode-map): * lisp/ehelp.el (electric-help-command-loop): * lisp/emacs-lisp/cl-macs.el (cl-defstruct): * lisp/emulation/cua-rect.el (cua--copy-rectangle-as-kill) (cua-copy-rectangle-as-text): * lisp/eshell/esh-var.el (eshell-parse-variable-ref): * lisp/hexl.el (hexl-insert-multibyte-char): * lisp/international/titdic-cnv.el (tsang-quick-converter) (ziranma-converter): * lisp/language/tibet-util.el (tibetan-decompose-precomposition-alist): * lisp/mail/mailalias.el (mail-get-names): * lisp/mh-e/mh-e.el (mh-auto-fields-list, mh-identity-default): * lisp/mouse.el (mouse-buffer-menu-map, mouse-buffer-menu-alist): * lisp/play/gametree.el (gametree-make-heading-function): * lisp/shell.el (shell--command-completion-data): * lisp/talk.el (talk-update-buffers): * lisp/tempo.el (tempo-insert-template, tempo-is-user-element) (tempo-build-collection): * lisp/term.el (term-input-filter, term-pager-help): * lisp/textmodes/table.el (table-delete-column): * lisp/url/url-cache.el (url-cache-create-filename-human-readable): * lisp/textmodes/tex-mode.el (latex-imenu-create-index): Don't quote lambdas.
* | Remove many items obsolete since Emacs 23.2 and 23.3Stefan Kangas2020-08-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/allout.el (allout-init): * lisp/emacs-lisp/shadow.el (shadows-compare-text-p): * lisp/ffap.el (ffap-version): * lisp/filecache.el (file-cache-choose-completion): * lisp/help.el (print-help-return-message): * lisp/image-mode.el (image-mode-maybe): * lisp/imenu.el (imenu-example--name-and-position): * lisp/international/mule-cmds.el (princ-list): * lisp/mail/rmail.el (rmail-highlight-face): * lisp/minibuffer.el (read-file-name-predicate): * lisp/mouse.el (mouse-choose-completion): * lisp/progmodes/cc-cmds.el (c-forward-into-nomenclature): * lisp/progmodes/xscheme.el (advertised-xscheme-send-previous-expression): * lisp/simple.el (completion-base-size) (choose-completion-delete-max-match, exchange-dot-and-mark): * lisp/subr.el (eval-next-after-load): * lisp/term.el (term-dynamic-simple-complete): Remove items, obsolete since Emacs 23.2 and 23.3. * doc/misc/cc-mode.texi (Movement Commands): Doc fix. * doc/lispref/help.texi (Accessing Documentation): * lisp/emacs-lisp/edebug.el (edebug-wrap-def-body): * lisp/comint.el (comint-dynamic-list-completions): * lisp/progmodes/idlwave.el (idlwave-make-modified-completion-map-xemacs) (idlwave-make-modified-completion-map-emacs) (idlwave-choose-completion): * lisp/progmodes/vhdl-mode.el: * lisp/term.el (term-dynamic-list-completions): Remove references to 'mouse-choose-completion'. * lisp/image-mode.el (image-mode-to-text): Remove reference to 'image-mode-maybe'. * lisp/mail/rmail.el (rmail-highlight-headers): Use 'rmail-highlight' face instead of 'rmail-highlight-face'. * lisp/progmodes/antlr-mode.el (antlr-mode-map, antlr-mode-menu): Remove reference to 'c-forward-into-nomenclature'. * lisp/simple.el (choose-completion, choose-completion-string) (completion-list-mode, completion-setup-function): Don't use 'completion-base-size'. ; * etc/NEWS: List removed items. This was discussed in https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00400.html
* | Remove many items obsolete since Emacs 23.1Stefan Kangas2020-08-141-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emacs 23.1 was five major releases and over a decade ago. This list can be reviewed before to the next release, but for now hopefully this motivates any needed external updates. Ref: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02198.html * lisp/abbrev.el (pre-abbrev-expand-hook): * lisp/bookmark.el (bookmark-read-annotation-text-func) (bookmark-jump-noselect): * lisp/buff-menu.el (buffer-menu-mode-hook): * lisp/cus-edit.el (custom-mode-hook, custom-mode): * lisp/dirtrack.el (dirtrack-debug-toggle, dirtrack-debug): * lisp/emacs-lisp/crm.el (crm-minibuffer-complete) (crm-minibuffer-completion-help) (crm-minibuffer-complete-and-exit): * lisp/emacs-lisp/easymenu.el (easy-menu-precalculate-equivalent-keybindings): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-auto-fill): * lisp/epa.el (epa-display-verify-result): * lisp/epg.el (epg-passphrase-callback-function): * lisp/eshell/eshell.el (eshell-report-bug): * lisp/ffap.el (ffap-bug, ffap-submit-bug): * lisp/files.el (locate-file-completion): * lisp/hi-lock.el (hi-lock-face-history, hi-lock-regexp-history): * lisp/hilit-chg.el (highlight-changes-initial-state) (highlight-changes-active-string) (highlight-changes-passive-string, global-highlight-changes): * lisp/international/mule-cmds.el (nonascii-insert-offset) (nonascii-translation-table): * lisp/international/mule-diag.el (non-iso-charset-alist): * lisp/international/mule-util.el (detect-coding-with-priority): * lisp/international/mule.el (charset-id, charset-bytes) (charset-list, char-valid-p, generic-char-p) (char-coding-system-table, make-coding-system) (set-coding-priority) * lisp/mail/rmail.el (rmail-message-filter): * lisp/minibuffer.el (complete-in-turn, dynamic-completion-table) (completion-common-substring) (minibuffer-local-must-match-filename-map): * lisp/mouse.el (mouse-major-mode-menu, mouse-popup-menubar) (mouse-popup-menubar-stuff): * lisp/net/newst-treeview.el (newsticker-groups-filename): * lisp/obsolete/tpu-edt.el (tpu-have-ispell, GOLD-map): * lisp/password-cache.el (password-read-and-add): * lisp/shell.el (shell-dirtrack-toggle): * lisp/subr.el (forward-point, redisplay-end-trigger-functions) (process-filter-multibyte-p, set-process-filter-multibyte): * lisp/t-mouse.el (t-mouse-mode): * lisp/term/w32-win.el (w32-focus-frame, w32-select-font): * lisp/textmodes/ispell.el (ispell-aspell-supports-utf8): * lisp/textmodes/remember.el (remember-buffer): * lisp/tooltip.el (tooltip-hook): * lisp/url/url-util.el (url-generate-unique-filename): * lisp/url/url-vars.el (url-temporary-directory): * lisp/vc/vc-hooks.el (vc-workfile-version) (vc-default-working-revision): * lisp/vc/vc-mtn.el (vc-mtn-command): * lisp/vc/vc.el (vc-revert-buffer): * lisp/vcursor.el (vcursor-toggle-vcursor-map): Remove items, obsolete since Emacs 23.1. * lisp/abbrev.el (expand-abbrev): * lisp/epg.el (epg-context): Change 'epg-passphrase-callback-function' call to 'epa-' alternative. * lisp/eshell/em-rebind.el (eshell-cannot-leave-input-list): Don't refer to removed function 'forward-point'. * test/manual/etags/c-src/abbrev.c (Fexpand_abbrev): (syms_of_abbrev): Don't run removed hook 'pre-abbrev-expand-hook'. * lisp/international/mule.el (transform-make-coding-system-args): Declare obsolete. * lisp/progmodes/idlwave.el: Update reference to removed function 'char-valid-p'. * lisp/gnus/mml2015.el (epg-encrypt-string): * lisp/gnus/mml1991.el (epg-make-context): * lisp/gnus/mml-smime.el (autoload): Remove autoload of removed 'epg-passphrase-callback-function'. * lisp/minibuffer.el (completion-extra-properties): Remove support for `completion-common-substring'. * lisp/obsolete/tpu-edt.el (tpu-toggle-overwrite-mode) Remove support for removed `spell' package. * src/coding.c (syms_of_coding): * doc/misc/efaq.texi: * doc/emacs/frames.texi (Menu Mouse Clicks): * doc/misc/url.texi (Customization): Doc fixes. ; * etc/NEWS: List removed items.
* | mouse-drag-copy-region doc string clarificationLars Ingebrigtsen2020-08-051-1/+4
| | | | | | | | | | * lisp/mouse.el (mouse-drag-copy-region): Clarify that the variable only applies to selections in Emacs (bug#41856).
* | Clarify wording in my last commitStefan Kangas2020-05-191-1/+1
| | | | | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Clarify wording of integer option. Suggested by Eli Zaretskii.
* | Fix minor issues with mouse-drag-and-drop-region-show-tooltipStefan Kangas2020-05-171-3/+7
| | | | | | | | | | | | | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Fix defcustom type to allow all valid values. Suggested by David Ponce. (Bug#41351) (mouse-drag-and-drop-region): Fix bug where setting `drag-and-drop-region-show-tooltip' to 0 would still show a tooltip.
* | Fix customisation of mouse-drag-and-drop-region (bug#41251)Mattias Engdegård2020-05-141-1/+1
| | | | | | | | | | | | Reported by David Ponce. * lisp/mouse.el (mouse-drag-and-drop-region): Add missing unquote.