* src/xterm.c (xi_handle_focus_change): Pacify a wrong warning on
gcc (Debian 10.2.1-6).
xterm.c: In function ‘xi_handle_focus_change’:
xterm.c:12564:25: warning: ‘source’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
12564 | ie.device = source->name;
| ~~~~~~^~~~~~
Eli Zaretskii [Sun, 7 Aug 2022 14:03:52 +0000 (17:03 +0300)]
Fix 'vertical-motion' in bidi-reordered text
* src/xdisp.c (move_it_vertically_backward): Fix the case of long
bidi-reordered lines when starting from its last (top-most) screen
line.
(move_it_by_lines): Fix logic of detection when going by lines
overshoots.
Stefan Kangas [Sun, 7 Aug 2022 11:51:39 +0000 (13:51 +0200)]
Declare unused function ediff-user-grabbed-mouse obsolete
* lisp/vc/ediff-init.el (ediff-user-grabbed-mouse): Declare unused
function obsolete. As far as I can tell, this has been unused
since 1996.
* lisp/vc/ediff-wind.el (ediff-mouse-pixel-position): Make
variable obsolete. It is only used in the above obsolete funct
* lisp/vc/ediff-mult.el (ediff-filegroup-action)
(ediff-registry-action):
* lisp/vc/ediff-util.el (ediff-setup): Don't set above unused
variable.
* lisp/vc/ediff-init.el (ediff-spy-after-mouse): Make obsolete.
* lisp/vc/ediff-util.el (ediff-setup): Don't add above obsolete
function to pre-command-hook.
Stefan Kangas [Sun, 7 Aug 2022 11:16:53 +0000 (13:16 +0200)]
; Improve time-convert call in recently changed test
* test/lisp/eshell/em-pred-tests.el
(eshell-parse-file-name-attributes): Use t instead of nil as
second argument to 'time-convert'.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
Stefan Kangas [Sun, 7 Aug 2022 10:57:53 +0000 (12:57 +0200)]
Merge from origin/emacs-28
7ffcba4213 * etc/PROBLEMS: Problems with Alacritty and Emoji. (Bug#5... df95118e83 Link from (emacs)Init Syntax to (elisp)Introduction 7793cf0c3d Don't mention removed XEmacs support in reftex manual 3d1cf1b47a Don't mention removed XEmacs support in idlwave manual 7ff60c62a9 ; * admin/make-tarball.txt: Fix last change. 2fd5590d0c ; * lisp/play/fortune.el (fortune-ask-file): Doc fix.
When load-force-doc-strings is true, read (#$ . POS) as the (unibyte)
string referred to. This feature was lost by mistake in the recent
nonrecursive reader rewrite.
Noticed by Stefan Monnier.
* src/lread.c (get_lazy_string): New function (code mostly recycled
from an old version).
(read0): Detect (#$ . FIXNUM) and retrieve the string if appropriate.
* test/src/lread-resources/lazydoc.el:
* test/src/lread-tests.el (lread-force-load-doc-strings):
New test.
Fix two problems with our handling of X timestamps
1) We're not properly updating the X interaction timestamp after
receiving certain input events, and
2) X events sent in response to emacsclient commands get stale
timestamps because the timestamp tracking doesn't take into account
that interactions with the user can occur outside the X input
event channel.
* src/xterm.c:
(x_display_set_last_user_time_1): New function.
(x_display_set_last_user_time): Call it.
(x_ewmh_activate_frame): Refactor.
(x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation.
(server_timestamp_predicate): New function.
(x_get_server_time): New function.
(x_note_oob_interaction): New function.
(x_create_terminal): Register new function as terminal hook.
* src/termhooks.h: New hook: note_oob_interaction_hook.
Alan Mackenzie [Sat, 6 Aug 2022 21:11:18 +0000 (21:11 +0000)]
CC Mode: Optimize font-locking stanzas for long raw strings.
Also replace some regexp searches which had caused regexp engine stack
overflows with simple end-of-line calls.
* lisp/progmodes/cc-fonts.el (c-make-syntactic-matcher)
(c-make-font-lock-search-form): Start the generated functions with a skipping
of comments and strings.
(c-make-font-lock-BO-decl-search-function): Start the generated function with
a (fast) movement to the start of any literal.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings): Replace complicated regexp searches
for end of logical line with basic Lisp functions.
Michael Albinus [Sat, 6 Aug 2022 16:09:35 +0000 (18:09 +0200)]
Adapt Tramp for Android 12
* lisp/net/tramp-adb.el (tramp-methods): Use "%d".
(tramp-adb-handle-directory-files-and-attributes): Fix "." and
".." in listing.
(tramp-adb-sh-fix-ls-output): Fix file names with spaces.
(tramp-adb-maybe-open-connection): Compute args from `tramp-login-args'.
* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Check for adb device if indicated.
Stefan Kangas [Sat, 6 Aug 2022 15:00:13 +0000 (17:00 +0200)]
Fix namespacing problem in allout.el
* lisp/allout.el (allout-outlinify-sticky): Rename from
'outlineify-sticky'. Make old name into obsolete alias.
(outlinify-sticky): Make into obsolete function alias for
'allout-outlinify-sticky'.
(allout-mode): Doc fix.
Stefan Kangas [Sat, 6 Aug 2022 14:20:56 +0000 (16:20 +0200)]
Don't mention test failures on Ubuntu 16.04 in PROBLEMS
Ubuntu 16.04 LTS reached end of life on April 30th, 2021.
Furthermore, test failures don't seem significant enough to warrant an
entry. It's rather cosmetic.
* etc/PROBLEMS: Delete entry on test failures on Ubuntu 16.04.
Eventually we want to be able to generate "transient.texi" from
"transient.org", without having to either give up on idiomatic texinfo
or making it much more painful to maintain the org file.
We are much closer to that now, but there are still a few areas where
additional work is needed. This was mostly accomplished by using Org
macros.
The most significant outstanding issue is that the generated
references don't yet look like an experienced texinfo author like Eli
would like them to look. Additionally it is not yet possible to use a
macro that produces @dots{} in the places Eli added them, and in Org
code blocks it is not possible to use macros, so we cannot have
@var{...} appear in "@lisp ... @end lisp". The last issue probably
cannot be changed on Org's side, but since there are only two such
code blocks, this might be a situation where the compromise has to
come from the texinfo side. There are also three other very minor
and inconsequential differences.
For now I have regenerated the texinfo file from the org file and then
discarded the differences mentioned in the previous paragraph.
The process of merging (1) Eli's changes to the texinfo file
(including, but certainly not limited to markup), (2) changes to the
org source (updated content, formatting changes backported earlier,
fixes for formatting changes Eli did not fix, etc.) and (3) changes to
the code that converts the org source to texinfo, was very laborious
and painful. In essence, this amounted to a (at least) three-way
merge across three different languages and three repositories.
I tried very hard to not waste any of the effort Eli had put into
fixing up the generated texinfo file. I.e., I went back and forth
making improvements to the org source, implementing org macros,
regenerating the texinfo and comparing the remaining difference, and
creating commits on both sides. This resulted in a dozen commits on
both sides and took me well over a day. I could have put in even more
effort to absolutely ensure nothing at all is lost in the process, but
I think that would have amounted to a colossal waste of my time.
Going forward, if you find unidiomatic texinfo, then please don't fix
each instance. Instead write me an email, explaining what the problem
is. You are welcome to make limited fixes to the content or fix
one-of markup issue in the texinfo file; those are relatively simple
to backport in comparison.
Eli Zaretskii [Sat, 6 Aug 2022 13:55:51 +0000 (16:55 +0300)]
Speed up display of Arabic
* lisp/language/misc-lang.el (composition-function-table): Move
some of the Arabic composition rules to ZWJ and ZWNJ cells. This
speeds up display of Arabic by a factor of 2. (Bug#56682)
Eli Zaretskii [Sat, 6 Aug 2022 13:24:34 +0000 (16:24 +0300)]
Fix C-n/C-p inside bidirectional text
* src/xdisp.c (move_it_by_lines, try_cursor_movement): Handle
glyph rows whose direction of increasing buffer positions is
reverse of the normal: going down in the window makes buffer
positions higher.
* src/indent.c (Fvertical_motion): When looking for the last glyph
row occupied by point, take into account the bidi iteration
direction.
lWarne [Sat, 6 Aug 2022 13:01:38 +0000 (15:01 +0200)]
Fontify python escape sequences in literals
* lisp/progmodes/python.el (python-rx): Add regular expressions
matching escape codes in string and byte literals
(python--string-bytes-literal-matcher): new function
(python--not-raw-bytes-literal-start-regexp): new constant
(python--not-raw-string-literal-start-regexp): new constant
* test/lisp/progmodes/python-tests.el: Add tests for new
fontification (bug#57004).
Stefan Kangas [Sat, 6 Aug 2022 08:21:24 +0000 (10:21 +0200)]
Drop support for XEmacs package func-menu from idlwave
* lisp/progmodes/idlwave.el (idlwave-function-menu): Make into
obsolete alias for imenu. Update callers.
* doc/misc/idlwave.texi (Introduction, Motion Commands): Remove
any mention of func-menu.
Stefan Kangas [Sat, 6 Aug 2022 08:25:39 +0000 (10:25 +0200)]
Don't mention removed XEmacs support in idlwave manual
* doc/misc/idlwave.texi (Lesson I---Development Cycle)
(Syntax Highlighting, Windows and macOS, Troubleshooting): Delete
most references to XEmacs. Support for it was deleted in 28.1.
Jim Porter [Mon, 18 Jul 2022 03:25:00 +0000 (20:25 -0700)]
Allow creating processes where only one of stdin or stdout is a PTY
* src/lisp.h (emacs_spawn):
* src/callproc.c (emacs_spawn): Add PTY_IN and PTY_OUT arguments to
specify which streams should be set up as a PTY.
(call_process): Adjust call to 'emacs_spawn'.
* src/process.h (Lisp_Process): Replace 'pty_flag' with 'pty_in' and
'pty_out'.
* src/process.c (is_pty_from_symbol): New function.
(make-process): Allow :connection-type to be a cons cell, and allow
using a stderr process with a PTY for stdin/stdout.
(create_process): Handle creating a process where only one of stdin or
stdout is a PTY.
* lisp/eshell/esh-proc.el (eshell-needs-pipe, eshell-needs-pipe-p):
Remove.
(eshell-gather-process-output): Use 'make-process' and set
':connection-type' as needed by the value of 'eshell-in-pipeline-p'.
* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't signal an
error when ':connection-type' is a cons cell.
* test/src/process-tests.el
(process-test-sentinel-wait-function-working-p): Allow passing PROC
in, and rework into...
(process-test-wait-for-sentinel): ... this.
(process-test-sentinel-accept-process-output)
(process-test-sentinel-sit-for, process-test-quoted-batfile)
(process-test-stderr-filter): Use 'process-test-wait-for-sentinel'.
(make/process/test-connection-type): New function.
(make-process/connection-type/pty, make-process/connection-type/pty-2)
(make-process/connection-type/pipe)
(make-process/connection-type/pipe-2)
(make-process/connection-type/in-pty)
(make-process/connection-type/out-pty)
(make-process/connection-type/pty-with-stderr-buffer)
(make-process/connection-type/out-pty-with-stderr-buffer): New tests.
* test/lisp/eshell/esh-proc-tests.el (esh-proc-test--detect-pty-cmd):
New variable.
(esh-proc-test/pipeline-connection-type/no-pipeline)
(esh-proc-test/pipeline-connection-type/first)
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): New tests.
* doc/lispref/processes.texi (Asynchronous Processes): Document new
':connection-type' behavior.
(Output from Processes): Remove caveat about ':stderr' forcing
'make-process' to use pipes.
Stefan Kangas [Fri, 5 Aug 2022 18:17:23 +0000 (20:17 +0200)]
Allow newline after def*-form for definition-prefix
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Add another semantic function.
(loaddefs-generate--compute-prefixes): Allow newline after the "(def*"
form. (Bug#57000)
Stefan Monnier [Fri, 5 Aug 2022 14:38:59 +0000 (10:38 -0400)]
timer.el: Avoid repeated timers
https://mail.gnu.org/archive/html/emacs-devel/2022-07/msg01127.html
points out that end-users can get bitten by this, accidentally
calling `timer-activate` on an already activated timer.
* lisp/emacs-lisp/timer.el (timer--activate): Signal an error if we try
to re-add a timer that's already on the timer-list.
Eli Zaretskii [Fri, 5 Aug 2022 12:53:06 +0000 (15:53 +0300)]
Avoid assertion violations in 'back_to_previous_visible_line_start'
* src/xdisp.c (init_iterator): Always initialize narrowed_begv to
zero, since SET_WITH_NARROWED_BEGV depends on it being non-zero as
an indication that long-line optimizations are in use.
(back_to_previous_visible_line_start): When long-line
optimizations are in effect, we may end up not on a newline.
Stefan Monnier [Fri, 5 Aug 2022 12:18:04 +0000 (08:18 -0400)]
bytecomp.el: Further simplifications enabled by commit 59732a83c8875c
* lisp/emacs-lisp/bytecomp.el (byte-compile-output-docform): Don't
insert a \n before the #@ docstrings since make-docfile doesn't scan
.elc files any more.
Make loaddefs.el dependencies more explicit in src/Makefile.in
* src/Makefile.in (LC_ALL): Add loaddefs.el as a dependency, too,
since that file may be deleted, but the loaddefs.elc file still
exists. This causes problems in nativecomp builds.
Stefan Kangas [Fri, 5 Aug 2022 10:55:28 +0000 (12:55 +0200)]
Fix namespace problems in viper.el
* lisp/emulation/viper.el
(viper-this-major-mode-requires-vi-state): Rename from
'this-major-mode-requires-vi-state'. Retain old name as an
obsolete alias.
(viper-set-state-in-major-mode): Rename from
'set-viper-state-in-major-mode'. Retain old name as an obsolete
alias.
Stefan Kangas [Fri, 5 Aug 2022 10:49:38 +0000 (12:49 +0200)]
Fix namespace problems in xscheme.el
* lisp/progmodes/xscheme.el (xscheme-default-runlight): Rename
from 'default-xscheme-runlight'. Retain old name as an obsolete
alias.
(xscheme-verify-buffer): Rename from 'verify-xscheme-buffer'.
Retain old name as an obsolete alias.
Stefan Kangas [Fri, 5 Aug 2022 10:28:59 +0000 (12:28 +0200)]
Fix namespace problem in saveplace.el
* lisp/saveplace.el (save-place-load-alist-from-file): Rename from
'load-save-place-alist-from-file'. Retain old name as an obsolete
alias. Update callers.
Po Lu [Fri, 5 Aug 2022 08:12:07 +0000 (16:12 +0800)]
Improve C-x C-q in emacs-news-mode
* lisp/textmodes/emacs-news-mode.el (emacs-news-mode-map)
(emacs-news-view-mode-map): Make C-x C-q switch to the
appropriate mode for editing, and vice versa.
(emacs-news-mode): Disable button-mode and make buffer
read-write.
Po Lu [Fri, 5 Aug 2022 05:21:29 +0000 (13:21 +0800)]
Improve multi-pointer X support
* etc/TODO: Document that MPX support still needs work.
* src/xterm.c (xi_handle_interaction): New function.
(handle_one_xevent): Call it in the appropriate places.