* doc/lispref/modes.texi (Search-based Fontification):
Remove paragraph that has been unnecessary and confusing ever since
regexp-opt stopped using capturing brackets more than 21 years ago.
Pip Cet [Tue, 2 Mar 2021 20:38:23 +0000 (20:38 +0000)]
Prepare pdumper dump file in memory, write it in one go (Bug#46881)
* src/pdumper.c (struct dump_context): Add buf, buf_size, max_offset fields.
(dump_grow_buffer): New function.
(dump_write): Use memcpy, not an actual emacs_write.
(dump_seek): Keep track of maximum seen offset. Don't actually seek.
(Fdump_emacs_portable): Write out the file contents when done.
* lisp/help-mode.el (help-mode-map): Add 'i' and 's'.
(help-mode--current-data): New variable.
(help-mode): Make it local.
(help-view-source, help-goto-info): New commands.
Jared Finder [Tue, 15 Jun 2021 13:54:08 +0000 (15:54 +0200)]
Fix dragging dividers in terminal Emacs when there's margins
* lisp/mouse.el (mouse-drag-line): Do the right thing in the
presence of margins (bug#41156).
(mouse-drag-line): Bind left-margin/right-margin in the map, too.
Fix false positives in docstring width warning with (fn...) constructs.
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Don't consider the function signature when determining whether the
doc string is too wide (bug#49007). (The signature is folded
later when displaying help.)
Stephen Gildea [Tue, 15 Jun 2021 06:16:37 +0000 (23:16 -0700)]
mh-junk need not support SpamAssassin 2.20 from 2003
* lisp/mh-e/mh-junk.el (mh-spamassassin-*list): Remove support
for SpamAssassin 2.20. (SpamAssassin 3.0 was released in 2004.)
This change updates both the flags for sa-learn and the comments
about how the current version works.
This change reverts part of a change made in 2003 that added
support for what was even then an "old version of spamassassin."
* lisp/calendar/iso8601.el (iso8601-parse-time): Get fractional
times (with leading zeroes in the fraction part) right (bug#49017).
Fix based on a patch by "J.P." <jp@neverwas.me>.
Andrea Corallo [Mon, 14 Jun 2021 12:37:14 +0000 (14:37 +0200)]
* Do not produce .elc temporary file when unnecessary (bug#48978)
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Produce .elc
temporary files only when non native compiling or when native
compiling but `byte+native-compile' is non nil.
* lisp/net/tramp.el (tramp-allow-unsafe-temporary-files): New defcustom.
(tramp-handle-find-backup-file-name)
(tramp-handle-make-auto-save-file-name): Don't expose sensible
auto-save or backup files on local temporary directory. (Bug#45245)
* test/lisp/net/tramp-tests.el (tramp--test-always): New defalias.
(tramp-test10-write-region, tramp-test21-file-links)
(tramp--test--deftest-direct-async-process): Use it.
(tramp-test37-make-auto-save-file-name)
(tramp-test38-find-backup-file-name): Extend tests.
pillule [Mon, 14 Jun 2021 07:59:11 +0000 (09:59 +0200)]
Improve handling of dedicated flag for side windows (Bug#48493)
* doc/lispref/windows.texi (Buffers and Windows): Mention the
special handling of side windows and add a reference.
(Buffer Display Action Alists): Say explicitly that
`display-buffer-in-side-window' is dedicating to side by default.
(Dedicated Windows): Add case (4) and explain its meaning, add
a reference.
(Displaying Buffers in Side Windows): Move the paragraph about
`switch-to-(prev|next)-buffer' into a new item to emphasize the
special meaning of dedication for side windows.
* lisp/window.el (set-window-buffer-start-and-point): Restore
side dedication.
(switch-to-prev-buffer, switch-to-next-buffer): Correct return
value that should be nil instead of the same buffer in case of
no change.
(delete-windows-on): Restore side dedication.
(replace-buffer-in-windows): Update the docstring, restore side
dedication.
(quit-restore-window): Rearrange the logic so that strongly
dedicated windows are eventually deleted first. Restore the
side dedication. In the final case try to
`switch-to-prev-buffer' before deleting a window (Bug#48367).
* src/fileio.c (Fsubstitute_in_file_name): Mention that undefined
variables aren't replaced (as opposed to what happens in a shell
substitution) (bug#40949).
Allow save-interprogram-paste-before-kill to be a number
* doc/emacs/killing.texi (Clipboard): Document it.
* lisp/simple.el (save-interprogram-paste-before-kill): Extend
range (bug#41168).
(kill-new): Implement it (bug#41168).
Stefan Monnier [Sat, 12 Jun 2021 20:22:03 +0000 (16:22 -0400)]
EIEIO: Promote the CLOS behavior over the EIEIO-specific behavior
Change docs to advertize `slot-value` rather than `oref`.
Change the implementation of `:initform` to better match the CLOS semantics,
while preserving the EIEIO semantics, but warn when encountering cases
where the two diverge.
Demote the mostly unused special semantics of `oref-default`
on non-class allocated slots.
* doc/misc/eieio.texi (Quick Start): Use `slot-value`.
(Accessing Slots): Move `slot-value` before `oref`.
Fix paren-typo in example (reported by pillule <pillule@riseup.net>).
(Introspection): Remove mention of `class-slot-initarg`.
* lisp/transient.el (transient--parse-group, transient--parse-suffix):
Don't use `oref-default` to get the default value.
(transient-lisp-variable): Init forms are evaluated.
* lisp/emacs-lisp/eieio.el (defclass): Warn about inapplicable
`:initarg` and about uses of init forms that are ambiguous.
(oref): Don't advertize the deprecated use of initargs as slot names.
(oref-default): Don't advertize the deprecated case where it returns the
initform's value.
(initialize-instance): Use `macroexp-const-p`.
* lisp/emacs-lisp/eieio-core.el (eieio--unbound): Rename from
`eieio-unbound`.
(eieio--unbound-form): New var.
(eieio--slot-override): Use it.
(eieio-defclass-internal): Use it. Change `init` so it should always
be evaluated.
(eieio--known-class-slot-names): New var.
(eieio--eval-default-p): Rename from `eieio-eval-default-p`.
(eieio--perform-slot-validation-for-default): Use `macroexp-const-p` to
decide whether to skip the test.
(eieio--add-new-slot): Register slot in `eieio--known-class-slot-names`
when applicable.
(eieio-oref-default, eieio-oset-default): Add warning for unknown slots
and slots not known to be allocated to the class.
(eieio-default-eval-maybe): Delete function. Use just `eval` instead.
(eieio-declare-slots): Allow slots to specify their allocation class.
* lisp/cedet/srecode/insert.el (point): Declare the slot instead of
moving the class definition before the slot's first use.
(srecode-template-inserter-point, srecode-insert-fcn):
Use nil instead of unbound for the `point` slot.
* lisp/cedet/srecode/compile.el (srecode-template-inserter):
Declare the `key` slot that all children should have.
Matt Beshara [Sun, 6 Jun 2021 03:06:47 +0000 (13:06 +1000)]
Add ability to bring only the selected frame to the front (bug#48865)
Causes ‘ns-hide-emacs’ to layer the selected frame in front of every other
application’s windows, and give that frame keyboard focus, when called with
'activate-front.
* src/nsfns.m (Fns_hide_emacs): Allow activating only selected frame.
Dmitry Gutov [Fri, 11 Jun 2021 01:39:34 +0000 (04:39 +0300)]
Simplify vc-git-log-switches's usage; change default value to nil
* lisp/vc/vc-git.el (vc-git-log-switches):
Do not mention or allow the value 't' anymore
(https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00452.html).
(vc-git-print-log): Use 'vc-git-log-switches' directly.
Eli Zaretskii [Thu, 10 Jun 2021 13:55:04 +0000 (16:55 +0300)]
Support mercury in 'ctags' as well
The previous lack of support was due to incorrect calls to 'make_tag'
in 'mercury_pr', which caused 'pfnote' to refrain from adding Mercury
tags to the list of recorded tags.
* lib-src/etags.c (mercury_pr): Pass the correct NAME and NAMELEN
arguments to 'make_tag'.
* test/manual/etags/CTAGS.good: Adjust to the above change.
Eli Zaretskii [Thu, 10 Jun 2021 12:06:10 +0000 (15:06 +0300)]
Improve documentation of 'M-y'
* doc/emacs/killing.texi (Yanking): Mention that TTY frames can
also support yanking from the clipboard.
(Earlier Kills): Finalize the documentation of the new behavior
of the lone 'M-y'. (Bug#48478)
Martin Rudalics [Thu, 10 Jun 2021 07:14:21 +0000 (09:14 +0200)]
Provide new option `delete-window-set-selected' (Bug#47300)
When `delete-window' deletes its frame's selected window, this new
option allows to choose another window as replacement.
* lisp/window.el (get-lru-window, get-mru-window)
(get-largest-window): New optional argument NO-OTHER.
(window-at-pos): New function.
(delete-window-set-selected): New option.
(delete-window): Handle `delete-window-set-selected'.
* src/window.c (Fdelete_window_internal): Set the selected
window of WINDOW's frame to the first window on that frame and
let `delete-window' choose a more suitable window instead.
* doc/lispref/windows.texi (Deleting Windows): Describe new
option `delete-window-set-selected'.
(Cyclic Window Ordering): Describe new NO-OTHER argument for
`get-lru-window', `get-mru-window' and `get-largest-window'.
* etc/NEWS: Mention `delete-window-set-selected' and the NO-OTHER
argument.
Alan Third [Tue, 8 Jun 2021 19:08:34 +0000 (20:08 +0100)]
Fix image filename encoding issues (bug#48902)
* src/image.c (image_find_image_fd): Don't return an encoded filename
string.
* src/nsfns.m: ([NSString stringWithLispString:]): Clarify usage
comment.
* src/nsimage.m ([EmacsImage allocInitFromFile:]): No need to encode
the filename when converting to NSString.
Harald Jörg [Tue, 8 Jun 2021 21:23:25 +0000 (23:23 +0200)]
; perl-mode.el: Detect regexes immediately after "|&"
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Add "|&" to the list of characters after which a slash starts a
regular expression (Bug#23992).
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-ppss):
Correct the docstring.
(cperl-test-bug-23992): New test for Bug#23992.
(cperl-test-bug-42168): Adapt inline comments to the current code.
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl:
Resource file with example code from the bug report.
Juri Linkov [Tue, 8 Jun 2021 16:51:51 +0000 (19:51 +0300)]
Sync overlay code in minibuffer-message and set-minibuffer-message (bug#48669)
* lisp/minibuffer.el (minibuffer-message): Copy more overlay positioning code
from set-minibuffer-message.
(minibuffer--message-overlay-pos): Mention both minibuffer-message and
set-minibuffer-message in the docstring.
(set-minibuffer-message): Use 'cursor t' instead of 1.
Stephen Gildea [Tue, 8 Jun 2021 04:47:24 +0000 (21:47 -0700)]
MH-E: do not look for MH variants in relative directories
* lisp/mh-e/mh-e.el (mh-variants): Do not examine relative directories
in exec-path (e.g., "."); these won't have MH installed. Also,
file-chase-links is not robust with relative names: you cannot pass it
a relative name that is a symlink.
* test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-relative-to-project-root):
Make tests more strict again.
Eli Zaretskii [Sun, 6 Jun 2021 12:29:18 +0000 (15:29 +0300)]
Fix a problem with restarting 'tags-search'
* lisp/progmodes/etags.el (tags-search, tags-query-replace): Link
to 'fileloop-continue' instead of 'tags-loop-continue', for
continuing TAGS-based search/replace commands.
* lisp/fileloop.el (fileloop-continue): Reset
'switch-to-buffer-preserve-window-point' to nil when switching to
another buffer, so as to make sure a new search always restarts
from point-min in each buffer it searches. (Bug#48628)
Fabrice Nicol [Tue, 1 Jun 2021 02:15:59 +0000 (04:15 +0200)]
Add support for Mercury (https://mercurylang.org) in 'etags'
Tag declarations starting lines with ':-'.
By default, all declarations are tagged. Optionally, first
predicate or functions in clauses can be tagged as in Prolog
support using '--declarations'. (Bug#47408).
* lib-src/etags.c (test_objc_is_mercury, Mercury_functions)
(mercury_skip_comment, mercury_decl, mercury_pr):
Implement Mercury support. As Mercury and Objective-C have
the same file extension .m, a heuristic test tries to detect
the language.
* doc/man/etags.1: Document the change. Add Mercury-specific
behavior for '--declarations'. This option tags first
predicates or functions in clauses in addition to declarations.
Paul W. Rankin [Sat, 8 May 2021 09:09:59 +0000 (19:09 +1000)]
src/nsterm.m: fix window tabbing on macOS
* src/nsterm.m: remove NSWindowTabbingModeDisallowed to respect
system-wide preferences
* etc/NEWS: add mention of native tab support in macOS and where
to specify system-wide setting
Alex Bochannek [Sat, 5 Jun 2021 20:29:09 +0000 (22:29 +0200)]
Fix Gnus summary exclusion when everything matches
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-recipient):
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-subject):
(gnus-summary-limit-to-address, gnus-summary-limit-to-extra):
Don't claim that there aren't any matches when everything matches
an exclusion (bug#48834).
for the details.
* src/keyboard.c (read_decoded_event_from_main_queue): For
raw-text encoed input, if Meta bit is encoded, apply the Meta
modifier to single-byte characters that have the 0x80 bit set.
For input encoded otherwise, if the Meta bit is encoded, remove
the 0x80 bit after decoding the characters.
(tty_read_avail_input): Reset the 0x80 bit only if Meta bit is not
encoded.
(Fset_input_meta_mode): Support 'encoded' as the value of META.
(Fset_input_mode): Document 'encoded' for META.
(Fcurrent_input_mode): Support and document 'encoded' as the value
of META.
(syms_of_keyboard): DEFSYM 'encoded'.
Eli Zaretskii [Sat, 5 Jun 2021 11:16:06 +0000 (14:16 +0300)]
Fix slow operation of 'string-width'
* src/composite.c (find_automatic_composition): Accept one
additional argument BACKLIM; don't look back in buffer or string
farther than that. Add an assertion for BACKLIM.
(composition_adjust_point, Ffind_composition_internal): Callers
adjusted.
* src/composite.h (find_automatic_composition): Adjust prototype.
* src/character.c (lisp_string_width): Call
'find_automatic_composition' with the value of BACKLIM equal to POS,
to avoid costly and unnecessary search back in the string, since
those previous characters were already checked for automatic
compositions. (Bug#48734) (Bug#48839)
Dmitry Gutov [Sat, 5 Jun 2021 00:56:33 +0000 (03:56 +0300)]
Make icomplete less blinky and more responsive
* lisp/icomplete.el (icomplete-pre-command-hook, icomplete-tidy):
Remove, update the callers
(https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00111.html).
(icomplete-compute-delay): Change the default to 150ms.
(icomplete-max-delay-chars): Change the default to 2.
Tassilo Horn [Fri, 4 Jun 2021 19:58:11 +0000 (21:58 +0200)]
Ask if dir and subdir dired buffers be killed when deleting dir
Previously, when you've had dired buffers
~/foo/
~/foo/bar/
~/foo/bar/baz/
and then deleted ~/foo/, dired (with dired-clean-up-buffers-too set to
non-nil) would only ask to delete the dired buffer of ~/foo/. Now it
will offer to delete all three buffers.
* lisp/dired.el (dired-buffers-for-dir): Add optional argument SUBDIRS
which makes the function return also dired buffers showing a subdir of
DIR.
(dired-in-this-tree-p): Make obsolete in favor of file-in-directory-p
which actually does what the name suggest whereas dired-in-this-tree-p
is just string-matching on filenames which will fail with symlinks
filenames including ./ or ../.
Stephen Berman [Fri, 4 Jun 2021 10:01:41 +0000 (12:01 +0200)]
Fix placement of point in Dired deletion operations
* lisp/dired.el (dired-do-flagged-delete, dired-do-delete): Use
point-marker instead of point to record each file name position.
Clean up the markers before returning.
(dired-internal-do-deletions): Move to the file name marker, and
then move point to the file name to visually emphasize which file
is being operated on (bug#48805).