* src/callint.c (Finteractive): Any other format spec than %s will
bug out with "Format specifier doesn’t match argument type", so
say explicitly that only %s is supported (bug#31314).
Phil Sainty [Sat, 13 Jul 2019 11:20:40 +0000 (23:20 +1200)]
* lisp/so-long.el (so-long-variable-overrides): Use correct bidi option
Set 'bidi-paragraph-direction' to 'left-to-right', rather than setting
'bidi-display-reordering' to nil, as the latter is only intended for
use when debugging the display code.
Michael Albinus [Sat, 13 Jul 2019 11:33:10 +0000 (13:33 +0200)]
Make check for compression programs more robust in Tramp
* lisp/net/tramp-sh.el (tramp-inline-compress-start-size):
Revert change of init value. We fix this differently.
(tramp-find-inline-compress): Check also the output of the
processes, not only the return code.
Eli Zaretskii [Sat, 13 Jul 2019 09:47:02 +0000 (12:47 +0300)]
Fix TTY menus in GUD and GDB-MI modes
* lisp/menu-bar.el (menu-bar-open): Accept a numerical
argument interactively, and drop down menu at that X
coordinate.
(popup-menu): Detect when MENU is not a list. (Bug#36613)
Eli Zaretskii [Sat, 13 Jul 2019 08:32:18 +0000 (11:32 +0300)]
Avoid loading mule-util at startup
* lisp/international/mule-util.el (char-displayable-p): Move
from here...
* lisp/international/mule.el (char-displayable-p): ...to
here. This avoids always loading mule-util at startup due
to a call to 'char-displayable-p' in
'startup--setup-quote-display'.
Dima Kogan [Sun, 30 Jun 2019 17:37:53 +0000 (10:37 -0700)]
Add ability to highlight-lines-matching-regexp directly from Isearch
* lisp/isearch.el: Implement the new functionality.
(isearch-highlight-lines-matching-regexp): New function bound
to 'M-s h l' in isearch.
(isearch--highlight-regexp-or-lines): New internal function.
* etc/NEWS (Search and Replace): Mention this change.
* doc/emacs/search.texi (Special Isearch): Document 'M-s h l'.
(Bug#18241)
Phil Sainty [Fri, 2 Nov 2018 01:51:21 +0000 (14:51 +1300)]
Add so-long library
* lisp/so-long.el: New library.
* doc/emacs/trouble.texi (Long Lines): New node covering so-long.el.
* doc/emacs/emacs.texi (Top): Add menu entry for the Long Lines node.
* etc/NEWS: Include under "New Modes and Packages in Emacs 27.1"
Paul Eggert [Sat, 13 Jul 2019 05:29:02 +0000 (22:29 -0700)]
Replace Vdead with tagged pointer
This speeds up ‘make compile-always’ by 0.1% on my platform.
Suggested by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00257.html
* src/.gdbinit (pwinx, pgx, xbuffer, xprintstr):
Output dead_object () as "DEAD".
* src/alloc.c (Vdead, DEADP): Remove.
All uses replaced by dead_object () / deadp.
(deadp): New function.
(init_alloc_once_for_pdumper): Remove no-longer-needed
initialization.
* src/lisp.h (dead_object): New function.
Document format-spec and expand the modifiers it supports
* doc/lispref/text.texi (Interpolated Strings): New section.
* lisp/format-spec.el (format-spec--parse-modifiers)
(format-spec--pad): New functions.
(format-spec): Support more format modifiers (bug#32931).
Teemu Likonen [Sat, 13 Jul 2019 00:12:58 +0000 (02:12 +0200)]
Use the gpg --sender option
* lisp/epg.el (epg-start-encrypt)
* lisp/gnus/mml-sec.el (mml-secure-epg-encrypt): When
'mml-secure-openpgp-sign-with-sender' is non-nil message sender's
email address (in addition to its old behaviour) will also be used
to set gpg's "--sender email@domain" option.
* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit):
Always include the number of failed tests, because absence of the
text is not reassuring (bug#36616).
* lisp/gnus/nnimap.el (nnimap-login): When base64-ing
credentials, don't let bsae64-encode-string split the result into
several lines, because servers do not understand that (bug#34458).
* lisp/url/url-auth.el (url-basic-auth): When base64-ing
credentials, don't let bsae64-encode-string split the result into
several lines, because servers do not understand that (bug#36619).
* lisp/mail/rfc2047.el (rfc2047-fold-region): Don't break lines
right after the Header: field, but wait until the next
whitespace. (This only makes a difference for words that are very
long (i.e., longer than, say, 60 characters, depending on the
header name length.)
Paul Eggert [Fri, 12 Jul 2019 06:06:22 +0000 (23:06 -0700)]
Tweak builtin symbol order for speed
* lib-src/make-docfile.c (compare_globals):
Make symbols 1 through 4 be t, unbound, error, lambda.
This is in addition to symbol 0 being nil.
This change improved ‘make compile-always’ performance by 0.6%
on my platform.
Paul Eggert [Fri, 12 Jul 2019 00:01:20 +0000 (17:01 -0700)]
Avoid duplicate comparison in describe_map_compare
* src/fns.c (string_version_cmp): New function.
This has most of the old Fstring_version_lessp,
with an assertion to make things a bit clearer.
* src/fns.c (Fstring_version_lessp):
* src/keymap.c (describe_map_compare): Use it (Bug#33237).
Juri Linkov [Thu, 11 Jul 2019 21:35:21 +0000 (00:35 +0300)]
Better match-data handling in perform-replace
* lisp/replace.el (perform-replace): Don't wrap replace-highlight
in save-match-data. Use `(nth 0 real-match-data)' instead of
`(match-beginning 0)' after replace-highlight. (Bug#36328)
* lisp/format-spec.el (format-spec): Allow passing through format
strings that have no specs (to be able to act as a filter). Also
add an example.
* test/lisp/format-spec-tests.el (test-format-spec): Add tests for
the new functionality.
* src/fileio.c (Fexpand_file_name): Clarify that "~" in NAME is
expanded, and not just "~/". Also clarify that ~USER is not
expanded if USER doesn't exist (bug#36490).
Tweak the order keystrokes are sorted in keymap listings
* src/keymap.c (describe_map_compare): Change the sorting order of
keystrokes, so that we get the order <f1> <f2> <f11> instead of
<f1> <f11> <f2> (bug#33237).
* lisp/progmodes/elisp-mode.el (eval-sexp-add-defvars): When
collecting defvars in the current buffer, ignore the ones that are
in comments or strings (bug#34233).
Eli Zaretskii [Thu, 11 Jul 2019 13:28:41 +0000 (16:28 +0300)]
Resurrect SVG support on MS-Windows
* src/image.c (syms_of_image) <Qgio> [HAVE_NTGUI]: New DEFSYM.
(init_svg_functions) [LIBRSVG_CHECK_VERSION >= 2.32.0]: Load
g_file_new_for_path and g_memory_input_stream_new_from_data
from libgio, not from libglib. (Bug#35548)
* lisp/term/w32-win.el (dynamic-library-alist): Add the libgio
DLL.
Eli Zaretskii [Thu, 11 Jul 2019 13:03:33 +0000 (16:03 +0300)]
Avoid assertion violations when resize-mini-windows is nil
* src/xdisp.c (resize_mini_window): Always reset the
mini-window's start point to the beginning of the buffer, even
if resizing is not needed. This avoids assertion violations
when resize-mini-windows is nil. (Bug#36595)
Paul Eggert [Wed, 10 Jul 2019 19:37:55 +0000 (12:37 -0700)]
Avoid functions deprecated in librsvg 2.45.1
* src/image.c (init_svg_functions) [WINDOWSNT]:
Load the pre-2.32 or 2.32 functions,
depending on LIBRSVG_CHECK_VERSION.
(svg_load_image): In librsvg 2.32 or later, use
g_memory_input_stream_new_from_data, g_file_new_for_path and
rsvg_handle_new_from_stream_sync rather than the
deprecated-in-2.45 rsvg_handle_write and rsvg_handle_close.
From a patch by YAMAMOTO Mitsuharu (Bug#35548#11).
* lisp/calc/calc-alg.el (calcFunc-sec, calcFunc-csc, calcFunc-cot):
Check that `math-known-sin' and `math-known-tan' succeeded before
using their value in arithmetic.
* test/lisp/calc/calc-tests.el (calc-test-trig): Add regression tests.
Stefan Kangas [Sun, 7 Jul 2019 14:27:26 +0000 (16:27 +0200)]
Small cleanups in asm-mode.el (Bug#36540)
* lisp/progmodes/asm-mode.el: Remove "tools" from "Keywords" header.
Doc fixes.
(asm-comment-char, asm-comment): Doc fixes.
(asm-newline): Redefine as an obsolete function alias for
'newline-and-indent' instead of using a defalias.
* lisp/comint.el (comint--prompt-recursion-depth): New variable
(bug#33252).
(comint-watch-for-password-prompt): Use it to avoid bugging out
and making Emacs unusable when a shell script is prompting for
passwords in an infloop.
* lisp/gnus/message.el (message--fold-long-headers): Header lines
should be no longer than 79 characters before folding
(bug#33313). Previous comment about 998 octets is about maximum
allowed header field length.
Paul Eggert [Wed, 10 Jul 2019 06:18:13 +0000 (23:18 -0700)]
Simplify math-get-calendar-tzinfo
* lisp/calc/calc-forms.el (calendar-current-time-zone-cache):
Remove defvar.
(math-get-calendar-tzinfo): Simplify and do not reach
into caldst’s cache.
Stefan Monnier [Tue, 9 Jul 2019 21:04:07 +0000 (17:04 -0400)]
* src/fileio.c: Fix bug#36431
(decide_coding_unwind): Re-introduce. Move text back to the gap.
Return the new `inserted` via the unwind_data.
(Finsert_file_contents): Use it.
Make sure `inserted` is always 0 when we jump straight to `notfound`.
Don't insert the text in the buffer until we know it's properly decoded
for the byteness of the buffer.
* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt):
Allow insert-file-contents to return an empty buffer in case of
non-local exit in set-auto-coding-function.
Paul Eggert [Tue, 9 Jul 2019 20:55:16 +0000 (13:55 -0700)]
Defend fingerprint against even-smarter LTO
* src/pdumper.c (Fdump_emacs_portable, pdumper_load):
Don’t cast volatile to non-volatile pointer, as that does not in
general suffice to prevent a compiler from optimizing away memcmp
and/or memcpy calls. Instead, copy the fingerprint by hand.
Paul Eggert [Tue, 9 Jul 2019 20:10:27 +0000 (13:10 -0700)]
Do not alter match data in Fcapitalize etc.
Without this patch, (capitalize "x") can alter the match data,
which is not what users expect. Problem found by running
morse-tests-unnato-region in a stripped-down Emacs.
Perhaps ‘load’ should also save and restore the match data?
That would be a simpler fix, though arguably incompatible.
* src/lread.c (save_match_data_load): New function.
* src/chartab.c (uniprop_table):
* src/doc.c (reread_doc_file):
* src/eval.c (Fautoload_do_load):
* src/fns.c (Frequire): Use it.
Paul Eggert [Tue, 9 Jul 2019 20:02:51 +0000 (13:02 -0700)]
Port image-type-from-file-header-test to non-SVG Emacs
Problem reported privately by Michael Albinus.
* test/lisp/image-tests.el (image-type-from-file-header-test):
Don’t assume svg is a supported image type.