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.
Po Lu [Fri, 5 Aug 2022 02:18:18 +0000 (10:18 +0800)]
Improve input extension focus handling with multiple master devices
* src/xterm.c (x_cache_xi_devices): Initialize device fields to
0.
(xi_handle_focus_change, xi_focus_handle_for_device)
(xi_handle_delete_frame): New functions; store focus information
per-device instead.
(x_detect_focus_change): Handle GenericEvents that way instead.
(handle_one_xevent): Don't cache XI devices on DeviceChanged.
(x_free_frame_resources): Clear any frame focus information.
* src/xterm.h (struct xi_device_t): New fields for focus
tracking. Add comments describing fields.
Stefan Kangas [Thu, 4 Aug 2022 20:58:59 +0000 (22:58 +0200)]
Be more lax when picking up prefixes for loaddefs
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--compute-prefixes): Allow tabs and spaces before
symbol name, so that "(defvar\tfoo-bar nil)" is properly picked up.
Before this change, such a definition would be wrongly picked up as
the symbol "nil".
* lisp/auth-source.el (auth-source-netrc-parse-all): New function
(bug#56976).
(auth-source-netrc-parse): Partially revert behaviour in previous
change -- require :allow-null to match.
* lisp/emacs-lisp/loaddefs-gen.el (no-update-autoloads): Moved
here from autoload.el.
* lisp/emacs-lisp/loaddefs-gen.el: Removed now that it's no longer
used.
* lisp/emacs-lisp/package.el
(package-autoload-ensure-default-file): Don't warn about
soon-to-be obsolete functon.
Clean up nntp-send-authinfo after removing obsolete variable
* lisp/gnus/nntp.el (netrc-parse, netrc-machine, netrc-get):
Remove declarations.
(nntp-send-authinfo): Now that `nntp-authinfo-file' is removed,
don't parse the .authinfo file twice, but just rely on the
auth-source functions (bug#56972).
Stefan Kangas [Thu, 4 Aug 2022 12:37:17 +0000 (14:37 +0200)]
Fix namespace problem in meta-mode.el
* lisp/progmodes/meta-mode.el
(meta-font-lock-match-declaration-item-and-skip-to-next): Rename
from 'font-lock-match-meta-declaration-item-and-skip-to-next'.
Retain old name as an obsolete alias.
Stefan Kangas [Thu, 4 Aug 2022 10:14:10 +0000 (12:14 +0200)]
Fix namespace problem in dired-aux.el
* lisp/dired-aux.el (dired-minibuffer-default-add-shell-commands):
Rename from 'minibuffer-default-add-dired-shell-commands'. Retain
old name as an obsolete alias.
Michael Albinus [Thu, 4 Aug 2022 09:59:18 +0000 (11:59 +0200)]
Fix Tramp test
* test/lisp/net/tramp-tests.el (tramp-test48-unload):
Ignore autoload functions in `tramp-file-name' structure tests,
since `tramp-file-name-handler' is also autoloaded.
* src/composite.c (composition_compute_stop_pos): Use an 'endpos' that
is not too far away.
(find_automatic_composition): Use a 'head' that is not too far away.
Also make sure that this code path is not taken when long line
optimizations are disabled.
* src/dispextern.h (struct composition_it): Add a field that points
to the parent iterator.
Po Lu [Thu, 4 Aug 2022 07:52:03 +0000 (15:52 +0800)]
Fix about:protocols in EWW
* lisp/net/eww.el (eww--dwim-expand-url): Handle `about: ' URLs.
(bug#56885)
* lisp/url/url-about.el (url-about): Return correct content type
for HTML data.
* lisp/url/url-http.el (url-http--get-referer): Refrain from
looking for a referrer if the lastloc had no host.