aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2010-08-08 17:15:44 -0400
committerChong Yidong2010-08-08 17:15:44 -0400
commitcc36ae609d01e7922c662c78866300d57b34b07e (patch)
tree2fc2af92520d09b2fb9cf4014187496cf35793df /src
parent675e2c697bc8a0ff827fcb33297f63f4cc7ecad3 (diff)
parent7815fe1985833c57457882b415a29358991dabdc (diff)
downloademacs-cc36ae609d01e7922c662c78866300d57b34b07e.tar.gz
emacs-cc36ae609d01e7922c662c78866300d57b34b07e.zip
Merge changes from emacs-23 branch.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog32
-rw-r--r--src/charset.c86
-rw-r--r--src/coding.c2
-rw-r--r--src/dired.c3
-rw-r--r--src/fns.c23
-rw-r--r--src/minibuf.c3
-rw-r--r--src/w32fns.c2
-rw-r--r--src/xfns.c10
8 files changed, 128 insertions, 33 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7931a9bbfa6..8214030d4d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12010-08-08 Kenichi Handa <handa@m17n.org>
2
3 * charset.c: Include <stdlib.h>
4 (struct charset_sort_data): New struct.
5 (charset_compare): New function.
6 (Fsort_charsets): New funciton.
7 (syms_of_charset): Declare Fsort_charsets as a Lisp function.
8
9 * coding.c (decode_coding_iso_2022): Fix checking of dimension
10 number in CTEXT extended segment.
11
122010-08-08 Juanma Barranquero <lekktu@gmail.com>
13
14 * w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring.
15 * xfns.c (syms_of_xfns) <x-max-tooltip-size>: Reflow docstring.
16
172010-08-08 Juanma Barranquero <lekktu@gmail.com>
18
19 * fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep)
20 (Fhash_table_size): Fix typos in docstrings.
21 (Fmake_hash_table): Doc fix.
22
232010-08-08 Juanma Barranquero <lekktu@gmail.com>
24
25 * minibuf.c (syms_of_minibuf) <read-buffer-function>:
26 Doc fix (bug#5625).
27
282010-08-08 Ken Brown <kbrown@cornell.edu>
29
30 * dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of
31 the MSDOS definition.
32
12010-08-08 Dan Nicolaescu <dann@ics.uci.edu> 332010-08-08 Dan Nicolaescu <dann@ics.uci.edu>
2 34
3 Use const char* instead of char*. 35 Use const char* instead of char*.
diff --git a/src/charset.c b/src/charset.c
index 9811e63118e..036d7146db6 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <config.h> 28#include <config.h>
29 29
30#include <stdio.h> 30#include <stdio.h>
31#include <stdlib.h>
31#include <unistd.h> 32#include <unistd.h>
32#include <ctype.h> 33#include <ctype.h>
33#include <sys/types.h> 34#include <sys/types.h>
@@ -2071,23 +2072,22 @@ that case, find the charset from what supported by that coding system. */)
2071 charset = CHAR_CHARSET (XINT (ch)); 2072 charset = CHAR_CHARSET (XINT (ch));
2072 else 2073 else
2073 { 2074 {
2074 Lisp_Object charset_list;
2075
2076 if (CONSP (restriction)) 2075 if (CONSP (restriction))
2077 { 2076 {
2078 for (charset_list = Qnil; CONSP (restriction); 2077 int c = XFASTINT (ch);
2079 restriction = XCDR (restriction)) 2078
2079 for (; CONSP (restriction); restriction = XCDR (restriction))
2080 { 2080 {
2081 int id; 2081 struct charset *charset;
2082 2082
2083 CHECK_CHARSET_GET_ID (XCAR (restriction), id); 2083 CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset);
2084 charset_list = Fcons (make_number (id), charset_list); 2084 if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset))
2085 return XCAR (restriction);
2085 } 2086 }
2086 charset_list = Fnreverse (charset_list); 2087 return Qnil;
2087 } 2088 }
2088 else 2089 restriction = coding_system_charset_list (restriction);
2089 charset_list = coding_system_charset_list (restriction); 2090 charset = char_charset (XINT (ch), restriction, NULL);
2090 charset = char_charset (XINT (ch), charset_list, NULL);
2091 if (! charset) 2091 if (! charset)
2092 return Qnil; 2092 return Qnil;
2093 } 2093 }
@@ -2238,6 +2238,69 @@ Return charset identification number of CHARSET. */)
2238 return make_number (id); 2238 return make_number (id);
2239} 2239}
2240 2240
2241struct charset_sort_data
2242{
2243 Lisp_Object charset;
2244 int id;
2245 int priority;
2246};
2247
2248static int
2249charset_compare (const void *d1, const void *d2)
2250{
2251 const struct charset_sort_data *data1 = d1, *data2 = d2;
2252 return (data1->priority - data2->priority);
2253}
2254
2255DEFUN ("sort-charsets", Fsort_charsets, Ssort_charsets, 1, 1, 0,
2256 doc: /* Sort charset list CHARSETS by a priority of each charset.
2257Return the sorted list. CHARSETS is modified by side effects.
2258See also `charset-priority-list' and `set-charset-priority'. */)
2259 (Lisp_Object charsets)
2260{
2261 Lisp_Object len = Flength (charsets);
2262 int n = XFASTINT (len), i, j, done;
2263 Lisp_Object tail, elt, attrs;
2264 struct charset_sort_data *sort_data;
2265 int id, min_id, max_id;
2266 USE_SAFE_ALLOCA;
2267
2268 if (n == 0)
2269 return Qnil;
2270 SAFE_ALLOCA (sort_data, struct charset_sort_data *, sizeof (*sort_data) * n);
2271 for (tail = charsets, i = 0; CONSP (tail); tail = XCDR (tail), i++)
2272 {
2273 elt = XCAR (tail);
2274 CHECK_CHARSET_GET_ATTR (elt, attrs);
2275 sort_data[i].charset = elt;
2276 sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs));
2277 if (i == 0)
2278 min_id = max_id = id;
2279 else if (id < min_id)
2280 min_id = id;
2281 else if (id > max_id)
2282 max_id = id;
2283 }
2284 for (done = 0, tail = Vcharset_ordered_list, i = 0;
2285 done < n && CONSP (tail); tail = XCDR (tail), i++)
2286 {
2287 elt = XCAR (tail);
2288 id = XFASTINT (elt);
2289 if (id >= min_id && id <= max_id)
2290 for (j = 0; j < n; j++)
2291 if (sort_data[j].id == id)
2292 {
2293 sort_data[j].priority = i;
2294 done++;
2295 }
2296 }
2297 qsort (sort_data, n, sizeof *sort_data, charset_compare);
2298 for (i = 0, tail = charsets; CONSP (tail); tail = XCDR (tail), i++)
2299 XSETCAR (tail, sort_data[i].charset);
2300 SAFE_FREE ();
2301 return charsets;
2302}
2303
2241 2304
2242void 2305void
2243init_charset (void) 2306init_charset (void)
@@ -2340,6 +2403,7 @@ syms_of_charset (void)
2340 defsubr (&Scharset_priority_list); 2403 defsubr (&Scharset_priority_list);
2341 defsubr (&Sset_charset_priority); 2404 defsubr (&Sset_charset_priority);
2342 defsubr (&Scharset_id_internal); 2405 defsubr (&Scharset_id_internal);
2406 defsubr (&Ssort_charsets);
2343 2407
2344 DEFVAR_LISP ("charset-map-path", &Vcharset_map_path, 2408 DEFVAR_LISP ("charset-map-path", &Vcharset_map_path,
2345 doc: /* *List of directories to search for charset map files. */); 2409 doc: /* *List of directories to search for charset map files. */);
diff --git a/src/coding.c b/src/coding.c
index a5632bad963..6012978b60a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -3902,7 +3902,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
3902 int size; 3902 int size;
3903 3903
3904 ONE_MORE_BYTE (dim); 3904 ONE_MORE_BYTE (dim);
3905 if (dim < 0 || dim > 4) 3905 if (dim < '0' || dim > '4')
3906 goto invalid_code; 3906 goto invalid_code;
3907 ONE_MORE_BYTE (M); 3907 ONE_MORE_BYTE (M);
3908 if (M < 128) 3908 if (M < 128)
diff --git a/src/dired.c b/src/dired.c
index 5bb3f27013c..d72ea54a518 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -65,8 +65,7 @@ extern struct direct *readdir (DIR *);
65 65
66#endif /* HAVE_DIRENT_H */ 66#endif /* HAVE_DIRENT_H */
67 67
68/* Some versions of Cygwin don't have d_ino in `struct dirent'. */ 68#ifdef MSDOS
69#if defined(MSDOS) || defined(__CYGWIN__)
70#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) 69#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
71#else 70#else
72#define DIRENTRY_NONEMPTY(p) ((p)->d_ino) 71#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
diff --git a/src/fns.c b/src/fns.c
index 8c49947a127..501867552f8 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -225,9 +225,8 @@ Symbols are also allowed; their print names are used instead. */)
225 return Qt; 225 return Qt;
226} 226}
227 227
228DEFUN ("compare-strings", Fcompare_strings, 228DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0,
229 Scompare_strings, 6, 7, 0, 229 doc: /* Compare the contents of two strings, converting to multibyte if needed.
230doc: /* Compare the contents of two strings, converting to multibyte if needed.
231In string STR1, skip the first START1 characters and stop at END1. 230In string STR1, skip the first START1 characters and stop at END1.
232In string STR2, skip the first START2 characters and stop at END2. 231In string STR2, skip the first START2 characters and stop at END2.
233END1 and END2 default to the full lengths of the respective strings. 232END1 and END2 default to the full lengths of the respective strings.
@@ -1199,7 +1198,7 @@ value is a new vector that contains the elements between index FROM
1199 1198
1200DEFUN ("substring-no-properties", Fsubstring_no_properties, Ssubstring_no_properties, 1, 3, 0, 1199DEFUN ("substring-no-properties", Fsubstring_no_properties, Ssubstring_no_properties, 1, 3, 0,
1201 doc: /* Return a substring of STRING, without text properties. 1200 doc: /* Return a substring of STRING, without text properties.
1202It starts at index FROM and ending before TO. 1201It starts at index FROM and ends before TO.
1203TO may be nil or omitted; then the substring runs to the end of STRING. 1202TO may be nil or omitted; then the substring runs to the end of STRING.
1204If FROM is nil or omitted, the substring starts at the beginning of STRING. 1203If FROM is nil or omitted, the substring starts at the beginning of STRING.
1205If FROM or TO is negative, it counts from the end. 1204If FROM or TO is negative, it counts from the end.
@@ -1291,7 +1290,7 @@ substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte
1291} 1290}
1292 1291
1293DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, 1292DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,
1294 doc: /* Take cdr N times on LIST, returns the result. */) 1293 doc: /* Take cdr N times on LIST, return the result. */)
1295 (Lisp_Object n, Lisp_Object list) 1294 (Lisp_Object n, Lisp_Object list)
1296{ 1295{
1297 register int i, num; 1296 register int i, num;
@@ -1328,7 +1327,7 @@ DEFUN ("elt", Felt, Selt, 2, 2, 0,
1328} 1327}
1329 1328
1330DEFUN ("member", Fmember, Smember, 2, 2, 0, 1329DEFUN ("member", Fmember, Smember, 2, 2, 0,
1331doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. 1330 doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'.
1332The value is actually the tail of LIST whose car is ELT. */) 1331The value is actually the tail of LIST whose car is ELT. */)
1333 (register Lisp_Object elt, Lisp_Object list) 1332 (register Lisp_Object elt, Lisp_Object list)
1334{ 1333{
@@ -1346,7 +1345,7 @@ The value is actually the tail of LIST whose car is ELT. */)
1346} 1345}
1347 1346
1348DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, 1347DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
1349doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. 1348 doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
1350The value is actually the tail of LIST whose car is ELT. */) 1349The value is actually the tail of LIST whose car is ELT. */)
1351 (register Lisp_Object elt, Lisp_Object list) 1350 (register Lisp_Object elt, Lisp_Object list)
1352{ 1351{
@@ -1372,7 +1371,7 @@ The value is actually the tail of LIST whose car is ELT. */)
1372} 1371}
1373 1372
1374DEFUN ("memql", Fmemql, Smemql, 2, 2, 0, 1373DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
1375doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. 1374 doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
1376The value is actually the tail of LIST whose car is ELT. */) 1375The value is actually the tail of LIST whose car is ELT. */)
1377 (register Lisp_Object elt, Lisp_Object list) 1376 (register Lisp_Object elt, Lisp_Object list)
1378{ 1377{
@@ -2702,7 +2701,7 @@ advisable. */)
2702Lisp_Object Vfeatures, Qsubfeatures; 2701Lisp_Object Vfeatures, Qsubfeatures;
2703 2702
2704DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0, 2703DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
2705 doc: /* Returns t if FEATURE is present in this Emacs. 2704 doc: /* Return t if FEATURE is present in this Emacs.
2706 2705
2707Use this to conditionalize execution of lisp code based on the 2706Use this to conditionalize execution of lisp code based on the
2708presence or absence of Emacs or environment extensions. 2707presence or absence of Emacs or environment extensions.
@@ -4425,8 +4424,8 @@ is a float, it must be > 1.0, and the new size is computed by
4425multiplying the old size with that factor. Default is 1.5. 4424multiplying the old size with that factor. Default is 1.5.
4426 4425
4427:rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0. 4426:rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.
4428Resize the hash table when ratio of the number of entries in the 4427Resize the hash table when the ratio (number of entries / table size)
4429table. Default is 0.8. 4428is greater or equal than THRESHOLD. Default is 0.8.
4430 4429
4431:weakness WEAK -- WEAK must be one of nil, t, `key', `value', 4430:weakness WEAK -- WEAK must be one of nil, t, `key', `value',
4432`key-or-value', or `key-and-value'. If WEAK is not nil, the table 4431`key-or-value', or `key-and-value'. If WEAK is not nil, the table
@@ -4549,7 +4548,7 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold,
4549DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0, 4548DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0,
4550 doc: /* Return the size of TABLE. 4549 doc: /* Return the size of TABLE.
4551The size can be used as an argument to `make-hash-table' to create 4550The size can be used as an argument to `make-hash-table' to create
4552a hash table than can hold as many elements of TABLE holds 4551a hash table than can hold as many elements as TABLE holds
4553without need for resizing. */) 4552without need for resizing. */)
4554 (Lisp_Object table) 4553 (Lisp_Object table)
4555{ 4554{
diff --git a/src/minibuf.c b/src/minibuf.c
index 863b7aeee61..009d94c36a8 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2080,7 +2080,8 @@ syms_of_minibuf (void)
2080 staticpro (&Qread_expression_history); 2080 staticpro (&Qread_expression_history);
2081 2081
2082 DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function, 2082 DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function,
2083 doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); 2083 doc: /* If this is non-nil, `read-buffer' does its work by calling this function.
2084The function is called with the arguments passed to `read-buffer'. */);
2084 Vread_buffer_function = Qnil; 2085 Vread_buffer_function = Qnil;
2085 2086
2086 DEFVAR_BOOL ("read-buffer-completion-ignore-case", 2087 DEFVAR_BOOL ("read-buffer-completion-ignore-case",
diff --git a/src/w32fns.c b/src/w32fns.c
index 72830c435e9..d1f21e8acdd 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7053,7 +7053,7 @@ or when you set the mouse color. */);
7053 7053
7054 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, 7054 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
7055 doc: /* Maximum size for tooltips. 7055 doc: /* Maximum size for tooltips.
7056Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); 7056Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */);
7057 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); 7057 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
7058 7058
7059 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, 7059 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
diff --git a/src/xfns.c b/src/xfns.c
index 249aa6998c3..bc28ccd3a63 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1003,7 +1003,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1003 1003
1004 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0) 1004 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0)
1005 FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f); 1005 FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
1006 1006
1007 if (cursor != x->text_cursor 1007 if (cursor != x->text_cursor
1008 && x->text_cursor != 0) 1008 && x->text_cursor != 0)
1009 XFreeCursor (dpy, x->text_cursor); 1009 XFreeCursor (dpy, x->text_cursor);
@@ -5598,7 +5598,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
5598 font_param = Ffont_get (font, intern (":name")); 5598 font_param = Ffont_get (font, intern (":name"));
5599 if (STRINGP (font_param)) 5599 if (STRINGP (font_param))
5600 default_name = xstrdup (SDATA (font_param)); 5600 default_name = xstrdup (SDATA (font_param));
5601 else 5601 else
5602 { 5602 {
5603 font_param = Fframe_parameter (frame, Qfont_param); 5603 font_param = Fframe_parameter (frame, Qfont_param);
5604 if (STRINGP (font_param)) 5604 if (STRINGP (font_param))
@@ -5609,7 +5609,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
5609 default_name = xstrdup (x_last_font_name); 5609 default_name = xstrdup (x_last_font_name);
5610 5610
5611 /* Convert fontconfig names to Gtk names, i.e. remove - before number */ 5611 /* Convert fontconfig names to Gtk names, i.e. remove - before number */
5612 if (default_name) 5612 if (default_name)
5613 { 5613 {
5614 char *p = strrchr (default_name, '-'); 5614 char *p = strrchr (default_name, '-');
5615 if (p) 5615 if (p)
@@ -5870,8 +5870,8 @@ or when you set the mouse color. */);
5870 Vx_cursor_fore_pixel = Qnil; 5870 Vx_cursor_fore_pixel = Qnil;
5871 5871
5872 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, 5872 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
5873 doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). 5873 doc: /* Maximum size for tooltips.
5874Text larger than this is clipped. */); 5874Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */);
5875 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); 5875 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
5876 5876
5877 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, 5877 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,