Commit graph

84244 commits

Author SHA1 Message Date
Po Lu
9561d45de1 Fix clicking on files in Dired when drag is enabled
* lisp/dired.el (dired-mouse-drag): Don't drag if the mouse
didn't move far enough.
2022-04-12 19:22:01 +08:00
Olaf Trygve Berglihn
8c3d655fe7 Add biblatex alias entry types for compability with bibtex
* lisp/textmodes/bibtex.el (bibtex-biblatex-entry-alist): Add
biblatex alias entry types for compability with bibtex (bug#54877).

Copyright-paperwork-exempt: yes
2022-04-12 12:21:19 +02:00
Michael Albinus
17f0900d7b Adapt macOS defaults in Tramp's process-attributes implementation
* doc/misc/tramp.texi (Remote processes):
Mention tramp-connection-local-darwin-ps-* constants.

* lisp/net/tramp-integration.el
(tramp-connection-local-darwin-ps-variables): Fix docstring.
(top): Simplify setting local profiles.

* test/lisp/net/tramp-tests.el (tramp-test31-list-system-processes)
(tramp-test31-process-attributes): New tests.
2022-04-12 09:41:11 +02:00
Filipp Gunbin
e258e58276 process-attributes-ps-args / process-attributes-ps-format for Darwin
* lisp/net/tramp-integration.el
(tramp-darwin-process-attributes-ps-args)
(tramp-darwin-process-attributes-ps-format)
(tramp-connection-local-darwin-ps-variables): New defconsts.  Add
them to connection-local variables.  Preset default "ps" profile
for Darwin.
2022-04-12 09:12:29 +02:00
Sean Whitton
2e9111813b Add two classic Common Lisp macro-writing macros
* lisp/emacs-lisp/cl-macs.el (cl-with-gensyms, cl-once-only): New macros.
2022-04-11 23:01:55 -07:00
Stefan Monnier
6a480c830b * lisp/emacs-lisp/macroexp.el (macroexp-let2*): Allow common shorthand 2022-04-11 15:10:51 -04:00
Paul Eggert
d6338f8a6a Use preferred chars among duplicates as per UTR#25 §25. 2022-04-11 10:54:28 -07:00
Juri Linkov
67505e0355 * lisp/minibuffer.el (minibuffer-completion-auto-choose): New defcustom.
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion): Remove commands.
(minibuffer-local-completion-map): Remove keybindings of
minibuffer-choose-next-completion and minibuffer-choose-previous-completion.
Use them for minibuffer-next-completion and minibuffer-previous-completion.
* lisp/simple.el (minibuffer-local-shell-command-map): Idem.
2022-04-11 19:52:47 +03:00
Lars Ingebrigtsen
2c45d3cae0 Make more IPV6 domains non-suspicious in textsec
* lisp/international/textsec.el (textsec--ipvx-address-p): Make
more IPV6 domains non-suspicious.
2022-04-11 17:36:26 +02:00
Mattias Engdegård
26db1ca80e Recognise hybrid IPv6/IPv4 addresses in textsec (bug#54624)
* lisp/international/textsec.el (textsec--ipvx-address-p):
  Recognise hybrid addresses like "::ffff:129.55.2.201".
  Combine to a single regexp and translate to rx.
  Remove some regexp ambiguity (relint complaint).
* test/lisp/international/textsec-tests.el (test-suspiction-domain):
  Add test cases.
2022-04-11 16:29:24 +02:00
Lars Ingebrigtsen
7d5d0abd2d Ensure shell.el loading properly
* lisp/shell.el (subr-x): Require for string-chop-newline
(bug#54834).
2022-04-11 12:12:49 +02:00
Augusto Stoffel
48cb9c4aaa Add lazy highlight when reading 'query-replace' arguments
* lisp/replace.el (query-replace-read-args):  Use
'minibuffer-lazy-highlight-setup' to highlight the text to be replaced
in the original buffer (and a match count, if applicable).
(replace--region-filter): New function for code that
used to be inlined in perform-replace but is useful elsewhere.
(perform-replace): Use 'replace--region-filter'.
2022-04-10 22:37:04 +03:00
Augusto Stoffel
4c0c9d23ab Rewrite the minibuffer lazy highlight feature
The new API was discussed in bug#53126.  It's more robust and easier
to use in complex cases like that of 'query-replace'.

* etc/NEWS: Amend the feature announcement
* lisp/isearch.el (isearch-edit-string): Use new API.
(minibuffer-lazy-highlight-transform,
minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count,
minibuffer-lazy-highlight--after-change,
minibuffer-lazy-highlight--exit) Remove helper functions, which are
now kept together with the lazy highlight configuration variables
within a closure.
(minibuffer-lazy-highlight-setup): This function now takes the lazy
highlighting configuration variables as argument, and returns a
closure that is intended to run as part of the minibuffer setup.
2022-04-10 22:36:47 +03:00
Eli Zaretskii
8addfafc2a Fix WebP image support on MS-Windows
* src/image.c (init_webp_functions) [WINDOWSNT]: Load Demux
functions from the WebPDemux DLL.  Load internal functions where
the public APIs are inline functions defined in the WebP headers.
(WebPAnimDecoderOptionsInit) [WINDOWSNT]: Define to call
'WebPAnimDecoderOptionsInitInternal'.
(WebPDemux): Define to call 'WebPDemuxInternal'.
(WebPAnimDecoderNew): Define to call
'WebPAnimDecoderNewInternal'.
(syms_of_image) <webpdemux>: New symbol.

* lisp/term/w32-win.el (dynamic-library-alist): Add a member for
'webpdemux'.
2022-04-10 16:45:43 +03:00
Alan Mackenzie
02b521ad74 CC Mode: Fix unwanted fontification of function call as function declaration
This happens when the enclosing function's return type is a struct, etc.  This
fixes bug #54743;

* lisp/progmodes/cc-engine.el (c-update-brace-stack): Replace "(" by ")" in a
`member' call.
2022-04-10 12:20:39 +00:00
Kaushal Modi
cca47ae555 Update docstrings for shortdoc.el FUNC lisp form API
* lisp/emacs-lisp/shortdoc.el (define-short-documentation-group):
Updated docstrings.
2022-04-10 13:52:49 +02:00
Juri Linkov
735b451910 Allow non-interactive uses of minibuffer-next-completion
* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Use 1 for n by default.
2022-04-10 10:37:55 +03:00
Lars Ingebrigtsen
b69e8bade6 Fix mode-line doc string
* lisp/faces.el (mode-line): Fix doc string.
2022-04-10 03:15:12 +02:00
Lars Ingebrigtsen
8b3748c234 Fix sql-mode comment-end parsing
* lisp/progmodes/sql.el (sql-mode): Fix /* ... -*/ parsing
(bug#54769).
2022-04-09 12:28:58 +02:00
Lars Ingebrigtsen
e2f3b0f16e Improve package.el error messages on too-old Emacsen
* lisp/emacs-lisp/package.el (package-compute-transaction): Give a
better error message on too-old Emacs versions (bug#54747).
2022-04-08 14:46:14 +02:00
Po Lu
410690085e Interpolate scrolls coming from mice by default
* lisp/pixel-scroll.el
(pixel-scroll-precision-interpolate-mice): New
user option.
(pixel-scroll-precision): If the class of the last event device
is `mouse', interpolate the next scroll.
2022-04-08 18:57:29 +08:00
Michael Albinus
d9851c6df2 Ensure local default-directory' when calling process-attributes'.
* lisp/server.el (server-running-p):
* lisp/subr.el (memory-limit): Ensure local `default-directory'
when calling `process-attributes'.
2022-04-08 12:47:53 +02:00
Po Lu
ac2708bf6f Implement support for reporting device names on PGTK
* lisp/frame.el (device-class): Add new function.
* lisp/term/pgtk-win.el (pgtk-device-class): New function.
* src/pgtkterm.c (pgtk_device_added_or_removal_cb)
(pgtk_seat_added_cb, pgtk_seat_removed_cb)
(pgtk_enumerate_devices)
(pgtk_free_devices, pgtk_regenerate_devices)
(pgtk_get_device_for_event): New functions.
(mark_pgtkterm): Mark device data.
(pgtk_delete_terminal): Delete device data.
(pgtk_handle_event, key_press_event, note_mouse_movement)
(construct_mouse_click, button_event, scroll_event)
(drag_data_received): Set device correctly.
(pgtk_term_init): Initialize device data and seat tracking.
(pgtk_delete_display): Delete device data.
* src/pgtkterm.h (struct pgtk_device_t): New struct.
(struct pgtk_display_info): New field `devices'.  Delete lots of
unused macros and reformat comments.
2022-04-08 13:37:16 +08:00
Po Lu
e984993954 * lisp/term/x-win.el (x-device-class): Detect more keyboards. 2022-04-08 12:12:08 +08:00
Po Lu
598d1a2aa3 * lisp/term/x-win.el (x-device-class): Detect "USB USB Keykoard"s. 2022-04-08 11:03:27 +08:00
Po Lu
1a1c5a6884 Add code for determining the type of an input device
* doc/lispref/commands.texi (Command Loop Info):
* etc/NEWS: Update documentation and announce `device-class'.

* lisp/frame.el (x-device-class):
(device-class):
* lisp/term/x-win.el (x-device-class): New functions.
2022-04-08 09:47:25 +08:00
Stefan Monnier
3c57867df4 lisp/simple.el: Use #' in new code
* lisp/simple.el (minibuffer-local-shell-command-map): Use #' to quote
function names.
2022-04-07 19:20:54 -04:00
Matthias Meulien
4397755983 Display file mode information when diff font lock prettify enabled
* lisp/vc/diff-mode.el (diff--font-lock-prettify): Make regexp capture
file mode information.
2022-04-07 16:01:31 -04:00
Stefan Monnier
39e8fd357d OClosure: New function function-documentation
As mentioned in the original OClosure commit, OClosures (ab)use the
bytecode's docstring slot to hold the OClosure's type.  This currently
prevents OClosures from having their own docstring.

Introduce a new generic function `function-documentation` to fetch the
docstring of a function, which can then be implemented in various
different ways depending on the OClosure's type.

* lisp/simple.el (function-documentation): New generic function.
(bad-package-check): Strength-reduce `eval` to `symbol-value`.
* src/doc.c (Fdocumentation): Use it.

* lisp/emacs-lisp/oclosure.el (oclosure--accessor-docstring): New function.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test):
Add test for accessor's docstrings.
2022-04-07 15:59:09 -04:00
Lars Ingebrigtsen
4c8e23d5d7 Clarify read-answer-short/use-short-answers action
* lisp/emacs-lisp/map-ynp.el (read-answer-short): Clarify what
this variable affects (bug#54754).

* src/fns.c (Fyes_or_no_p): Mention `use-short-answers'.
2022-04-07 13:37:16 +02:00
Andrew G Cohen
d859cdd621 Encrypt some parameters in auth-source plstore backend
The auth-source plstore backend allows a list of extra parameters but
currently stores them all unencrypted.  This allows a plist with
:unencrypted and :encrypted keys to specify which extra parameters to
encrypt in the plstore file.

* lisp/auth-source.el (auth-source-plstore-create): Allow specifying
both unencrypted and encrypted extra parameters.
2022-04-07 13:17:47 +02:00
Jai Flack
77f3bc37e1 Add a mu backend for gnus-search
* lisp/gnus-search.el (gnus-search-mu-program): New defcustom
(gnus-search-mu-switches): New defcustom
(gnus-search-mu-remove-prefix): New defcustom
(gnus-search-mu-config-directory): New defcustom
(gnus-search-mu-raw-queries-p): New defcustom
(gnus-search-mu): New subclass of gnus-search-indexed
(gnus-search-transform-expression): New method
(gnus-search-mu-handle-date): New function
(gnus-search-mu-handle-flag): New function
(gnus-search-indexed-extract): New method
(gnus-search-indexed-search-command): New method (bug#54662).
2022-04-07 13:14:01 +02:00
Michael Albinus
7e9807d41b * lisp/net/tramp-integration.el: Don't require files-x. 2022-04-07 12:11:11 +02:00
Vincent Belaïche
9a15e15b62 Fix ses-tests.el
* lisp/ses.el (ses-jump-cell-name-function): Docstring typo.

* test/lisp/ses-tests.el (ses--cells, foo, bar, B2, toto): Do not
do any outer defvar, but set the defvar only under the
with-suppressed-warnings directive to silence the byte-compiler.
2022-04-06 22:59:43 +02:00
Stefan Monnier
9b8b39cce1 * lisp/ses.el: Fix 80-column-docstring warnings
Also remove redundant `:group` args and prefer #' to quote function names.
2022-04-06 14:42:33 -04:00
Po Lu
c0bb11432e Move some X11 drag and drop processing to Lisp
* lisp/term/x-win.el: Set unsupported drop function.
* lisp/x-dnd.el (x-dnd-handle-unsupported-drop): New function.
* src/keyboard.c (kbd_buffer_get_event): Handle
UNSUPPORTED_DROP_EVENT.
* src/termhooks.h (enum event_kind): New event
`UNSUPPORTED_DROP_EVENT'.
* src/xterm.c (x_dnd_send_unsupported_drop): Send those events
instead.
(x_dnd_do_unsupported_drop): Move actual unsupported drop
handling here.
(syms_of_xterm): New variable `x-dnd-unsupported-drop-function'.
* src/xterm.h: Update prototypes.
2022-04-06 20:30:24 +08:00
Lars Ingebrigtsen
406da54bc6 Fix minor-mode doc string quoting
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Fix
double quoting of things like (default-value 'electric-pair-mode)
(bug#54746).
2022-04-06 13:47:46 +02:00
Davide Masserut
45621c0b79 Make the Foot terminal an alias of xterm-256color
* lisp/faces.el (term-file-aliases): Make the foot terminal an alias
of xterm-256color (bug#54739).
2022-04-06 12:24:09 +02:00
Kien Nguyen
7eca680e54 Make file-name-split returns driver name as well in Windows
* lisp/files.el (file-name-split): Returns driver name as well in
Windows.
* lisp/net/browse-url.el (browse-url-file-url): Don't hexify colon
character in file path for Windows (bug#54721).
2022-04-06 11:58:02 +02:00
Davide Masserut
e32dcc7527 Add .bashrc detection to sh-mode
* lisp/progmodes/sh-script.el (sh-mode): Add .bashrc string-match
(bug#54727).
2022-04-06 11:38:08 +02:00
Markus Kopp
51a98a92e9 Use CUA functions to scroll pages with pixel-scroll-scroll-mode
* lisp/pixel-scroll.el (pixel-scroll-interpolate-down)
(pixel-scroll-interpolate-up): Use `cua-scroll-up' and
`cua-scroll-down' to scroll if
`pixel-scroll-precision-interpolate-page' is off.  (bug#54696)
2022-04-06 17:30:20 +08:00
Michael Albinus
fbf6b7d2f0 Revert unneeded change in tramp-integration.el
* lisp/net/tramp-integration.el:
Apply `connection-local-set-profiles' w/o retrieving old values.
2022-04-06 09:51:09 +02:00
Lars Ingebrigtsen
069e0ba9f3 Fix URL-related typos in comments and messages
* lisp/ffap.el (ffap-next): Fix typo in message.
* lisp/finder.el (finder-commentary): Fix typo in comment.
2022-04-06 09:27:52 +02:00
Po Lu
78ecd67888 Improve safety of haiku-drag-message
* lisp/term/haiku-win.el (haiku-drag-and-drop): Ignore
placeholder message.
* src/frame.c (delete_frame): Prevent deleting drop source frame
on Haiku.
* src/haiku_support.cc (RELEASE_NOW, CANCEL_DROP): New message
types.
(class EmacsView, MessageReceived): Handle new message types.
(be_drag_message): Drag CANCEL_DROP message on quit; also send
RELEASE_NOW to view if quitting.

* src/haikuselect.c (syms_of_haikuselect)
(haiku_unwind_drag_message): Clear new frame variable.
(Fhaiku_drag_message): Set new frame variable.
* src/haikuterm.h: Update prototypes.
2022-04-06 05:54:31 +00:00
Po Lu
62eb57f438 Clean up more PGTK code
* lisp/term/pgtk-win.el (featurep):
(pgtk):
(pgtk-use-im-context):
(pgtk-handle-nxopen):
(pgtk-handle-nxopentemp):
(pgtk-ignore-1-arg):
([C-drag-n-drop]):
([M-drag-n-drop]):
([C-M-drag-n-drop]):
(pgtk-alternate-modifier):
(pgtk-right-alternate-modifier):
(pgtk-right-command-modifier):
(pgtk-right-control-modifier):
(pgtk-do-hide-emacs):
(pgtk-hide-others):
(pgtk-do-hide-others):
(pgtk-emacs-info-panel):
(pgtk-do-emacs-info-panel):
(pgtk-next-frame):
(pgtk-prev-frame):
(after-make-frame-functions):
(tool-bar-mode):
(pgtk-toggle-toolbar):
(pgtk-print-buffer):
(scalable-fonts-allowed):
(pgtk-standard-fontset-spec):
(pgtk-store-cut-buffer-internal):
(pgtk-copy-including-secondary):
(pgtk-paste-secondary):
(pgtk-suspend-error):
(window-system-initialization):
(after-init-hook): Remove code mindlessly copied from ns-win.el,
delete unused custom group, write doc strings and rename
variables duplicated from X to their names on X.  Also reformat
comments and code.
(pgtk-use-im-context-handler): New function.

* src/pgtkfns.c (syms_of_pgtkfns): Delete useless
AppleScript (!) code copied from NS.
* src/pgtkselect.c: Write FIXME about selection API usage.

* src/pgtkterm.c (get_keysym_name): Implement correctly instead
of sprintf'ing the numeric value of the keysym into a static
buffer.
(pgtk_set_window_size):
(xg_scroll_callback): Delete code that was #if 0'd out and
doesn't make sense on PGTK.
(pgtk_delete_terminal): Remove misleading comment.
2022-04-06 12:27:57 +08:00
Paul Eggert
8ef37913d3 Port Org encode-time usage back to Emacs 25
* lisp/org/ol.el (org-store-link):
* lisp/org/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org/org-macro.el (org-macro--vc-modified-time):
* lisp/org/org-macs.el (org-2ft, org-matcher-time):
* lisp/org/org-table.el (org-table-eval-formula):
* lisp/org/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Don’t assume Emacs 27 encode-time, since standalone Org still
works with Emacs 25 and it’s easier if we minimize differences
from standalone Org.  Problem reported by Max Nikulin (Bug#54731).
This reverts much of 2021-12-16T17:40:21Z!eggert@cs.ucla.edu.
2022-04-05 17:52:34 -07:00
Juri Linkov
575c3beb4c Allow completion wrapping in minibuffer completion navigation commands
* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Don't set completion-wrap-movement.
2022-04-05 23:08:48 +03:00
Juri Linkov
4e2c70272f New commands for navigating completions from the minibuffer.
* lisp/simple.el (minibuffer-local-shell-command-map):
* lisp/minibuffer.el (minibuffer-local-completion-map):
Bind "M-<up>" to minibuffer-choose-previous-completion,
"M-<down>" to minibuffer-choose-next-completion,
"M-S-<up>" to minibuffer-previous-completion,
"M-S-<down>" to minibuffer-next-completion,
"M-RET" to minibuffer-choose-completion.
(with-minibuffer-completions-window): New macro.
(minibuffer-previous-completion, minibuffer-next-completion)
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion)
(minibuffer-choose-completion): New commands.

https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00335.html
2022-04-05 22:20:16 +03:00
Juri Linkov
7aaffe25eb Use base prefix and suffix instead of completion-base-position (bug#49931)
* lisp/minibuffer.el (minibuffer-completion-help):
Set completion-base-affixes from base-prefix and base-suffix.
In completion-list-insert-choice-function handle
string values of start/end as prefix/suffix.

* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): New variables.
(choose-completion): Let-bind base-affixes to completion-base-affixes.
Use base-affixes when completion-use-base-affixes is non-nil.
(completion-setup-function): Sync values of base-affixes and
completion-base-affixes.
2022-04-05 21:54:11 +03:00
Juri Linkov
6a50ff10f7 Choosing a completion with a prefix argument doesn't exit the minibuffer
* lisp/simple.el (choose-completion): New optional args NO-EXIT and NO-QUIT.
(bug#47417)
2022-04-05 21:21:42 +03:00