Alan Mackenzie [Mon, 8 Jul 2019 09:24:29 +0000 (09:24 +0000)]
Fix bug #36474, such that CC Mode quotes work properly in electric-pair-mode
Also finishes the fix for bug #36423.
* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Add an `eval-after-load'
to set electric-pair-inhibit-predicate for existing CC Mode buffers when
elec-pair.elc gets loaded.
(c-basic-common-init): Set electric-pair-inhibit-predicate when a CC Mode mode
gets initialized.
(c-electric-pair-inhibit-predicate): New function.
Juri Linkov [Sun, 7 Jul 2019 22:35:35 +0000 (01:35 +0300)]
Handle scroll-error-top-bottom in follow.el and view.el (bug#21893)
* lisp/follow.el (follow-scroll-up-arg, follow-scroll-up-window):
Use scroll-up-command instead of scroll-up.
(follow-scroll-down-arg, follow-scroll-down-window):
Use scroll-down-command instead of scroll-down.
(follow-scroll-up, follow-scroll-down): Handle scroll-error-top-bottom.
* lisp/view.el (view-scroll-lines): Use scroll-down-command
instead of scroll-down and scroll-up-command instead of scroll-up.
(view-really-at-end): Handle scroll-error-top-bottom.
Paul Eggert [Sun, 7 Jul 2019 19:29:27 +0000 (12:29 -0700)]
Remove printmax_t etc.
printmax_t etc. were needed only for platforms that lacked
support for printing intmax_t. These platforms are now so
obsolete that they are no longer practical porting targets.
* src/image.c (gs_load): Fix unlikely buffer overrun
discovered while making these changes. It was introduced in
2011-07-17T00:34:43!eggert@cs.ucla.edu.
* src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
Remove. All uses replaced by their standard counterparts
intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
Describe the rx notation in the elisp manual (bug#36496)
The additions are excluded from the print version to avoid making it
thicker.
* doc/lispref/elisp.texi (Top): New menu entry.
* doc/lispref/searching.texi (Regular Expressions): New menu entry.
(Regexp Example): Add rx form of the example.
(Rx Notation, Rx Constructs, Rx Functions): New nodes.
* doc/lispref/control.texi (pcase Macro): Describe the rx pattern.
Paul Eggert [Sun, 7 Jul 2019 00:41:52 +0000 (17:41 -0700)]
Don’t ignore stderr failure when ADDRESS_SANITIZER
* src/emacs.c (close_output_streams): Move from here ...
* src/sysdep.c: ... to here, where it really belongs anyway.
When ADDRESS_SANITIZER, fflush stderr and check for ferror,
to catch stderr output errors even in this case.
Noam Postavsky [Sat, 28 Oct 2017 19:48:17 +0000 (15:48 -0400)]
Use buffer's name for help-mode bookmarks (Bug#24573)
* lisp/help-mode.el (help-bookmark-make-record): Replace buffer
objects with their names in help-args, otherwise the bookmark won't be
readable from the bookmark save file.
Wilson Snyder [Sat, 6 Jul 2019 17:27:13 +0000 (13:27 -0400)]
Backout replacing manually crafted hex regexes with [:xdigit:].
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number): Backout replacing manually crafted hex regexes with
[:xdigit:] (Bug#36167). This repairs Verilog-mode regressions;
Verilog-mode maintains back-compatibility with Emacsen before this syntax
was supported.
* doc/misc/gnus.texi (Foreign Groups): Update description of
gnus-read-ephemeral-emacs-bug-group for multiple bug
IDs (bug#11961).
* lisp/gnus/gnus-group.el (gnus-bug-group-download-format-alist):
Use HTTPS for Debian's bug tracker.
(gnus-group--read-bug-ids): New function for reading multiple bug
IDs in the minibuffer. Improves on previous brittle approach of
word-at-point -> read-string -> string-to-number by a) defaulting to
the more accurate bug-reference-bug-regexp or number-at-point
without using the intrusive INITIAL-INPUT argument, and b) not
attempting to parse bug IDs.
(gnus-read-ephemeral-bug-group): Use it. Extend docstring and
commentary. Fix handling of multiple bug IDs as either numbers or
strings. Hoist some string consing out of inner loop. Delete
temporary file even on error. Throw more informative error when
url-insert-file-contents successfully returns an error (bug#36433).
(gnus-read-ephemeral-debian-bug-group): Use gnus-group--read-bug-ids
and fix docstring for multiple bug IDs. Accept optional WINDOW-CONF
like other ephemeral bug group commands.
(gnus-read-ephemeral-emacs-bug-group): Use gnus-group--read-bug-ids
and fix string/numeric ID conversions. Try loading debbugs-gnu
before testing for debbugs-gnu-summary-mode (bug#36433).
Stefan Kangas [Sat, 6 Jul 2019 14:27:05 +0000 (16:27 +0200)]
Add tests for text-property-search to check prop-match-value
* test/lisp/emacs-lisp/text-property-search-tests.el
(with-match-test): New macro.
(text-property-search-forward-prop-match-match-face-nil-nil)
(text-property-search-forward-prop-match-match-face-bold-t)
(text-property-search-forward-prop-match-match-face-bold-nil)
(text-property-search-backward-prop-match-match-face-nil-nil)
(text-property-search-backward-prop-match-match-face-italic-t)
(text-property-search-backward-prop-match-match-face-italic-nil):
Add test cases to also verify the value of prop-match-value
(bug#36486).
* src/macfont.m (macfont_supports_charset_and_languages_p)
(macfont_has_char): Don't pass integers outside the Unicode codespace to
CFCharacterSetIsLongCharacterMember. Do not merge to master.
Juri Linkov [Thu, 4 Jul 2019 22:01:01 +0000 (01:01 +0300)]
* lisp/minibuffer.el (minibuffer-message-properties): New variable.
(minibuffer-message): Use it to propertize message unless already
propertized by the caller.
* lisp/simple.el (minibuffer-error-function): Propertize the error.
* lisp/isearch.el (isearch-message-properties): New variable.
(isearch--momentary-message, isearch-message-prefix)
(isearch-message-suffix): Use it. (Bug#21112)
Use a more precise test to determine whether the input to `regexp-opt'
is safe to optimise when KEEP-ORDER is non-nil, permitting more inputs
to be optimised than before. For example, ("good" "goal" "go") is now
accepted.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
More precise test for whether the list is safe w.r.t. KEEP-ORDER.
(regexp-opt--contains-prefix): Remove.
* test/lisp/emacs-lisp/regexp-opt-tests.el: Use lexical-binding.
(regexp-opt-test--permutation, regexp-opt-test--factorial)
(regexp-opt-test--permutations, regexp-opt-test--match-all)
(regexp-opt-test--check-perm, regexp-opt-test--explain-perm)
(regexp-opt-keep-order): Test KEEP-ORDER.
Alan Mackenzie [Thu, 4 Jul 2019 13:18:51 +0000 (13:18 +0000)]
Fix an infinite loop in c-end-of-macro. Should fix bug #36484
Also fix two faulty regexps, save-match-data, and check c-major-mode-is
'c++-mode where needed.
* lis/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re)
(c-last-open-c-comment-start-on-line-re): Handle repeated *s in regexp
correctly.
* lisp/progmodes/cc-engine.el (c-beginning-of-macro, c-end-of-macro): Protect
the match-data with save-match-data around regexp operations.
(c-end-of-macro): In the loop handling multiline block comments, check a
comment actually is multiline.
* lisp/progmodes/cc-mode.el (c-depropertize-CPP): Only call
c-depropertize-raw-strings-in-region in C++ Mode.
João Távora [Wed, 3 Jul 2019 23:34:26 +0000 (00:34 +0100)]
Fix Flymake's user-visible accessors of diagnostic positions
Diagnostics are supported by overlays, and they can legitimately move
around. So flymake-diagnostic-beg and flymake-diagnostic-end must
look up the overlay positions, not the immutable slots of the
flymake--diag structure, which become stale.
* lisp/progmodes/flymake.el (version): Bump to 1.0.8.
(flymake-diagnostic-beg, flymake-diagnostic-end): Use diag's
overlay.
(flymake-show-diagnostic): Use flymake-diagnostic-end,
flymake-diagnostic-beg.
Eric Abrahamsen [Wed, 3 Jul 2019 19:53:43 +0000 (12:53 -0700)]
Small fix to writing Gnus dribble change-level entries
* lisp/gnus/gnus-start.el (gnus-group-change-level): PREVIOUS needs to
still be a string when the dribble entry is written, so don't
convert it to an entry until after that's done. Also, we're not
meant to write PREVIOUS itself, we're meant to write the group that
comes _after_ it in the sort-order of gnus-group-list, so do that
instead.
Stefan Kangas [Sun, 30 Jun 2019 23:21:47 +0000 (01:21 +0200)]
Add tests for bookmark.el (Bug#36452)
* test/lisp/bookmark-resources/example.txt:
* test/lisp/bookmark-resources/test.bmk:
* test/lisp/bookmark-tests.el: New files.
* lisp/bookmark.el: Minor cleanups.
(bookmark-insert-annotation): Signal error on invalid bookmark.
(bookmark-write-file): Add newline at end of file.
Eli Zaretskii [Wed, 3 Jul 2019 07:31:48 +0000 (10:31 +0300)]
Fix rotation validity test in image.c
* src/image.c (compute_image_rotation): Fix the validity test
for :rotation values. This avoids logging error messages when
no :rotation was provided in the image spec.
Paul Eggert [Tue, 2 Jul 2019 23:09:46 +0000 (16:09 -0700)]
Replace TRACE with redisplay_trace, etc.
This simplifies callers and catches trace printf format errors
even with typical (non-debugging) compiles.
* src/dispextern.h (TRACE) [GLYPH_DEBUG]:
Move definitions to xdisp.c if it’s used only there.
* src/xdisp.c (redisplay_trace): New function, replacing TRACE macro.
(move_trace): New function, replacing TRACE_MOVE macro.
All uses changed.
(dump_glyph): When tracing, don’t use %d to format ptrdiff_t,
or %x to format a pointer.
(expose_frame): Redo trace printfs to avoid interleaved output
on GNU/Linux.
João Távora [Wed, 15 May 2019 12:10:22 +0000 (13:10 +0100)]
Correctly reindent previous line in electric-indent-mode
Fixes: bug#35254
Do this even when electric-indent-inhibit is t, except when the
newline insertion is being performed by electric-layout-mode.
* lisp/electric.el (electric-indent-post-self-insert-function):
Reindent previous line unless operating under
electric-layout-mode.
(electric-layout-post-self-insert-function-1): Bind
electric-indent-inhibit to 'electric-layout-mode.
* test/lisp/electric-tests.el
(electric-layout-control-reindentation): New test.
João Távora [Fri, 29 Mar 2019 12:27:11 +0000 (12:27 +0000)]
Protect Flymake from being corrupted by backends
A backend building a diagnostic with a nil :type would cause Flymake
to create a diagnostic without an overlay, confusing Flymake's
accounting of overlays and diagnostics
João Távora [Thu, 28 Mar 2019 18:04:35 +0000 (18:04 +0000)]
More carefully cleanup Flymake C/C++ backend's temp buffers
Sometimes the Flymake process dies by some means that doesn't involve
a sentinel call for the "exit" status, so we clean up the temporary
buffer as soon as we notice it's not process-alive-p anymore.
Alan Mackenzie [Tue, 2 Jul 2019 12:33:01 +0000 (12:33 +0000)]
CC Mode: Improve handling of unbalanced strings
* lisp/progmodes/cc-fonts.el (c-before-font-lock-functions): Add function
c-after-change-escape-NL-in-string into value for most languages.
* lisp/progmodes/cc-mode.el (c-after-change-escape-NL-in-string): New
function.
(c-before-change-check-unbalanced-strings): Handle the making and breaking of
escaped newlines, by removal or addition of text.
Paul Eggert [Tue, 2 Jul 2019 04:42:58 +0000 (21:42 -0700)]
Fix regex-emacs debug format glitches
These patches affect behavior only if REGEX_EMACS_DEBUG.
* src/regex-emacs.c (debug_putchar): Use unsigned for %x.
(print_compiled_pattern, ENSURE_FAIL_STACK, PUSH_FAILURE_POINT)
(POP_FAILURE_POINT): Use %td for ptrdiff_t.
(print_compiled_pattern, regex_compile, re_match_2_internal):
Put newlines at ends of lines, not at starts of next lines.
Omit white space at line ends.
Eli Zaretskii [Mon, 1 Jul 2019 14:54:15 +0000 (17:54 +0300)]
Adjust return value of image-transforms-p
* src/image.c (Fimage_transforms_p):
* doc/lispref/display.texi (Image Descriptors):
image-transforms-p now returns at most (scale rotate90), even
if ImageMagick is available.
Sam Steingold [Fri, 28 Jun 2019 21:22:55 +0000 (17:22 -0400)]
Extract gnus-collect-urls from gnus-summary-browse-url
* lisp/gnus/gnus-sum.el (gnus-collect-urls): Extract from ...
(gnus-summary-browse-url): Use it here.
Extracting URLs from an article will be useful in BBDB interaction.
* src/hbfont.c: Include hb-ot.h.
[HAVE_NTGUI]: Add DEF_DLL_FN and #define for hb_tag_to_string,
hb_font_get_face, hb_ot_layout_table_get_script_tags,
hb_ot_layout_table_get_feature_tags, hb_ot_layout_script_get_language_tags,
and hb_ot_layout_language_get_feature_tags.
(hbfont_init_w32_funcs) [HAVE_NTGUI]: Add LOAD_DLL_FN for them.
(hbfont_otf_features, hbfont_otf_capability): New functions.
Paul Eggert [Sun, 30 Jun 2019 15:08:02 +0000 (08:08 -0700)]
Remove divide_double
* src/image.c (divide_double): Remove. All uses replaced
with inline equivalents. Suggested by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2019-06/msg01067.html
Alan Mackenzie [Sun, 30 Jun 2019 15:02:13 +0000 (15:02 +0000)]
C++ Mode: change the default doc comment style from nothing to gtkdoc
Also amend a pertinent regular expression. This fixes bug #11865.
* lisp/progmodes/cc-vars.el (c-doc-comment-style): Insert an entry for
c++-mode, namely gtkdoc.
* lisp/progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Amend the regexp
recognizing the introductory "/**" to allow subsequent characters on that
line.
Michael Albinus [Sun, 30 Jun 2019 09:23:06 +0000 (11:23 +0200)]
Release Tramp 2.4.2
* lisp/net/tramp.el: Bump version.
* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Add `add-name-to-file' error message.
(tramp--test-ignore-add-name-to-file-error): Make error handler
more explicit about the error.