Eli Zaretskii [Sat, 29 Jun 2019 09:48:15 +0000 (12:48 +0300)]
Fix display of fringe bitmaps for tooltips in echo area
* src/xdisp.c (display_line): Force redrawing of fringe
bitmaps when redisplaying a minibuffer window with
truncate-lines set to a non-nil value. (Bug#36308)
Make regexp matching of raw bytes work in all combination of unibyte
and multibyte patterns and targets, as exact strings and in character
alternatives (bug#3687).
* src/regex-emacs.c (analyze_first):
Include raw byte in fastmap when pattern is a multibyte exact string.
Include leading byte in fastmap for raw bytes in character alternatives.
(re_match_2_internal):
Decrement the byte count by the number of bytes in the pattern character,
not 1.
* test/src/regex-emacs-tests.el (regexp-unibyte-unibyte)
(regexp-multibyte-unibyte, regexp-unibyte-mutibyte)
(regexp-multibyte-multibyte): New tests.
Paul Eggert [Thu, 27 Jun 2019 22:39:04 +0000 (15:39 -0700)]
Improve ‘equal’ and array doc
* doc/lispref/objects.texi (Array Type): Array sizes are
nonnegative fixnums, not arbitrary integers.
(Equality Predicates): Do not say that ‘eq’ equals ‘=’ on bignums.
Do not imply that ‘equal’ must signal an error on circular lists.
Paul Eggert [Thu, 27 Jun 2019 19:31:27 +0000 (12:31 -0700)]
Omit a few minor unnecessary range checks
Based on Pip Cet’s review (Bug#36370#19).
* src/fileio.c (Fdo_auto_save):
* src/image.c (lookup_image):
* src/textprop.c (Fnext_single_char_property_change):
Prefer XFIXNUM to XFIXNAT for clarity and consistency with
neighboring code, and to avoid unnecessary range checks.
* src/image.c (lookup_image): Omit unnecessary range checks.
Paul Eggert [Thu, 27 Jun 2019 19:31:27 +0000 (12:31 -0700)]
Improve XFIXNUM cleanup a bit
Based on Pip Cet’s review (Bug#36370#13).
* src/ccl.c (Fccl_execute_on_string): Use clearer indexing.
* src/dosfns.c (Fint86, Fdos_memput):
Avoid runtime checks for negative fixnums when debugging.
This restores the earlier machine code.
* src/lisp.h (XFIXNUM, XUFIXNUM): Use eassert, not eassume.
(XFIXNAT): At the start, merely eassert FIXNUMP rather
than eassuming FIXNATP. At the end, eassume that the
result is nonnegative. This restores help to the compiler
that the previous patch mistakenly removed.
Paul Eggert [Thu, 27 Jun 2019 19:31:27 +0000 (12:31 -0700)]
Clean up use of XFIXNUM etc.
A few bits of the code were relying on the fact that XFIXNUM,
XFIXNAT, and XUFIXNUM do something even with arguments that
are not fixnums/fixnats. Separate these rare uses out into
XFIXNUM_RAW and XUFIXNUM_RAW.
Problem and original patch reported by Pip Cet (Bug#36370).
* src/ccl.c (Fccl_execute_on_string):
* src/fileio.c (Finsert_file_contents, a_write)
(Fdo_auto_save):
* src/process.c (conv_lisp_to_sockaddr):
* src/textprop.c (Fnext_single_char_property_change)
(Fprevious_single_char_property_change)
(Fnext_property_change, Fnext_single_property_change)
(Fprevious_property_change)
(Fprevious_single_property_change):
Don’t assume fixnums are nonnegative.
* src/ccl.c (Fccl_execute_on_string):
Fix range-checking bug if AREF (status, i) is out of int range.
* src/data.c (arith_driver): Use XFIXNUM_RAW as we want
efficient garbage if the value is not a fixnum.
* src/dosfns.c (Fint86, Fdos_memput):
Check that args are nonnegative.
* src/image.c (lookup_image): Check that args are in range.
* src/lisp.h (lisp_h_XHASH): Use XUFIXNUM_RAW, since this
is for hashing.
(lisp_h_XFIXNAT, XFIXNAT) [USE_LSB_TAG]: Remove macros.
(lisp_h_XFIXNUM_RAW, XFIXNUM_RAW) [USE_LSB_TAG]: New macros, with
the semantics of the old macros without _RAW.
(XFIXNUM_RAW, XUFIXNUM_RAW): New inline functions, with the
semantics of the old functions without _RAW.
(FIXNUMP): Move definition up to avoid forward use.
(XFIXNUM, XFIXNAT, XUFIXNUM): Use eassume to add a runtime
check (when debugging) that the argument has the proper form.
(XFIXNUM, XFIXNAT): Now inline functions only, since they
refer to their arguments more than once now that they use eassume.
* src/textprop.c (Fprevious_single_char_property_change):
Avoid fixnum overflow with invalid input.
(set_text_properties): Fix unlikely failure
to validate arguments, by using EQ instead of XFIXNAT.
* src/w32term.c (w32_draw_glyph_string):
* src/xterm.c (x_draw_glyph_string):
Treat negative minimums as 0 rather than as garbage patterns.
Paul Eggert [Thu, 27 Jun 2019 19:21:20 +0000 (12:21 -0700)]
Catch duplicate keywords in image specs
* src/image.c (struct image_keyword.count): Now bool, not int,
since it is either 0 or 1.
(parse_image_spec, xpm_image_p): Use bool for boolean.
(parse_image_spec): Fix a bug introduced in
2011-09-21T17:41:20!eggert@cs.ucla.edu that reported only
triplicate (or more) keywords, not duplicates.
emacsclient: ignore --eval parameters when starting alternate editor
* lib-src/emacsclient.c (fail): If the user said --eval, don't
pass those arguments to the alternate editor as file names.
Suggested by a patch from Scott Turner (bug#11474).
* lisp/profiler.el (profiler-cpu-log, profiler-memory-log): New
variables.
(profiler-cpu-profile): Work even if the profiler is no longer
running (bug#22114).
(profiler-memory-profile): Ditto.
(profiler-stop): Save the data.
(profiler-reset): Clear the saved data.
(profiler-report-cpu, profiler-report-memory): Report on the saved
data.
(profiler-report): Save the data here, too.
Dan Nicolaescu [Thu, 27 Jun 2019 18:13:14 +0000 (20:13 +0200)]
Include the date in the bzr annotation buffer
* lisp/vc/vc-bzr.el (vc-bzr-annotate-command)
(vc-bzr-annotate-time)
(vc-bzr-annotate-extract-revision-at-line): Include a date in the
bzr annotation buffer (bug#5428).
Lennart Borgman [Thu, 27 Jun 2019 17:08:42 +0000 (19:08 +0200)]
Add more fontification to regexp builder mode
* lisp/emacs-lisp/re-builder.el (reb-copy): Work in the presence
of newlines in the regexps.
(reb-change-syntax): Use a dedicated history variable.
(reb-fontify-string-re): Fontify sub-matches.
(reb-regexp-grouping-backslash, reb-regexp-grouping-construct):
New faces.
(reb-string-font-lock-keywords): New variable.
(reb-mark-non-matching-parenthesis): Match parenthesis.
(reb-restart-font-lock): New function.
* lisp/emacs-lisp/re-builder.el (reb-mode-map): Add divider some
dividers (bug#6347).
* lisp/textmodes/refill.el (refill-post-command-function): Make
default-indent-new-line work as indent-new-comment-line.
* lisp/textmodes/refill.el (refill-post-command-function): Bind
`M-C-j' and `M-j' to default-indent-new-line instead of
indent-new-comment-line to allow overriding via
`comment-line-break-function' (bug#12413).
Paul Eggert [Thu, 27 Jun 2019 09:33:36 +0000 (02:33 -0700)]
Tweak ‘error’ and ‘user-error’ doc strings
* lisp/net/tramp.el (tramp-user-error):
* lisp/subr.el (user-error):
Say that user errors are sometimes called pilot errors.
* lisp/subr.el (error, user-error):
Reorder wording to discuss mechanism first, then formatting advice,
rather than going back and forth between the two topics.
Tighten up the wording a bit.
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg01196.html
https://lists.gnu.org/archive/html/emacs-devel/2019-06/msg00967.html
* etc/TODO: Remove gnus-bug from list of obsolete bug-reporting
commands now that it is implemented in terms of report-emacs-bug.
`replace-regexp-in-string' omits the first START characters of the
input string in its return value. This is a clear bug, but fixing it
probably causes more trouble; document the behaviour instead (bug#36372).
* doc/lispref/searching.texi (Search and Replace)
* lisp/subr.el (replace-regexp-in-string):
Document current behaviour.
Reported by Marco Wahl <marcowahlsoft@gmail.com>.
Update `Commentary:` to use the new command names.
(pages--ctl-x-ctl-p-map): Fix `mark-page` binding.
(pages-directory-mode-map): Update `add-new-page` => `pages-add-new-page`.
Eli Zaretskii [Wed, 26 Jun 2019 16:23:34 +0000 (19:23 +0300)]
Support invoking Emacs via a symlink on MS-Windows
* src/w32.c (w32_my_exename): Resolve symlinks in the
executable name, to support searching for the pdumper file
when the executable is found via a symlink.
* src/emacs.c (load_pdump): Add a comment about symlink
resolution on Windows.
Fdocumentation_property: Return doc string for indirect variables
* src/doc.c (Fdocumentation_property): When dealing with indirect
variables (i.e., aliases), also check the symbol being pointed to
for the doc string (bug #17180).
* lisp/emacs-lisp/rx.el (rx-regexp, rx-literal): Check the cadr of the
form for stringness, not the form itself.
* test/lisp/emacs-lisp/rx-tests.el (rx-to-string-lisp-forms): New test.
Noam Postavsky [Wed, 26 Jun 2019 02:04:13 +0000 (22:04 -0400)]
Merge from emacs-26
e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347) 06b35b2f92 ; * lisp/frame.el: Enhance add-variable-watcher commentary. 572e34bb6f Rename 'make-symbolic-link' argument NEWNAME to LINKNAME 04477adedc Check that length of data returned by sysctl is non-zero 81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): D... 9d48979ca8 Fix Python tests depending on system-type fcf6cc3177 Fix problem with wdired test when symlinks cannot be created. 4701e0663e Improve wording of documentation of click events
Noam Postavsky [Fri, 21 Jun 2019 11:09:44 +0000 (07:09 -0400)]
Don't bind search-spaces-regexp around possible autoload (Bug#35802)
* lisp/isearch.el (isearch-search-fun-default): Move possible autoload
trigger outside let-binding of search-spaces-regexp.
* lisp/char-fold.el (char-fold-make-table): Remove no longer needed
workaround.
* lisp/info.el (Info-search-whitespace-regexp):
* lisp/isearch.el (search-whitespace-regexp):
* src/search.c (syms_of_search) <search-spaces-regexp>: Add warning
about adding capturing groups to the value.
* test/lisp/char-fold-tests.el: Remove, binding search-spaces-regexp
to a different should be considered a bug.
Noam Postavsky [Fri, 14 Jun 2019 12:43:17 +0000 (08:43 -0400)]
Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)
* lisp/emacs-lisp/rx.el (rx-regexp): Allow non-string forms.
(rx-constituents): Add literal constituent, which is like a plain
STRING form, but allows arbitrary lisp expressions.
(rx-literal): New function.
(rx-compile-to-lisp): New variable.
(rx--subforms): New helper function for handling subforms, including
non-constant case.
(rx-group-if, rx-and, rx-or, rx-=, rx->=, rx-repeat, rx-submatch)
(rx-submatch-n, rx-kleene, rx-atomic-p): Use it to handle non-constant
subforms.
(rx): Document new form, wrap non-constant forms with concat call.
* test/lisp/emacs-lisp/rx-tests.el (rx-tests--match): New macro.
(rx-nonstring-expr, rx-nonstring-expr-non-greedy): New tests.
* etc/NEWS: Announce changes.
Noam Postavsky [Mon, 24 Jun 2019 01:27:43 +0000 (21:27 -0400)]
Fix sgml-mode handling of quotes within parens (Bug#36347)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Use
syntax-ppss-table if set. This is only needed on the release branch,
on master the caller (syntax-propertize) already does this.
(sgml-mode): Set syntax-ppss-table to sgml-tag-syntax-table. This
correctly classifies parens as punctuation, so they won't confuse the
parser.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New test copied from master, with two cases added for this bug.
Paul Eggert [Tue, 25 Jun 2019 22:54:37 +0000 (15:54 -0700)]
Prefer PATH_MAX to MAXPATHLEN
PATH_MAX is standardized, MAXPATHLEN is not.
Also, the Gnulib pathmax module fixes some rare bugs with PATH_MAX.
So prefer PATH_MAX to MAXPATHLEN unless we know the latter is
also correct (for some platform-specific code).
* admin/merge-gnulib (GNULIB_MODULES): Add pathmax.
This module was already present, as a dependency of canonicalize-lgpl,
but now Emacs is using it directly. Sort.
* lib-src/emacsclient.c: Include stdint.h, pathmax.h.
(get_current_dir_name): Sync to current src/sysdep.c.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/sysdep.c: Include pathmax.h.
(get_current_dir_name_or_unreachable):
Use PATH_MAX instead of MAXPATHLEN.
Dima Kogan [Tue, 25 Jun 2019 22:49:24 +0000 (00:49 +0200)]
View-search-... now hit all the matches, regardless of window position
* lisp/view.el (view-search): Jump to the next/prev occurrence of
the search, even if it's displayed in the buffer (bug#18131).
This seems more logical than the previous (undocumented) behaviour.
Emilio C. Lopes [Tue, 25 Jun 2019 21:40:22 +0000 (23:40 +0200)]
Support opening a new connection when reverting a telnet buffer
* net/telnet.el (telnet-connect-command): New variable.
(telnet-revert-buffer): New function.
(telnet-mode): Use `telnet-revert-buffer' as `revert-buffer-function'.
(telnet, rsh): Set `telnet-connect-command' accordingly (bug#18312).
* lisp/files.el (file-size-human-readable): Open code string-empty-p
call. This was the single occurrence of a subr-x.el function in
files.el, which does not (yet) load subr-x.el.
Highlight zsh glob flags and qualifiers in sh-mode
* lisp/progmode/sh-script.el (sh-syntax-propertize-function):
Add regexps to highlight zsh glob flags and alternate qualifiers
without mistaking them for comments. (bug#19455).
Phil Sainty [Tue, 25 Jun 2019 14:02:12 +0000 (16:02 +0200)]
Fix `goto-address-url-regexp'
* lisp/net/goto-addr.el (goto-address-uri-schemes-ignored): New
variable.
(goto-address-uri-schemes): Ditto.
(goto-address-url-regexp): Use them to compose the final regexp.
* lisp/net/goto-addr.el: The URI schemes to be recognised by
`goto-address-mode' were not regexp-quoted (Bug#23343).
Tino Calancha [Tue, 25 Jun 2019 13:42:17 +0000 (15:42 +0200)]
Make winner restore point in all windows that display a buffer
* lisp/window.el (window--before-delete-windows): New defun.
(delete-window, delete-other-windows): Use it.
* lisp/winner.el (winner-set): Use marker in 'window-prev-buffers'
when available and different than the value returned by
'winner-get-point' (bug#23621).
Robert Weiner [Tue, 25 Jun 2019 12:08:49 +0000 (14:08 +0200)]
Unlispify even more in custom-unlispify-menu-entry
* lisp/cus-edit.el (custom-unlispify-menu-entry): Also allow : and
/ as separators in symbols when making the symbols look more
human-readable (bug#23986).