1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

48778 commits

Author SHA1 Message Date
Po Lu
804a96af28 Update Android port
* src/sfnt.c (xfree, sfnt_make_interpreter)
(stack_overflow_test_args, stack_underflow_test_args)
(dup_test_args, clear_test_args, raw_test_args, fdef_test_args)
(fdef_1_test_args, endf_test_args, rs_test_args, debug_test_args)
(eif_test_args, sds_test_args, round_test_args, sangw_test_args)
(aa_test_args, scantype_test_args): Include alloca.h.  Minor
fixes for standards conformance.
2023-08-29 10:47:56 +08:00
Po Lu
4d06a9faff Correct display of stretch glyphs within hscrolled windows
* src/haikuterm.c
(haiku_draw_glyphless_glyph_string_foreground): Make char2b
static, stifling a GCC warning.
(haiku_draw_stretch_glyph_string): Use computed X if s->x is
outside the confines of the text area.
2023-08-27 02:19:46 +00:00
Stefan Kangas
d8b528c896 Clean up image error reporting somewhat
* src/image.c (image_not_found_error, image_invalid_data_error):
New functions.  All uses of image_error with "Invalid image data ..."
and "Cannot find image file ..." changed to use them.
(image_create_x_image_and_pixmap_1): Remove redundant Qnil arguments.
2023-08-26 14:39:38 +02:00
Eli Zaretskii
7318fa75b8 ; * src/emacs.c (main) [!HAVE_PDUMPER]: Avoid setting unused variable. 2023-08-26 12:35:06 +03:00
Eli Zaretskii
db56d2b041 Merge from origin/emacs-29
39d2285bdc ; * doc/emacs/sending.texi (Mail Aliases): Add some usefu...
f3fa436bc0 ; Fix doc string of 'current-idle-time'
02532bb582 Fix custom :type of dired-mouse-drag-files
fc5de406be ; Improve SMTPmail documentation about OAuth2
1aaeaf22ce Account for string names in active file
4860456584 Fix 'makefile-browser-client' variable initialization
2023-08-26 05:25:50 -04:00
Daniel Martín
5427ef23b8 Do not raise a different frame when closing a frame
* src/frame.h: Declare an NS-only function to make a frame the
key window.
* src/nsfns.m (ns_make_frame_key_window): Implement it.
* src/frame.c (delete_frame): Call ns_make_frame_key_window
instead of Fraise_frame.  (Bug#61525)
2023-08-26 11:03:59 +03:00
Po Lu
349798a9b8 Demote errors from utimensat copying directories
* lisp/files.el (copy-directory): Wrap set-file-times within
with-demoted-errors.

* src/fileio.c (Fcopy_file): Adjust commentary.
2023-08-26 09:57:32 +08:00
Paul Eggert
8bc21ef110 Use float not double in webp_load alpha conversion
* src/image.c (webp_load): Pacify gcc -Wdouble-promotion
by using (1 - a), where the 1 is converted to 1.0f, rather
than (1.0 - a), which mistakenly converts a to double.
Also, reindent to use GNU style.
2023-08-25 18:45:43 -07:00
Po Lu
4a6b32f72f Disable XkbLC_ControlFallback
* src/xterm.c (handle_one_xevent) <XI_KeyPress>: Fix typos within
the commentary.
(x_term_init) [HAVE_XKB]: Disable the ControlFallback library
control, lest Xlib map function keys with ControlMask set to
ASCII keysyms within inactive groups.
2023-08-26 09:38:34 +08:00
Stefan Kangas
eb61bbacef Fix alpha blending for WebP images
* src/image.c (webp_load): Fix WebP transparency by doing manual alpha
blending instead of naive masking.  (Bug#59242)
2023-08-25 20:26:59 +02:00
Eli Zaretskii
f3fa436bc0 ; Fix doc string of 'current-idle-time'
* src/keyboard.c (Fcurrent_idle_time): Doc fix (bug#65512).
2023-08-25 08:53:21 +03:00
Po Lu
d913b3d82d Attempt to fix bug#65068
* src/xterm.c (handle_one_xevent) <KeyPress>: Prevent calls to
XkbTranslateKeysym with a modified keysym if overflow happens.
<XI_KeyPress>: Expound upon the different forms of key event
lookup and the chaotic code beneath within the commentary.
Discontinue separating keycode lookup from key translation.
Supply the effective group within the modifier mask provided
to both XKB translation functions.  (bug#65068)
2023-08-25 10:47:12 +08:00
Po Lu
ad5e17d063 Properly parse format 4 cmap tables
* src/sfnt.c (sfnt_read_cmap_format_4): Read range_shift field
propery.  Prior to this, it would be inadvertently treated as an
entry within the segment end code array, which only functioned
by happenstance.
(sfnt_lookup_glyph_4): Remove workaround grounded upon an
erroneous interpretation of the bug fixed by the aformentioned
change.

* src/sfnt.h (struct sfnt_cmap_format_4): Introduce previously
absent `range_shift' field.
2023-08-24 16:36:13 +08:00
Po Lu
a7c13f535f Stifle a compiler warning under GCC 13
* src/haiku_support.cc (MessageReceived): Shun snprintf, as GCC
produces false positives cautioning against truncation.
2023-08-24 05:13:23 +00:00
Po Lu
32fe187bdf Install rcs2log within Emacs packages for Android
* doc/emacs/android.texi (Android Environment): Mention the
`rcs2log' program name variable.  Also refine the wording of the
paragraph describing bundled programs a bit.

* doc/lispref/processes.texi (Subprocess Creation): Mention
`rcs2log' and `rcs2log-program-name'.  Correct typos and
spelling mistakes within the variable index.

* etc/NEWS: Amend the announcement of *-program-name to also
cite rcs2log.

* java/Makefile.in (install_temp): Copy rcs2log to
lib/*/librcs2log.so after minor revisions to change the
interpreter name.

* lisp/vc/vc-rcs.el (vc-rcs-rcs2log-program): Ground the program
name upon `rcs2log-program-name'.

* src/callproc.c (syms_of_callproc) <Vrcs2log_program_name>: New
defvar.  Define to `librcs2log.so' under Android, `rcs2log'
elsewhere.
2023-08-24 12:41:54 +08:00
Po Lu
1986484d4d Properly detect medium fonts
* src/sfntfont.c (sfnt_decode_family_style): Refer to the
preferred family and subfamily if present.
2023-08-24 09:08:11 +08:00
Po Lu
81fc5d83fe Repair displaying compound glyph components with anchor points
* src/sfnt.c (sfnt_interpret_compound_glyph_1): Move
initialization of x and y out of conditional.
2023-08-23 12:09:27 +08:00
Po Lu
d2e8985b80 Fix compatibility problems with several fonts
* src/sfnt.c (sfnt_lookup_glyph_8): Perform binary search
instead of combing through each group if the table is large.
(sfnt_read_simple_glyph): Avoid losing if the last byte of a
vector is identical to the last byte of the glyph data.
(sfnt_read_gvar_table): Don't overwrite gvar table data while
reading shared coordinates.
2023-08-23 09:15:16 +08:00
Po Lu
8e51a3e3f8 Avoid crashes rescaling fonts with long names
* src/font.c (font_rescale_ratio): Check NAME is not nil before
matching it against a regexp.
2023-08-22 17:34:41 +08:00
Po Lu
269fd08dab ; Amend doc strings of two functions
* src/dispnew.c (syms_of_display):

* src/frame.c (Fwindow_system): Revise doc strings to mention
the `android' value.
2023-08-22 17:17:32 +08:00
Po Lu
7af94bacd7 Optimize format 12 cmap table lookup
* src/sfnt.c (sfnt_compare_char): New function.
(sfnt_lookup_glyph_12): Detect ``large'' cmap tables of format
12 and perform a binary search.  Such tables are frequently
provided by CJK fonts.
2023-08-22 16:45:35 +08:00
Jim Porter
357c2fba98 Merge from origin/emacs-29
3296031ad7 ; Another improvement for documentation of pixelwise scro...
baeb2d71ae Support defun navigation for DEFUN in c-ts-mode (bug#64442)
781ddd7e7d Fix touchpad scrolling on MS-Windows
c125bd060e Fix order in which package-vc dependencies are resolved
500ced133a Fix building of VC package manuals with relative org link...
456ecabe9e Fix the documentation of 'cl-flet'
f6ebd1ef0d ; * src/treesit.c (Ftreesit_node_parent): Improve comment...
fac0e2d533 Avoid false "wrong passphrase" messages in EPA
8f683b51d8 Fix jsx font-lock in older tree-sitter-js grammars
d9af79ae39 Fix cloning 'face-remapping-alist' for indirect buffers
636fb267c4 Improve documentation of case transfer in replacement com...
7856d51436 Fix horizontal scrolling of images with C-f
8cf5659ec2 ; Fix defcustom in completion.el
a8c8a4e368 ; * src/fns.c (Fcopy_sequence): Doc fix.  (Bug#64960)
205d87cdca Fix unpacking ZIP archives on MS-Windows
3712e8bc38 ; Fix typos in lisp/keymap.el doc strings (bug#65329).
21b2ecee66 Fix command example in Eshell manual
26949819df ; lisp/progmodes/csharp-mode.el (treesit-query-capture): ...
221ed70b90 ; Improve documentation of 'define-alternatives'
32280205e2 Add user options mentioned in the Eshell manual to the va...
cf3145a486 * Add missing alias to `native-comp-enable-subr-trampolin...
922b649028 * Add missing alias to `native-comp-enable-subr-trampolin...
6962823c83 ; * etc/PROBLEMS: Fix typo and clarify wording.

# Conflicts:
#	doc/misc/eshell.texi
2023-08-21 18:23:11 -07:00
Po Lu
fb5e1b21fb Properly enumerate GX fonts of the same family with divergent styles
* doc/emacs/android.texi (Android Fonts): Revise explanation of
GX font replacement during font enumeration.

* src/sfntfont.c (sfnt_replace_fonts_p): If PREV and DESC are of
the same family and both are GX fonts, restrict actions taken to
removing duplicate styles from PREV.  Reported by a user who
tried to install GX versions of Cascadia Mono, which are
distributed as two files providing the bold and italic variation
axes respectively.
2023-08-21 20:45:34 +08:00
Po Lu
722559155d ; Adjust commentary
* src/androidterm.c (android_text_to_string)
(android_update_selection, android_reset_conversion)
(android_set_build_fingerprint): Refine wording in commentary
and correct typos.
2023-08-21 16:03:54 +08:00
Po Lu
b1e498ac8c Enable providing icons for Android desktop notifications
* doc/lispref/os.texi (Desktop Notifications)
<android-notifications-notify>: Mention the :icon parameter.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(EmacsDesktopNotification) <icon>: New field.
(<init>): New argument ICON.  Set this.icon to its value.
(display1): Use provided icon and always supply a pending intent
to open Emacs once the notification is clicked.

* java/res/layout/sdk8_notifications_view.xml
(sdk8_notifications_title, sdk8_notifications_content): Set
foreground color to #000000.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update signature of <init>.
(android_locate_icon): New function.
(android_notifications_notify_1): New arg ICON.
(Fandroid_notifications_notify): New parameter icon.
(syms_of_androidselect): <QCicon>: New symbol.
2023-08-21 09:36:52 +08:00
Po Lu
4f714dc081 Support desktop notifications on Android
* doc/emacs/android.texi (Android Environment): Correct list of
permissions granted by default.

* doc/lispref/os.texi (Desktop Notifications): Document the new
function `android-notifications-notify' and its limitations.

* java/AndroidManifest.xml.in: Request notification permissions.

* java/org/gnu/emacs/EmacsDesktopNotification.java: New file.

* java/res/layout/sdk8_notifications_view.xml: New file holding
substitute notification widget definitions for Android versions
prior to 3.0.

* java/res/values/strings.xml: Remove inadvertently introduced
tag attribute.

* lisp/org/org-clock.el (haiku-notifications-notify): Correct
file name in function declaration.
(android-notifications-notify): New declaration.
(org-show-notification): Use `android-notifications-notify'.

* src/androidselect.c (android_init_emacs_desktop_notification)
(android_notifications_notify_1, Fandroid_notifications_notify):
New functions.
(init_androidselect, syms_of_androidselect): Initialize new
class and define new subr.
2023-08-20 20:25:53 +08:00
Po Lu
fd1479a0af Fix libselinux object leaks
* src/fileio.c (Fcopy_file, Fset_file_selinux_context): Call
freecon prior to signaling file errors.
2023-08-20 12:48:03 +08:00
Po Lu
15e498047f Update Android port
* src/sfnt.c (sfnt_decompose_compound_glyph): New argument
GET_METRICS.  Call this function to retrieve glyph metrics used
to compute phantom points when a component glyph's anchor point
is one.
(sfnt_decompose_glyph, sfnt_build_glyph_outline): Plumb
GET_METRICS these two functions.
(sfnt_interpret_shc): Don't shift the provided reference point.
(sfnt_transform_f26dot6): Eschew looping through X and Y if no
offsets are provided.
(sfnt_interpret_compound_glyph_2): Discontinue initializing
phantom points here.
(sfnt_interpret_compound_glyph_1): Do not incorporate phantom
points into the ultimately produced glyph outline.  Correctly
provide for phantom childanchor points.
(sfnt_test_get_metrics, main): Update tests.

* src/sfnt.h: Update prototypes.

* src/sfntfont.c (struct sfntfont_get_glyph_outline_dcontext):
New fields `hmtx', `hhea' and `maxp'.
(sfntfont_get_metrics): New function.
(sfntfont_get_glyph_outline): Provide new tables and the new
callback function.
2023-08-20 12:48:03 +08:00
Eli Zaretskii
781ddd7e7d Fix touchpad scrolling on MS-Windows
* src/w32term.c (w32_construct_mouse_wheel): The number of lines
to scroll should always be positive in wheel-scroll events.
Whether to scroll up or down is encoded in the modifiers, which
produce either wheel-up or wheel-down event.  (Bug#65070)

* doc/lispref/commands.texi (Misc Events): Clarify the
documentation of 'wheel-up' and 'wheel-down' events.
2023-08-19 17:01:18 +03:00
Eli Zaretskii
a85f31c4a4 ; * src/androidterm.c (android_text_to_string): Fix commentary. 2023-08-19 14:29:25 +03:00
Eli Zaretskii
8e8468c46d ; Cleanup comments and doc strings in textconv.c
* src/textconv.c (copy_buffer_text): Rename from 'copy_buffer'.
All callers changed.
(textconv_query, complete_edit_check, commit_text)
(finish_composing_text, set_composing_region)
(textconv_set_point_and_mark, delete_surrounding_text)
(request_point_update, textconv_barrier, get_extracted_text)
(get_surrounding_text, report_point_change)
(report_selected_window_change): Fix commentary.
(Fset_text_conversion_style, text-conversion-edits)
(overriding-text-conversion-style, text-conversion-face): Doc fix.
2023-08-19 13:32:48 +03:00
Eli Zaretskii
b12ce748d1 ; * src/fileio.c (Fset_file_acl): Don't leak memory. 2023-08-19 10:28:47 +03:00
Po Lu
b57a648648 ; * src/textconv.c (Fset_text_conversion_style): Fix typo. 2023-08-19 13:37:55 +08:00
Po Lu
2effd18c97 Make some file I/O operations more robust on Android
* src/android.h (android_readlinkat): New prototype.
* src/androidvfs.c (struct android_vops): New function pointer
`readlink'.
(unix_vfs_ops, android_unix_readlink, afs_vfs_ops)
(android_afs_readlink, content_vfs_ops, android_content_mkdir)
(android_content_chmod, authority_vfs_ops)
(android_authority_readlink, saf_root_vfs_ops)
(android_saf_root_readlink, saf_tree_vfs_ops)
(android_saf_tree_readlink, saf_file_vfs_ops, saf_new_vfs_ops)
(android_saf_new_readlink, root_vfs_ops): Implement new
`readlink' vops for each vnode type.
(android_readlinkat): New function.

* src/fileio.c (Fcopy_file): Be more flexible about SELinux
errors under Android.
(emacs_readlinkat): Use `android_readlink' when built as
libemacs.so.
2023-08-19 13:25:42 +08:00
Po Lu
ec8f330df6 ; Remove set but unused variable
* src/androidvfs.c (android_check_content_access): Delete
`length'.
2023-08-19 09:08:47 +08:00
Po Lu
449008a60f Disable text conversion inside read-char-exclusive
* src/lread.c (read_filtered_event): Disable text conversion if
merely ascii_required.  (bug#65370)
2023-08-19 08:51:44 +08:00
Po Lu
6a4b6c3e83 Disable text conversion within read-char-from-minibuffer
* lisp/subr.el (read-char-from-minibuffer): Disable text
conversion.  (bug#65370)
(y-or-n-p): Remove redundant binding of
`override-text-conversion-style', given that read-key already
disables text conversion.

* src/textconv.c (Fset_text_conversion_style): Always reset text
conversion for the selected frame in addition to any displaying
current_buffer.
2023-08-19 08:48:20 +08:00
Stefan Monnier
4f1ce5db12 (Fmake_local_variable): Fix bug#65209
* src/data.c (Fmake_local_variable): Don't delegate to `Fset` since
they have to obey `let_shadows_buffer_binding_p` whereas we don't.

* test/src/data-tests.el (data-tests--bug65209): New var.
(data-tests-make-local-bug65209): New test.
2023-08-18 19:22:17 -04:00
Eli Zaretskii
f6ebd1ef0d ; * src/treesit.c (Ftreesit_node_parent): Improve commentary. 2023-08-18 09:19:59 +03:00
Eli Zaretskii
3685387e60 Fix invocation with --debug-init and changes to debug-ignored-errors
* src/eval.c (syms_of_eval) <debug-ignored-errors>: Mention in the
doc string the caveat with removing errors from the standard value
while invoking Emacs with --debug-init.

* lisp/startup.el (startup--load-user-init-file): If the user's
init files add to the value of 'debug-ignored-errors', make sure
the additions are preserved after restoring the value we reset
during loading the init file, if Emacs was invoked with
"--debug-init".  (Bug#65267)
2023-08-17 21:35:20 +03:00
Po Lu
5856ea5e4e Introduce support for Desktop Notifications on Haiku
* doc/lispref/os.texi (Desktop Notifications): Document Haiku
desktop notifications.

* etc/NEWS: Announce this change.

* lisp/org/org-clock.el (haiku-notifications-notify): New
declaration.
(org-show-notification): Employ that function.

* src/haiku_io.c (haiku_len) <NOTIFICATION_CLICK_EVENT>: Return
the length for this type of event.

* src/haiku_select.cc (my_team_id, be_display_notification): New
functions.

* src/haiku_support.cc (my_team_id, ArgvReceived): New
functions.

* src/haiku_support.h (enum haiku_event_type): New event type
NOTIFICATION_CLICK_EVENT.
(struct haiku_notification_click_event): New structure.

* src/haikuselect.c (haiku_notifications_notify_1)
(Fhaiku_notifications_notify): New functions.
(syms_of_haikuselect): Register new defsubr.

* src/haikuterm.c (haiku_read_socket):
* src/haikuselect.h:
* src/termhooks.h: Add new events for notification clicks on
Haiku.
2023-08-17 08:34:32 +00:00
Eli Zaretskii
636fb267c4 Improve documentation of case transfer in replacement commands
* doc/emacs/search.texi (Replacement and Lax Matches):
* src/search.c (Freplace_match):
* lisp/replace.el (query-replace, query-replace-regexp): Clarify
in the doc string and the manual how letter-case is transferred
from the replaced text to the replacement text.  (Bug#65347)
2023-08-17 10:07:48 +03:00
Dmitry Gutov
9dff654432 * src/fileio.c (Ffile_name_concat): Improve docstring. 2023-08-17 04:16:09 +03:00
Gregory Heytings
9e9e11648d Simplify 'without-restriction'
This simplification is symmetrical to 01fb898420.

* src/editfns.c: (Finternal__labeled_widen): Add a call to
'Fwiden', and rename from 'internal--unlabel-restriction'.
(unwind_labeled_narrow_to_region): Use the renamed function, and
remove the call to 'Fwiden'.
(syms_of_editfns): Rename the symbol.

* lisp/subr.el (internal--without-restriction): Use the renamed
function.
2023-08-16 16:06:34 +00:00
Eli Zaretskii
a8c8a4e368 ; * src/fns.c (Fcopy_sequence): Doc fix. (Bug#64960) 2023-08-16 15:42:24 +03:00
Po Lu
f2f2e6a082 Update Android port
* configure.ac: Test for getpwent using gl_CHECK_FUNCS_ANDROID.
(bug#65319)

* etc/MACHINES (Android): Mention that a non-GUI build is also
possible on Android.

* lisp/loadup.el: Provide for regular builds on Android.
(bug#65339)

* lisp/wid-edit.el (widget-event-start): Remove function, since
event-start now does the same thing.
(widget-button--check-and-call-button, widget-button-click):
Adjust correspondingly.  Reported by Stefan Monnier
<monnier@iro.umontreal.ca>.

* src/sysdep.c (close_output_streams): Apply workarounds for the
file descriptor sanitizer on all builds where __ANDROID__ is
defined, not just Android port builds.  (bug#65340)
2023-08-16 20:32:38 +08:00
Po Lu
24886a2cc4 Remove get_boot_time from msdos.c
* src/msdos.c (get_boot_time): That all of the actual locking in
filelock.c is under #ifndef MSDOS escaped my notice.  Remove
this unused function.
2023-08-16 11:12:44 +08:00
Po Lu
6dacf5bce4 Fix display of compound glyphs that employ simple transforms
* src/sfnt.c (sfnt_transform_coordinates): Always compute an
affine transform matrix except if no scale is provided at all.
Unconditionally apply x_off and y_off.
(sfnt_decompose_compound_glyph): Delete arguments OF_X and
OFF_Y.  Apply component offsets after writing simple glyph
contours.
(sfnt_decompose_glyph): Modify for new calling convention.
(sfnt_transform_f26dot6): Modify analogously to
sfnt_decompose_compound_glyph.  Also correct anchor offset
computation to scale the unscaled component anchor coordinates
by the interpreter scale.
(sfnt_interpret_compound_glyph_1): Also modify for new calling
convention.
* src/sfnt.h (struct sfnt_compound_glyph_component): <u>: Make
scale fields signed.
2023-08-16 11:02:55 +08:00
Paul Eggert
cc5649bd28 Simplify get_boot_sec
* src/filelock.c (get_boot_sec):
Simplify by removing a special case for MS-DOS.
* src/msdos.c (get_boot_time): New dummy that always fails.
2023-08-15 15:55:40 -07:00
Po Lu
a8365aa841 Micro-optimize GXAXIS
* src/sfnt.c (GXAXIS): Check for the availability of naxis slot
elements in a single operation.
2023-08-15 08:59:03 +08:00