Mercurial > hg > xemacs-beta
annotate lisp/x-misc.el @ 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 | e29fcfd8df5f |
children | d0bb90d90736 308d34e9f07d |
rev | line source |
---|---|
428 | 1 ;;; x-misc.el --- miscellaneous X functions. |
2 | |
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Sun Microsystems. | |
5 ;; Copyright (C) 1995, 1996 Ben Wing. | |
6 | |
7 ;; Author: Ben Wing <ben@xemacs.org> | |
8 ;; Maintainer: XEmacs Development Team | |
9 ;; Keywords: extensions, dumped | |
10 | |
11 ;; This file is part of XEmacs. | |
12 | |
13 ;; XEmacs is free software; you can redistribute it and/or modify it | |
14 ;; under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; XEmacs is distributed in the hope that it will be useful, but | |
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 ;; General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with XEmacs; see the file COPYING. If not, write to the | |
25 ;; Free Software Foundation, 59 Temple Place - Suite 330, | |
26 ;; Boston, MA 02111-1307, USA. | |
27 | |
28 ;;; Commentary: | |
29 | |
30 ;; This file is dumped with XEmacs (when X support is compiled in). | |
31 | |
32 ;;; Code: | |
33 | |
502 | 34 (globally-declare-fboundp |
35 '(x-get-resource)) | |
36 | |
428 | 37 (defun x-bogosity-check-resource (name class type) |
38 "Check for a bogus resource specification." | |
39 (let ((bogus (x-get-resource | |
40 (concat "__no-such-friggin-locale__." name) | |
41 (concat "__No-such-friggin-widget__." class) | |
42 type 'global nil t))) | |
43 (if bogus | |
44 (display-warning | |
45 'resource | |
46 (format "Bad resource specification encountered: something like | |
47 Emacs*%s: %s | |
48 You should replace the * with a . in order to get proper behavior when | |
49 you use the specifier and/or `set-face-*' functions." name bogus))))) | |
50 | |
51 (defun x-init-specifier-from-resources (specifier type locale | |
52 &rest resource-list) | |
53 "Initialize a specifier from the resource database. | |
54 LOCALE specifies the locale that is to be initialized and should be | |
55 a frame, a device, or 'global. TYPE is the type of the resource and | |
56 should be one of 'string, 'boolean, 'integer, or 'natnum. The | |
57 remaining args should be conses of names and classes of resources | |
58 to be examined. The first resource with a value specified becomes | |
59 the spec for SPECIFIER in LOCALE. (However, if SPECIFIER already | |
60 has a spec in LOCALE, nothing is done.) Finally, if LOCALE is 'global, | |
61 a check is done for bogus resource specifications." | |
62 (if (eq locale 'global) | |
4783
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
502
diff
changeset
|
63 (mapc #'(lambda (x) |
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
502
diff
changeset
|
64 (x-bogosity-check-resource (car x) (cdr x) type)) |
e29fcfd8df5f
Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
502
diff
changeset
|
65 resource-list)) |
428 | 66 (if (not (specifier-spec-list specifier locale)) |
67 (catch 'done | |
68 (while resource-list | |
69 (let* ((name (caar resource-list)) | |
70 (class (cdar resource-list)) | |
71 (resource | |
442 | 72 (x-get-resource name class type locale nil 'warn))) |
428 | 73 (if resource |
74 (progn | |
75 (add-spec-to-specifier specifier resource locale) | |
76 (throw 'done t)))) | |
77 (setq resource-list (cdr resource-list)))))) | |
78 | |
79 (defun x-get-resource-and-bogosity-check (name class type &optional locale) | |
80 (x-bogosity-check-resource name class type) | |
442 | 81 (x-get-resource name class type locale nil 'warn)) |
428 | 82 |
83 (defun x-get-resource-and-maybe-bogosity-check (name class type &optional | |
84 locale) | |
85 (if (eq locale 'global) | |
86 (x-bogosity-check-resource name class type)) | |
442 | 87 (x-get-resource name class type locale nil 'warn)) |
428 | 88 |
89 ;;; x-misc.el ends here |