diff options
| author | Po Lu | 2023-09-16 10:38:46 +0800 |
|---|---|---|
| committer | Po Lu | 2023-09-16 10:38:46 +0800 |
| commit | ee4b6a4a2d6b2779cdcf662938b5c81dc2fd2bef (patch) | |
| tree | 2a76448b0abe5f75afb9dc72fd8ef91916bf9689 /src | |
| parent | bc25d76650ab6b534b4016c607c36f8b67267dc0 (diff) | |
| download | emacs-ee4b6a4a2d6b2779cdcf662938b5c81dc2fd2bef.tar.gz emacs-ee4b6a4a2d6b2779cdcf662938b5c81dc2fd2bef.zip | |
Update Android port
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return
false if the list of menu buttons is empty, lest Android cease
displaying menus on the assumption that Emacs is defective.
* java/org/gnu/emacs/EmacsView.java (popupMenu): Likewise.
* src/fns.c (sort_list): Render sentence motion commands
functional within commentary
* src/sfntfont.c (sfntfont_list_family): Sort and deduplicate
the returned family list and make it a list of symbols.
(syms_of_sfntfont) <Qstring_lessp>: New defsym.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 6 | ||||
| -rw-r--r-- | src/sfntfont.c | 32 |
2 files changed, 32 insertions, 6 deletions
| @@ -2334,9 +2334,9 @@ See also the function `nreverse', which is used more often. */) | |||
| 2334 | 2334 | ||
| 2335 | 2335 | ||
| 2336 | /* Stably sort LIST ordered by PREDICATE using the TIMSORT | 2336 | /* Stably sort LIST ordered by PREDICATE using the TIMSORT |
| 2337 | algorithm. This converts the list to a vector, sorts the vector, | 2337 | algorithm. This converts the list to a vector, sorts the vector, |
| 2338 | and returns the result converted back to a list. The input list is | 2338 | and returns the result converted back to a list. The input list |
| 2339 | destructively reused to hold the sorted result. */ | 2339 | is destructively reused to hold the sorted result. */ |
| 2340 | 2340 | ||
| 2341 | static Lisp_Object | 2341 | static Lisp_Object |
| 2342 | sort_list (Lisp_Object list, Lisp_Object predicate) | 2342 | sort_list (Lisp_Object list, Lisp_Object predicate) |
diff --git a/src/sfntfont.c b/src/sfntfont.c index d6dfa8b6f0d..0696b66d244 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c | |||
| @@ -3646,8 +3646,9 @@ sfntfont_draw (struct glyph_string *s, int from, int to, | |||
| 3646 | Lisp_Object | 3646 | Lisp_Object |
| 3647 | sfntfont_list_family (struct frame *f) | 3647 | sfntfont_list_family (struct frame *f) |
| 3648 | { | 3648 | { |
| 3649 | Lisp_Object families; | 3649 | Lisp_Object families, tem, next; |
| 3650 | struct sfnt_font_desc *desc; | 3650 | struct sfnt_font_desc *desc; |
| 3651 | unsigned short count; | ||
| 3651 | 3652 | ||
| 3652 | families = Qnil; | 3653 | families = Qnil; |
| 3653 | 3654 | ||
| @@ -3655,8 +3656,30 @@ sfntfont_list_family (struct frame *f) | |||
| 3655 | /* Add desc->family to the list. */ | 3656 | /* Add desc->family to the list. */ |
| 3656 | families = Fcons (desc->family, families); | 3657 | families = Fcons (desc->family, families); |
| 3657 | 3658 | ||
| 3658 | /* Not sure if deleting duplicates is worth it. Is this ever | 3659 | /* Sort families in preparation for removing duplicates. */ |
| 3659 | called? */ | 3660 | families = Fsort (families, Qstring_lessp); |
| 3661 | |||
| 3662 | /* Remove each duplicate within families. */ | ||
| 3663 | |||
| 3664 | tem = families; | ||
| 3665 | while (!NILP (tem) && !NILP ((next = XCDR (tem)))) | ||
| 3666 | { | ||
| 3667 | /* If the two strings are equal. */ | ||
| 3668 | if (!NILP (Fstring_equal (XCAR (tem), XCAR (next)))) | ||
| 3669 | /* Set tem's cdr to the cons after the next item. */ | ||
| 3670 | XSETCDR (tem, XCDR (next)); | ||
| 3671 | else | ||
| 3672 | /* Otherwise, start considering the next item. */ | ||
| 3673 | tem = next; | ||
| 3674 | } | ||
| 3675 | |||
| 3676 | /* Intern each font family. */ | ||
| 3677 | |||
| 3678 | tem = families; | ||
| 3679 | |||
| 3680 | FOR_EACH_TAIL (tem) | ||
| 3681 | XSETCAR (tem, Fintern (XCAR (tem), Qnil)); | ||
| 3682 | |||
| 3660 | return families; | 3683 | return families; |
| 3661 | } | 3684 | } |
| 3662 | 3685 | ||
| @@ -3962,6 +3985,9 @@ syms_of_sfntfont (void) | |||
| 3962 | /* Default foundry name. */ | 3985 | /* Default foundry name. */ |
| 3963 | DEFSYM (Qmisc, "misc"); | 3986 | DEFSYM (Qmisc, "misc"); |
| 3964 | 3987 | ||
| 3988 | /* Predicated employed for sorting font family lists. */ | ||
| 3989 | DEFSYM (Qstring_lessp, "string-lessp"); | ||
| 3990 | |||
| 3965 | /* Set up staticpros. */ | 3991 | /* Set up staticpros. */ |
| 3966 | sfnt_vendor_name = Qnil; | 3992 | sfnt_vendor_name = Qnil; |
| 3967 | staticpro (&sfnt_vendor_name); | 3993 | staticpro (&sfnt_vendor_name); |