1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00
Commit graph

149304 commits

Author SHA1 Message Date
Lars Ingebrigtsen
aa9cba6587 Allow empty elements in directory-append
* doc/lispref/files.texi (Directory Names): Document it.
* src/fileio.c (Fdirectory_append): Allow empty elements.
2021-07-25 08:00:50 +02:00
Mattias Engdegård
03f844249c Disable delay and ding in replace-tests
* test/lisp/replace-tests.el (replace-tests-with-undo):
When testing the "U" (undo all changes) option, the code will delay
and ding which is obnoxious in an automated test.
Disabling that makes the test quiet and about 150 times faster.
2021-07-24 19:30:39 +02:00
Eli Zaretskii
e3155440dc ; * src/fileio.c (Fdirectory_append): Doc fix. 2021-07-24 20:18:28 +03:00
Yuan Fu
7c83e605ab Add filter to GDB's register buffer
* lisp/progmodes/gdb-mi.el (gdb-registers-enable-filter)
(gdb-registers-filter-pattern-list): New custom options.
(gdb-header-click-event-handler, gdb-registers-toggle-filter): New
functions.
(gdb-header-click-event-handler): Only add a register if it passes the
filter.
(gdb-registers-mode-map): New keybinding for toggling the filter.
(gdb-registers-header): New buttons on the header line for the
filter (bug#39179).
2021-07-24 19:11:08 +02:00
Lars Ingebrigtsen
42d4537ed2 Really convert to multibyte in Fdirectory_append
* src/fileio.c (Fdirectory_append): Fix check for whether we need
to convert to multibyte.
(Fdirectory_append):
2021-07-24 18:53:43 +02:00
Michael Albinus
0c77d1d2ca Fix last commit in tramp.el 2021-07-24 18:49:57 +02:00
Lars Ingebrigtsen
4b1367ee97 Fix Fdirectory_append check for whether strings have to be converted
* src/coding.c (string_ascii_p): Make it non-static.

* src/fileio.c (Fdirectory_append): Fix check for whether we need
to convert to multibyte.

* src/fns.c (string_ascii_p): Remove copy.

* src/lisp.h: Declare string_ascii_p.
2021-07-24 18:35:14 +02:00
Lars Ingebrigtsen
26da0b5ecb Set the normal-erase-is-backspace variable from Customize
* lisp/simple.el (normal-erase-is-backspace): Always set the
variable so that Customize is up-to-date (bug#49593).
2021-07-24 18:21:50 +02:00
Lars Ingebrigtsen
6becc97433 Tweak Fdirectory_append slightly
* src/fileio.c (Fdirectory_append): Make the xfree condition more
robust.
2021-07-24 18:09:14 +02:00
Lars Ingebrigtsen
ba918ecb78 Improve directory-append manual entry
* doc/lispref/files.texi (Directory Names): Mention zero-length
restriction.
2021-07-24 18:06:36 +02:00
Lars Ingebrigtsen
28bf38743d Tweak Fdirectory_append for efficiency
* src/fileio.c (Fdirectory_append): Make slightly more efficient.
2021-07-24 17:28:10 +02:00
Lars Ingebrigtsen
b4543dfa9e Extend directory-append to take an arbitrary number of components
* doc/lispref/files.texi (Directory Names): Document it.
* lisp/emacs-lisp/shortdoc.el (file-name): Add new example.

* src/fileio.c (Fdirectory_append): Change the function to take an
arbitrary number of components.
2021-07-24 17:22:43 +02:00
Basil L. Contovounesios
8cd66a3170 ; Fix directory-append arglist in files.texi. 2021-07-24 14:59:36 +01:00
Michael Albinus
4d43974468 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2021-07-24 13:58:23 +02:00
Michael Albinus
9ad1f71c39 Add Tramp support for yubikey (bug#49714)
* lisp/net/tramp.el (tramp-yubikey-regexp): New defcustom.
(tramp-action-show-and-confirm-message): New defun.

* lisp/net/tramp-sh.el (tramp-actions-before-shell)
(tramp-actions-copy-out-of-band): Add `tramp-yubikey-regexp' action.
2021-07-24 13:58:03 +02:00
Lars Ingebrigtsen
8b808be2fb Adjust tab-bar to the new mode-line-misc-info value
* lisp/tab-bar.el (tab-bar--define-keys): Adjust to the new
default value for `mode-line-misc-info'.
2021-07-24 13:53:46 +02:00
Lars Ingebrigtsen
d8a4a5ac7c Remove duplicated NEWS entries 2021-07-24 13:47:54 +02:00
Lars Ingebrigtsen
9192f5d25b Make 's' in *Help* work for Lisp-defined variables again
* lisp/help-fns.el (describe-variable): Make the `s' command work
for Lisp-defined variables again (bug#39121).
2021-07-24 13:46:02 +02:00
Lars Ingebrigtsen
86a795f6dd Fix problem when moving files called ~ to the trash
* lisp/files.el (move-file-to-trash): Construct the trash file
name safely (bug#49711).  This makes (move-file-to-trash "/tmp/~")
etc work.
2021-07-24 13:34:52 +02:00
Lars Ingebrigtsen
5431a58e86 Add new function `directory-append'
* doc/lispref/files.texi (Directory Names): Document it, and
remove the concat-based file concatenation description.
* lisp/emacs-lisp/shortdoc.el (file-name): Add.  And add more
expand-file-name examples.

* src/fileio.c (Fdirectory_append): New function.
2021-07-24 13:30:58 +02:00
Eli Zaretskii
d0625dc553 ; One more change in back.texi. 2021-07-24 13:41:01 +03:00
Eli Zaretskii
06d0a66e57 ; Yet another last-minute change in Emacs manual for printing
* doc/emacs/book-spine.texi:
* doc/emacs/back.texi: Minor copyedits.
2021-07-24 13:15:50 +03:00
Lars Ingebrigtsen
9ac6ff53b1 Make the test for auto-mode-alist from .dir-local.el stricter
* lisp/files.el (set-auto-mode--dir-local-valid-p): New function.
(set-auto-mode--apply-alist): Use it as a stricter test.
2021-07-24 11:16:15 +02:00
Eli Zaretskii
59eaa30c90 ; * etc/NEWS: Fix wording of the 'fill-column' entry. 2021-07-23 22:49:34 +03:00
Eli Zaretskii
26ff27714c ; * lisp/calendar/cal-french.el (calendar-french-trim-feast): Doc fix. 2021-07-23 22:46:28 +03:00
Eli Zaretskii
5708322560 ; * lisp/files.el (set-auto-mode--apply-alist): Doc fix. 2021-07-23 22:43:22 +03:00
Eli Zaretskii
1163217725 Improve recently added documentation
* etc/NEWS: Improve wording of a recently added entry.

* doc/misc/smtpmail.texi (Queued delivery): Fix typo.
2021-07-23 22:38:10 +03:00
Michael Albinus
8ec35857cf Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2021-07-23 20:30:46 +02:00
Alex Bochannek
eb20d013a1 Fix bug#49699
* lisp/net/tramp-sh.el (tramp-scp-strict-file-name-checking):
Adapt check for macOS.  (Bug#49699)
2021-07-23 20:29:59 +02:00
Lars Ingebrigtsen
2a231378fa Fix typo in set-auto-mode--apply-alist
* lisp/files.el (set-auto-mode--apply-alist): Fix typo in
ad5faa424a (bug#49712).
2021-07-23 20:18:21 +02:00
Lars Ingebrigtsen
1f24519735 Allow storing SMTP variables when queueing mail
* doc/misc/smtpmail.texi (Queued delivery): Document it (bug#49709).

* lisp/gnus/message.el (message-multi-smtp-send-mail): Store
variables.

* lisp/mail/smtpmail.el (smtpmail-queue-mail): Mention it.
(smtpmail-store-queue-variables): New variable.
(smtpmail-send-it): Store SMTP variables if requested.
(smtpmail-send-queued-mail): Restore variables.
2021-07-23 17:58:20 +02:00
Lars Ingebrigtsen
6ce2acdadb Fix do-auto-fill thinko introduced earlier today
* lisp/simple.el (do-auto-fill): `current-fill-column' returns nil
to signal that we should fill.
2021-07-23 15:56:44 +02:00
Tom Tromey
ad5faa424a Add auto-mode-alist functionality to .dir-locals.el
* doc/emacs/custom.texi (Directory Variables): Document
auto-mode-alist in .dir-locals.el (Bug#18721)
* doc/emacs/modes.texi (Choosing Modes): Update.
* lisp/files.el (set-auto-mode--apply-alist): New function,
from set-auto-mode.
(set-auto-mode): Check directory locals for auto-mode-alist.
(dir-locals-collect-variables): Add "predicate" parameter.
(hack-dir-local--get-variables): New function, from
hack-dir-local-variables.
(hack-dir-local-variables): Call hack-dir-local--get-variables.
* test/lisp/files-resources/.dir-locals.el: New file.
* test/lisp/files-resources/whatever.quux: New file.
* test/lisp/files-tests.el (files-tests-data-dir): New variable.
(files-test-dir-locals-auto-mode-alist): New test.
2021-07-23 15:51:11 +02:00
Jean Forget
6a3b89f9df Add more support for the French Revolutionary Calendar
* lisp/calendar/cal-french.el (calendar-french-feasts-array): New
variable (bug#19174).
(calendar-french-trim-feast): New function.
(calendar-french-date-string, calendar-french-goto-date):
(calendar-french-goto-date): Use them.

http://datetime.mongueurs.net/Histoire/s-c/01-g.en.html
https://metacpan.org/pod/DateTime::Calendar::FrenchRevolutionary#Internet
2021-07-23 15:26:45 +02:00
Mattias Engdegård
aa5437493b Off-by-one error in compilation rule end-column function (bug#49624)
* lisp/progmodes/compile.el (compilation-error-properties):
When the end-column parameter of a compilation message rule
(in compilation-error-regexp-alist[-alist]) is a function, treat its
return value as if it were matched by the regexp, which is how it is
documented to work, and how all other parameters work.
2021-07-23 15:20:44 +02:00
Mattias Engdegård
109ca1bd00 Warn about arity errors in inlining calls (bug#12299)
Wrong number of arguments in inlining function calls (to `defsubst` or
explicitly using `inline`) did not result in warnings, or in very
cryptic ones.

* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Add calls
to `byte-compile--check-arity-bytecode`.
* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile--check-arity-bytecode): New functions.
(byte-compile-callargs-warn): Use factored-out function.
* test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el:
* test/lisp/emacs-lisp/bytecomp-tests.el ("warn-callargs-defsubst.el"):
New test case.
2021-07-23 15:19:01 +02:00
F. Jason Park
4d172946c3 Remove text props from callback args in erc-button
* lisp/erc/erc-button.el (erc-button-add-buttons-1): Remove text
properties from strings stored in `erc-data' and passed to
`erc-callback'
(both text properties themselves) (bug#49704).  This reduces
memory usage in erc buffers (which are long-lived and can become
very large).
2021-07-23 15:18:05 +02:00
Lars Ingebrigtsen
172dfac035 declare-function doc string clarification about FILE
* lisp/subr.el (declare-function): Mention that FILE can be nil
(bug#21466).
2021-07-23 15:12:03 +02:00
Stefan Kangas
99018681c4 Make nil value of fill-column obsolete
* lisp/textmodes/fill.el (current-fill-column): Make nil value of
'fill-column' obsolete.  (Bug#22847)
(current-fill-column--has-warned): New variable to track warning.
* lisp/simple.el (do-auto-fill): Remove handling of nil return value
from 'current-fill-column'.
* etc/NEWS: Announce obsoletion of this usage.
2021-07-23 14:57:44 +02:00
Lars Ingebrigtsen
4357d595ee Adjust time-tests.el to bug#30056
* test/lisp/time-tests.el (time-tests-display-time-update): Adjust
test (bug#30056).
2021-07-23 14:46:12 +02:00
Lars Ingebrigtsen
9dfa94aed1 Move mode-line NEWS items to a common section 2021-07-23 14:44:15 +02:00
Lars Ingebrigtsen
bb68faed02 'global-mode-string' elements should have a space at the end
* lisp/time.el (display-time-string-forms):
* lisp/battery.el (battery-mode-line-format): Add a space to the
end (bug#30056).
* lisp/bindings.el (mode-line-misc-info): Remove space from end.
This will make the default format have one space before the
line-of-dashes (instead of two) on terminals.
2021-07-23 14:40:53 +02:00
Lars Ingebrigtsen
f3806ee149 Fix an rcirc merge problem
* lisp/net/rcirc.el (rcirc-get-server-method)
(rcirc-get-server-password): Remove double definition after merge.
2021-07-23 14:13:38 +02:00
Eli Zaretskii
ce04a88f3c MS-Windows followup to recent emacsclient changes
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_file-has-acl): Set to true
to avoid compiling file-has-acl.c on MS-Windows.
2021-07-23 14:56:16 +03:00
Paul Eggert
007744dd04 Redo emacsclient socket symlink-attack checking
* admin/merge-gnulib (GNULIB_MODULES): Add file-has-acl.
* lib/file-has-acl.c: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c: Include acl.h, for file_has_acl.
(O_PATH): Default to O_SEARCH, which is good enough here.
(union local_sockaddr): New type.
(socket_status): Remove, replacing with ...
(connect_socket): New function.  All callers changed.
This function checks for ownership and permissions issues with the
parent directory of the socket file, instead of checking the
owner of the socket (which does not help security).
(socknamesize): Move to file scope.
(local_sockname): New arg S.  No need to pass socknamesize.
UID arg is now uid_t.  All callers changed.  Get file descriptor
of parent directory of socket, to foil some symlink attacks.
Do not follow symlinks to that directory.
(set_local_socket): Create the socket here instead of on
each attempt to connect it.  Fall back from XDG_RUNTIME_DIR
to /tmp only if the former fails due to ENOENT.  Adjust
permission-failure diagnostic to match changed behavior.

This addresses Bug#33847, which complained about emacsclient in a
safer XDG environment not connecting to an Emacs server running in
a less-safe enviroment outside XDG.  The patch fixes a
longstanding issue with emacsclient permission checking.
It’s ineffective to look at the permission of the socket file
itself; on some platforms, these permissions are ignored anyway.
What matters are the permissions on the parent directory of the
socket file, as these are what make symlink attacks possible.
Change the permissions check accordingly, and also refuse to
follow symlinks to that parent directory.  These changes make it
OK for emacsclient to fall back from XDG_RUNTIME_DIR to the
traditionally less-safe /tmp/emacsNNNN directories, since /tmp is
universally sticky nowadays.
2021-07-23 13:33:37 +02:00
Philip Kaludercic
55a19a1da2
Merge branch 'feature/rcirc-update' 2021-07-23 13:23:35 +02:00
Lars Ingebrigtsen
f1101fdc82 Make erc recognize `foo*' as a function Lisp symbol
* lisp/erc/erc-button.el (erc-button-alist): Add some more chars
to the `foo' button regexp (bug#49690).
2021-07-23 13:15:32 +02:00
Lars Ingebrigtsen
d3163a3b8f Make supersession warnings work again
* src/filelock.c (lock_file): Fix thinko in lock_file in 2ad34bcea4
(bug#49701).
2021-07-23 11:49:22 +02:00
Eli Zaretskii
662f91a795 Fix display of line/wrap-prefix when there's a display property at BOL
* src/xdisp.c (get_line_prefix_it_property): New function.
(handle_line_prefix): Call 'get_line_prefix_it_property' instead
of 'get_it_property', to examine also the property of the buffer
text underlying the display or overlay string.  (Bug#49695)
2021-07-22 21:23:48 +03:00
Lars Ingebrigtsen
fcae435f59 Make revert-buffer preserve buffer-readedness
* lisp/files.el (revert-buffer): Preserve buffer-readedness
(bug#35166).
2021-07-22 16:24:58 +02:00