F. Jason Park [Tue, 3 Oct 2023 07:00:19 +0000 (00:00 -0700)]
Deprecate option erc-remove-parsed-property
* etc/ERC-NEWS: Add entry for `erc-remove-parsed-property'.
* lisp/erc/erc.el (erc-remove-parsed-property): Deprecate option
because the potential for inadvertent self harm outweighs the
potential benefits. Additionally, replicating this functionality via
hooks is trivial.
(erc-display-line-1): Remove quasi-deprecated `tags' property because
the preferred format for `erc-response.tags' has changed, and ERC has
never supported IRCv3 tags.
F. Jason Park [Thu, 5 Oct 2023 03:39:03 +0000 (20:39 -0700)]
Use erc-display-message instead of erc-make-notice
* lisp/erc/erc-backend.el (erc-server-JOIN): Let `erc-display-message'
handle formatting instead of baking out a string. The text ultimately
inserted remains unchanged, but forwarding the original `format-spec'
arguments now has the side effect of influencing text properties, which
conveys richer meaning for modules to act upon when doing things like
deciding whether to hide a given message.
* lisp/erc/erc.el (erc-cmd-IGNORE, erc-cmd-UNIGNORE,
erc--unignore-user, erc-cmd-IDLE, erc-cmd-BANLIST, erc-cmd-MASSUNBAN):
Use `erc-display-message' with `notice' for the TYPE parameter instead
of composing `erc-make-notice' and `erc-display-line'.
F. Jason Park [Sat, 7 Oct 2023 00:34:04 +0000 (17:34 -0700)]
Sort and dedupe when loading modules in erc-open
* doc/misc/erc.texi: Add new subheading "Module Loading" under the
"Modules" chapter.
* lisp/erc/erc.el (erc--sort-modules): New utility function to sort
and dedupe modules.
(erc-modules): In `custom-set' function, factor out collation into
separate utility `erc--sort-modules'.
(erc-update-modules): Call `erc--update-modules' with an argument, the
current value of `erc-modules'.
(erc--aberrant-modules): New variable, a list of symbols whose modules
ERC suspects of being incorrectly defined.
(erc--warn-about-aberrant-modules): New function to print an error
message and emit a warning prior to connecting when
`erc--aberrant-modules' is non-nil.
(erc--find-mode): Make heuristic more robust by always checking for a
mode activation command rather than just a state variable. This fixes
a compatibility bug, new in 5.6, affecting third-party modules that
autoload module definitions instead of their corresponding
mode-activation commands.
(erc--update-modules): Add new positional argument `modules'.
(erc--setup-buffer-hook): Add new default member,
`erc--warn-about-aberrant-modules'.
(erc-open): Pass sorted `erc-modules' to `erc--update-modules'.
* test/lisp/erc/erc-tests.el (erc--sort-modules): New test.
(erc-tests--update-modules): New fixture.
(erc--update-modules): Remove and rework as three separate tests
dedicated to specific contexts. The existing one had poor coverage
and was difficult, if not impossible, to follow.
(erc--update-modules/unknown, erc--update-modules/local,
erc--update-modules/realistic): New tests. (Bug#57955)
F. Jason Park [Thu, 5 Oct 2023 07:16:46 +0000 (00:16 -0700)]
Honor nil values in erc--restore-initialize-priors
* lisp/erc/erc.el (erc--restore-initialize-priors): Don't produce
invalid "empty" `setq' form when parameter VARS contains defaults that
initialize to nil. This function is mainly used by local modules,
which were first made usable in ERC 5.5 (bug#57955).
* test/lisp/erc/erc-tests.el (erc--restore-initialize-priors): Fix
expected expansion, which is now slightly leaner. (Bug#60936)
F. Jason Park [Wed, 11 Oct 2023 01:14:53 +0000 (18:14 -0700)]
Skip post-minibuffer restore in erc-scrolltobottom-all
* etc/ERC-NEWS: Remove mention of `erc-scrolltobottom-relaxed' in
entry for module `scrolltobottom'.
* lisp/erc/erc-goodies.el (erc-input-line-position): Fix mention of
abandoned option `erc-scrolltobottom-relaxed'.
(erc-scrolltobottom-all): Subsume option `erc-scrolltobottom-relaxed'
by recognizing a third value state, `relaxed'. A separate option
would make more sense if other options also depended on
`erc-scrolltobottom-all'.
(erc-scrolltobottom-relaxed): Remove redundant option, which was to be
new in ERC 5.6.
(erc-scrolltobottom-enable, erc-scrolltobottom-mode): Warn if user
attempts to enable `erc-scrolltobottom-all' on Emacs 27, which is not
supported.
(erc--scrolltobottom-relaxed-commands,
erc--scrolltobottom-post-force-commands,
erc--scrolltobottom-relaxed-skip-commands): Remove unused variables.
(erc--scrolltobottom-on-pre-command,
erc--scrolltobottom-on-pre-command-relaxed,
erc--scrolltobottom-on-post-command-relaxed): Remove unused functions.
(erc--scrolltobottom-on-post-command): Remove conditional branch for
dealing with a non-nil `erc--scrolltobottom-window-info'.
(erc--scrolltobottom-setup): Convert from generic to normal function
and remove setup and teardown for unused hooks. Set variable
`read-minibuffer-restore-windows' locally when option
`erc-scrolltobottom-all' is non-nil.
(erc--scrolltobottom-on-pre-insert): Replace reference to subsumed
option `erc-scrolltobottom-relaxed' with new value `relaxed' for
existing option `erc-scrolltobottom-all'.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el
(erc-scenarios-scrolltobottom--relaxed): Replace option
`erc-scrolltobottom-relaxed' with new value `relaxed' for
`erc-scrolltobottom-all'. (Bug#64855)
Po Lu [Fri, 13 Oct 2023 03:57:46 +0000 (11:57 +0800)]
Try harder to generate tombstones upon emacs_abort
* src/android.c (HAS_BUILTIN_TRAP): New macro definition.
(emacs_abort) [HAS_BUILTIN_TRAP]: Call __builtin_trap to abort,
in place of dereferencing NULL.
* src/androidterm.c (android_draw_fringe_bitmap): Correct
comment transplanted from X code.
Po Lu [Thu, 12 Oct 2023 13:46:54 +0000 (21:46 +0800)]
Enable highlighting Gud execution lines without hl-line-mode
* doc/emacs/building.texi (Debugger Operation): Mention two new
options and the relationship between Gud and HL Line Mode.
* etc/NEWS (Editing Changes in Emacs 30.1): Mention the new
option.
* lisp/progmodes/gud.el (gud-highlight-current-line-overlay):
New variable.
(gud-sentinel) <signal, exit>: Delete that overlay if set.
(gud-highlight-current-line, gud-highlight-current-line-face):
New user options.
(gud-display-line): Create and move an overlay without employing
hl-line-mode, if so enjoined by the user.
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Use `skip-when'.
(file-notify-test12-unmount, file-notify-test12-unmount-remote):
New tests.
Po Lu [Thu, 12 Oct 2023 00:43:56 +0000 (08:43 +0800)]
Respond to JNI errors around drawing operations
* src/android.c (android_fill_polygon, android_draw_rectangle)
(android_draw_point, android_draw_line, android_lock_bitmap):
Check or clear errors around potential JNI errors; the penalty
incurred to performance is not as significant as was expected.
Alan Mackenzie [Wed, 11 Oct 2023 13:26:01 +0000 (13:26 +0000)]
In cl-prin1, enable raw printing for a byte-compiled function
* lisp/emacs-lisp/cl-print.el (cl-print-compiled): document the
new option `raw'.
(cl-print-object/compiled-function): when cl-print-compiled is
`raw', just print the function using `prin1'. Apply a button
to this output which, when activated disassembles the function.
* etc/NEWS (cl-print): Add an entry for this new feature.
These were there to work around deficiencies in how Eshell produces
completions for 'pcomplete-argument' (Eshell passed various non-string
objects to Pcomplete, which broke things). Now, Eshell always returns
a stringified form of the argument, with the original value stored via
the text property 'pcomplete-arg-value'.
* lisp/pcomplete.el (pcomplete-arg): Revert changes back to a simpler
form.
Ulrich Müller [Tue, 10 Oct 2023 09:58:03 +0000 (11:58 +0200)]
Update astronomical length units in Calc
* lisp/calc/calc-units.el (math-standard-units): Update the
astronomical unit and the parsec, using their definitions by the
International Astronomical Union.
* lisp/progmodes/project.el (project-mode-line): New user option.
(project-menu-entry, project-mode-line-map): New variables.
(project-mode-line-format): New variable.
(project-mode-line-format): New function.
Juri Linkov [Mon, 9 Oct 2023 18:03:03 +0000 (21:03 +0300)]
* lisp/progmodes/xref.el: Show the number of matches on mode-line (bug#66332)
(xref-num-matches-found, xref-num-matches-face, xref-mode-line-matches):
New variables.
(xref--show-xref-buffer): Set xref-num-matches-found to the length of xrefs,
and buffer-local mode-line-process to xref-mode-line-matches.
Harald Jörg [Mon, 9 Oct 2023 15:49:15 +0000 (17:49 +0200)]
; cperl-mode.el: Don't override fontificaton in comments.
* lisp/progmodes/cperl-mode.el (cperl-init-faces): Reorder the
matchers for fontification of array and hash elements and keys so
that they don't override comment and string fontification (Bug#66145).
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-66145):
New test for all combinations of sigils and brackets/braces to
verify that strings and comments are left untouched. This test
also works for perl-mode which has always done it correctly.
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-66145.pl: New
resource file for the above test.
Don't allow Services entries in pop-up menus on macOS (bug#66420)
* src/nsmenu.m ([EmacsMenu runMenuAt:forFrame:keymaps:]):
Prevent the system from adding context menu plug-ins
(Services entries or sub-menu) to all our pop-up menus.
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): If a file
matches the ignored packages in :ignored-files, do not install any
dependencies it lists.
Eli Zaretskii [Sun, 8 Oct 2023 08:29:29 +0000 (11:29 +0300)]
; Improve documentation of VC commands
* doc/emacs/maintaining.texi (Basic VC Editing)
(VC With A Merging VCS, VC With A Locking VCS, Advanced C-x v v)
(Registering, Pulling / Pushing, Merging): Improve wording,
accuracy, and indexing.
Po Lu [Sun, 8 Oct 2023 01:13:11 +0000 (09:13 +0800)]
Introduce a tool bar for dictionary mode
* lisp/doc-view.el (doc-view-minor-mode-menu): Correct typo in
edit mode menu.
* lisp/net/dictionary.el (dictionary-mode-menu): New menu.
(dictionary-tool-bar-map): New variable; derive menu bar entries
from the dictionary-mode-menu.
(dictionary-mode): Set the tool bar map to
dictionary-tool-bar-map.
Stefan Kangas [Sat, 7 Oct 2023 16:29:07 +0000 (18:29 +0200)]
Recommend `M-x man` in woman.el docs
* lisp/woman.el (Commentary, woman): Recommend using 'M-x man' where
available. The added sentence is copied from the emacs manual.
Ref: https://lists.gnu.org/r/emacs-devel/2023-10/msg00090.html
Eli Zaretskii [Sat, 7 Oct 2023 07:48:00 +0000 (03:48 -0400)]
Merge from origin/emacs-29
a74e51cfd15 Fix a defcustom :type c27b90d04bf Fix 'ido--ffap-find-file' 1594d5f17ad Fix setting the pipe capacity for subprocesses aad8b5d78f3 Handle LANG on macOS differently (bug#65908)
Eli Zaretskii [Sat, 7 Oct 2023 06:46:04 +0000 (09:46 +0300)]
Fix 'ido--ffap-find-file'
* lisp/ido.el (ido--ffap-find-file): Make the signature consistent
with that of 'find-file', and pass the optional second argument to
'find-file'. (Bug#66382)
Eli Zaretskii [Fri, 6 Oct 2023 05:31:59 +0000 (08:31 +0300)]
Fix setting the pipe capacity for subprocesses
* src/process.c (create_process) [F_SETPIPE_SZ]: Set the pipe
capacity only if the required read-process-max is larger than the
default capacity of the pipe. (Bug#66288)
Gerd Möllmann [Thu, 5 Oct 2023 18:41:54 +0000 (20:41 +0200)]
Handle LANG on macOS differently (bug#65908)
* src/nsterm.m (ns_init_locale): If LANG is set, try to use that,
otherwise try to deduce what LANG should be. Check is the result is
valid, and use LANG="en_US.UTF-8" if not.
Silence macro expansion during completion at point
* lisp/emacs-lisp/macroexp.el (macroexp-inhibit-compiler-macros): Add
variable.
(macroexp--compiler-macro): Inspect that new variable and, if it is
non-nil, return the input form unchanged.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages. Avoid compiler macros. (Bug#58148)
It keeps interfering with other rules, slowing everything down a
little bit and makes it harder to add or change other rules. The rule
is still there and can easily be re-enabled by those who need it.
* etc/NEWS: Announce.
* lisp/progmodes/compile.el (compilation-error-regexp-alist):
Exclude `omake`.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
Actually test the `cucumber` rule. Remove the `omake` test case.
(compile-test-error-regexps):
Test `omake` here. Test other rules without `omake` included.
Spencer Baugh [Wed, 28 Jun 2023 12:48:01 +0000 (08:48 -0400)]
Make newly-created smerge-diff-buffers read-only
Buffers name *vc-diff* are usually created by vc, which makes them
read-only. If we create such a buffer, let's make it read-only too.
If the buffer already exists, though, don't change that since the user
might have deliberately made it writable.
* lisp/vc/smerge-mode.el (smerge-diff): Make newly-created
smerge-diff-buffers read-only. (bug#64071)
* src/androidgui.h (enum android_ime_operation): New operation
ANDROID_IME_REPLACE_TEXT.
* src/androidterm.c (android_handle_ime_event): Decode text when
encountering an ANDROID_IME_REPLACE_TEXT operation. Return if
decoding overflowed rather than presenting Qnil to textconv
functions.
(replaceText): New JNI function.
* src/frame.h (enum text_conversion_operation): New operation
TEXTCONV_REPLACE_TEXT.
* src/textconv.c (really_commit_text): Move point to start if
the composing region is set.
(really_replace_text): New function.
(handle_pending_conversion_events_1) <TEXTCONV_REPLACE_TEXT>:
New case.
(replace_text): New function.
Po Lu [Wed, 4 Oct 2023 08:33:05 +0000 (16:33 +0800)]
Correct local reference leaks
* src/android.c (android_build_string): Accept a list of local
references to destroy upon an allocation failure, facilitating
the proper deallocation of local references in such situations.
(android_browse_url): Revise for new calling convention.
* src/androidmenu.c (android_menu_show, android_dialog_show):
Revise for new calling convention.
* src/androidselect.c (android_notifications_notify_1): Supply
each successive local reference to android_build_string as
notification text is being encoded.
Alan Mackenzie [Tue, 3 Oct 2023 10:22:26 +0000 (10:22 +0000)]
Correct the `cond' forms in cl-print-string-with-limit
In this function, calling with limit bound to t will cause an
error in any of the cond forms which set print-length, etc.
Correct them!
* lisp/emacs-lisp/cl-print.el (cl-print-string-with-limit):
Amend the doc string. In the cond forms in the bindings for
print-length, etc., test the value t first. Amend those for
print-length and print-level also to test for a zero value of
limit.