commit 233dcf127dfccea422d9d75e18d5b1383d4c2c62 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Tue Jan 13 09:10:05 2015 +0100 In adjust_frame_size don't return too early after font size change. * frame.c (adjust_frame_size): Make sure new numbers of lines/columns get installed after font size change (Bug#19575). diff --git a/src/ChangeLog b/src/ChangeLog index 48c7370..00068d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-01-13 Martin Rudalics + + * frame.c (adjust_frame_size): Make sure new numbers of + lines/columns get installed after font size change (Bug#19575). + 2015-01-13 Dmitry Antipov Add DEFUN attributes. diff --git a/src/frame.c b/src/frame.c index f138db9..ec580f3 100644 --- a/src/frame.c +++ b/src/frame.c @@ -335,6 +335,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, int unit_height = FRAME_LINE_HEIGHT (f); int old_pixel_width = FRAME_PIXEL_WIDTH (f); int old_pixel_height = FRAME_PIXEL_HEIGHT (f); + int old_cols = FRAME_COLS (f); + int old_lines = FRAME_LINES (f); int new_pixel_width, new_pixel_height; /* The following two values are calculated from the old frame pixel sizes and any "new" settings for tool bar, menu bar and internal @@ -466,7 +468,9 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, && new_windows_width == old_windows_width && new_windows_height == old_windows_height && new_pixel_width == old_pixel_width - && new_pixel_height == old_pixel_height) + && new_pixel_height == old_pixel_height + && new_cols == old_cols + && new_lines == old_lines) /* No change. Sanitize window sizes and return. */ { sanitize_window_sizes (frame, Qt); commit b53b1ca422ff1925f631be511fbec9deb1e4cc33 Author: Dmitry Antipov Date: Tue Jan 13 07:08:54 2015 +0300 Consolidate duplicated string matching code. * search.c (fast_string_match_internal): New function, consolidated from... (fast_string_match, fast_string_match_ignore_case): ...functions which are... * lisp.h (fast_string_match, fast_string_match_ignore_case): inlined from here now. (fast_string_match_internal): Add prototype. * dired.c (file_name_completion): Use fast_string_match_internal. diff --git a/src/ChangeLog b/src/ChangeLog index 792407e..48c7370 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -18,6 +18,15 @@ * keyboard.c (Ftop_level, Fexit_recursive_edit) (Fabor_recursive_edit): Add noreturn attribute. + * search.c (fast_string_match_internal): New function, + consolidated from... + (fast_string_match, fast_string_match_ignore_case): ...functions + which are... + * lisp.h (fast_string_match, fast_string_match_ignore_case): + inlined from here now. + (fast_string_match_internal): Add prototype. + * dired.c (file_name_completion): Use fast_string_match_internal. + 2015-01-12 Paul Eggert Port to 32-bit MingGW --with-wide-int diff --git a/src/dired.c b/src/dired.c index 00f9a5b..9026c56 100644 --- a/src/dired.c +++ b/src/dired.c @@ -634,23 +634,14 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, name = DECODE_FILE (name); { - Lisp_Object regexps; + Lisp_Object regexps, table = (completion_ignore_case + ? Vascii_canon_table : Qnil); /* Ignore this element if it fails to match all the regexps. */ - if (completion_ignore_case) - { - for (regexps = Vcompletion_regexp_list; CONSP (regexps); - regexps = XCDR (regexps)) - if (fast_string_match_ignore_case (XCAR (regexps), name) < 0) - break; - } - else - { - for (regexps = Vcompletion_regexp_list; CONSP (regexps); - regexps = XCDR (regexps)) - if (fast_string_match (XCAR (regexps), name) < 0) - break; - } + for (regexps = Vcompletion_regexp_list; CONSP (regexps); + regexps = XCDR (regexps)) + if (fast_string_match_internal (XCAR (regexps), name, table) < 0) + break; if (CONSP (regexps)) continue; diff --git a/src/lisp.h b/src/lisp.h index 6a39f08..a11e612 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4054,10 +4054,23 @@ struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, Lisp_Object, bool, bool); -extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object); +extern ptrdiff_t fast_string_match_internal (Lisp_Object, Lisp_Object, + Lisp_Object); + +INLINE ptrdiff_t +fast_string_match (Lisp_Object regexp, Lisp_Object string) +{ + return fast_string_match_internal (regexp, string, Qnil); +} + +INLINE ptrdiff_t +fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string) +{ + return fast_string_match_internal (regexp, string, Vascii_canon_table); +} + extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, ptrdiff_t); -extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object); extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, diff --git a/src/search.c b/src/search.c index 0252542..e961798 100644 --- a/src/search.c +++ b/src/search.c @@ -459,17 +459,18 @@ matched by parenthesis constructs in the pattern. */) return string_match_1 (regexp, string, start, 1); } -/* Match REGEXP against STRING, searching all of STRING, - and return the index of the match, or negative on failure. - This does not clobber the match data. */ +/* Match REGEXP against STRING using translation table TABLE, + searching all of STRING, and return the index of the match, + or negative on failure. This does not clobber the match data. */ ptrdiff_t -fast_string_match (Lisp_Object regexp, Lisp_Object string) +fast_string_match_internal (Lisp_Object regexp, Lisp_Object string, + Lisp_Object table) { ptrdiff_t val; struct re_pattern_buffer *bufp; - bufp = compile_pattern (regexp, 0, Qnil, + bufp = compile_pattern (regexp, 0, table, 0, STRING_MULTIBYTE (string)); immediate_quit = 1; re_match_object = string; @@ -504,26 +505,6 @@ fast_c_string_match_ignore_case (Lisp_Object regexp, return val; } -/* Like fast_string_match but ignore case. */ - -ptrdiff_t -fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string) -{ - ptrdiff_t val; - struct re_pattern_buffer *bufp; - - bufp = compile_pattern (regexp, 0, Vascii_canon_table, - 0, STRING_MULTIBYTE (string)); - immediate_quit = 1; - re_match_object = string; - - val = re_search (bufp, SSDATA (string), - SBYTES (string), 0, - SBYTES (string), 0); - immediate_quit = 0; - return val; -} - /* Match REGEXP against the characters after POS to LIMIT, and return the number of matched characters. If STRING is non-nil, match against the characters in it. In that case, POS and LIMIT are commit ad9c4a4091df19064a7f7f53bfdb687931e141f6 Author: Dmitry Antipov Date: Tue Jan 13 06:39:45 2015 +0300 Support const and noreturn DEFUN attributes. * lib-src/make-docfile.c (struct global): New field 'flags'. (DEFUN_noreturn, DEFUN_const): New enum bitfields. (add_global): Now return pointer to global. (write_globals): Add _Noreturn and ATTRIBUTE_CONST attributes if requested by global's flags. (stream_match): New function. (scan_c_stream): Recognize 'attributes:' of DEFUN. * src/callint.c (Finteractive): * src/character.c (Fcharacterp, Fmax_char): * src.data.c (Feq, Fnull, Fconsp, Fatom, Flistp, Fnlistp, Fsymbolp) (Fstringp, Fchar_or_string_p, Fintegerp, Fnatnump, Fnumberp) (Ffloatp, Fbyteorder): * src/decompress.c (Fzlib_available_p): * src/fns.c (Fidentity): * src/frame.c (Fframe_windows_min_size): * src/gnutls.c (Fgnutls_error_p, Fgnutls_available_p): * src/window.c (Fwindow__sanitize_window_sizes): * src/xdisp.c (Ftool_bar_height): * src/xfaces.c (Fface_attribute_relative_p): Add const attribute. * src/emacs.c (Fkill_emacs): * src/eval.c (Fthrow): * src/keyboard.c (Ftop_level, Fexit_recursive_edit) (Fabor_recursive_edit): Add noreturn attribute. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 7403596..969aac8 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,14 @@ +2015-01-13 Dmitry Antipov + + Support DEFUN attributes. + * make-docfile.c (struct global): New field 'flags'. + (DEFUN_noreturn, DEFUN_const): New enum bitfields. + (add_global): Now return pointer to global. + (write_globals): Add _Noreturn and ATTRIBUTE_CONST attributes + if requested by global's flags. + (stream_match): New function. + (scan_c_stream): Recognize 'attributes:' of DEFUN. + 2015-01-10 Paul Eggert Port to 32-bit --with-wide-int diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index bc5420e..79d421a 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -562,6 +562,7 @@ struct global { enum global_type type; char *name; + int flags; union { int value; @@ -569,13 +570,16 @@ struct global } v; }; +/* Bit values for FLAGS field from the above. Applied for DEFUNs only. */ +enum { DEFUN_noreturn = 1, DEFUN_const = 2 }; + /* All the variable names we saw while scanning C sources in `-g' mode. */ int num_globals; int num_globals_allocated; struct global *globals; -static void +static struct global * add_global (enum global_type type, char *name, int value, char const *svalue) { /* Ignore the one non-symbol that can occur. */ @@ -601,7 +605,10 @@ add_global (enum global_type type, char *name, int value, char const *svalue) globals[num_globals - 1].v.svalue = svalue; else globals[num_globals - 1].v.value = value; + globals[num_globals - 1].flags = 0; + return globals + num_globals - 1; } + return NULL; } static int @@ -708,13 +715,7 @@ write_globals (void) globals[i].name, globals[i].name, globals[i].name); else { - /* It would be nice to have a cleaner way to deal with these - special hacks. */ - if (strcmp (globals[i].name, "Fthrow") == 0 - || strcmp (globals[i].name, "Ftop_level") == 0 - || strcmp (globals[i].name, "Fkill_emacs") == 0 - || strcmp (globals[i].name, "Fexit_recursive_edit") == 0 - || strcmp (globals[i].name, "Fabort_recursive_edit") == 0) + if (globals[i].flags & DEFUN_noreturn) fputs ("_Noreturn ", stdout); printf ("EXFUN (%s, ", globals[i].name); @@ -726,36 +727,7 @@ write_globals (void) printf ("%d", globals[i].v.value); putchar (')'); - /* It would be nice to have a cleaner way to deal with these - special hacks, too. */ - if (strcmp (globals[i].name, "Fatom") == 0 - || strcmp (globals[i].name, "Fbyteorder") == 0 - || strcmp (globals[i].name, "Fcharacterp") == 0 - || strcmp (globals[i].name, "Fchar_or_string_p") == 0 - || strcmp (globals[i].name, "Fconsp") == 0 - || strcmp (globals[i].name, "Feq") == 0 - || strcmp (globals[i].name, "Fface_attribute_relative_p") == 0 - || strcmp (globals[i].name, "Fframe_windows_min_size") == 0 - || strcmp (globals[i].name, "Fgnutls_errorp") == 0 - || strcmp (globals[i].name, "Fidentity") == 0 - || strcmp (globals[i].name, "Fintegerp") == 0 - || strcmp (globals[i].name, "Finteractive") == 0 - || strcmp (globals[i].name, "Ffloatp") == 0 - || strcmp (globals[i].name, "Flistp") == 0 - || strcmp (globals[i].name, "Fmax_char") == 0 - || strcmp (globals[i].name, "Fnatnump") == 0 - || strcmp (globals[i].name, "Fnlistp") == 0 - || strcmp (globals[i].name, "Fnull") == 0 - || strcmp (globals[i].name, "Fnumberp") == 0 - || strcmp (globals[i].name, "Fstringp") == 0 - || strcmp (globals[i].name, "Fsymbolp") == 0 - || strcmp (globals[i].name, "Ftool_bar_height") == 0 - || strcmp (globals[i].name, "Fwindow__sanitize_window_sizes") == 0 -#ifndef WINDOWSNT - || strcmp (globals[i].name, "Fgnutls_available_p") == 0 - || strcmp (globals[i].name, "Fzlib_available_p") == 0 -#endif - || 0) + if (globals[i].flags & DEFUN_const) fputs (" ATTRIBUTE_CONST", stdout); puts (";"); @@ -817,6 +789,23 @@ scan_c_file (char *filename, const char *mode) return scan_c_stream (infile); } +/* Return 1 if next input from INFILE is equal to P, -1 if EOF, + 0 if input doesn't match. */ + +static int +stream_match (FILE *infile, const char *p) +{ + for (; *p; p++) + { + int c = getc (infile); + if (c == EOF) + return -1; + if (c != *p) + return 0; + } + return 1; +} + static int scan_c_stream (FILE *infile) { @@ -1033,7 +1022,63 @@ scan_c_stream (FILE *infile) if (generate_globals) { - add_global (FUNCTION, name, maxargs, 0); + struct global *g = add_global (FUNCTION, name, maxargs, 0); + + /* The following code tries to recognize function attributes + specified after the docstring, e.g.: + + DEFUN ("foo", Ffoo, Sfoo, X, Y, Z, + doc: /\* doc *\/ + attributes: attribute1 attribute2 ...) + (Lisp_Object arg...) + + Now only 'noreturn' and 'const' attributes are used. */ + + /* Advance to the end of docstring. */ + c = getc (infile); + if (c == EOF) + goto eof; + int d = getc (infile); + if (d == EOF) + goto eof; + while (1) + { + if (c == '*' && d == '/') + break; + c = d, d = getc (infile); + if (d == EOF) + goto eof; + } + /* Skip spaces, if any. */ + do + { + c = getc (infile); + if (c == EOF) + goto eof; + } + while (c == ' ' || c == '\n' || c == '\r' || c == '\t'); + /* Check for 'attributes:' token. */ + if (c == 'a' && stream_match (infile, "ttributes:")) + { + char *p = input_buffer; + /* Collect attributes up to ')'. */ + while (1) + { + c = getc (infile); + if (c == EOF) + goto eof; + if (c == ')') + break; + if (p - input_buffer > sizeof (input_buffer)) + abort (); + *p++ = c; + } + *p = 0; + if (strstr (input_buffer, "noreturn")) + g->flags |= DEFUN_noreturn; + if (strstr (input_buffer, "const")) + g->flags |= DEFUN_const; + } continue; } diff --git a/src/ChangeLog b/src/ChangeLog index 252dfd3..792407e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,23 @@ +2015-01-13 Dmitry Antipov + + Add DEFUN attributes. + * callint.c (Finteractive): + * character.c (Fcharacterp, Fmax_char): + * data.c (Feq, Fnull, Fconsp, Fatom, Flistp, Fnlistp, Fsymbolp) + (Fstringp, Fchar_or_string_p, Fintegerp, Fnatnump, Fnumberp) + (Ffloatp, Fbyteorder): + * decompress.c (Fzlib_available_p): + * fns.c (Fidentity): + * frame.c (Fframe_windows_min_size): + * gnutls.c (Fgnutls_error_p, Fgnutls_available_p): + * window.c (Fwindow__sanitize_window_sizes): + * xdisp.c (Ftool_bar_height): + * xfaces.c (Fface_attribute_relative_p): Add const attribute. + * emacs.c (Fkill_emacs): + * eval.c (Fthrow): + * keyboard.c (Ftop_level, Fexit_recursive_edit) + (Fabor_recursive_edit): Add noreturn attribute. + 2015-01-12 Paul Eggert Port to 32-bit MingGW --with-wide-int diff --git a/src/callint.c b/src/callint.c index 2595503..dd238b9 100644 --- a/src/callint.c +++ b/src/callint.c @@ -101,7 +101,8 @@ If the string begins with `^' and `shift-select-mode' is non-nil, Emacs first calls the function `handle-shift-selection'. You may use `@', `*', and `^' together. They are processed in the order that they appear, before reading any arguments. -usage: (interactive &optional ARGS) */) +usage: (interactive &optional ARGS) */ + attributes: const) (Lisp_Object args) { return Qnil; diff --git a/src/character.c b/src/character.c index 4a5c7ec..39d32c9 100644 --- a/src/character.c +++ b/src/character.c @@ -232,14 +232,16 @@ DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0, In Emacs Lisp, characters are represented by character codes, which are non-negative integers. The function `max-char' returns the maximum character code. -usage: (characterp OBJECT) */) +usage: (characterp OBJECT) */ + attributes: const) (Lisp_Object object, Lisp_Object ignore) { return (CHARACTERP (object) ? Qt : Qnil); } DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0, - doc: /* Return the character of the maximum code. */) + doc: /* Return the character of the maximum code. */ + attributes: const) (void) { return make_number (MAX_CHAR); diff --git a/src/data.c b/src/data.c index 820c3ce..0389eb4 100644 --- a/src/data.c +++ b/src/data.c @@ -176,7 +176,8 @@ args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) /* Data type predicates. */ DEFUN ("eq", Feq, Seq, 2, 2, 0, - doc: /* Return t if the two args are the same Lisp object. */) + doc: /* Return t if the two args are the same Lisp object. */ + attributes: const) (Lisp_Object obj1, Lisp_Object obj2) { if (EQ (obj1, obj2)) @@ -185,7 +186,8 @@ DEFUN ("eq", Feq, Seq, 2, 2, 0, } DEFUN ("null", Fnull, Snull, 1, 1, 0, - doc: /* Return t if OBJECT is nil. */) + doc: /* Return t if OBJECT is nil. */ + attributes: const) (Lisp_Object object) { if (NILP (object)) @@ -263,7 +265,8 @@ for example, (type-of 1) returns `integer'. */) } DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0, - doc: /* Return t if OBJECT is a cons cell. */) + doc: /* Return t if OBJECT is a cons cell. */ + attributes: const) (Lisp_Object object) { if (CONSP (object)) @@ -272,7 +275,8 @@ DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0, } DEFUN ("atom", Fatom, Satom, 1, 1, 0, - doc: /* Return t if OBJECT is not a cons cell. This includes nil. */) + doc: /* Return t if OBJECT is not a cons cell. This includes nil. */ + attributes: const) (Lisp_Object object) { if (CONSP (object)) @@ -282,7 +286,8 @@ DEFUN ("atom", Fatom, Satom, 1, 1, 0, DEFUN ("listp", Flistp, Slistp, 1, 1, 0, doc: /* Return t if OBJECT is a list, that is, a cons cell or nil. -Otherwise, return nil. */) +Otherwise, return nil. */ + attributes: const) (Lisp_Object object) { if (CONSP (object) || NILP (object)) @@ -291,7 +296,8 @@ Otherwise, return nil. */) } DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, - doc: /* Return t if OBJECT is not a list. Lists include nil. */) + doc: /* Return t if OBJECT is not a list. Lists include nil. */ + attributes: const) (Lisp_Object object) { if (CONSP (object) || NILP (object)) @@ -300,7 +306,8 @@ DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, } DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0, - doc: /* Return t if OBJECT is a symbol. */) + doc: /* Return t if OBJECT is a symbol. */ + attributes: const) (Lisp_Object object) { if (SYMBOLP (object)) @@ -333,7 +340,8 @@ DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, } DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0, - doc: /* Return t if OBJECT is a string. */) + doc: /* Return t if OBJECT is a string. */ + attributes: const) (Lisp_Object object) { if (STRINGP (object)) @@ -436,7 +444,8 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p, } DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0, - doc: /* Return t if OBJECT is a character or a string. */) + doc: /* Return t if OBJECT is a character or a string. */ + attributes: const) (register Lisp_Object object) { if (CHARACTERP (object) || STRINGP (object)) @@ -445,7 +454,8 @@ DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0, } DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, - doc: /* Return t if OBJECT is an integer. */) + doc: /* Return t if OBJECT is an integer. */ + attributes: const) (Lisp_Object object) { if (INTEGERP (object)) @@ -463,7 +473,8 @@ DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, } DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, - doc: /* Return t if OBJECT is a nonnegative integer. */) + doc: /* Return t if OBJECT is a nonnegative integer. */ + attributes: const) (Lisp_Object object) { if (NATNUMP (object)) @@ -472,7 +483,8 @@ DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, } DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0, - doc: /* Return t if OBJECT is a number (floating point or integer). */) + doc: /* Return t if OBJECT is a number (floating point or integer). */ + attributes: const) (Lisp_Object object) { if (NUMBERP (object)) @@ -492,7 +504,8 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p, } DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0, - doc: /* Return t if OBJECT is a floating point number. */) + doc: /* Return t if OBJECT is a floating point number. */ + attributes: const) (Lisp_Object object) { if (FLOATP (object)) @@ -2954,7 +2967,8 @@ DEFUN ("lognot", Flognot, Slognot, 1, 1, 0, DEFUN ("byteorder", Fbyteorder, Sbyteorder, 0, 0, 0, doc: /* Return the byteorder for the machine. Returns 66 (ASCII uppercase B) for big endian machines or 108 (ASCII -lowercase l) for small endian machines. */) +lowercase l) for small endian machines. */ + attributes: const) (void) { unsigned i = 0x04030201; diff --git a/src/decompress.c b/src/decompress.c index b14f0a2..b78dace 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -88,7 +88,8 @@ unwind_decompress (void *ddata) } DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0, - doc: /* Return t if zlib decompression is available in this instance of Emacs. */) + doc: /* Return t if zlib decompression is available in this instance of Emacs. */ + attributes: const) (void) { #ifdef WINDOWSNT diff --git a/src/emacs.c b/src/emacs.c index d09c3c3..ca1a8b2 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1892,7 +1892,8 @@ or SIGHUP, and upon SIGINT in batch mode. The value of `kill-emacs-hook', if not void, is a list of functions (of no args), -all of which are called before Emacs is actually killed. */) +all of which are called before Emacs is actually killed. */ + attributes: noreturn) (Lisp_Object arg) { struct gcpro gcpro1; diff --git a/src/eval.c b/src/eval.c index 7e4b016..5cadb1b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1162,7 +1162,8 @@ unwind_to_catch (struct handler *catch, Lisp_Object value) DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, doc: /* Throw to the catch for TAG and return VALUE from it. -Both TAG and VALUE are evalled. */) +Both TAG and VALUE are evalled. */ + attributes: noreturn) (register Lisp_Object tag, Lisp_Object value) { struct handler *c; diff --git a/src/fns.c b/src/fns.c index 7739663..91cd513 100644 --- a/src/fns.c +++ b/src/fns.c @@ -46,7 +46,8 @@ static void sort_vector_copy (Lisp_Object, ptrdiff_t, static bool internal_equal (Lisp_Object, Lisp_Object, int, bool, Lisp_Object); DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, - doc: /* Return the argument unchanged. */) + doc: /* Return the argument unchanged. */ + attributes: const) (Lisp_Object arg) { return arg; diff --git a/src/frame.c b/src/frame.c index 0eb51bd..f138db9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -270,7 +270,8 @@ predicates which report frame's specific UI-related capabilities. */) /* Placeholder used by temacs -nw before window.el is loaded. */ DEFUN ("frame-windows-min-size", Fframe_windows_min_size, Sframe_windows_min_size, 4, 4, 0, - doc: /* */) + doc: /* */ + attributes: const) (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise) { diff --git a/src/gnutls.c b/src/gnutls.c index 75fe614..5e6c635 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -695,7 +695,8 @@ See also `gnutls-boot'. */) DEFUN ("gnutls-errorp", Fgnutls_errorp, Sgnutls_errorp, 1, 1, 0, doc: /* Return t if ERROR indicates a GnuTLS problem. ERROR is an integer or a symbol with an integer `gnutls-code' property. -usage: (gnutls-errorp ERROR) */) +usage: (gnutls-errorp ERROR) */ + attributes: const) (Lisp_Object err) { if (EQ (err, Qt)) return Qnil; @@ -1603,7 +1604,8 @@ This function may also return `gnutls-e-again', or #endif /* HAVE_GNUTLS */ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, - doc: /* Return t if GnuTLS is available in this instance of Emacs. */) + doc: /* Return t if GnuTLS is available in this instance of Emacs. */ + attributes: const) (void) { #ifdef HAVE_GNUTLS diff --git a/src/keyboard.c b/src/keyboard.c index 9d6eb07..0fe2ffc 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1163,7 +1163,8 @@ top_level_1 (Lisp_Object ignore) DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "", doc: /* Exit all recursive editing levels. -This also exits all active minibuffers. */) +This also exits all active minibuffers. */ + attributes: noreturn) (void) { #ifdef HAVE_WINDOW_SYSTEM @@ -1186,7 +1187,8 @@ user_error (const char *msg) /* _Noreturn will be added to prototype by make-docfile. */ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", - doc: /* Exit from the innermost recursive edit or minibuffer. */) + doc: /* Exit from the innermost recursive edit or minibuffer. */ + attributes: noreturn) (void) { if (command_loop_level > 0 || minibuf_level > 0) @@ -1197,7 +1199,8 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, /* _Noreturn will be added to prototype by make-docfile. */ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", - doc: /* Abort the command that requested this recursive edit or minibuffer input. */) + doc: /* Abort the command that requested this recursive edit or minibuffer input. */ + attributes: noreturn) (void) { if (command_loop_level > 0 || minibuf_level > 0) diff --git a/src/window.c b/src/window.c index 5ae95f2..e5ddef5 100644 --- a/src/window.c +++ b/src/window.c @@ -3000,7 +3000,8 @@ resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizonta /* Placeholder used by temacs -nw before window.el is loaded. */ DEFUN ("window--sanitize-window-sizes", Fwindow__sanitize_window_sizes, Swindow__sanitize_window_sizes, 2, 2, 0, - doc: /* */) + doc: /* */ + attributes: const) (Lisp_Object frame, Lisp_Object horizontal) { return Qnil; diff --git a/src/xdisp.c b/src/xdisp.c index f006f8e..041a022 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12276,7 +12276,8 @@ DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height, 0, 2, 0, doc: /* Return the number of lines occupied by the tool bar of FRAME. If FRAME is nil or omitted, use the selected frame. Optional argument -PIXELWISE non-nil means return the height of the tool bar in pixels. */) +PIXELWISE non-nil means return the height of the tool bar in pixels. */ + attributes: const) (Lisp_Object frame, Lisp_Object pixelwise) { int height = 0; diff --git a/src/xfaces.c b/src/xfaces.c index 6ecd857..85af770 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3546,7 +3546,8 @@ with the value VALUE is relative. A relative value is one that doesn't entirely override whatever is inherited from another face. For most possible attributes, the only relative value that users see is `unspecified'. -However, for :height, floating point values are also relative. */) +However, for :height, floating point values are also relative. */ + attributes: const) (Lisp_Object attribute, Lisp_Object value) { if (EQ (value, Qunspecified) || (EQ (value, QCignore_defface))) commit 329b902141c68190a2d8a5d6fd9312b6a816471c Author: Dmitry Gutov Date: Tue Jan 13 06:06:15 2015 +0300 Don't eagerly load xref Fixes: debbugs:19554 * lisp/menu-bar.el (menu-bar-goto-menu): Before calling `xref-marker-stack-empty-p', first check that `xref' is loaded. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4985ad1..504012e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-01-13 Dmitry Gutov + + * menu-bar.el (menu-bar-goto-menu): Before calling + `xref-marker-stack-empty-p', first check that `xref' is loaded. + (Bug#19554) + 2015-01-12 Martin Rudalics * progmodes/xref.el (xref-marker-stack-empty-p): Add autoload diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 67cb327..cd1a4d0 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -381,7 +381,8 @@ (bindings--define-key menu [xref-pop] '(menu-item "Back" xref-pop-marker-stack - :visible (not (xref-marker-stack-empty-p)) + :visible (and (featurep 'xref) + (not (xref-marker-stack-empty-p))) :help "Back to the position of the last search")) (bindings--define-key menu [xref-apropos] commit 52afe0cfa248053c96e26bc67bdc427945358655 Author: Paul Eggert Date: Mon Jan 12 11:26:06 2015 -0800 Port to 32-bit MingGW --with-wide-int Problem reported by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00265.html * lisp.h (struct Lisp_Sub_Char_Table): Check that offset matches what we think it is, rather than checking only its alignment (and doing so incorrectly on MinGW). diff --git a/src/ChangeLog b/src/ChangeLog index 32f17e1..252dfd3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2015-01-12 Paul Eggert + + Port to 32-bit MingGW --with-wide-int + Problem reported by Eli Zaretskii in: + http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00265.html + * lisp.h (struct Lisp_Sub_Char_Table): Check that offset matches + what we think it is, rather than checking only its alignment (and + doing so incorrectly on MinGW). + 2015-01-12 Dmitry Antipov * fileio.c (Ffile_name_as_directory, Fdirectory_file_name): diff --git a/src/lisp.h b/src/lisp.h index 9ed9375..6a39f08 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1689,10 +1689,9 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct) - CHAR_TABLE_STANDARD_SLOTS); } -/* Make sure that sub char-table contents slot - is aligned on a multiple of Lisp_Objects. */ -verify ((offsetof (struct Lisp_Sub_Char_Table, contents) - - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0); +/* Make sure that sub char-table contents slot is where we think it is. */ +verify (offsetof (struct Lisp_Sub_Char_Table, contents) + == offsetof (struct Lisp_Vector, contents[SUB_CHAR_TABLE_OFFSET])); /*********************************************************************** Symbols commit cc59a3e577cf54dfa085bba2da8840b2e6cdf7e7 Author: Martin Rudalics Date: Mon Jan 12 18:26:39 2015 +0100 Add autoload cookie for xref-marker-stack-empty-p (Bug#19554). * progmodes/xref.el (xref-marker-stack-empty-p): Add autoload cookie (Bug#19554). diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a55849a..4985ad1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2015-01-12 Martin Rudalics + * progmodes/xref.el (xref-marker-stack-empty-p): Add autoload + cookie (Bug#19554). + * frame.el (frame-notice-user-settings): Remove code dealing with frame-initial-frame-tool-bar-height. Turn off `tool-bar-mode' only if `window-system-frame-alist' or `default-frame-alist' ask diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b822619..7f77d21 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -301,6 +301,7 @@ backward." (let ((marker (ring-remove ring))) (set-marker marker nil nil))))) +;;;###autoload (defun xref-marker-stack-empty-p () "Return t if the marker stack is empty; nil otherwise." (ring-empty-p xref--marker-ring)) commit e946a9acf6e12137caf836fc043d695c65684110 Author: Dmitry Antipov Date: Mon Jan 12 20:14:43 2015 +0300 Miscellaneous tiny fixes here and there. * fileio.c (Ffile_name_as_directory, Fdirectory_file_name): Remove dead NILP check. * image.c (Flookup_image): Use regular format for docstring. * keyboard.c (apply_modifiers_uncached): Use stpcpy. diff --git a/src/ChangeLog b/src/ChangeLog index ea6274f..32f17e1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2015-01-12 Dmitry Antipov + + * fileio.c (Ffile_name_as_directory, Fdirectory_file_name): + Remove dead NILP check. + * image.c (Flookup_image): Use regular format for docstring. + * keyboard.c (apply_modifiers_uncached): Use stpcpy. + 2015-01-12 Martin Rudalics * dispnew.c (change_frame_size_1): Pass Qchange_frame_size to diff --git a/src/fileio.c b/src/fileio.c index 15c6f91..cd3c485 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -522,8 +522,6 @@ For a Unix-syntax file name, just appends a slash. */) USE_SAFE_ALLOCA; CHECK_STRING (file); - if (NILP (file)) - return Qnil; /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -591,9 +589,6 @@ In Unix-syntax, this function just removes the final slash. */) CHECK_STRING (directory); - if (NILP (directory)) - return Qnil; - /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (directory, Qdirectory_file_name); diff --git a/src/image.c b/src/image.c index 5d08a89..9c09c55 100644 --- a/src/image.c +++ b/src/image.c @@ -9288,7 +9288,8 @@ DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, } -DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") +DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, + doc: /* */) (Lisp_Object spec) { ptrdiff_t id = -1; diff --git a/src/keyboard.c b/src/keyboard.c index 5411aff..9d6eb07 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6270,10 +6270,10 @@ apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_ if (modifiers & meta_modifier) { *p++ = 'M'; *p++ = '-'; } if (modifiers & shift_modifier) { *p++ = 'S'; *p++ = '-'; } if (modifiers & super_modifier) { *p++ = 's'; *p++ = '-'; } - if (modifiers & double_modifier) { strcpy (p, "double-"); p += 7; } - if (modifiers & triple_modifier) { strcpy (p, "triple-"); p += 7; } - if (modifiers & down_modifier) { strcpy (p, "down-"); p += 5; } - if (modifiers & drag_modifier) { strcpy (p, "drag-"); p += 5; } + if (modifiers & double_modifier) p = stpcpy (p, "double-"); + if (modifiers & triple_modifier) p = stpcpy (p, "triple-"); + if (modifiers & down_modifier) p = stpcpy (p, "down-"); + if (modifiers & drag_modifier) p = stpcpy (p, "drag-"); /* The click modifier is denoted by the absence of other modifiers. */ *p = '\0';