Commit graph

158034 commits

Author SHA1 Message Date
Po Lu
bab449f034 Improve drag-and-drop emulation time handling
* src/xselect.c (x_handle_selection_request): Use
display-specific pending DND time.
(x_set_pending_dnd_time): Delete function.
* src/xterm.c (x_dnd_do_unsupported_drop, handle_one_xevent):
Set dpyinfo->pending_dnd_time instead.
* src/xterm.h (struct x_display_info): New field
`pending_dnd_time'.  Make handling pending drops
display-specific to avoid interference when there are multiple
displays.
2022-07-09 16:18:35 +08:00
Po Lu
edabfe4ff6 Fix race conditions handling selection clear events on Haiku
* src/haiku_select.cc (be_handle_clipboard_changed_message):
Include current clipboard count.
(be_selection_outdated_p): New function.
* src/haikuselect.c (haiku_handle_selection_clear): Ignore
outdated events.
(haiku_selection_disowned): New argument `count'.  Include it in
the timestamp field of the selection clear event.
* src/haikuselect.h: Update prototypes.
* src/systime.h: Define `Time' to an appropriate value on Haiku.
2022-07-09 04:50:35 +00:00
Stefan Kangas
f400c60237 Merge from origin/emacs-28
3442de2edd Doc fix; don't mention obsolete variable
c4e251103b ; * lisp/textmodes/rst.el: Update URLs.
2022-07-09 06:30:38 +02:00
Po Lu
29c8866c7f Fix redisplay after running selection hook on Haiku
* src/haikuselect.c (haiku_handle_selection_clear): Call
redisplay_preserve_echo_area.
2022-07-09 01:16:05 +00:00
Po Lu
35ae8d9f3b Add new minor mode to deactivate the region once PRIMARY is lost
* doc/emacs/killing.texi (Primary Selection): Document new minor
mode `lost-selection-mode'.
* etc/NEWS: Announce new minor mode.
* lisp/select.el (lost-selection-function): New function.
(lost-selection-mode): New global minor mode.
2022-07-09 09:07:22 +08:00
Sean Whitton
3d3aaf3af3 ; * message.el (message-auto-save-directory): Clarify docstring. 2022-07-08 17:28:51 -07:00
Po Lu
ee58141785 Speed up querying for window manager support
* src/xterm.c (handle_one_xevent): Clear net_supported_window if
it is destroyed.
(x_get_wm_check_window): New function.
(x_wm_supports_1): First try net_supported_window.  If it still
exists, don't ask for _NET_SUPPORTING_WM_CHECK.
2022-07-09 08:05:30 +08:00
Alan Mackenzie
0508d7c4d6 Remove now unused parameter TRACK from do_switch_frame.
* src/lisp.h (extern do_swith_frame declaration)
* src/frame.c (do_switch_frame): Remove parameter TRACK and its comment.
* src/frame.c (Fselect_frame, Fhandle_switch_frame, delete_frame)
* src/keyboard.c (quit_throw_to_read_char)
* src/minibuf.c (read_minibuf_unwind (twice))
* src/window.c (Fset_window_configuration): Remove argument TRACK.
2022-07-08 20:19:03 +00:00
Stefan Kangas
3442de2edd Doc fix; don't mention obsolete variable
* src/window.c (Fset_window_hscroll): Doc fix; don't mention obsolete
variable.
2022-07-08 21:16:00 +02:00
Juri Linkov
df15795361 * lisp/isearch.el (isearch-search-fun-in-noncontiguous-region): New function.
(isearch-search-fun-in-text-property): Refactor body to
'search-within-boundaries', then call it (bug#14013).
(search-within-boundaries): New function refactored from
isearch-search-fun-in-text-property.

* test/lisp/isearch-tests.el: Add tests for new search functions.
(isearch--test-search-within-boundaries): New function.
(isearch--test-search-fun-in-text-property)
(isearch--test-search-fun-in-noncontiguous-region): New tests.
2022-07-08 20:58:33 +03:00
Juri Linkov
3cfac1fe07 Display the number of invisible matches for isearch-lazy-count (bug#40808)
* lisp/isearch.el (lazy-count-invisible-format): New variable.
(isearch-mode): Set isearch-lazy-count-invisible to nil.
(isearch-lazy-count-format): Use lazy-count-invisible-format and
isearch-lazy-count-invisible.
(isearch-range-invisible): Handle the value 'can-be-opened' of
'search-invisible' and don't open overlays for it, just check
if these overlays can be opened.
(isearch-lazy-count-invisible): New variable.
(isearch-lazy-highlight-new-loop): Set isearch-lazy-count-invisible to nil.
(isearch-lazy-highlight-search): Let-bind search-invisible either to t
for non-nil isearch-lazy-count, or to 'can-be-opened'.
(isearch-lazy-highlight-match): Don't highlight matches intended
to be counted only, not highlighted.
(isearch-lazy-highlight-buffer-update): Separately count invisible
matches by isearch-lazy-count-invisible.

* lisp/info.el (Info-isearch-filter): Check if search-invisible is t.
2022-07-08 20:47:11 +03:00
Stefan Kangas
ef559dcd2a Don't mention moved variable in dired-x manual
* doc/misc/dired-x.texi (Technical Details): Remove mention of
'dired-clean-up-buffers-too'; it has been moved to dired.el.
2022-07-08 19:44:05 +02:00
Stefan Kangas
fc50847b40 Delete redundant defgroup dired-keys
* lisp/dired-x.el (dired-keys): Delete defgroup.
(dired-bind-vm): Move to :group dired-x.
2022-07-08 19:44:05 +02:00
Stefan Kangas
99c96f50ed Move dired-do-relsymlink from dired-x.el to dired.el
* lisp/dired-x.el (dired-do-relsymlink, dired-make-relative-symlink)
(dired-do-relsymlink-regexp): Move from here...
* lisp/dired-aux.el (dired-do-relsymlink, dired-make-relative-symlink)
(dired-do-relsymlink-regexp): ...to here.  (Bug#21981)

* lisp/dired-x.el: Move keybinding and menu binding from here...
* lisp/dired.el (dired-mode-map, dired-mode-regexp-menu): ...to
here.

* lisp/dired-x.el (dired-keep-marker-relsymlink): Move from here...
* lisp/dired.el (dired-keep-marker-relsymlink): ...to here.  Improve
docstring.

* doc/misc/dired-x.texi (Miscellaneous Commands): Move
documentation of above commands from here...
* doc/emacs/dired.texi (Operating on Files)
(Transforming File Names): ...to here.
2022-07-08 19:44:05 +02:00
Juri Linkov
033d370a51 * lisp/progmodes/ruby-mode.el (ruby-mode): Set outline-regexp, outline-level.
Suggested by Yilkal Argaw <yilkalargawworkneh@gmail.com>.
2022-07-08 20:17:29 +03:00
Mattias Engdegård
1c300c983f Remove unused member of internal struct
* src/fns.c (struct textprop_rec, concat_to_string): Remove `from`.
2022-07-08 18:26:28 +02:00
Stefan Kangas
58790a5266 * lisp/dired.el (dired-jump-map): Bind also "j" to dired-jump. 2022-07-08 16:14:17 +02:00
Po Lu
9e0f52b7d9 Ensure correct position is returned after child frame movement
* src/xterm.c (x_set_offset): Synchronize child frame movement
correctly.
2022-07-08 21:16:25 +08:00
Mattias Engdegård
6791165b2a Fix file-name-case-insensitive-p in ffap (bug#56443)
Don't crash if the file name argument to file-name-case-insensitive-p,
after expansion, doesn't have a parent directory.  This occurs
when calling ffap on something that looks like an email address.

* src/fileio.c (Ffile_name_case_insensitive_p): Return nil if no file
or parent directory could be found.
* test/src/fileio-tests.el (fileio-tests--identity-expand-handler)
(fileio--file-name-case-insensitive-p): New test.
2022-07-08 15:13:21 +02:00
Stefan Kangas
739e3dbe05 Remove many items obsolete since 24.1
* lisp/allout.el (allout-abbreviate-flattened-numbering)
(allout-mode-deactivate-hook):
* lisp/ansi-color.el (ansi-color-unfontify-region):
* lisp/auth-source.el (auth-source-hide-passwords)
(auth-source-user-or-password)
(auth-source-forget-user-or-password):
* lisp/cedet/data-debug.el (data-debug-map):
* lisp/cedet/semantic/grammar.el (semantic-grammar-syntax-table)
(semantic-grammar-map):
* lisp/chistory.el (command-history-map):
* lisp/comint.el (comint-dynamic-complete)
(comint-dynamic-complete-as-filename)
(comint-dynamic-simple-complete):
* lisp/dired-x.el (read-filename-at-point)
(dired-x-submit-report):
* lisp/dos-fns.el (register-name-alist, make-register)
(register-value, set-register-value, intdos, mode25, mode4350):
* lisp/emacs-lisp/bytecomp.el (byte-compile-disable-print-circle):
* lisp/emacs-lisp/chart.el (chart-map):
* lisp/emacs-lisp/package.el (package-menu-view-commentary):
* lisp/emacs-lock.el (toggle-emacs-lock, emacs-lock-from-exiting):
* lisp/erc/erc.el (erc-complete-word):
* lisp/eshell/em-cmpl.el (eshell-cmpl-suffix-list):
* lisp/eshell/esh-util.el (eshell-for):
* lisp/files.el (inhibit-first-line-modes-regexps)
(inhibit-first-line-modes-suffixes):
* lisp/gnus/gnus-msg.el (gnus-outgoing-message-group)
(gnus-debug-files, gnus-debug-exclude-variables):
* lisp/gnus/gnus-registry.el (gnus-registry-user-format-function-M):
* lisp/gnus/gnus.el (gnus-local-domain, gnus-carpal):
* lisp/gnus/nnimap.el (nnimap-split-rule):
* lisp/iimage.el (turn-on-iimage-mode):
* lisp/image.el (image-extension-data, image-library-alist):
* lisp/mail/emacsbug.el (report-emacs-bug-pretest-address):
* lisp/mail/mail-utils.el (rmail-dont-reply-to):
* lisp/mail/mailalias.el (mail-complete-function)
(mail-completion-at-point-function):
* lisp/mail/rmail.el (rmail-dont-reply-to-names)
(rmail-default-dont-reply-to-names):
* lisp/mail/sendmail.el (mail-mailer-swallows-blank-line)
(mail-sent-via):
* lisp/menu-bar.el (menu-bar-kill-ring-save):
* lisp/minibuffer.el (completion-annotate-function)
(minibuffer-local-filename-must-match-map):
* lisp/msb.el (msb-after-load-hooks):
* lisp/obsolete/eieio-compat.el (eieio-defmethod)
(eieio-defgeneric):
* lisp/obsolete/info-edit.el (Info-edit-map):
* lisp/obsolete/starttls.el (starttls-any-program-available):
* lisp/progmodes/cfengine.el (cfengine-mode-abbrevs):
* lisp/progmodes/cwarn.el (turn-on-cwarn-mode):
* lisp/progmodes/make-mode.el (makefile-complete):
* lisp/progmodes/meta-mode.el (meta-complete-symbol)
(meta-mode-map):
* lisp/progmodes/pascal.el (pascal-toggle-completions)
(pascal-last-completions, pascal-show-completions):
* lisp/progmodes/prolog.el (prolog-char-quote-workaround):
* lisp/progmodes/which-func.el (which-func-mode): [FUNCTION]
* lisp/simple.el (count-lines-region, minibuffer-completing-symbol):
* lisp/speedbar.el (speedbar-syntax-table, speedbar-key-map):
* lisp/strokes.el (strokes-report-bug):
* lisp/subr.el (condition-case-no-debug):
* lisp/term/ns-win.el (ns-alternatives-map)
(ns-store-cut-buffer-internal):
* lisp/term/w32-win.el (w32-default-color-map):
* lisp/term/x-win.el (x-cut-buffer-or-selection-value):
* lisp/textmodes/bibtex.el (bibtex-complete)
(bibtex-entry-field-alist):
* lisp/textmodes/reftex-index.el (reftex-index-map)
(reftex-index-phrases-map):
* lisp/textmodes/reftex-sel.el (reftex-select-label-map)
(reftex-select-bib-map):
* lisp/textmodes/reftex-toc.el (reftex-toc-map):
* lisp/textmodes/rst.el (rst-block-face, rst-external-face)
(rst-definition-face, rst-directive-face, rst-comment-face)
(rst-emphasis1-face, rst-emphasis2-face, rst-literal-face)
(rst-reference-face):
* lisp/vc/vc-hooks.el (vc-toggle-read-only):
* lisp/view.el (view-return-to-alist)
(view-return-to-alist-update): Remove many functions and variables
obsolete since 24.1.

* lisp/textmodes/bibtex.el (bibtex-entry-alist): Don't use above
removed variable 'bibtex-entry-field-alist'.
* lisp/cedet/data-debug.el (data-debug-edebug-expr)
(data-debug-eval-expression):
* lisp/emacs-lisp/trace.el (trace--read-args):
* lisp/files-x.el (read-file-local-variable-value):
* lisp/simple.el (read--expression): Don't use above removed variable
'minibuffer-completing-symbol'.
* lisp/textmodes/rst.el (rst-font-lock-keywords): Don't use above
removed variables.
* src/w32fns.c (Fw32_default_color_map): Delete obsolete function.
(syms_of_w32fns): Delete defsubr for above defun.
* src/keyboard.c (syms_of_keyboard) <Vdeferred_action_list>
<Vdeferred_action_function>: Delete DEFVARs.
<Qdeferred_action_function>: Delete DEFSYM.
(syms_of_keyboard_for_pdumper): Adjust for above change.
(command_loop_1): Don't run deferred-action-function hook.
* lisp/subr.el (deferred-action-list, deferred-action-function):
Delete obsoletion statements.
* lisp/emacs-lisp/ert-x.el (ert-simulate-command): Don't run
'deferred-action-list' hook.
* doc/lispref/hooks.texi (Standard Hooks): Delete
'deferred-action-function'.

* lisp/emacs-lisp/lisp.el (field-complete):
* lisp/eshell/em-cmpl.el (eshell-cmpl-initialize):
* lisp/gnus/gnus-msg.el (gnus-inews-insert-gcc):
* lisp/gnus/nnmail.el (nnmail-fancy-expiry-target):
* lisp/mail/mail-utils.el (mail-dont-reply-to):
* lisp/mail/sendmail.el (sendmail-send-it):
* lisp/mail/smtpmail.el (smtpmail-send-it):
* lisp/minibuffer.el (minibuffer-completion-help):
* lisp/progmodes/python.el: Don't use above removed items.
* lisp/emacs-lisp/eieio-core.el:
* lisp/mail/mailalias.el (mail-complete-alist): Doc fixes; don't refer
to above removed items.
; * etc/NEWS: List removed items.
2022-07-08 14:10:38 +02:00
Stefan Kangas
ca7b5dbfca Put safe-local-variable property on auto-insert
* lisp/autoinsert.el (auto-insert): Put safe-local-variable
property to allow disabling auto-inserting without a warning.
2022-07-08 13:08:21 +02:00
Stefan Kangas
9abf841429 Stop ffap-machine-at-point from pinging random hosts
Having this on by default is highly problematic from a security and
privacy standpoint, as it risks having outgoing traffic that could
potentially reveal sensitive data (passwords, names, etc.).

It also seems to be causing issues for users, see e.g.
https://github.com/emacs-helm/helm/issues/648

* lisp/ffap.el (ffap-machine-p-known): Change default to 'accept'.
2022-07-08 12:10:33 +02:00
Stefan Kangas
38697a07c0 Add :safe property to ffap-machine-p-* variables
* lisp/ffap.el (ffap--accept-or-reject-p): New predicate defun.
(ffap-machine-p-local, ffap-machine-p-known)
(ffap-machine-p-unknown): Add :safe property using above new
predicate.
2022-07-08 11:58:17 +02:00
Stefan Kangas
f85683c434 Add tests for mail-extr.el
* test/lisp/mail/mail-extr-tests.el: New file.
2022-07-08 11:02:45 +02:00
Stefan Kangas
c4e251103b ; * lisp/textmodes/rst.el: Update URLs. 2022-07-08 10:36:10 +02:00
Stefan Kangas
989908eee8 Avoid obsolete initial-input argument in net-utils.el
* lisp/net/net-utils.el (ping, nslookup-host, dns-lookup-host)
(run-dig, ftp, smbclient, smbclient-list-shares, finger)
(network-connection-to-service): Don't use obsolete initial-input
argument.  Use 'format-prompt'.  (Bug#56436)
2022-07-08 10:26:35 +02:00
Po Lu
0fc9808ded Improve behavior of sticky tooltips on Haiku
* src/haiku_support.cc (class EmacsView, MouseMoved): Remove
`tooltip_position'.
(class EmacsMotionSuppressionView): New class.
(BView_set_and_show_sticky_tooltip): Rename to
`be_show_sticky_tooltip'.  Add motion suppression view.

* src/haiku_support.h: Update prototypes.
* src/haikufns.c (Fx_show_tip): Update for renamed function.
2022-07-08 07:34:45 +00:00
Po Lu
bc015a7b44 Fix flickering system tooltips on Haiku
* src/haiku_support.cc (class EmacsView, MouseMoved): Restore
sticky status and mouse relative position.
(BView_set_and_show_sticky_tooltip):
* src/haikufns.c (haiku_hide_tip): Fix coding style.
2022-07-08 06:55:01 +00:00
Po Lu
eb86a375e8 Reduce synchronization setting frame alpha
* src/xterm.c (x_set_frame_alpha): Don't synchronize while
setting alpha property, and don't ask for the current value of
the opacity property, which is much more expensive than changing
it.
2022-07-08 13:43:24 +08:00
Stefan Kangas
7397d0fd19 Merge from origin/emacs-28
2ac0ddc4ac ; * lisp/net/net-utils.el: Minor doc fixes.
2022-07-08 06:31:54 +02:00
Po Lu
b6a90b71a2 Fix returned action symbol upon "xterm" drop
* src/xterm.c (x_dnd_do_unsupported_drop): Set
x_dnd_action_symbol.
(x_dnd_begin_drag_and_drop): Don't clear it afterwards.
2022-07-08 10:44:49 +08:00
Stefan Kangas
139eb1f845 * lisp/emacs-lisp/ert.el (Commentary): Refer to the Info manual. 2022-07-07 23:21:39 +02:00
Stefan Kangas
cbfd959e26 Prefer keymap inheritance in shr-image-map
* lisp/net/shr.el (shr-image-map): Replace copy-keymap with
inheritance.
2022-07-07 23:21:39 +02:00
Lars Ingebrigtsen
a371298d2a Make imenu--create-keymap more resilient
* lisp/imenu.el (imenu--create-keymap): Ignore nil items in the
alist (bug#56430).
2022-07-07 20:21:38 +02:00
Eli Zaretskii
d397b04215 Fix buffer-tests
* test/src/buffer-tests.el (test-restore-buffer-modified-p): Don't
assume turning on auto-save-mode cannot auto-save immediately.
2022-07-07 19:34:30 +03:00
Mattias Engdegård
53c0690fa2 Faster append and vconcat
By separating the code paths for append and vconcat, each becomes
simpler and faster.

* src/fns.c (concat_strings): Rename to...
(concat_to_string): ...this.
(concat): Split into concat_to_list and concat_to_vector.
(concat_to_list, concat_to_vector): New, specialised and
streamlined from earlier combined code.
(concat2, concat3, Fappend, Fconcat, Fvconcat): Adjust calls.
2022-07-07 17:43:21 +02:00
Alan Mackenzie
9cd72b02b6 Remove obscure, obsolete code from do_switch_frame
This is relevant for bug #56305, and might solve that bug.  The code being
removed went into Emacs between 1992 and 1994, and looks to have been a
workaround for switching frames, before the command 'other-frame' had been
written.  Nowadays, that code has harmful effects, causing frames' focus to be
redirected at random, sometimes back to the frame itself.

* src/frame.c (do_switch_frame): Remove 53 lines of code.
2022-07-07 15:38:09 +00:00
Stefan Kangas
f32808ce98 * lisp/net/dig.el (dig): Provide default. 2022-07-07 15:38:58 +02:00
Stefan Kangas
6d95b4e6ec Make net-utils-url at point funs obsolete in favor of ffap
* lisp/net/net-utils.el (net-utils-machine-at-point)
(net-utils-url-at-point): Redefine as obsolete function alias for
'ffap-machine-at-point' and 'ffap-url-at-point'.  Update callers.
* lisp/ffap.el (ffap-machine-at-point, ffap-url-at-point): Autoload.
2022-07-07 15:35:25 +02:00
Po Lu
1fa5f0428f Fix selection disowning upon frame deletion on Wayland
* src/pgtkselect.c (pgtk_clear_frame_selections): Manually
disown cleared selections.  (bug#56434)
2022-07-07 21:15:29 +08:00
Stefan Kangas
0aa0dac799 * lisp/net/eww.el (eww-browse-url): Add 'browser-kind' property. 2022-07-07 14:47:30 +02:00
Stefan Kangas
49b10a95c3 * lisp/woman.el (woman): Fix comment; don't mention gnudoit. 2022-07-07 14:23:01 +02:00
Stefan Kangas
9155f2ada3 Make two XEmacs related variables obsolete
* lisp/net/browse-url.el (browse-url-gnudoit-program)
(browse-url-gnudoit-args): Make obsolete.  The corresponding command
'browse-url-w3-gnudoit' is already obsolete since 25.1.
2022-07-07 14:23:01 +02:00
Po Lu
59a798b3f0 Fix GTK build
* src/xterm.c (x_dnd_begin_drag_and_drop): Update GTK quitting
code for last change too.  Reported by Norbert Koch
<viteno@netic.de>.
2022-07-07 20:16:43 +08:00
Po Lu
7a9f8ed6fb Fix quitting out of selection converters during drag and drop
* src/xterm.c (x_dnd_process_quit): New function.
(x_dnd_begin_drag_and_drop): Use it instead.  Also quit if
quit-flag is true immediately after a selection converter is
run.
2022-07-07 18:39:51 +08:00
Stefan Kangas
a40a4d3a09 Mark comint modes in net-utils.el as non-interactive
* lisp/net/net-utils.el (net-utils-mode, nslookup-mode, ftp-mode)
(smbclient-mode, network-connection-mode): Mark as non-interactive.
(nslookup-mode-map, ftp-mode-map): Prefer defvar-keymap.
2022-07-07 12:17:29 +02:00
Stefan Kangas
2ac0ddc4ac ; * lisp/net/net-utils.el: Minor doc fixes. 2022-07-07 12:16:18 +02:00
Stefan Kangas
707124d2b9 Make 'run-dig' command obsolete in favor of 'dig'
* lisp/net/net-utils.el (run-dig): Redefine in terms of `dig' and make
obsolete.  (Bug#56432).
(dig-program): Delete duplicate defcustom; it is also in dig.el.
(dig-program-options): Move from here...
* lisp/net/dig.el (dig-program-options): ...to here.
(dig-invoke): Respect 'dig-program-options'.
(dig): Prompt for DNS server when given double prefix argument.
2022-07-07 11:29:27 +02:00
Eli Zaretskii
74f43f82e6 Fix undo of changes in cloned indirect buffers
* lisp/simple.el (primitive-undo): If the visited-modtime of the
indirect buffer's file is bogus, use the modtime of the file
visited by its base buffer.

* src/undo.c (record_first_change): Call
'buffer_visited_file_modtime' with the correct buffer, instead of
always calling 'Fvisited_file_modtime', which returns possibly
bogus values for indirect buffers.
* src/fileio.c (Fset_visited_file_modtime): Signal a meaningful
error for indirect buffers.
(buffer_visited_file_modtime): New function, with implementation
taken from 'Fvisited_file_modtime'.
(Fvisited_file_modtime): Call 'buffer_visited_file_modtime'.
* src/lisp.h: Add prototype for 'buffer_visited_file_modtime'.
(Bug#56397)
2022-07-07 11:56:31 +03:00
Stefan Kangas
b075a59a1a * lisp/net/dig.el (dig-exit): Mark for 'dig-mode'. 2022-07-07 10:39:23 +02:00