João Távora [Mon, 21 Sep 2020 14:52:49 +0000 (15:52 +0100)]
Shoosh byte-compiler in test/lisp/progmodes/elisp-mode-tests
* test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-generic-no-default)
(xref-elisp-generic-co-located-default)
(xref-elisp-generic-separate-default): Prefix local arguments with _.
João Távora [Sun, 20 Sep 2020 20:21:32 +0000 (21:21 +0100)]
Integrate shorthand functionality into elisp-mode.el
Also rename the main variable to elisp-shorthands, from the
silly pleonastic shorthand-shorthands.
For some reason, I had to stick the new source-file loading functions
in lisp/international/mule.el, otherwise lisp/loadup.el wouldn't see
them. This should probably be fixed.
João Távora [Sat, 19 Sep 2020 21:16:38 +0000 (22:16 +0100)]
Move most of the shorthand implementation to C code
This very likely isn't the final form of the implementation. For one,
the reader is much slower and allocates a Lisp string for every atom
read, regardless if its already interned or not, which perhaps has the
potential to be catastrophic in terms of GC.
But it passes the tests.
The solution to this, is probably to simplify the semantics of
shorthand-shorthands. Instead of making it a regexp-to-longhand
alist, make it just prefix-to-longhand. Then we wouldn't need to call
Fstring_match in oblookup_considering_shorthand, meaning we wouldn't
need a Lisp string there.
* lisp/shorthand.el (shorthand-shorthands): Move to C code.
(shorthand--expand-shorthand): Remove.
(shorthand-read-wrapper): Remove.
(shorthand-intern-soft-wrapper): Remove.
(read, intern-soft): No longer advise.
* src/lread.c:
(read1, Fintern, Fintern_soft, Funintern): Use
oblookup_considering_shorthand.
(oblookup_considering_shorthand): New helper.
(syms_of_lread): Declare shorthand-shorthands.
Stefan Kangas [Sat, 15 Aug 2020 00:53:35 +0000 (02:53 +0200)]
Add new option flyspell-correct-on-mouse-3
* lisp/textmodes/flyspell.el
(flyspell-correct-on-mouse-3): New option to bind
'flyspell-correct-word' to 'mouse-3'.
(flyspell--set-correct-on-mouse-3): New function to update option.
(flyspell-mode): Update 'flyspell-mouse-map' if above option is
set.
* doc/emacs/fixit.texi (Spelling): Mention the new option.
* etc/NEWS: Announce the new option.
Stefan Kangas [Sat, 15 Aug 2020 02:55:35 +0000 (04:55 +0200)]
Mark XEmacs compat alias as obsolete
* lisp/subr.el (user-original-login-name): Mark as obsolete. This
XEmacs compat alias was obsoleted even by XEmacs, so there is no point
in keeping it around.
Steven Allen [Sun, 16 Aug 2020 12:31:27 +0000 (14:31 +0200)]
Set the current buffer in esh-mode before running filter functions
* lisp/eshell/esh-mode.el: (eshell-output-filter): Match
current-buffer behavior of comint-output-filter (bug#42870).
This change (a) sets the current buffer to the process-buffer when
invoking preoutput filter functions and (b) only invokes them when the
process-buffer is live. Otherwise, the preoutput filter functions be
invoked in whatever buffer happens to be focused, breaking hooks that
read buffer-local variables.
Stefan Monnier [Sat, 15 Aug 2020 21:30:11 +0000 (17:30 -0400)]
* lisp/net/eudc-bob.el: Use lexical-binding; Misc simplifications
(eudc-bob-generic-keymap, eudc-bob-image-keymap)
(eudc-bob-sound-keymap, eudc-bob-url-keymap, eudc-bob-mail-keymap):
Move initialization into declaration. Use RET rather than `return`.
(eudc-jump-to-event): Delete; use `mouse-set-point` instead.
(eudc-bob-save-object): Rewrite using `write-region`.
(eudc-bob-popup-menu): Use `popup-menu`.
Paul Eggert [Sat, 15 Aug 2020 19:32:56 +0000 (12:32 -0700)]
Fix recently-introduced Fdelete bug
Problem reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2020-08/msg00444.html
* src/fns.c (Fdelete): Fix correctness bug via a simpler (though more
memory-intensive) approach. It’s probably not worth optimizing
the memory usage yere.
* test/src/fns-tests.el (test-vector-delete): Add test for the bug.
Paul Eggert [Sat, 15 Aug 2020 17:48:37 +0000 (10:48 -0700)]
Minimize ‘equal’ calls in (delete x vector)
* src/fns.c (Fdelete): When deleting from a vector, call Fequal
only once per vector element. This is faster when Fequal is slow,
and avoids the need to preinitialize the vector result. Finish
when the result is exhausted, not when the input is exhausted;
the two are equivalent but the former may be faster.
* test/src/fns-tests.el (test-vector-delete): New test.
Paul Eggert [Sat, 15 Aug 2020 17:48:36 +0000 (10:48 -0700)]
Prefer Fvector to make_uninit_vector
Fvector is less error-prone than make_uninit_vector, as it
avoids the possibility of a GC crash due to an uninitialized
vector. So prefer Fvector to make_uninit_vector when this is
easy (and when there's no significant performance difference).
Inspired by a suggestion by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html
* src/ccl.c (Fregister_ccl_program):
* src/ccl.c (Fregister_ccl_program):
* src/charset.c (Fdefine_charset_internal):
* src/font.c (Fquery_font, Ffont_info, syms_of_font):
* src/fontset.c (font_def_new, Fset_fontset_font):
* src/ftfont.c (ftfont_shape_by_flt):
* src/hbfont.c (hbfont_shape):
* src/macfont.m (macfont_shape):
* src/search.c (Fnewline_cache_check):
* src/xfaces.c (Fx_family_fonts):
* src/xfns.c (Fx_window_property_attributes):
Prefer Fvector to make_uninit_vector when either is easy.
* src/fontset.c (font_def_new): Now a function with one less
arg instead of a do-while macro, and renamed from FONT_DEF_NEW.
All uses changed.
Paul Eggert [Sat, 15 Aug 2020 17:48:36 +0000 (10:48 -0700)]
Fix GC bugs related to uninitialized vectors
Avoid problems if GC occurs while initializing a vector.
Problem with Fdelete reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html
I looked for similar problems elsewhere and found quite a few.
* src/coding.c (make_subsidiaries):
* src/composite.c (syms_of_composite):
* src/font.c (build_style_table, Ffont_get_glyphs):
* src/nsselect.m (clean_local_selection_data):
* src/nsxwidget.m (js_to_lisp):
* src/syntax.c (init_syntax_once):
* src/window.c (Fcurrent_window_configuration):
* src/xselect.c (selection_data_to_lisp_data)
(clean_local_selection_data):
Use make_nil_vector instead of make_uninit_vector.
* src/fns.c (Fdelete):
* src/xwidget.c (webkit_js_to_lisp):
Use allocate_nil_vector instead of allocate_vector.
* src/search.c (Fnewline_cache_check):
Use make_vector instead of make_uninit_vector.
* doc/misc/gnus.texi (Searching for Articles): Document moved M-s
(bug#39706).
* lisp/gnus/gnus-sum.el (gnus-summary-mode-map): Move
gnus-summary-search-article-forward to M-s M-s, and add M-s M-r
for gnus-summary-search-article-backward.
Eli Zaretskii [Sat, 15 Aug 2020 10:23:58 +0000 (13:23 +0300)]
Don't wrap lines at NBSP when nobreak-char-display is t
* src/xdisp.c (get_next_display_element): When
nobreak-char-display is t, display NBSP and non-ASCII hyphens as
themselves, not as their ASCII counterparts, just with the
nobreak-space/nobreak-hyphen face. (Bug#42811)
Jari Aalto [Sat, 15 Aug 2020 10:11:41 +0000 (12:11 +0200)]
Add support for ffap guessing at file names containing spaces
* lisp/ffap.el (ffap-file-name-with-spaces): New variable (bug#8439).
(ffap-search-backward-file-end, ffap-search-forward-file-end)
(ffap-dir-separator-near-point): New functions.
(ffap-string-at-point): Use the variable and the new functions to
guess at files containing strings.
Paul Eggert [Sat, 15 Aug 2020 02:29:14 +0000 (19:29 -0700)]
Pacify Apple clang 11 __builtin_assume
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2020-08/msg00300.html
* src/lisp.h (bool_vector_bitref, bool_vector_set):
Use eassert instead of eassume for bool_vector_size checks.
Amin Bandali [Sat, 15 Aug 2020 01:54:48 +0000 (21:54 -0400)]
Add `message' to erc-match.el highlight types
* lisp/erc/erc-match.el (erc-current-nick-highlight-type,
erc-pal-highlight-type, erc-fool-highlight-type,
erc-keyword-highlight-type, erc-dangerous-host-highlight-type): Add
`message' type for highlighting the entire message but not the
sender's nick.
(erc-match-message): Check for the new `message' highlight type and
propertize the message (not including the nick) accordingly.
* etc/NEWS: Announce the addition of the `message' highlight type.
Paul Eggert [Fri, 14 Aug 2020 21:33:21 +0000 (14:33 -0700)]
Fix bus error on Debian bullseye
Problem reported by Lars Ingebrigtsen, and problem diagnosis
and most of this patch by Pip Cet (Bug#42832).
* src/pdumper.c (dump_bitsets_init): Rename from dump_bitset_init.
All callers changed. Initialize two bitsets with a single malloc
call.
(struct pdumper_loaded_dump_private): New member last_mark_bits.
(pdumper_find_object_type_impl): Return PDUMPER_NO_OBJECT if
the last_mark_bits’ bit is clear.
(pdumper_set_marked_impl): Assert that the last_mark_bits’
bit is set.
(pdumper_clear_marks_impl): Save mark_bits into
last_mark_bits before clearing mark_bits. Co-authored-by: Pip Cet <pipcet@gmail.com>
Noam Postavsky [Fri, 14 Aug 2020 17:31:16 +0000 (19:31 +0200)]
Make configure say so if we have "--with-json" but no jansson support
* configure.ac (OPTION_DEFAULT_IFAVAILABLE): New macro. Use it to
define the --with-json option. Add with_json and HAVE_JSON to the
'MISSING' checks (bug#39953).
* doc/emacs/maintaining.texi (Project Buffer Commands): Update
project-kill-buffers-ignores that was renamed recently
(bug#41868) (in 2ab66c9f9be923350f123fdea05b5b3ce8283d8a).
Stefan Kangas [Fri, 14 Aug 2020 14:47:57 +0000 (16:47 +0200)]
Comment to postpone deletion of c-subword-mode
* lisp/progmodes/subword.el (c-subword-mode): Clarify that this
obsolete function alias should not be removed just yet. There is a
copy of this definition in cc-cmds.el, obsolete since 24.3, and it is
better to delete both at the same time.
* test/lisp/progmodes/cperl-mode-tests.el: Adjust for `perl-mode`.
(cperl-test-ppss): Rename from `cperl-test-face` and change return value.
(cperl-mode-test-bug-42168): Test the `syntax-ppss` state rather than
the font-lock faces, so it works for both `perl-mode` and `cperl-mode`.
Mauro Aranda [Fri, 14 Aug 2020 14:40:40 +0000 (16:40 +0200)]
Make sure we only act on edited widgets in Custom-save
* lisp/cus-edit.el (Custom-save): Only act on edited widgets in the
buffer. If we attempt to redraw all widgets, we confuse
custom-variable-modified-p, or we end up drawing State buttons for
all options, including the hidden ones (bug#42801).
Jonas Bernoulli [Fri, 14 Aug 2020 14:18:01 +0000 (16:18 +0200)]
Parse the whole buffer at once in compile.el
* lisp/progmodes/compile.el (compilation-next-single-property-change):
Parse whole buffer at once (bug#42806).
Also remove the comment that mentioned that it is an option to do it
in one go as we now actually start doing. As the existence of that
comment suggested, there is not really a reason to process the buffer
in small chunks. On the contrary, processing the output in arbitrary
units can result in certain constructs not being recognized because
they begin in one arbitrary chunk, while ending in another.
Dmitry Gutov [Fri, 14 Aug 2020 07:20:04 +0000 (10:20 +0300)]
Unbreak project-find-regexp in Emacs 26.3 (bug#42765)
* lisp/progmodes/project.el: Depend on xref. Bump the version.
* lisp/progmodes/xref.el: Remove 'project' from the list of
dependencies. Depending on Emacs 26.3 already ensures that some
version is available. Bump the version.
(xref--process-file-region): Move from project.el with a rename.
Update the sole caller.
(xref-backend-references): Make compatible with old project.el.
Update the docstring.
Ferdinand Pieper [Fri, 14 Aug 2020 14:15:08 +0000 (16:15 +0200)]
Fix flow filling for flowing multiple flowed lines
* lisp/mail/flow-fill.el (fill-flowed): Loop until all flowed lines
are collected.
* test/lisp/mail/flow-fill-tests.el
(fill-flow-tests-fill-flowed-decode): Also test for multiple
flowed lines (bug#42855).
Stefan Kangas [Fri, 14 Aug 2020 11:03:42 +0000 (13:03 +0200)]
Remove Emacs 22 compat code from semantic
* lisp/cedet/semantic/bovine/c.el (semantic-c-end-of-macro):
Make into obsolete function alias for 'c-end-of-macro'.
(semantic-lex-cpp-define, semantic-lex-c-macrobits):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-paren-or-list):
Adjust callers.
Stefan Kangas [Sat, 16 May 2020 12:16:24 +0000 (14:16 +0200)]
Remove many items obsolete since Emacs 23.1
Emacs 23.1 was five major releases and over a decade ago.
This list can be reviewed before to the next release, but for now
hopefully this motivates any needed external updates.
Ref: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02198.html
This patch breaks Info fontification, please revert it.
Here is what I said in the message sent later with another patch at
https://debbugs.gnu.org/14645#14
Using the text property `face' instead of `font-lock-face'
might break something, so a better patch below removes
the text properties `face info-index-match' from the Info buffer
Harald Jörg [Fri, 14 Aug 2020 08:01:30 +0000 (10:01 +0200)]
cperl-mode: Highlight '{$a++ / $b}' correctly
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres):
Recognize {$a++ / $b} correctly as division. (Bug#42168)
* test/lisp/progmodes/cperl-mode-tests.el: New file with test
verifying the fix.
Eli Zaretskii [Thu, 30 Jul 2020 13:56:36 +0000 (16:56 +0300)]
Fix face extension past EOL in overlay strings
* src/xdisp.c (face_at_pos): Pass ATTR_FILTER to
face_for_overlay_string.
* src/xfaces.c (face_for_overlay_string): Accept an additional
argument ATTR_INDEX and pass it to merge_face_ref for merging the
face at POS. This ensures a face from buffer text will not be
merged unless it specifies the :extend attribute. (Bug#42552)
* src/dispextern.h (face_for_overlay_string): Adjust prototype.
Juri Linkov [Thu, 13 Aug 2020 11:32:10 +0000 (13:32 +0200)]
Preserve the face foreground in Info-fontify-node
* lisp/info.el (Info-fontify-node): Preserve the face foreground.
Previously `Info-index' added the `info-index-match' face to the
strings of the found index entries. Later
`Info-virtual-index-find-node' inserts strings to the Info buffer.
And finally `Info-fontify-node' puts the `font-lock-face' property
with `info-xref' on links. The `face info-index-match' takes
precedence over `font-lock-face info-xref' (bug#14645).
Dima Kogan [Thu, 13 Aug 2020 10:20:53 +0000 (12:20 +0200)]
gcc-include compilation lines are now INFO, instead of WARNING
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Prior to this patch the
line that contains "from a.h:1:0," was seen as INFO and the line
that contains "from a.c:1:" was seen as a WARNING. This patch
makes them both INFO (bug#17826).
Ensure that server-socket-dir doesn't have "//" in the path
* lisp/server.el (server-socket-dir): Use expand-file-name to
avoid "//" in the path name (if either XDG_RUNTIME_DIR or TMPDIR
ends in a slash) (bug#18658).
Handle negative prefix arguments to mark-paragraph correctly
* textmodes/paragraph.el (mark-paragraph): Handle negative
arguments correctly (bug#18847). This makes `M- M-h M-h' do the
correct thing with expanding the region (like other marking
commands) backwards. Also fix problem at the end of the buffer,
where the numbers of paragraphs left in the buffer is less than
ARG, then paragraphs would also be marked *before* the current
paragraph. Also clarify the doc string.
Jonas Bernoulli [Sun, 9 Aug 2020 21:02:34 +0000 (23:02 +0200)]
Update section heading conventions for libraries
* doc/lispref/tips.texi (Comment Tips): Update information on section
headings to reflect common usage.
Previously the tips stated that if the code is split up into multiple
sections, then that should be done by splitting up the ";;; Code:"
section into multiple sub-sections.
However about half the libraries in Emacs instead use multiple
top-level sections. We update the tips (aka conventions) to allow
this common usage, but because it is awkward if there is a section
named "Code", which contains only some of the code instead of all of
it, we now recommend that that section should be empty in this case.
We cannot just give up on the "Code:" section/heading because that is
an old convention that is followed be nearly every library and because
it is likely that there are some utilities out there that depend on
its presence.
This was discussed in
https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00444.html
https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00001.html
Jonas Bernoulli [Wed, 15 Jul 2020 16:40:36 +0000 (18:40 +0200)]
* lisp/font-lock.el: No longer use headings as end of section markers.
Each section ends right before the following section begins and IMO
that means that it is unnecessary to mark the end of sections.
For users of `outline-minor-mode' the old end-of-section markers were
a distraction. They made it much harder to parse the overview outline
state because each section heading was followed by a end-of-section
marker that was formatted as a section heading. Because of this I
wanted to remove the end-of-section markers.
But as Eli pointed out these sections are long and not everyone uses
`outline-minor-mode'.
So instead of removing them, I am turning the end-of-section markers
into regular comments (beginning with just two semicolons) instead of
section headings (beginning with tree semicolons). That way users of
`outline-minor-mode' won't be distracted by them and others can still
benefit from the markers as before.
Jonas Bernoulli [Wed, 17 Jun 2020 00:59:41 +0000 (02:59 +0200)]
* lisp/font-lock.el: Split the Commentary into subsections.
The "Commentary" was already split into multiple sections, but
these sections where on the same level as "Commentary" itself,
which is less convenient for users of `outline-minor-mode'.
Jonas Bernoulli [Wed, 17 Jun 2020 01:00:12 +0000 (03:00 +0200)]
* lisp/net/imap.el: Use proper outline headings
This library already used section headings but it used just two
instead of three semicolons, making them indistinguishable from
plain comments. One heading is new.
Jonas Bernoulli [Fri, 8 May 2020 19:24:20 +0000 (21:24 +0200)]
* lisp/obsolete/longlines.el: Use proper outline headings.
This library already used section headings but it used just two
instead of three semicolons, making them indistinguishable from
plain comments. One heading is new.
These comments are unnecessary because the doc-strings that follow
already cover the same ground, while being more concise. These
comments were also prefixed with too many semicolons, causing them
to be treated as outline headings.
Jonas Bernoulli [Mon, 20 Apr 2020 21:30:41 +0000 (23:30 +0200)]
Merge two conditions and fix indentation
The motivation behind this change is that the indentation of some
lines was outright wrong. If we address that issue, then we might
as well also address the issue that some code is needlessly nested
an additional level. That we can fix by merging the conditions.
By doing these two changes in on commit we have to change the fewest
lines. Even though we are moving to using just spaces for indentation
of the modified lines, other lines in the same function are left alone
and continue to us tabs+spaces for indentation. That is not "wrong",
but just the style we are slowly migrating away from when touching
lines for other reasons.
Discussed in bug#42397.
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Merge two
conditions and fix indentation.
`concat' treats arguments that are nil as if they were empty strings.
We therefore do not have to write (if TEST THEN "") and can just use
(and TEST THEN).
Don't output emacsclient warning if both -a and --quiet
* lib-src/emacsclient.c (set_local_socket): Don't output the
warning if both -a and --quiet are specified (bug#16117).
Inspired by a patch from Scott Turner <srt19170@gmail.com>.
Paul Eggert [Wed, 12 Aug 2020 18:40:12 +0000 (11:40 -0700)]
Stop using Gnulib inttypes module
It wasn’t needed for MinGW after all, no other platform
seems to need it, and it slows down ‘configure’.
* admin/merge-gnulib (GNULIB_MODULES): Remove inttypes.
* m4/gnulib-comp.m4: Regenerate.
Paul Eggert [Wed, 12 Aug 2020 18:37:52 +0000 (11:37 -0700)]
Update from Gnulib
This incorporates:
2020-08-12 stdint: port intptr_t to more-recent MinGW
2020-08-11 Use __restrict also on clang
2020-08-11 Use flexible array syntax also on clang
2020-08-11 fcntl: On native Windows, use _setmode, not setmode
* lib/binary-io.h, lib/cdefs.h, lib/fcntl.c, lib/regex.h:
* lib/stdint.in.h: Copy from Gnulib.
Simplify the computation of mm-mime-mule-charset-alist
* lisp/gnus/mm-util.el (mm-mime-mule-charset-alist): For
compatibility with XEmacs, mm-mime-mule-charset-alist was first
set to a list of hard-coded entries, and then overwritten on Emacs
from `coding-system-list'. Remove the hard-coded values and
simplify the code.