Mercurial > hg > xemacs-beta
annotate lwlib/lwlib-fonts.c @ 5182:2e528066e2fc
Move #'sort*, #'fill, #'merge to C from cl-seq.el.
lisp/ChangeLog addition:
2010-04-01 Aidan Kehoe <kehoea@parhasard.net>
* cl-seq.el (fill, sort*, merge): Move these functions to fns.c.
(stable-sort): Make this docstring reflect the argument names used
in the #'sort* docstring.
* cl-macs.el (stable-sort): Make #'stable-sort exactly equivalent
to #'sort* in compiled code.
* bytecomp.el (byte-compile-maybe-add-*):
New macro, for functions like #'sort and #'mapcar that, to be
strictly compatible, should only take two args, but in our
implementation can take more, because they're aliases of #'sort*
and #'mapcar*.
(byte-compile-mapcar, byte-compile-sort, byte-compile-fillarray):
Use this new macro.
(map-into): Add a byte-compile method for #'map-into in passing.
* apropos.el (apropos-print): Use #'sort* with a :key argument,
now it's in C.
* compat.el (extent-at): Ditto.
* register.el (list-registers): Ditto.
* package-ui.el (pui-list-packages): Ditto.
* help.el (sorted-key-descriptions): Ditto.
src/ChangeLog addition:
2010-03-31 Aidan Kehoe <kehoea@parhasard.net>
* fns.c (STRING_DATA_TO_OBJECT_ARRAY)
(BIT_VECTOR_TO_OBJECT_ARRAY, c_merge_predicate_key)
(c_merge_predicate_nokey, list_merge, array_merge)
(list_array_merge_into_list, list_list_merge_into_array)
(list_array_merge_into_array, CHECK_KEY_ARGUMENT, Fmerge)
(list_sort, array_sort, FsortX):
Move #'sort*, #'fill, #'merge from cl-seq.el to C, extending the
implementations of Fsort, Ffillarray, and merge() to do so.
* keymap.c (keymap_submaps, map_keymap_sort_predicate)
(describe_map_sort_predicate):
Change the calling semantics of the C sort predicates to return a
non-nil Lisp object if the first argument is less than the second,
rather than C integers.
* fontcolor-msw.c (sort_font_list_function):
* fileio.c (build_annotations):
* dired.c (Fdirectory_files):
* abbrev.c (Finsert_abbrev_table_description):
Call list_sort instead of Fsort, list_merge instead of merge() in
these functions.
man/ChangeLog addition:
2010-04-01 Aidan Kehoe <kehoea@parhasard.net>
* lispref/lists.texi (Rearrangement):
Update the documentation of #'sort here, now that it accepts any
type of sequence and the KEY keyword argument. (Though this is
probably now the wrong place for this function, given that.)
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 01 Apr 2010 20:22:50 +0100 |
parents | a6c778975d7d |
children | c9d31263ab7d 308d34e9f07d |
rev | line source |
---|---|
3094 | 1 /* Font handling code for X and Xft. |
2 | |
3 Copyright (C) 2003 Eric Knauel | |
4 Copyright (C) 2004 Free Software Foundation, Inc. | |
5 | |
6 Author: Stephen J. Turnbull <stephen@xemacs.org> | |
7 Created: 24 Jul 2004 by Stephen J. Turnbull | |
8 | |
9 This file is part of XEmacs. | |
10 | |
11 XEmacs is free software; you can redistribute it and/or modify it | |
12 under the terms of the GNU General Public License as published by the | |
13 Free Software Foundation; either version 2, or (at your option) any | |
14 later version. | |
15 | |
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
19 for more details. | |
20 | |
21 You should have received a copy of the GNU General Public License | |
22 along with XEmacs; see the file COPYING. If not, write to | |
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 Boston, MA 02111-1307, USA. */ | |
25 | |
26 /* Synched up with: Not in GNU Emacs. */ | |
27 | |
28 #include <config.h> | |
29 #include <stdio.h> | |
30 #include <stdlib.h> | |
31 #include "lwlib-fonts.h" | |
32 | |
33 #if 0 | |
34 /* these are all from ../src; if we need them move the code */ | |
35 #include "lisp.h" | |
36 #include "device.h" | |
37 #include "device-impl.h" | |
38 #include "console-x-impl.h" | |
3360 | 39 #ifdef HAVE_FONTCONFIG |
3354 | 40 #include "font-mgr.h" |
3094 | 41 #endif |
3360 | 42 #endif |
3094 | 43 |
44 /* | |
45 * code for handling Xft | |
46 */ | |
47 | |
4916
a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents:
3360
diff
changeset
|
48 #ifdef HAVE_XFT |
3094 | 49 |
50 /* helper function to correctly open Xft/core fonts by name | |
51 #### Can't we use FcParseName here? | |
52 #### Is this done so often that the logic needs to be hard-coded in C? | |
53 | |
54 Daniel Pittman sez: Older code tried to enforce that an XLFD font was | |
55 not scaled, while this version just doesn't care. I think that is a | |
56 better behavior, since if someone really wants a scaled font we should | |
57 oblige them. | |
58 | |
59 Stephen sez: This whole function was ill-conceived, and I'm not sure it | |
60 succeeds at any of the things it attempts to do. First, we should be | |
61 using fontconfig directly. I'm not sure what Xft (or fontconfig) will | |
62 try to do if passed an XLFD. As for scaled fonts, both options are | |
63 equally bad. The problem is that the X server will often scale bitmap | |
64 fonts willy-nilly; it's worth trying to avoid that, but I can't say | |
65 whether that's worth overriding somebody who knows what they're doing. | |
66 In any case, I think we should find out what Xft (fontconfig?) is able | |
67 and willing to do with XLFDs, and probably move the logic to LISP. | |
68 */ | |
69 XftFont * | |
70 xft_open_font_by_name (Display *dpy, char *name) | |
71 { | |
72 XftFont *res = NULL; | |
73 | |
74 /* if (!NILP (Fxft_xlfd_font_name_p (make_string (name, strlen (name))))) */ | |
75 /* #### this is bogus but ... */ | |
76 int count = 0; | |
77 char *pos = name; | |
78 /* extra parens shut up gcc */ | |
79 while ((pos = index (pos, '-'))) | |
80 { | |
81 count++; | |
82 pos++; | |
83 } | |
84 | |
85 /* #### hard-coding DefaultScreen is evil! */ | |
86 if (count == 14 /* fully-qualified XLFD */ | |
87 || (count < 14 /* heuristic for wildcarded XLFD */ | |
88 && count >= 5 | |
89 && index (name, '*'))) | |
90 res = XftFontOpenXlfd (dpy, DefaultScreen (dpy), name); | |
91 else | |
92 res = XftFontOpenName (dpy, DefaultScreen (dpy), name); | |
93 | |
94 /* Try for a generic monospace font | |
95 #### Why? Menus don't need to line up in columns! */ | |
96 if (!res) | |
97 res = XftFontOpenName (dpy, DefaultScreen (dpy), "monospace"); | |
98 /* Try for anything we can get */ | |
99 if (!res) | |
100 res = XftFontOpenName (dpy, DefaultScreen (dpy), ""); | |
101 | |
102 if (!res) | |
103 { | |
104 /* #### This is Just So Wrong ... ! */ | |
105 /* sorry folks ... */ | |
106 fprintf (stderr, | |
107 "Unable to find any usable XFT font, even the defaults!\n"); | |
108 abort (); | |
109 return 0; | |
110 } | |
111 | |
112 return res; | |
113 } | |
114 | |
4916
a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents:
3360
diff
changeset
|
115 #endif /* HAVE_XFT */ |
3094 | 116 |
117 /* End of lwlib-fonts.c */ |