Po Lu [Mon, 29 May 2023 09:46:19 +0000 (17:46 +0800)]
Work around more problems with Bitmaps
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function `blitRect'.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
Use it on Android 8.x.
* src/android.c (blitRect): Implement new function.
Laurence Warne [Sun, 21 May 2023 17:59:43 +0000 (18:59 +0100)]
Fix unstable proced test
Fix unstable proced test by omitting the revert parameter in
'proced-update'. This was caused by the process being refined on
exiting between the initial 'proced' call and the successive
'proced-update' call. This resulted in proced skipping the refinement
in 'proced-update', causing all processes to be shown again and the
test to fail.
* test/lisp/proced-tests.el (proced-refine-with-update-test): Do not
use revert parameter when calling 'proced-update'.
Alan Mackenzie [Fri, 26 May 2023 14:32:07 +0000 (14:32 +0000)]
Fontify Java constructor names and arglists
This fixes bug#63328.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New
variable got-stmt-block. After scanning an arglist, set
got-arglist to t. When we have as yet no identifier,
got-arglist, and scan an open brace, test the "type" for being
the name of the enclosing class.
(c-directly-in-class-called-p): Test the two names for
equality, not merely one being the head of the other.
Support setting PAGER=cat in comint.el (bug#62958)
Paging can be undesirable in comint-derived commands such as
async-shell-command and M-x shell. It is a frequent footgun for new
Emacs users when they try to run commands which start a pager in such
modes.
Simply adding (setenv "PAGER" "cat") globally is not correct, since
that will break modes like term, which support paging quite well.
It's only and exactly the comint-derived modes which don't need
paging.
* lisp/comint.el (comint-pager): Add. (bug#62958)
(comint-exec-1): Use comint-pager to set PAGER.
Eli Zaretskii [Fri, 26 May 2023 11:04:03 +0000 (07:04 -0400)]
Merge from origin/emacs-29
aa5158630e7 Use 'font-lock-extend-region-functions' in python-mode b7b82ecb2b4 Fix python-info-docstring-p f42de74ebea ; * src/lread.c (read0, skip_lazy_string): Fix commentary... b6b384023a9 Fix cancellation of Wdired 916c2a19bde Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... f535c0e49d5 Handle #@00 in new reader in a compatible way (bug#63722) 40a758f5ceb ; Minor fixes in documentation of recently-changed VC com... c0d7447e9dc ; * etc/NEWS: Describe the Cairo XCB option. (Bug#63589) 42052686752 Don't mark selection request events 9f5249d5c8d Disable cairo-xcb support by default e5f42706ce2 * lisp/progmodes/project.el: Move :safe from defcustom to... 3afe4a42e90 * lisp/vc/vc-annotate.el (vc-annotate-mode-menu): Quote v... b62a2b08b80 Add vc-create/switch/print-branch to menu and update docu... d292d282292 Fix rare crashes in 'try_window_reusing_current_matrix' 709d9020021 Make last Tramp change less invasive a72a1f24fcb ; Fix last change. 5c6517a115d ; * lisp/menu-bar.el (popup-menu): Doc fix. 212884f2bfe ; Fix last change. 1b9812af80b ; * etc/PROBLEMS: Document problem with GnuPG 2.4.1. (Bu... 765edc204d4 ; Support SQLite3 extensions on macOS 5aadb87d6f6 Fix 'use-dialog-box-p' and friends
Eli Zaretskii [Fri, 26 May 2023 10:20:56 +0000 (13:20 +0300)]
Fix emacsclient when there are irrecoverable file-visiting errors
* lisp/server.el (server-process-filter, server-return-error):
Display the error message to be sent to the client as a regular
message, to give the user the opportunity to see it. Delete the
terminal immediately after sending the error message to the
client, to make sure the terminal's modes are restored.
(Bug#63629)
kobarity [Wed, 24 May 2023 13:06:51 +0000 (22:06 +0900)]
Use 'font-lock-extend-region-functions' in python-mode
* lisp/progmodes/python.el (python-font-lock-extend-region): Change
arguments and return value for 'font-lock-extend-region-functions'.
(python-mode): Change from
'font-lock-extend-after-change-region-function' to
'font-lock-extend-region-functions'. (Bug#63622)
kobarity [Wed, 24 May 2023 13:01:12 +0000 (22:01 +0900)]
Fix python-info-docstring-p
* lisp/progmodes/python.el (python-info-docstring-p): Stop using
python-rx string-delimiter.
* test/lisp/progmodes/python-tests.el
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Mark as expected failures
until another bug in 'python-info-docstring-p' is corrected.
(python-info-docstring-p-7): New test. (Bug#63622)
Handle #@00 in new reader in a compatible way (bug#63722)
This was a regression from Emacs 28.
* src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which
is a quirk from the old reader that we preserve for compatibility.
* test/src/lread-tests.el (lread-skip-to-eof): Verify it.
Po Lu [Fri, 26 May 2023 07:20:39 +0000 (15:20 +0800)]
Allow starting Emacs --debug-init on Android
* doc/emacs/android.texi (Android Troubleshooting): Document
`debug-init' option.
* java/AndroidManifest.xml.in
(EmacsLauncherPreferencesActivity): New activity. Export on
systems older than Android 7.0.
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Adjust for
string startup argument.
* java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java: New
file.
* java/org/gnu/emacs/EmacsPreferencesActivity.java
(EmacsPreferencesActivity): Don't make final.
(startEmacsQ): Give start-up argument as an argument, not as a
boolean.
(startEmacsDebugInit): New function.
(onCreate): Register new listener; make final.
* java/org/gnu/emacs/EmacsService.java (onCreate): Pass
extraStartupArgument.
* java/org/gnu/emacs/EmacsThread.java (EmacsThread): Rename
startDashQ to extraStartupArgument.
(run): Adjust accordingly.
* java/res/values-v24/bool.xml:
* java/res/values/bool.xml:
* java/res/values/strings.xml: New files.
* java/res/xml/preferences.xml: Add new option. Move string
resources around.
Juri Linkov [Thu, 25 May 2023 18:40:38 +0000 (21:40 +0300)]
* lisp/progmodes/project.el: Move :safe from defcustom to autoload (bug#63469)
(project-vc-ignores, project-vc-merge-submodules)
(project-vc-include-untracked, project-vc-name)
(project-vc-extra-root-markers, project-kill-buffers-display-buffer-list):
Autoload the line that puts 'safe-local-variable' property on defcustom symbol
instead of using the :safe keyword.
Juri Linkov [Thu, 25 May 2023 18:24:23 +0000 (21:24 +0300)]
Add vc-create/switch/print-branch to menu and update documentation (bug#63690)
* doc/emacs/maintaining.texi (VC Change Log):
Add 'C-x v b l' (vc-print-branch-log).
(Creating Branches): Add @kindex and @findex for vc-create-branch.
(Switching Branches): Add @kindex and @findex for vc-switch-branch.
* lisp/vc/vc-hooks.el (vc-menu-map): Add menu items for new
commands vc-create-branch and vc-switch-branch, and also
vc-print-branch-log.
Fix apparently wrong `delete` and `delq` value discards (bug#61730)
* lisp/startup.el (normal-top-level):
Update process-environment in case the DISPLAY variable comes first.
Also stop iterating over initial-environment once the first DISPLAY
is found.
* lisp/allout.el (allout-get-configvar-values):
* lisp/org/org.el (org-display-inline-remove-overlay):
* lisp/progmodes/gdb-mi.el (gdb-get-location):
* lisp/progmodes/idlwave.el
(idlwave-convert-xml-clean-routine-aliases)
(idlwave-convert-xml-clean-sysvar-aliases):
* lisp/textmodes/reftex.el (reftex-ref-style-toggle):
Update the base variable after performing a destructive deletion,
where it was obvious that this was intended.
Andrea Corallo [Wed, 24 May 2023 15:05:26 +0000 (17:05 +0200)]
Fix nativecomp ICE compiling structure related code (bug#63674)
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Define the predicate to
be effective at compile time as native comp relies on `cl-typep' that
relies o predicates to work.
Use return values of assq-delete-all and assoc-delete-all
* lisp/allout-widgets.el (allout-widgets-mode):
* lisp/progmodes/eglot.el (eglot-handle-notification):
Update variables with the new value, which was probably the intention
here.
Po Lu [Wed, 24 May 2023 02:53:41 +0000 (10:53 +0800)]
Update Android port
* src/sfnt.c (sfnt_decompose_compound_glyph): Allow decomposing
up to 16 nested components.
(CALL, LOOPCALL): Correctly error if no fdef storage exists.
(sfnt_interpret_run): New label `next_instruction', for CALL.
(sfnt_interpret_compound_glyph_1): Allow decomposing up to 16
nested components. Prevent crash if there are no end points or
points.
(sfnt_read_cvar_table): Prevent assigning uninitialized values.
(sfnt_vary_simple_glyph): Update commentary.
Eli Zaretskii [Tue, 23 May 2023 14:44:23 +0000 (17:44 +0300)]
Fix 'use-dialog-box-p' and friends
* lisp/subr.el (use-dialog-box-p): Use dialog boxes also when
invoked from some window-system gesture. (Bug#63655)
(y-or-n-p): Fix the description in the doc string of conditions
under which a dialog box will be used.
* src/fns.c (Fyes_or_no_p): Use the same condition for dialog
boxes as in 'use-dialog-box-p'. Fix the description in the doc
string of conditions under which a dialog box will be used.
* doc/lispref/minibuf.texi (Multiple Queries, Yes-or-No Queries):
Fix the description of conditions under which a dialog box will be
used.
Stefan Monnier [Mon, 22 May 2023 16:49:26 +0000 (18:49 +0200)]
Avoid duplicates when adding package dirs to load-path
Do not merge to master, we're going to delete this code there.
* lisp/emacs-lisp/package.el (package-activate-1): Check if the path
we're about to add is already in 'load-path', since package autoload
files have been updating 'load-path' for a decade.
Robert Pluim [Mon, 22 May 2023 13:44:21 +0000 (15:44 +0200)]
Avoid duplicate load-path entry when generating package autoloads
'file-name-directory' produces a path ending in '/', so that needs to be
run through 'directory-file-name' to avoid duplicate entries in
'load-path'. (Bug#63625)
* lisp/emacs-lisp/package.el (package-generate-autoloads): Call
'directory-file-name' on the directory of 'load-file-name'.
Eli Zaretskii [Tue, 23 May 2023 11:30:31 +0000 (14:30 +0300)]
Disable loading SQLite3 extensions when SQLite3 version is too old
* src/sqlite.c (HAVE_LOAD_EXTENSION): Define to 1 only if
enabling/disabling extension loading is supported as well.
(load_dll_functions, Fsqlite_load_extension): Condition on
HAVE_LOAD_EXTENSION, not on HAVE_SQLITE3_LOAD_EXTENSION.
(Bug#63653)
Spencer Baugh [Fri, 12 May 2023 19:28:06 +0000 (15:28 -0400)]
Use faster option for running vc-hg status (Bug#63470)
In modern Mercurial, removing the "re:" "-I" "." options provides a
10x-20x speedup because it allows the Rust implementation of "hg
status" to be used.
* lisp/vc/vc-hg.el (vc-hg--program-version): Add.
(vc-hg-dir-status-files): Use --config commands.status.relative=1 to
make paths relative when available.
Alan Mackenzie [Mon, 22 May 2023 16:09:07 +0000 (16:09 +0000)]
Fix syntax bugs involving escaped newlines in comments
This fixes bug#63535
* src/syntax.c (forw_comment): take the initial syntax from the
argument PREV_SYNTAX rather than checking the buffer position
for a backslash. Update the state at each character scanned.
(scan_sexps_forward): When the end position is escaped after a
call to forw_comment, return this status to the caller.
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Run with a lower `auto-revert-interval` (1 s) and adjust the
a timeout value. This should lower the time for this particular
test from 25 to below 10 s.
; Fix markup of some treesit vars in Elisp manual.
* doc/lispref/modes.texi (Parser-based Font Lock):
(Parser-based Indentation):
* doc/lispref/parsing.texi (Multiple Languages): Use @code in place
of @var when the argument is not a metavariable.
Po Lu [Mon, 22 May 2023 03:52:33 +0000 (11:52 +0800)]
Plug various leaks and fix input method initialization
* src/image.c (free_bitmap_record): Free bm->name correctly even
if the display connection has been closed.
* src/xfns.c (x_window): Use dpyinfo-specific `use_xim' flag.
* src/xterm.c (use_xim): Remove global variable.
(xim_destroy_callback): Free `xim_styles' if present, and set it
to NULL to be on the safe side.
(xim_open_dpy): Consult dpyinfo->use_xim instead. Don't leak
`xim_styles' if an IM was previously opened.
(xim_initialize): Use dpyinfo-specific `use_xim' flag.
(xim_close_dpy): Check if `dpyinfo->xim_callback_data' is set
before unregistering the instantiation callback.
(x_term_init): Determine whether or not to use XIM for each
display opened, instead of using the resources of the last
display opened to toggle a global flag.
(x_delete_terminal): Always call `image_destroy_all_bitmaps' and
`xim_close_dpy'. Free storage used to hold bitmap records.
* src/xterm.h (struct x_display_info): New field `use_xim'.
F. Jason Park [Fri, 19 May 2023 06:47:27 +0000 (23:47 -0700)]
Fix custom type of erc-autojoin-channels-alist
* lisp/erc/erc-join.el (erc-autojoin-channels-alist): In ERC 5.4, the
type of this option changed to accept symbols signifying IRC network
names. However, the option's definition was not updated to reflect
that. See commit 9bb8d90cddf "Allow irc network symbols in
erc-autojoin-channels-alist".
F. Jason Park [Fri, 19 May 2023 06:47:27 +0000 (23:47 -0700)]
; Silence byte compiler in erc-netsplit-JOIN
* etc/ERC-NEWS: Partially revert edit from c9f1ad2a870 "Revive option
erc-query-on-unjoined-chan-privmsg".
* lisp/erc/erc-netsplit.el (erc-netsplit-JOIN): Silence byte compiler
warning re ignored return value from `delete' when removing nicks.
Could probably suppress rather than reconstitute since the CAR of an
`erc-netsplit-list' entry originates from the trailing "reason" param
of the instigating "QUIT" command and should look something like
"irc.example.org chat.example.org", which cannot be confused for a
nickname.
* test/lisp/erc/resources/erc-scenarios-common.el: Fix wording in
Commentary.
Eli Zaretskii [Sun, 21 May 2023 10:57:14 +0000 (13:57 +0300)]
New Rmail commands for reading mailing-lists
* lisp/mail/rmail.el (rmail--mailing-list-message): New internal
function.
(rmail-mailing-list-help, rmail-mailing-list-post)
(rmail-mailing-list-unsubscribe, rmail-mailing-list-archive): New
commands.
(rmail-mode-map): Add menu items for the new commands.
Jens Schmidt [Sat, 20 May 2023 21:46:42 +0000 (23:46 +0200)]
Remove obsolete information from Gnus manual
The Gnus manual was still referencing long-removed external
marks in section "Archiving Mails". Without external marks,
that section is almost pointless, so remove it completely.
* doc/misc/gnus.texi (Archiving Mail): Remove section.
(Top, Browsing the Web): Remove references to "Archiving
Mail". (Bug#63497)
Jens Schmidt [Sat, 20 May 2023 21:03:29 +0000 (23:03 +0200)]
Preserve mark in comint-history-isearch
This preserves mark in `comint-history-isearch-backward' and
friends, which tend to set the mark on completion of the isearch
to unexpected positions.
* lisp/comint.el (comint-history-isearch-end): Set `isearch-opoint'
to point. (Bug#63616)
* lisp/emacs-lisp/bytecomp.el (mutating-fns):
Add assoc-delete-all, assq-delete-all and rassq-delete-all.
* lisp/emacs-lisp/shortdoc.el (alist, list):
Don't mutate constants in examples illustrating use of
assoc-delete-all, assq-delete-all and rassq-delete-all.
Eli Zaretskii [Sat, 20 May 2023 14:56:40 +0000 (17:56 +0300)]
Fix Skeletons menu-bar menu in Python modes
* lisp/progmodes/python.el (python-mode, python-ts-mode): Call
'python-skeleton-add-menu-items' here, not in 'python-base-mode',
since the "Python" menu is not yet set up in the latter.
(Bug#63598)
Eli Zaretskii [Sat, 20 May 2023 14:26:52 +0000 (17:26 +0300)]
Fix async invocations in Dired with 'fish' shell
* lisp/dired-aux.el (dired-shell-stuff-it): Separate '&' and ';'
by blanks, for the sake of shells such as 'fish'. Suggested by
Lycomedes 1814 <lycomedes1814@yandex.com>.