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).
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.
Po Lu [Mon, 31 Jan 2022 12:21:04 +0000 (20:21 +0800)]
Implement `alpha-background' on PGTK
* src/ftcrfont.c (ftcrfont_draw): Respect alpha-background where
appropriate.
* src/gtkutil.c (xg_create_frame_widgets): Swap some
conditionals around to get the right visual and signal handlers
on PGTK.
(xg_widget_style_updated): Likewise.
* src/pgtkfns.c (pgtk_set_alpha_background): New function.
(pgtk_frame_parm_handlers): Add it instead of the generic param
handler.
(Fx_create_frame): Fix typo.
* src/pgtkterm.c (pgtk_fill_rectangle):
(pgtk_set_cr_source_with_gc_foreground):
(pgtk_set_cr_source_with_gc_background):
(pgtk_set_cr_source_with_color): New argument
`respect_alpha_backend'. All callers changed.
* src/pgtkterm.h: Update function prototypes.
Po Lu [Mon, 31 Jan 2022 10:37:09 +0000 (18:37 +0800)]
Fix accesses to GTK structures on tooltip frames
* src/xfns.c (xic_set_preeditarea): Don't set the GTK context on
tooltip frames.
(x_set_alpha_background): Don't make tooltip frames paintable.
* src/xterm.c (x_xr_ensure_picture): Get rid of GDK visual code.
This is now done in a better way inside xg_create_frame_widgets.
(bug#53654)
Po Lu [Mon, 31 Jan 2022 09:59:12 +0000 (17:59 +0800)]
Improve portability of alpha channel handling on TrueColor visuals
* src/xfns.c (select_visual): Always ask for a TrueColor visual.
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_draw): Test `alpha_bits' instead of
n_planes.
* src/xterm.c (x_fill_rectangle, x_clear_rectangle): Likewise.
(x_query_colors, x_alloc_nearest_color): Remove code that
hard-coded alpha mask.
(x_term_init): Calculate alpha bits and offset and populate
field appropriately.
* src/xterm.h (struct x_display_info): New fields `alpha_bits'
and `alpha_offset'.
(x_make_truecolor_pixel): Stop hardcoding the value of the alpha
mask.
Stefan Kangas [Mon, 31 Jan 2022 06:42:50 +0000 (07:42 +0100)]
Factor out function to check for clang in tests
This also stops a flymake test from failing on my machine.
* lisp/emacs-lisp/ert-x.el (ert-gcc-is-clang-p): New function
factored out from ...
* test/lisp/progmodes/flymake-tests.el (flymake-tests--gcc-is-clang):
* test/lisp/cedet/semantic/bovine/gcc-tests.el
(semantic-gcc-test-output-parser-this-machine): ... here.
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types)
(included-c-header-files):
* test/lisp/cedet/semantic/bovine/gcc-tests.el
(semantic-gcc-test-output-parser-this-machine): Use above new function.
Po Lu [Mon, 31 Jan 2022 02:15:47 +0000 (10:15 +0800)]
Implement `alpha-background' on non-Cairo builds
* src/frame.c (gui_set_alpha_background): Recompute basic faces
so xft face ext info gets reset.
* src/gtkutil.c (xg_create_frame_widgets): Attach to style
updated signal.
(xg_update_frame_menubar): Set menu bar visual correctly.
(xg_widget_style_updated): New function.
* src/xfns.c (x_set_alpha_background): New function.
(x_frame_parm_handlers): Use x_set_alpha_background instead.
* src/xterm.c (x_xr_ensure_picture): Export function.
(x_update_opaque_region): New function.
(x_fill_rectangle): New parameter `respect_alpha_background'.
All callers changed.
(handle_one_xevent): Set opaque region on ConfigureNotify.
(x_drop_xrender_surfaces): Set opaque region.
(x_xrender_color_from_gc_foreground):
(x_xrender_color_from_gc_background): Premultiply alpha with
components if asked for.
* src/xterm.h (struct x_display_info): New atom
`Xatom_net_wm_opaque_region'.
(clone-frame): Use frame-internal-parameters.
(undelete-frame--handle-delete-frame): Instead of using frameset-save,
save frame-parameters except frame-internal-parameters and 'display'
on non-graphic display. Also save window-state from window-state-get.
(undelete-frame): Instead of using frameset-restore,
set default-frame-alist for make-frame (like in clone-frame),
and restore window-state with window-state-put.
* lisp/frameset.el (frameset-session-filter-alist): Append
parameters from frame-internal-parameters with the filter :never.
Remove :name that is now in frame-internal-parameters.
(frameset-persistent-filter-alist): Remove outer-window-id,
parent-id, window-id that are now in frame-internal-parameters,
included here via frameset-session-filter-alist.
* src/frame.c (frame-internal-parameters): New variable.
Stefan Kangas [Sun, 30 Jan 2022 05:31:11 +0000 (06:31 +0100)]
Merge from origin/emacs-28
e81e375539 ; Yet another minor fix of Malayalam composition rules. 94f38cbec4 Fix last change of Malayalam composition rules ed3bbeb80d Fix rendering of Malayalam script 5ef3a52342 Improve documentation of Occur mode
Eli Zaretskii [Sat, 29 Jan 2022 19:56:53 +0000 (21:56 +0200)]
Fix last change of Malayalam composition rules
* lisp/language/indian.el (malayalam-composable-pattern):
Reinstate. Instead of removing it, add any sequence of
Malayalam characters to the existing patterns, so as not
to lose the patterns that use ZWJ and ZWNJ. (Bug#53625)
Eli Zaretskii [Sat, 29 Jan 2022 19:22:02 +0000 (21:22 +0200)]
Fix rendering of Malayalam script
* lisp/language/indian.el (malayalam-composable-pattern): Remove.
(script-regexp-alist): Remove 'malayalam-composable-pattern'.
Instead, pass any sequence of Malayalam codepoints to the shaping
engine. (Bug#53625)
Allow redirecting `message' output to a different buffer
* doc/lispref/display.texi (Logging Messages): Document it.
* src/xdisp.c (message_dolog): Add sanity checking.
(syms_of_xdisp): Make Vmessages_buffer_name into a defvar
(bug#27170).
Eli Zaretskii [Sat, 29 Jan 2022 15:54:43 +0000 (17:54 +0200)]
Don't require mouse for prompting via dialog boxes
* lisp/subr.el (use-dialog-box-p): Don't require mouse support,
and allow dialog boxes when invoked via the TTY menus without a
mouse.
(from--tty-menu-p): New internal variable.
* lisp/menu-bar.el (popup-menu): Bind 'from--tty-menu-p' when
invoking a command from the menu.
Make revert-buffer ('g') keep point in VC diff buffers
* lisp/vc/vc.el (vc-diff-restore-buffer): New function.
(vc-diff-finish): Update its calling convention to include an
optional 'oldbuf' parameter, and handle it.
(vc-diff-internal): Pass a clone of the incumbent vc-diff
buffer to 'vc-diff-finish' (bug#28852).
Po Lu [Sat, 29 Jan 2022 10:53:28 +0000 (18:53 +0800)]
Fix unrelated help text tooltips if a popup is shown during the delay
* doc/lispref/frames.texi (Pop-Up Menus): Document new hook.
* etc/NEWS: Announce `x-pre-popup-menu-hook'.
* lisp/tooltip.el (tooltip-mode): Make sure `tooltip-hide' is
run before any popup menu is displayed to prevent unrelated help
text from obscuring the popup menu if it pops up during the
tooltip delay.
* src/menu.c (x_popup_menu_1): Run said hook right before the
popup menu is displayed.
(syms_of_menu): New hook `x-pre-popup-menu-hook'.
Michael Albinus [Sat, 29 Jan 2022 10:45:38 +0000 (11:45 +0100)]
Fix error in filelock.c
* src/filelock.c (lock_file): Move call of file name handler to
`Flock_file'. Determine lock_filename only in case
create_lockfiles is non-nil. Adapt the rest of the function accordingly.
(Flock_file): Do not check for create_lockfiles. Call file name
handler if appropriate. (Bug#53207)
Eli Zaretskii [Sat, 29 Jan 2022 09:55:02 +0000 (11:55 +0200)]
Fix native-compilation at startup
* lisp/startup.el (normal-top-level): Set up the initial value of
'native-comp-eln-load-path' early into startup, then amend it
after calling 'command-line'. (Bug#53497)
Po Lu [Sat, 29 Jan 2022 05:06:02 +0000 (05:06 +0000)]
Implement real menu help-echo text on Haiku
* lisp/tooltip.el (tooltip-show-help): Remove Haiku-specific
conditional since that's now taken care of by C code.
* src/haiku_io.c (haiku_read_size):
(haiku_read_with_timeout):
(haiku_write_without_signal): Add parameter `popup_p'. All
callers changed.
(port_popup_menu_to_emacs): New variable.
* src/haiku_support.cc (struct be_popup_menu_data): New
structure.
(be_popup_menu_thread_entry): New function.
(class EmacsMenuItem): New field `menu_ptr'.
(Highlight): Send help text to the popup port if this item
isn't for a menu bar.
(BMenu_add_item): Set menu_ptr appropriately.
(BMenu_run): Complete rewrite that allows to read help text from
the menu bar port.
* src/haiku_support.h (struct haiku_menu_bar_help_event): New
fields for popup menus.
* src/haikumenu.c (digest_menu_items): Only set help tooltip on
popup menus when system tooltips are enabled.
(haiku_menu_show_help):
(haiku_process_pending_signals_for_menu): New functions.
(haiku_menu_show): Pass new callbacks.
Stefan Monnier [Fri, 28 Jan 2022 18:19:11 +0000 (13:19 -0500)]
Reduce code duplication in parts of (auto)load&defalias
* src/data.c (defalias): New function, extracted from `Fdefalias`.
(Fdefalias): Use it.
(Ffset): Don't handle `Vautoload_queue` here, handle it in
`defalias` instead.
* src/comp.c (comp--register-subr): Use `defalias` instead of
duplicating its code.
* src/eval.c (load_with_autoload_queue): New function, extracted from
`Fautoload_do_load`.
(Fautoload_do_load): Use it.
(un_autoload): Mark it as static.
* src/fns.c (Frequire): Use it as well.
* src/lisp.h (defalias, load_with_autoload_queue): New declarations.
(un_autoload): Remove declaration.
Sebastian Urban [Fri, 28 Jan 2022 16:12:35 +0000 (17:12 +0100)]
Fix manual points about tex-latex-block/latex-insert-block
* doc/emacs/text.texi (LaTeX Editing):
(LaTeX Editing): Update documentation of
tex-latex-block/latex-insert-block to what they really point to
(bug#37325).
Michael Albinus [Fri, 28 Jan 2022 15:32:15 +0000 (16:32 +0100)]
Clarify where the shell-command output goes
* lisp/simple.el (shell-command):
* doc/emacs/misc.texi (Single Shell): Clarify where the output
goes if the specified buffer isn't the current one (bug#40896).
Lele Gaifax [Fri, 28 Jan 2022 07:41:51 +0000 (08:41 +0100)]
Fix copyright-fix-years, use a dash to separate years in a range
Commit 7a46fa9c751f7c3147cd9b27fe84c1ce25419d3b, allowing en-dash as
years separator, changed the way the years range is composed taking the
separator from the `sep' variable instead of always using an hardwired
hyphen. Since the code explicitly avoid to touch (that is, extend)
existing ranges, that `sep' variable is almost always a space, or
whatever character precedes the last parsed year, thus generating a
range like "2020 2022" instead of "2020-2022".
* lisp/emacs-lisp/copyright.el (copyright-fix-years): Always use an dash
to separate years in a range.
* test/lisp/emacs-lisp/copyright-tests.el (with-copyright-fix-years-test):
(copyright-fix-years-tests--data):
(text-copyright-fix-years): New test cases (bug#53597).
Po Lu [Fri, 28 Jan 2022 08:38:02 +0000 (16:38 +0800)]
Use the real cursor beneath the pointer on xwidgets
* src/xwidget.c (define_cursors): Make manual cursor definition
code PGTK-only.
(xw_update_cursor_for_view):
(xw_last_crossing_cursor_cb): New functions.
(xw_maybe_synthesize_crossing): Attach and disconnect cursor
signal handler where appropriate.
(xwidget_init_view): Set the default cursor to the nontext
cursor.
(Fxwidget_delete_view): Disconnect last crossing signal if
appropriate.
* src/xwidget.h (struct xwidget_view): New field
`last_crossing_cursor_signal'.