Stefan Kangas [Fri, 4 Feb 2022 13:15:33 +0000 (14:15 +0100)]
Silence byte-compiler in two tests
* test/lisp/electric-tests.el (electric-pair-define-test-form):
* test/src/buffer-tests.el (buffer-tests--make-test-name): Silence
byte-compiler by defining defuns also at run time.
Po Lu [Fri, 4 Feb 2022 02:11:31 +0000 (10:11 +0800)]
Make `x-gtk-use-native-input' take effect immediately
* lisp/term/x-win.el (x-internal-focus-input-context): New
declaration.
(x-gtk-use-native-input-watcher): New variable watcher.
* src/xfns.c (Fx_internal_focus_input_context): New function.
(syms_of_xfns): Define new subr.
Po Lu [Fri, 4 Feb 2022 00:51:24 +0000 (08:51 +0800)]
Improve image depth handling
Emacs defaults to a 32-bit TrueColor visual, but if that happens
on a display which defaults to 16-bit TrueColor, yet happens to
have 32-bit color, and doesn't have the X Render Extension, an
error will occur in x_composite_image as libXpm will load
pixmaps of depth 16 instead of depth 32.
* src/image.c (x_create_x_image_and_pixmap): Explictly specify
display depth.
(x_create_xrender_picture):
(xpm_load):
(gs_load): Use dpyinfo->n_planes instead of
DefaultDepthOfScreen.
Jim Porter [Mon, 31 Jan 2022 02:53:53 +0000 (18:53 -0800)]
When executing an Eshell pipeline, send input to the first process
Previously, input was sent to the last process in the pipeline,
resulting in unexpected behavior when running commands like
'tr a-z A-Z | rev'.
* lisp/eshell/esh-util.el (eshell-process-pair-p)
(eshell-make-process-pair): New functions.
* lisp/eshell/esh-cmd.el (eshell-last-async-proc): Rename to...
(eshell-last-async-procs): ... this, and store a pair of processes.
(eshell-interactive-process): Replace with...
(eshell-interactive-process-p, eshell-head-process)
(eshell-tail-process): ... these.
(eshell-cmd-initialize): Set 'eshell-last-async-procs'.
(eshell-do-pipelines): Set 'headproc'.
(eshell-execute-pipeline): Return 'headproc' and 'tailproc'.
(eshell-resume-eval): Use 'eshell-last-async-procs'.
(eshell-do-eval): Make sure we work with a pair of processes.
* lisp/eshell/esh-proc.el (eshell-send-eof-to-process): Move from
here...
* lisp/eshell/esh-mode.el (eshell-send-eof-to-process): ... to here,
and only send EOF to the head process.
* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments)
* lisp/eshell/esh-mode.el (eshell-intercept-commands)
(eshell-watch-for-password-prompt):
Use 'eshell-interactive-process-p'.
* lisp/eshell/esh-cmd.el (eshell-as-subcommand):
Use 'eshell-tail-process'.
* lisp/eshell/eshell.el (eshell-command):
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-wait-for-subprocess):
Use 'eshell-interactive-process-p' and 'eshell-tail-process'.
* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc-stdin):
New test.
Jim Porter [Fri, 28 Jan 2022 07:13:36 +0000 (23:13 -0800)]
Ensure that tailproc is set for the last process in an Eshell pipeline
In particular, this used to fail for pipelines where the last process
in the pipeline came from the first element of the pipeline. This
could happen when a process was piped to an ordinary Lisp function,
like in '*echo hi | echo bye'.
* lisp/eshell/esh-cmd.el (eshell-do-pipelines): Set the tailproc even
for the first process in the pipeline.
* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-tailproc): New
test.
Eli Zaretskii [Thu, 3 Feb 2022 17:36:43 +0000 (19:36 +0200)]
Allow ensuring that a window's starting point is never invisible
* src/xdisp.c (syms_of_xdisp) <make-window-start-visible>: New
buffer-local variable.
(redisplay_window): If 'make-window-start-visible' is non-nil,
don't accept window-start position that is in invisible text or is
covered by a "replacing" 'display' property. (Bug#14582)
Michael Albinus [Thu, 3 Feb 2022 14:30:39 +0000 (15:30 +0100)]
Revert an erroneous change in tramp-cache.el
* lisp/net/tramp-cache.el (tramp-get-hash-table):
Use `string-match-p' instead of `string-search'. The latter one
was introduced by accident. Reported by Kai Tetzlaff <kai@tetzlaff.eu>.
Don't use `string-search` in soap-client (bug#53744)
* lisp/net/soap-client.el (soap-decode-xs-complex-type):
Since soap-client is a core ELPA package and may be used with
Emacs versions older than 28, it cannot use `string-search`;
revert to `string-match`.
Po Lu [Thu, 3 Feb 2022 05:16:35 +0000 (05:16 +0000)]
Simplify box display code on Haiku
* src/haikuterm.c (haiku_calculate_relief_colors): Remove
`rgbout_c' parameter.
(haiku_draw_relief_rect): Push state if performing additional
clipping.
(haiku_draw_string_box): Stop passing clip rects to the relief
drawing functions.
(haiku_draw_glyph_string): Fix calls to haiku_draw_string_box
for new parameters.
Harald Jörg [Wed, 2 Feb 2022 21:30:09 +0000 (22:30 +0100)]
; cperl-mode.el: Detect prototypes in anonymous subroutines
My commit 3d49ad73e5a from 2021-09-143 had a flaw causing bad
fontification and indentation after anonymous subroutines with
a prototype.
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Correctly
process prototypes in anonymous subroutines
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-attrs-and-signatures): new tests for various
combinations of attributes, prototypes, and signatures
* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: new
test source
Alan Mackenzie [Wed, 2 Feb 2022 20:35:39 +0000 (20:35 +0000)]
New file lisp/emacs-lisp/debug-early.el for backtraces in early bootstrap
This is also used in batch mode in general.
* lisp/debug-early.el (debug-early-backtrace, debug-early): New functions.
* lisp/loadup.el (top level): Load debug-early.el as first file.
* src/eval.c (signal_or_quit): Remove the condition in the batch mode section
of not being in dumping or bootstrap, since it is no longer needed. Test that
'debug-early's symbol-function is bound. Ensure there is enough working space
in specpdl and eval_depth.
(syms_of_eval): New DEFSYM for Qdebug_early. Initialise Vdebugger to
Qdebug_early rather than Qnil.
Juri Linkov [Wed, 2 Feb 2022 19:50:41 +0000 (21:50 +0200)]
* lisp/replace.el (query-replace-read-from): Use default for empty input.
Set 'default' from non-empty 'query-replace-read-from-default'.
Use the default in non-regexp prompt and return it for empty input.
https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00044.html
Po Lu [Wed, 2 Feb 2022 11:05:54 +0000 (19:05 +0800)]
Improve correctness of generated xwidget events
* src/xwidget.c (xw_maybe_synthesize_crossing): Add new
parameters for controlling the crossing mode. Also improve the
accuracy of generated crossing events when the mouse pointer
moves outside the toplevel from an inferior of it. All callers
changed.
(xw_notify_virtual_upwards_until):
(xw_notify_virtual_downwards_until): New parameters for crossing
mode. All callers changed.
Juri Linkov [Tue, 1 Feb 2022 19:42:51 +0000 (21:42 +0200)]
* lisp/tab-line.el: Support non-buffer tabs in some tab face functions.
(tab-line-tab-face-special, tab-line-tab-face-modified): For non-buffer tabs
when 'tab-line-tabs-function' is e.g. 'tab-line-tabs-buffer-groups',
try to get the buffer from the property 'buffer'.
https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg01923.html
* src/eval.c (funcall_subr): Test most likely cases first (conforming
calls to finite-arity or n-adic SUBRs), and the error cases last,
instead of doing it the other way around. Simplify.
Po Lu [Tue, 1 Feb 2022 05:39:28 +0000 (05:39 +0000)]
Clean up Haiku display structures
* src/haikufns.c (haiku_set_parent_frame): Set `parent_desc'
correctly.
* src/haikuterm.h (C_FRAME, C_FONT, C_TERMINAL):
(struct haiku_display_info):
(struct haiku_output): Get rid of C_* preprocessor defines,
since these files are no longer included in any way by C++ files.
Stefan Monnier [Mon, 31 Jan 2022 21:25:09 +0000 (16:25 -0500)]
(byte-compile-eval): Adjust to changes in `load-history`
The `function-history` patch introduced a regression which caused
spurious compiler warnings. Fix it.
The new code also fixes a bug in the old code, thus causing some
new non-spurious warnings. Fix them as well.
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Adjust to changes in
`load-history`.
* lisp/gnus/gnus-group.el (nnrss-discover-feed)
(nnrss-save-server-data): Use `declare-function`.
Eric Abrahamsen [Tue, 25 Jan 2022 00:24:10 +0000 (16:24 -0800)]
Don't remove dummy.group from gnus-newsrc-alist on Gnus save
bug#53352
* lisp/gnus/gnus-start.el (gnus-gnus-to-quick-newsrc-format): This
function was removing dummy.group from the global value of
`gnus-newsrc-alist' on save; we only wanted to remove it temporarily.
Eric Abrahamsen [Tue, 25 Jan 2022 00:20:44 +0000 (16:20 -0800)]
Obsolete gnus-registry-enabled in favor of checking gnus-registry-db
* lisp/gnus/gnus-registry.el (gnus-registry-enabled): Obsolete this
variable; recommend using `gnus-registry-db' as a boolean instead.
(gnus-registry-load, gnus-registry-register-message-ids,
gnus-registry-article-marks-to-chars,
gnus-registry-article-marks-to-names, gnus-registry-clear,
gnus-registry-install-p): In all these functions, test
`gnus-registry-db' instead of `gnus-registry-enabled'. We no longer
set or clear that variable.
Juri Linkov [Mon, 31 Jan 2022 18:46:06 +0000 (20:46 +0200)]
* lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer.
Support the case when reverting is in the buffer with a name other than
the default name "*vc-diff*". Then don't try to switch to the buffer
"*vc-diff*" with an assumption that revert-buffer is always performed
in the current buffer (bug#28852).
Eli Zaretskii [Mon, 31 Jan 2022 17:29:54 +0000 (19:29 +0200)]
Clarify documentation of a "face's font"
* doc/lispref/display.texi (Attribute Functions)
(Face Attributes): Clarify that the :font attribute of a face and
the font returned by 'face-font' are by default for ASCII
characters. (Bug#53664)
Alan Mackenzie [Mon, 31 Jan 2022 17:20:45 +0000 (17:20 +0000)]
Bind Qdebugger to Qdebug in signal_or_quit.
* src/eval.c (signal_or_quit): Bind the correct variable, Qdebugger (not
Vdebugger) to Qdebug in the section for errors in batch jobs.
(syms_of_eval): New DEFSYM for Qdebugger.
Stefan Monnier [Mon, 31 Jan 2022 16:07:06 +0000 (11:07 -0500)]
(function-history): New symbol property (bug#53632)
Rework the code we have in Fdefalias that tries to keep track
of definitions so as to be able to undo them later.
We used to store in `load-history` when an autoload is redefined as
a non-autoload and in the `autoload` symbol property we used to store
the autoload data that used to be used before it got overriden.
Instead, store the history of the function definition of
a symbol in its `function-history` symbol property.
To make this list cheap in the default case, the latest value is not stored
in the list (since it's in the `symbol-function`) and neither is the first
file. So if there's only been a single definition (the most common case),
the list is empty and the property is just not present at all.
The patch also gets rid of the `autoload` vs `defun` distinction in
`load-history` which seems unnecessary (a significant part of the
motivation for this patch was to get rid of the special handling of
autoloads in this part of the code).
* src/data.c (add_to_function_history): New function.
(defalias): Use it. Don't add the `t` entries for autoloads and always
use `defun` regardless of the kind of definition.
Change `Vautoload_queue` to only hold the function
symbols since the rest is now available from `function-history`.
* src/eval.c (un_autoload): Adjust accordingly.
* src/lread.c (load-history): Udate docstring.
* lisp/loadhist.el (loadhist-unload-filename): New var.
(unload-feature): Bind it.
(loadhist-unload-element): Document its availability.
(loadhist--restore-autoload): Delete var.
(loadhist--unload-function): Delete function.
(loadhist-unload-element): Delete the `t` and `autoload` methods.
Rewrite the `defun` method using `function-history`.
* doc/lispref/loading.texi (Where Defined): Remove `autoload` and `t`
entries from `load-history` since we don't generate them any more.
Document the `function-history` which replaces the `autoload` property.
(Unloading): Adjust symbol property name accordingly.
* test/lisp/loadhist-resources/loadhist--bar.el:
* test/lisp/loadhist-resources/loadhist--foo.el: New files.
* test/lisp/loadhist-tests.el (loadhist-tests-unload-feature-nested)
(loadhist-tests-unload-feature-notnested): New tests.
Michael Albinus [Mon, 31 Jan 2022 14:26:06 +0000 (15:26 +0100)]
Extend filelock-tests.el for bug#53207
* test/src/filelock-tests.el (filelock-tests--fixture): Make it a
defmacro. Adapt callees.
(filelock-tests-unlock-spoiled, filelock-tests-kill-buffer-spoiled):
Simplify.
(filelock-tests-detect-external-change): New test
Eli Zaretskii [Mon, 31 Jan 2022 13:08:08 +0000 (15:08 +0200)]
Improve 'latin1-display-ucs-per-lynx'
* lisp/international/latin1-disp.el (latin1-display-ucs-per-lynx):
Don't judge display-ability of all the characters by testing just
one of them. Instead, install an ASCII equivalent of every
character that the terminal cannot display.