1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

169285 Commits

Author SHA1 Message Date
F. Jason Park
b4b4b5f431 Improve SOCKS error handling and support version 4a
* doc/misc/url.texi: Mention version 4a in SOCKS portion of "Gateways
in general" node.
* etc/NEWS: Mention version 4a support in new `socks' section.
* lisp/net/socks.el (socks-server): Add new Custom choice `4a' for
version field.  This change does not further overload the field in
terms of expected type because `socks-send-command' and `socks-filter'
already accommodate the symbol `http'.
(socks--errors-4): Add new constant containing error messages for
version 4.  The semantics are faithful to the de facto spec, but the
exact wording is slightly adapted.
(socks-filter): Allow for a null "type" field on error with version 5.
Previously, certain errors would not propagate because a wrong-type
signal would get in the way.
(socks-send-command): Massage existing version 4 protocol parsing to
accommodate 4a, and add error handling for version 4.  Use variable
`socks-username' for v4 variable-length ID field instead of calling
`user-full-name', which has potential privacy implications.
* test/lisp/net/socks-tests.el (socks-tests-v4-basic): Don't mock
`user-full-name' because `socks-send-command' no longer calls it to
determine the ID.
(socks-tests-v4a-basic, socks-tests-v4a-error): Add a couple tests for
SOCKS version 4a.  (Bug#53941)
2023-10-18 06:23:57 -07:00
F. Jason Park
2061bf0645 Don't hard code server ports in SOCKS tests
* test/lisp/net/socks-tests.el (socks-tests-canned-server-create,
socks-tests-filter-response-parsing-v4): Fix bug in process filter to
prevent prepared outgoing responses from being implicitly encoded as
UTF-8.  Fix similar mistake in v4 filter test.
(socks-tests-v4-basic, socks-tests-v5-auth-user-pass,
socks-tests-v5-auth-user-pass-blank, socks-tests-v5-auth-none): Allow
system to choose port instead of hard-coding it.
(socks-tests-perform-hello-world-http-request): Add optional `method'
parameter to specify a gateway method.
(socks-tests-v5-auth-none): Move body to helper function of the same
name.
(socks-override-functions): New test ensuring top-level advice around
`open-networks-stream' still supported.  (Bug#53941)
2023-10-18 06:23:14 -07:00
João Távora
e93d99a4a0 Eglot: respect completion sort order dictated by the server
Don't use flex style to do any completion sorting.

Previously, it was thought that the 'flex' completion style was only
kicking in to do (approximate) fontification of the completions
returned by the server, but it was found that it was also doing some
its own sorting in certain situation of non-empty matching patterns.

Replaced it with a new eglot--dumb-flex style which does only
fontification.

Github-reference: https://github.com/joaotavora/eglot/discussions/1306

* lisp/progmodes/eglot.el (eglot-completion-at-point): Rework.
(eglot--dumb-flex, eglot--dumb-allc): New helpers.
(completion-category-defaults): Rework Eglot-specific category.
(completion-styles-alist): Add Eglot-specific style.

* etc/EGLOT-NEWS: Mention change.
2023-10-18 07:37:57 -05:00
Po Lu
06fc5c2417 Correctly bisect format 12 and 8 cmap tables
* src/sfnt.c (sfnt_bsearch_above): Cease returning the last
element if it is ordered below the key itself.
(sfnt_lookup_glyph_8, sfnt_lookup_glyph_12): Verify whether the
group returned is NULL.
2023-10-18 13:52:19 +08:00
Po Lu
516b490bb4 Mollify compiler under Android builds without mmap
* src/sfntfont.c (sfnt_close_tables, sfnt_open_tables)
[!HAVE_MMAP]: Do not declare rc for munmap or mmap.
2023-10-18 09:09:47 +08:00
Jim Porter
6254b23a38 ; * lisp/eshell/esh-proc.el (eshell-process-wait-time): Add :version. 2023-10-17 11:59:13 -07:00
Gerd Möllmann
40c9e9d2e6 Gud lldb support (bug#66575)
* lisp/progmodes/gud.el (lldb): New command.
* etc/NEWS: Mention M-x lldb.
* src/.lldbinit: Show no souece lines on stop.
* doc/emacs/building.texi: Mention LLDB.
2023-10-17 19:14:59 +02:00
Gerd Möllmann
47adea3a90 Modify LLDB command xcomplete to return a Lisp list
* etc/emacs_lldb.py (xcomplete): Return a Lisp list. Add a comment
explaining the return value.
2023-10-17 17:25:56 +02:00
Michael Albinus
8181563f8c Fix tramp-revert-buffer-with-sudo
* lisp/net/tramp-cmds.el (tramp-revert-buffer-with-sudo):
Use `buffer-file-name' instead of `buffer-name'.  (Bug#66571)
2023-10-17 11:41:12 +02:00
Spencer Baugh
0d536f2755 Use project-name in the project-kill-buffers prompt
This is mildly prettier (bug#66518).

* lisp/progmodes/project.el (project-kill-buffers): Use project-name.
2023-10-17 02:28:02 +03:00
Jim Porter
0f9c3284c6 ; 'eshell-kill-process-wait-time' can be a floating-point number
* lisp/eshell/esh-proc.el (eshell-kill-process-wait-time): Update type.
2023-10-16 13:34:22 -07:00
Jim Porter
266ed1b847 ; Use the "new" calling convention for 'sit-for' in Eshell
* lisp/eshell/esh-proc.el (eshell-process-wait-seconds)
(eshell-process-wait-milliseconds): Make obsolete in favor of...
(eshell-process-wait-time): ... this, and...
(eshell-wait-for-process): ... use it.

* etc/NEWS: Announce this change (bug#66574).
2023-10-16 13:28:21 -07:00
Juri Linkov
5827d179fb Refactor 'vc-default-mode-line-string' (bug#66464)
* lisp/vc/vc-hooks.el (vc-mode-line-state): New function with code moved from
'vc-default-mode-line-string'.
(vc-default-mode-line-string): Use 'vc-mode-line-state'.

* lisp/vc/vc-git.el (vc-git-mode-line-string): Use
'vc-mode-line-state' instead of hacking the string returned from
'vc-default-mode-line-string'.

* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use
'vc-mode-line-state' instead of duplicating code from
'vc-default-mode-line-string'.
2023-10-16 20:14:18 +03:00
Eli Zaretskii
484fc70a7a Fix "C-0 C-x C-s" with write-protected files
* lisp/files.el (basic-save-buffer-2): Call 'set-file-modes' to
try to make the file writable, even if
'set-file-extended-attributes' succeeded.  (Bug#66546)
2023-10-16 14:17:57 +03:00
Gerd Möllmann
c3038bf5e1 ; LLDB support cleanup and extension 2023-10-16 10:14:19 +02:00
Michael Albinus
2071904d51 Merge from origin/emacs-29
07c45f20fd Fix test in files-tests
5d3f3288d2 ; * doc/emacs/search.texi (Regexp Backslash): Improve ind...
9525315c11 Add missing :version to two defcustoms
9044d4d94b Fix a defcustom :type in eldoc.el
8141d73ea7 Document 'M-x align' in the Emacs manual
2023-10-16 09:02:39 +02:00
Po Lu
36656ff70e Properly initialize argment list supplied to android_init_emacs
* src/android.c (initEmacs): NULL-terminate c_argv.
2023-10-16 09:00:45 +08:00
Po Lu
4c9f9dbd50 Revert "Update etc/rgb.txt from X.Org upstream"
This reverts commit 11f10dc0d0.

* etc/rgb.txt: Restore X11R6.6 version, where non-portable color
names are absent.
2023-10-16 08:56:53 +08:00
Sam Steingold
3e23238735 Fixup for "no file modes on windows and dos"
* lisp/ls-lisp.el (ls-lisp-format): Keep the first group of
permissions even when `modes' is not in `ls-lisp-verbosity'.
2023-10-15 11:51:34 -04:00
Alan Mackenzie
a0cd986e67 c-indent-new-comment-line: don't test for a macro in a comment
This fixes bug#9860.

* lisp/progmodes/cc-cmds (c-indent-new-comment-line): Test for
a comment/string before testing for a macro, thus preventing a
"macro" being spuriously recognized in a comment.  This allows
auto-fill-mode to work on a line beginning with # in a comment.
2023-10-15 10:54:23 +00:00
Michael Albinus
07c45f20fd Fix test in files-tests
* test/lisp/files-tests.el
(files-tests-file-name-non-special-expand-file-name-tilde): Fix test.
2023-10-15 12:26:43 +02:00
Eli Zaretskii
5d3f3288d2 ; * doc/emacs/search.texi (Regexp Backslash): Improve indexing. 2023-10-15 12:37:25 +03:00
Gerd Möllmann
98748aa6e6 ; New command alias xprint for LLDB 2023-10-15 09:40:24 +02:00
Po Lu
47ddff8ae8 ; Correct typos in android.texi
* doc/emacs/android.texi (Android Environment): Correct typos.
2023-10-15 15:02:43 +08:00
Po Lu
93104cff53 Correctly receive files through Android DND
* java/org/gnu/emacs/EmacsService.java (getUsefulContentResolver)
(getContentResolverContext): New functions which return a
content resolver from an EmacsActivity, if at all possible.
(openContentUri, checkContentUri): Probe or open URIs through
such content resolvers.  Probe URIs by opening them if merely
testing permissions fails, for DND URIs do not make
checkCallingUriPermission return true.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Address
potential crash.

* src/androidvfs.c (android_check_content_access): Circumvent
JNI dynamic method dispatch.
(android_authority_name): Guarantee NAME is never a directory.
2023-10-15 13:11:37 +08:00
Mauro Aranda
a3fd382f3f Fix searching for tags in compressed files
* lisp/progmodes/etags.el (etags--ensure-file): New function.
(etags--all-files): Make sure files in TAGS can be visited, even if
the files are compressed.  (Bug#2807)
(etags--xref-find-definitions): Report to xref a file that we are sure
it exists.  (Bug#44494)
2023-10-15 00:09:52 -04:00
Stefan Kangas
90b4a7acb5 Update publicsuffix.txt from upstream
* etc/publicsuffix.txt: Update from
https://publicsuffix.org/list/public_suffix_list.dat
dated 2023-10-01 03:58:26 UTC.
2023-10-15 00:34:02 +02:00
Stefan Kangas
11f10dc0d0 Update etc/rgb.txt from X.Org upstream
The upstream version contains the following changes:

  2023-07-10  rgb: Make color entries uniform
  2014-07-06  Add aliases for colors that differ between X11 and CSS
  2014-07-06  Add missing colors from CSS Color Module Level 4
  2008-06-04  Nuke CVS version tags
  2003-11-14  R6.6 is the Xorg base-line

* etc/rgb.txt: Sync with the version in X.Org upstream
https://cgit.freedesktop.org/xorg/app/rgb/tree/rgb.txt
commit 0d2caecebf0e2a10994c22960921f366dd98d19a.  (Bug#66538)
2023-10-14 21:23:57 +02:00
Alan Mackenzie
64850eaf98 Fix an infinite loop in c-beginning-of-defun-1
This fixes bug#61436.

The loop manifested itself in c-get-fallback-scan-pos as the
position returned wasn't at a {, so the search back in
c-beginning-of-defun-1 with a defun-prompt-regexp found the
same BOL and moved forward to after the match, repeat.

* lisp/progmodes/cc-defs.el (c-beginning-of-defun-1): Accept a
position found by beginning-of-defun (which uses
defun-prompt-regexp) only when the \\s( following it is a {.
Repeat the backward search when this isn't the case.
2023-10-14 19:16:45 +00:00
Stefan Kangas
9525315c11 Add missing :version to two defcustoms
* lisp/emacs-lisp/eldoc.el (eldoc-print-after-edit)
(eldoc-echo-area-prefer-doc-buffer): Add missing custom :version.
2023-10-14 21:00:00 +02:00
Mauro Aranda
9044d4d94b Fix a defcustom :type in eldoc.el
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-prefer-doc-buffer): Make
:type a choice, to allow for the value 'maybe'.  (Bug##66539)
2023-10-14 20:54:04 +02:00
Dmitry Gutov
fe62315ef3 Fix vc-hg-log-edit-toggle-amend
* lisp/vc/log-edit.el (log-edit--toggle-amend): Handle the case
when the VCS returns log entry that doesn't end with a newline
(bug#66423).
2023-10-14 20:47:57 +03:00
Dmitry Gutov
c0ffa8958e (vc-default-checkin-patch): Try to be compatible with BSD 'patch'
* lisp/vc/vc.el (vc-default-checkin-patch):
Try to be compatible with BSD 'patch' (bug#66211).
2023-10-14 20:10:08 +03:00
Dmitry Gutov
717d0335d7 (vc-root-diff): Don't compute and pass on WORKING-REVISION
* lisp/vc/vc.el (vc-root-diff): Don't compute and pass on
WORKING-REVISION (bug#66364).  It was unused.
2023-10-14 20:01:24 +03:00
Spencer Baugh
64dcdb7417 Optimize vc-hg-state for directories
Directories are never tracked in hg, so it's pointless to run
vc-hg-state on them.  And, in fact, our implementation previously
would list all the files contained in the directory and then parse
that in Emacs, which is very slow in large repos.

Let's just use the knowledge that directories aren't tracked in hg,
and skip running hg entirely.

* lisp/vc/vc-hg.el (vc-hg-state): Return nil for
directories.  (Bug#66364)
2023-10-14 19:57:31 +03:00
Harald Jörg
330dd51f8b ;cperl-mode.el: Do not mistake a left-shift operator for a here-doc.
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Empty
unquoted delimiters for here-documents are now forbidden
(Bug#65834).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-65834):
New test.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-65834.pl: new
resource with source code from the bug report.
2023-10-14 18:22:11 +02:00
Mauro Aranda
ad02fc212b Fix indentation and fontification in shell-script (Bug#26217)
* lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Treat "do" as
special, like we treat "in".
(sh-smie--sh-keyword-in-p): Change signature.  Take the token to
decide correctly if it's a keyword.
(sh-font-lock-keywords-var-1): Add do.

* test/lisp/progmodes/sh-script-resources/sh-indents.erts: New test.
* test/lisp/progmodes/sh-script-tests.el
(sh-script-test-do-fontification): New test.
2023-10-14 11:00:15 -04:00
Mattias Engdegård
1f95f91d85 Simplify and describe docstrings-wide check
* lisp/emacs-lisp/bytecomp.el
(byte-compile--wide-docstring-substitution-len): Remove.
* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width):
Add back explanatory comments lost in a previous change.
2023-10-14 13:26:20 +02:00
Eshel Yaron
8141d73ea7 Document 'M-x align' in the Emacs manual
* doc/emacs/indent.texi (Alignment): New section.
* doc/emacs/emacs.texi: Update menu. (Bug#66303)
2023-10-14 14:16:13 +03:00
Eli Zaretskii
fe110cb611 Merge from origin/emacs-29
06a8773811 ; * lisp/calendar/time-date.el (days-to-time): Doc fix.
0ea2d6d9e8 Document that time-to-days and days-to-time use different...
2023-10-14 06:55:05 -04:00
Mattias Engdegård
fbbe40cf50 Make the docstrings-wide check 70x faster
Instead of performing a number of expensive transformations on the
original doc string and then use a dynamically-created regexp to find
wide lines, step through the lines in the unmodified string and only
perform the transformations on lines that exceed the limit.
This is sound because the transformations are contractive.

The new check will usually not cons nor perform any regexp matching.

* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width): New.
(byte-compile--wide-docstring-p): Cheaper implementation.
2023-10-14 12:15:33 +02:00
Eli Zaretskii
06a8773811 ; * lisp/calendar/time-date.el (days-to-time): Doc fix. 2023-10-14 12:00:51 +03:00
Bob Rogers
0ea2d6d9e8 Document that time-to-days and days-to-time use different epochs
* doc/lispref/os.texi (Time Calculations):
* lisp/calendar/time-date.el (days-to-time, time-to-days): Doc fixes.
(Bug#66502)
2023-10-14 11:57:30 +03:00
Mattias Engdegård
548bc3e3d1 Sort byte compiler warnings in alphabetic order
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types):
Rearrange.  Add a few missing ones.
2023-10-14 10:34:10 +02:00
Jens Schmidt
115a940a4b Fix beginning-of-defun not jumping to BOF
In batch mode or when font-lock and some other niceties are switched
off, function `syntax-ppss' can modify match data held by function
`beginning-of-defun-raw'.  In that case, `beginning-of-defun' can jump
to some seemingly arbitrary position, and not the actual BOF.

* lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Save match data
around a call to `syntax-ppss'. (Bug#66218)
2023-10-14 11:01:52 +03:00
Mauro Aranda
281258e574 Fix saving faces with attributes that need filtering
* lisp/cus-edit.el (custom-face-save): The :shown-value property for
the custom-face widget is supposed to be a value suitable for the
customization widget.  (Bug#66391)
2023-10-14 10:48:12 +03:00
Michael Albinus
1677a65554 Merge from origin/emacs-29
dc8b336d02 * lisp/files.el (file-name-non-special): Handle quoted ti...
2023-10-14 09:38:17 +02:00
Michael Albinus
dc8b336d02 * lisp/files.el (file-name-non-special): Handle quoted tilde.
(Bug#65685)

* test/lisp/files-tests.el
(files-tests-file-name-non-special-expand-file-name-tilde):
New test.
2023-10-14 09:34:40 +02:00
Po Lu
03f5a06a05 Implement multi-window drag-and-drop under Android
* java/org/gnu/emacs/EmacsNative.java (sendDndDrag, sendDndUri)
(sendDndText): Declare new event-sending functions.

* java/org/gnu/emacs/EmacsView.java (onDragEvent): New function.

* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): New
function; respond to each drag and drop event, request
permissions if necessary and transfer dropped data to Lisp.

* lisp/dnd.el (dnd-unescape-file-uris): New variable.
(dnd-get-local-file-name): If that variable is nil, refrain from
unescaping URLs provided.

* lisp/term/android-win.el (android-handle-dnd-event): New
function.
(special-event-map): Bind drag-n-drop-event.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): New
functions.

* src/androidgui.h (enum android_event_type): New event types
ANDROID_DND_DRAG_EVENT, ANDROID_DND_URI_EVENT,
ANDROID_DND_TEXT_EVENT.
(struct android_dnd_event): New structure.
(union android_event) <dnd>: New field.

* src/androidterm.c (handle_one_android_event)
<ANDROID_DND_..._EVENT>: Generate drag-n-drop events for each
of these types.
(syms_of_androidterm) <Quri, Qtext>: New defsyms.
2023-10-14 10:15:42 +08:00
Eric Abrahamsen
0dd7e6e3ae Have gnus-summary-limit-to-age operate on calendar days
Reported and patched by Łukasz Stelmach <stlman@poczta.fm>.

* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Rather than
24-hour blocks. Also use `read-number', and drop the confusing option
to reverse younger/older both with the prefix argument and with a
negative number.
2023-10-13 16:48:55 -07:00