Now on revision 108856. ------------------------------------------------------------ revno: 108856 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 23:15:31 -0700 message: Avoid weird behavior with large horizontal scrolls. Without this change, for example, large hscroll values would mess up Emacs's display on Fedora 15 x86, presumably due to overflows in int calculations in the display code. Also, if buffers had long lines, Emacs would freeze. * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB. (set_window_hscroll): New function, containing the old guts of Fset_window_hscroll. Return the clipped value. (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it. This avoids the need to check against PTRDIFF_MAX. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-04 05:39:36 +0000 +++ src/ChangeLog 2012-07-04 06:15:31 +0000 @@ -1,5 +1,16 @@ 2012-07-04 Paul Eggert + Avoid weird behavior with large horizontal scrolls. + Without this change, for example, large hscroll values would + mess up Emacs's display on Fedora 15 x86, presumably due to + overflows in int calculations in the display code. + Also, if buffers had long lines, Emacs would freeze. + * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB. + (set_window_hscroll): New function, containing the old guts of + Fset_window_hscroll. Return the clipped value. + (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it. + This avoids the need to check against PTRDIFF_MAX. + * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch. 2012-07-04 Dmitry Antipov === modified file 'src/window.c' --- src/window.c 2012-07-03 18:24:42 +0000 +++ src/window.c 2012-07-04 06:15:31 +0000 @@ -51,6 +51,11 @@ #include "nsterm.h" #endif +/* Horizontal scrolling has problems with large scroll amounts. + It's too slow with long lines, and even with small lines the + display can be messed up. Impose a reasonable maximum. */ +enum { HSCROLL_MAX = 100000 }; + Lisp_Object Qwindowp, Qwindow_live_p; static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; @@ -670,27 +675,35 @@ return make_number (decode_window (window)->hscroll); } +/* Set W's horizontal scroll amount to HSCROLL clipped to a reasonable + range, returning the new amount as a fixnum. */ +static Lisp_Object +set_window_hscroll (struct window *w, EMACS_INT hscroll) +{ + int new_hscroll = clip_to_bounds (0, hscroll, HSCROLL_MAX); + + /* Prevent redisplay shortcuts when changing the hscroll. */ + if (w->hscroll != new_hscroll) + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; + + w->hscroll = new_hscroll; + return make_number (new_hscroll); +} + DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL. If WINDOW is nil, the selected window is used. -Return NCOL. NCOL should be zero or positive. +Clip the number to a reasonable value if out of range. +Return the new number. NCOL should be zero or positive. Note that if `automatic-hscrolling' is non-nil, you cannot scroll the window so that the location of point moves off-window. */) (Lisp_Object window, Lisp_Object ncol) { struct window *w = decode_window (window); - ptrdiff_t hscroll; CHECK_NUMBER (ncol); - hscroll = clip_to_bounds (0, XINT (ncol), PTRDIFF_MAX); - - /* Prevent redisplay shortcuts when changing the hscroll. */ - if (w->hscroll != hscroll) - XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; - - w->hscroll = hscroll; - return ncol; + return set_window_hscroll (w, XINT (ncol)); } DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, @@ -4850,9 +4863,6 @@ return Qnil; } -/* Scrolling amount must fit in both ptrdiff_t and Emacs fixnum. */ -#define HSCROLL_MAX min (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM) - DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 2, "^P\np", doc: /* Scroll selected window display ARG columns left. Default for ARG is window width minus 2. @@ -4864,16 +4874,11 @@ by this function. This happens in an interactive call. */) (register Lisp_Object arg, Lisp_Object set_minimum) { - Lisp_Object result; - ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); EMACS_INT requested_arg = (NILP (arg) ? window_body_cols (w) - 2 : XINT (Fprefix_numeric_value (arg))); - ptrdiff_t clipped_arg = - clip_to_bounds (- w->hscroll, requested_arg, HSCROLL_MAX - w->hscroll); - hscroll = w->hscroll + clipped_arg; - result = Fset_window_hscroll (selected_window, make_number (hscroll)); + Lisp_Object result = set_window_hscroll (w, w->hscroll + requested_arg); if (!NILP (set_minimum)) w->min_hscroll = w->hscroll; @@ -4892,16 +4897,11 @@ by this function. This happens in an interactive call. */) (register Lisp_Object arg, Lisp_Object set_minimum) { - Lisp_Object result; - ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); EMACS_INT requested_arg = (NILP (arg) ? window_body_cols (w) - 2 : XINT (Fprefix_numeric_value (arg))); - ptrdiff_t clipped_arg = - clip_to_bounds (w->hscroll - HSCROLL_MAX, requested_arg, w->hscroll); - hscroll = w->hscroll - clipped_arg; - result = Fset_window_hscroll (selected_window, make_number (hscroll)); + Lisp_Object result = set_window_hscroll (w, w->hscroll - requested_arg); if (!NILP (set_minimum)) w->min_hscroll = w->hscroll; ------------------------------------------------------------ revno: 108855 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 22:39:36 -0700 message: * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-04 03:49:19 +0000 +++ src/ChangeLog 2012-07-04 05:39:36 +0000 @@ -1,3 +1,7 @@ +2012-07-04 Paul Eggert + + * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch. + 2012-07-04 Dmitry Antipov * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch. === modified file 'src/buffer.c' --- src/buffer.c 2012-07-04 03:49:19 +0000 +++ src/buffer.c 2012-07-04 05:39:36 +0000 @@ -859,7 +859,7 @@ if (!strncmp (SSDATA (name), " ", 1)) /* see bug#1229 */ { /* Note fileio.c:make_temp_name does random differently. */ - sprintf (number, "-%"pD"d", XFASTINT (Frandom (make_number (999999)))); + sprintf (number, "-%"pI"d", XFASTINT (Frandom (make_number (999999)))); tem2 = concat2 (name, build_string (number)); tem = Fget_buffer (tem2); if (NILP (tem)) ------------------------------------------------------------ revno: 108854 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-07-04 07:49:19 +0400 message: * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-04 02:57:12 +0000 +++ src/ChangeLog 2012-07-04 03:49:19 +0000 @@ -1,3 +1,7 @@ +2012-07-04 Dmitry Antipov + + * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch. + 2012-07-04 Paul Eggert * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207) === modified file 'src/buffer.c' --- src/buffer.c 2012-07-03 18:24:42 +0000 +++ src/buffer.c 2012-07-04 03:49:19 +0000 @@ -859,7 +859,7 @@ if (!strncmp (SSDATA (name), " ", 1)) /* see bug#1229 */ { /* Note fileio.c:make_temp_name does random differently. */ - sprintf (number, "-%"pD"d", Frandom (make_number (999999))); + sprintf (number, "-%"pD"d", XFASTINT (Frandom (make_number (999999)))); tem2 = concat2 (name, build_string (number)); tem = Fget_buffer (tem2); if (NILP (tem)) ------------------------------------------------------------ revno: 108853 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-07-03 23:31:34 -0400 message: * lisp/xml.el (xml-name-regexp): Remove, redundant. Use xml-name-re. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-03 07:42:31 +0000 +++ lisp/ChangeLog 2012-07-04 03:31:34 +0000 @@ -1,3 +1,7 @@ +2012-07-04 Stefan Monnier + + * xml.el (xml-name-regexp): Remove, redundant. Use xml-name-re. + 2012-07-03 Michael Albinus * vc/ediff-diff.el (ediff-same-file-contents): Fix it for remote @@ -26,10 +30,10 @@ them to expand into markup as per XML spec. (xml-default-ns): New variable. (xml-entity-alist): Use XML spec definitions for lt and amp. - (xml-parse-region): Make first two arguments optional. Discard - text properties. - (xml-parse-tag-1): New function, spun off from xml-parse-tag. All - callers changed. + (xml-parse-region): Make first two arguments optional. + Discard text properties. + (xml-parse-tag-1): New function, spun off from xml-parse-tag. + All callers changed. (xml-parse-tag): Call xml-parse-tag-1. For backward compatibility, this function should not modify buffer contents. (xml-parse-tag-1): Fix opening-tag regexp. === modified file 'lisp/xml.el' --- lisp/xml.el 2012-07-03 05:28:42 +0000 +++ lisp/xml.el 2012-07-04 03:31:34 +0000 @@ -294,9 +294,6 @@ "Syntax table used by `xml-parse-region'.") ;; XML [5] -;; Note that [:alpha:] matches all multibyte chars with word syntax. -(eval-and-compile - (defconst xml-name-regexp "[[:alpha:]_:][[:alnum:]._:-]*")) ;; Fixme: This needs re-writing to deal with the XML grammar properly, i.e. ;; document ::= prolog element Misc* @@ -588,7 +585,7 @@ end-pos name) (skip-syntax-forward " ") (while (looking-at (eval-when-compile - (concat "\\(" xml-name-regexp "\\)\\s-*=\\s-*"))) + (concat "\\(" xml-name-re "\\)\\s-*=\\s-*"))) (setq end-pos (match-end 0)) (setq name (xml-maybe-do-ns (match-string-no-properties 1) nil xml-ns)) (goto-char end-pos) @@ -643,7 +640,7 @@ (error "XML: (Validity) Invalid DTD (expecting name of the document)")) ;; Get the name of the document - (looking-at xml-name-regexp) + (looking-at xml-name-re) (let ((dtd (list (match-string-no-properties 0) 'dtd)) (xml-parameter-entity-alist xml-parameter-entity-alist) (parameter-entity-re (eval-when-compile ------------------------------------------------------------ revno: 108852 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 19:57:12 -0700 message: Remove stray empty line. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-04 00:36:28 +0000 +++ src/ChangeLog 2012-07-04 02:57:12 +0000 @@ -14,7 +14,6 @@ 2012-07-03 Paul Eggert - * fileio.c: Improve handling of file time marker. (Bug#11852) (special_mtime): New function. (Finsert_file_contents, Fverify_visited_file_modtime): ------------------------------------------------------------ revno: 108851 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 17:36:28 -0700 message: * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207) Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later, since GCC 4.4.6 issues a bogus warning for them. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-04 00:04:46 +0000 +++ src/ChangeLog 2012-07-04 00:36:28 +0000 @@ -1,5 +1,9 @@ 2012-07-04 Paul Eggert + * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207) + Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later, + since GCC 4.4.6 issues a bogus warning for them. + Fix bugs in file timestamp newness comparisons. * fileio.c (Ffile_newer_than_file_p): * lread.c (Fload): Use full timestamp resolution of files, === modified file 'src/regex.c' --- src/regex.c 2012-06-26 01:05:39 +0000 +++ src/regex.c 2012-07-04 00:36:28 +0000 @@ -35,7 +35,7 @@ /* Ignore some GCC warnings for now. This section should go away once the Emacs and Gnulib regex code is merged. */ -#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +#if (__GNUC__ == 4 && 5 <= __GNUC_MINOR__) || 4 < __GNUC__ # pragma GCC diagnostic ignored "-Wstrict-overflow" # ifndef emacs # pragma GCC diagnostic ignored "-Wunused-but-set-variable" ------------------------------------------------------------ revno: 108850 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 17:04:46 -0700 message: Fix bugs in file timestamp newness comparisons. * fileio.c (Ffile_newer_than_file_p): * lread.c (Fload): Use full timestamp resolution of files, not just the 1-second resolution, so that files that are only slightly newer still count as newer. * fileio.c (Ffile_newer_than_file_p): Don't assume file timestamps fit in 'int'; this fixes a Y2038 bug on most hosts. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 23:51:32 +0000 +++ src/ChangeLog 2012-07-04 00:04:46 +0000 @@ -1,5 +1,16 @@ +2012-07-04 Paul Eggert + + Fix bugs in file timestamp newness comparisons. + * fileio.c (Ffile_newer_than_file_p): + * lread.c (Fload): Use full timestamp resolution of files, + not just the 1-second resolution, so that files that are only + slightly newer still count as newer. + * fileio.c (Ffile_newer_than_file_p): Don't assume file + timestamps fit in 'int'; this fixes a Y2038 bug on most hosts. + 2012-07-03 Paul Eggert + * fileio.c: Improve handling of file time marker. (Bug#11852) (special_mtime): New function. (Finsert_file_contents, Fverify_visited_file_modtime): === modified file 'src/fileio.c' --- src/fileio.c 2012-07-03 23:51:32 +0000 +++ src/fileio.c 2012-07-04 00:04:46 +0000 @@ -3079,8 +3079,7 @@ (Lisp_Object file1, Lisp_Object file2) { Lisp_Object absname1, absname2; - struct stat st; - int mtime1; + struct stat st1, st2; Lisp_Object handler; struct gcpro gcpro1, gcpro2; @@ -3106,15 +3105,14 @@ absname2 = ENCODE_FILE (absname2); UNGCPRO; - if (stat (SSDATA (absname1), &st) < 0) + if (stat (SSDATA (absname1), &st1) < 0) return Qnil; - mtime1 = st.st_mtime; - - if (stat (SSDATA (absname2), &st) < 0) + if (stat (SSDATA (absname2), &st2) < 0) return Qt; - return (mtime1 > st.st_mtime) ? Qt : Qnil; + return (EMACS_TIME_GT (get_stat_mtime (&st1), get_stat_mtime (&st2)) + ? Qt : Qnil); } #ifndef READ_BUF_SIZE === modified file 'src/lread.c' --- src/lread.c 2012-06-30 21:10:50 +0000 +++ src/lread.c 2012-07-04 00:04:46 +0000 @@ -26,6 +26,7 @@ #include #include /* For CHAR_BIT. */ #include +#include #include "lisp.h" #include "intervals.h" #include "character.h" @@ -1214,7 +1215,8 @@ SSET (efound, SBYTES (efound) - 1, 'c'); } - if (result == 0 && s1.st_mtime < s2.st_mtime) + if (result == 0 + && EMACS_TIME_LT (get_stat_mtime (&s1), get_stat_mtime (&s2))) { /* Make the progress messages mention that source is newer. */ newer = 1; ------------------------------------------------------------ revno: 108849 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 16:51:32 -0700 message: * fileio.c: Improve handling of file time marker. (Bug#11852) (special_mtime): New function. (Finsert_file_contents, Fverify_visited_file_modtime): Use it to set special mtime values consistently. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 22:03:37 +0000 +++ src/ChangeLog 2012-07-03 23:51:32 +0000 @@ -1,3 +1,10 @@ +2012-07-03 Paul Eggert + + * fileio.c: Improve handling of file time marker. (Bug#11852) + (special_mtime): New function. + (Finsert_file_contents, Fverify_visited_file_modtime): + Use it to set special mtime values consistently. + 2012-07-03 Andreas Schwab * fileio.c (Finsert_file_contents): Properly handle st_mtime === modified file 'src/fileio.c' --- src/fileio.c 2012-07-03 22:03:37 +0000 +++ src/fileio.c 2012-07-03 23:51:32 +0000 @@ -3215,6 +3215,17 @@ return lseek (fd, offset, whence); } +/* Return a special mtime value indicating the error number ERRNUM. */ +static EMACS_TIME +special_mtime (int errnum) +{ + EMACS_TIME t; + int ns = (errno == ENOENT || errno == EACCES || errno == ENOTDIR + ? NONEXISTENT_MODTIME_NSECS + : UNKNOWN_MODTIME_NSECS); + EMACS_SET_SECS_NSECS (t, 0, ns); + return t; +} DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents, 1, 5, 0, @@ -3242,6 +3253,8 @@ (Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace) { struct stat st; + int file_status; + EMACS_TIME mtime; register int fd; ptrdiff_t inserted = 0; int nochange = 0; @@ -3310,19 +3323,22 @@ /* Tell stat to use expensive method to get accurate info. */ Vw32_get_true_file_attributes = Qt; - total = stat (SSDATA (filename), &st); + file_status = stat (SSDATA (filename), &st); Vw32_get_true_file_attributes = tem; } - if (total < 0) #else - if (stat (SSDATA (filename), &st) < 0) + file_status = stat (SSDATA (filename), &st); #endif /* WINDOWSNT */ + + if (file_status == 0) + mtime = get_stat_mtime (&st); + else { badopen: save_errno = errno; if (NILP (visit)) report_file_error ("Opening input file", Fcons (orig_filename, Qnil)); - st.st_mtime = -1; + mtime = special_mtime (save_errno); st.st_size = -1; how_much = 0; if (!NILP (Vcoding_system_for_read)) @@ -4193,10 +4209,7 @@ if (NILP (handler)) { - if (st.st_mtime == -1) - EMACS_SET_INVALID_TIME (current_buffer->modtime); - else - current_buffer->modtime = get_stat_mtime (&st); + current_buffer->modtime = mtime; current_buffer->modtime_size = st.st_size; BVAR (current_buffer, filename) = orig_filename; } @@ -5093,17 +5106,9 @@ filename = ENCODE_FILE (BVAR (b, filename)); - if (stat (SSDATA (filename), &st) == 0) - mtime = get_stat_mtime (&st); - else - { - /* If the file doesn't exist now and didn't exist before, - we say that it isn't modified, provided the error is a tame one. */ - int ns = (errno == ENOENT || errno == EACCES || errno == ENOTDIR - ? NONEXISTENT_MODTIME_NSECS - : UNKNOWN_MODTIME_NSECS); - EMACS_SET_SECS_NSECS (mtime, 0, ns); - } + mtime = (stat (SSDATA (filename), &st) == 0 + ? get_stat_mtime (&st) + : special_mtime (errno)); if ((EMACS_TIME_EQ (mtime, b->modtime) /* If both exist, accept them if they are off by one second. */ || (EMACS_TIME_VALID_P (mtime) && EMACS_TIME_VALID_P (b->modtime) ------------------------------------------------------------ revno: 108848 committer: Andreas Schwab branch nick: emacs timestamp: Wed 2012-07-04 00:03:37 +0200 message: * fileio.c (Finsert_file_contents): Properly handle st_mtime marker for non-existing file. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 20:34:47 +0000 +++ src/ChangeLog 2012-07-03 22:03:37 +0000 @@ -1,3 +1,8 @@ +2012-07-03 Andreas Schwab + + * fileio.c (Finsert_file_contents): Properly handle st_mtime + marker for non-existing file. (Bug#11852) + 2012-07-03 Glenn Morris * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN === modified file 'src/fileio.c' --- src/fileio.c 2012-07-03 18:24:42 +0000 +++ src/fileio.c 2012-07-03 22:03:37 +0000 @@ -4193,7 +4193,10 @@ if (NILP (handler)) { - current_buffer->modtime = get_stat_mtime (&st); + if (st.st_mtime == -1) + EMACS_SET_INVALID_TIME (current_buffer->modtime); + else + current_buffer->modtime = get_stat_mtime (&st); current_buffer->modtime_size = st.st_size; BVAR (current_buffer, filename) = orig_filename; } ------------------------------------------------------------ revno: 108847 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-07-03 14:14:48 -0700 message: * make-docfile.c (scan_c_file): Suppress GCC warning. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-07-03 18:24:42 +0000 +++ lib-src/ChangeLog 2012-07-03 21:14:48 +0000 @@ -1,3 +1,7 @@ +2012-07-03 Paul Eggert + + * make-docfile.c (scan_c_file): Suppress GCC warning. + 2012-06-29 Tom Tromey * make-docfile.c (enum global_type) : New constant. === modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2012-07-03 18:24:42 +0000 +++ lib-src/make-docfile.c 2012-07-03 21:14:48 +0000 @@ -747,7 +747,7 @@ int defvarperbufferflag = 0; int defvarflag = 0; enum global_type type = INVALID; - char *name; + char *name IF_LINT (= 0); if (c != '\n' && c != '\r') { ------------------------------------------------------------ revno: 108846 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-03 16:34:47 -0400 message: * src/lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN and did not make it into globals.h). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 18:24:42 +0000 +++ src/ChangeLog 2012-07-03 20:34:47 +0000 @@ -1,3 +1,8 @@ +2012-07-03 Glenn Morris + + * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN + and did not make it into globals.h). + 2012-07-03 Tom Tromey * window.c (Fset_window_margins, Fset_window_fringes) === modified file 'src/lisp.h' --- src/lisp.h 2012-07-03 18:24:42 +0000 +++ src/lisp.h 2012-07-03 20:34:47 +0000 @@ -1,6 +1,6 @@ /* Fundamental definitions for GNU Emacs Lisp interpreter. - Copyright (C) 1985-1987, 1993-1995, 1997-2012 - Free Software Foundation, Inc. + +Copyright (C) 1985-1987, 1993-1995, 1997-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2835,6 +2835,7 @@ extern Lisp_Object Qinsert_file_contents; extern Lisp_Object Qfile_name_history; extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); +EXFUN (Fread_file_name, 6); /* not a normal DEFUN */ extern Lisp_Object close_file_unwind (Lisp_Object); extern Lisp_Object restore_point_unwind (Lisp_Object); extern _Noreturn void report_file_error (const char *, Lisp_Object); ------------------------------------------------------------ revno: 108845 committer: Tom Tromey branch nick: trunk timestamp: Tue 2012-07-03 12:24:42 -0600 message: Auto-generate EXFUN using make-docfile src * window.c (Fset_window_margins, Fset_window_fringes) (Fset_window_scroll_bars, Fset_window_vscroll): No longer static. * textprop.c (Fprevious_property_change): No longer static. * syntax.c (Fsyntax_table_p): No longer static. * process.c (Fget_process, Fprocess_datagram_address): No longer static. * keymap.c (Flookup_key, Fcopy_keymap): No longer static. * keyboard.c (Fcommand_execute): No longer static. Remove EXFUN. * insdel.c (Fcombine_after_change_execute): No longer static. * image.c (Finit_image_library): No longer static. * fileio.c (Fmake_symbolic_link): No longer static. * eval.c (Ffetch_bytecode): No longer static. * editfns.c (Fuser_full_name): No longer static. * doc.c: (Fdocumentation_property, Fsnarf_documentation): No longer static. * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer static. * dired.c (Ffile_attributes): No longer static. * composite.c (Fcomposition_get_gstring): No longer static. * callproc.c (Fgetenv_internal): No longer static. * ccl.h: Remove EXFUNs. * buffer.h: Remove EXFUNs. * dispextern.h: Remove EXFUNs. * intervals.h: Remove EXFUNs. * fontset.h: Remove EXFUN. * font.h: Remove EXFUNs. * dosfns.c (system_process_attributes): Remove EXFUN. * keymap.h: Remove EXFUNs. * lisp.h: Remove EXFUNs. * w32term.h: Remove EXFUNs. * window.h: Remove EXFUNs. * xsettings.h: Remove EXFUN. * xterm.h: Remove EXFUN. lib-src * make-docfile.c (enum global_type) : New constant. (struct global) : New field. (add_global): Add 'value' argument. (compare_globals): Sort functions at the end. (close_emacs_globals): New function. (write_globals): Handle functions. (scan_c_file): Call add_global for DEFUN. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-06-30 23:01:52 +0000 +++ lib-src/ChangeLog 2012-07-03 18:24:42 +0000 @@ -1,3 +1,13 @@ +2012-06-29 Tom Tromey + + * make-docfile.c (enum global_type) : New constant. + (struct global) : New field. + (add_global): Add 'value' argument. + (compare_globals): Sort functions at the end. + (close_emacs_globals): New function. + (write_globals): Handle functions. + (scan_c_file): Call add_global for DEFUN. + 2012-06-30 Juanma Barranquero * makefile.w32-in (CTAGS_CFLAGS): Remove EMACS_NAME; === modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2012-06-24 17:39:14 +0000 +++ lib-src/make-docfile.c 2012-07-03 18:24:42 +0000 @@ -564,6 +564,7 @@ /* The types of globals. */ enum global_type { + FUNCTION, EMACS_INTEGER, BOOLEAN, LISP_OBJECT, @@ -575,6 +576,7 @@ { enum global_type type; char *name; + int value; }; /* All the variable names we saw while scanning C sources in `-g' @@ -584,7 +586,7 @@ struct global *globals; static void -add_global (enum global_type type, char *name) +add_global (enum global_type type, char *name, int value) { /* Ignore the one non-symbol that can occur. */ if (strcmp (name, "...")) @@ -605,6 +607,7 @@ globals[num_globals - 1].type = type; globals[num_globals - 1].name = name; + globals[num_globals - 1].value = value; } } @@ -613,13 +616,29 @@ { const struct global *ga = a; const struct global *gb = b; + + if (ga->type == FUNCTION) + { + if (gb->type != FUNCTION) + return 1; + } + else if (gb->type == FUNCTION) + return -1; + return strcmp (ga->name, gb->name); } static void +close_emacs_globals (void) +{ + fprintf (outfile, "};\n"); + fprintf (outfile, "extern struct emacs_globals globals;\n"); +} + +static void write_globals (void) { - int i; + int i, seen_defun = 0; qsort (globals, num_globals, sizeof (struct global), compare_globals); for (i = 0; i < num_globals; ++i) { @@ -636,20 +655,49 @@ case LISP_OBJECT: type = "Lisp_Object"; break; + case FUNCTION: + if (!seen_defun) + { + close_emacs_globals (); + fprintf (outfile, "\n"); + seen_defun = 1; + } + break; default: fatal ("not a recognized DEFVAR_", 0); } - fprintf (outfile, " %s f_%s;\n", type, globals[i].name); - fprintf (outfile, "#define %s globals.f_%s\n", - globals[i].name, globals[i].name); + if (globals[i].type != FUNCTION) + { + fprintf (outfile, " %s f_%s;\n", type, globals[i].name); + fprintf (outfile, "#define %s globals.f_%s\n", + 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) + fprintf (outfile, "_Noreturn "); + fprintf (outfile, "EXFUN (%s, ", globals[i].name); + if (globals[i].value == -1) + fprintf (outfile, "MANY"); + else if (globals[i].value == -2) + fprintf (outfile, "UNEVALLED"); + else + fprintf (outfile, "%d", globals[i].value); + fprintf (outfile, ");\n"); + } + while (i + 1 < num_globals && !strcmp (globals[i].name, globals[i + 1].name)) ++i; } - fprintf (outfile, "};\n"); - fprintf (outfile, "extern struct emacs_globals globals;\n"); + if (!seen_defun) + close_emacs_globals (); } @@ -699,6 +747,7 @@ int defvarperbufferflag = 0; int defvarflag = 0; enum global_type type = INVALID; + char *name; if (c != '\n' && c != '\r') { @@ -764,8 +813,9 @@ } else continue; - if (generate_globals && (!defvarflag || defvarperbufferflag - || type == INVALID)) + if (generate_globals + && (!defvarflag || defvarperbufferflag || type == INVALID) + && !defunflag) continue; while (c != '(') @@ -784,7 +834,6 @@ if (generate_globals) { int i = 0; - char *name; /* Skip "," and whitespace. */ do @@ -805,8 +854,12 @@ name = xmalloc (i + 1); memcpy (name, input_buffer, i + 1); - add_global (type, name); - continue; + + if (!defunflag) + { + add_global (type, name, 0); + continue; + } } /* DEFVAR_LISP ("name", addr, "doc") @@ -814,7 +867,7 @@ DEFVAR_LISP ("name", addr, doc: /\* doc *\/) */ if (defunflag) - commas = 5; + commas = generate_globals ? 4 : 5; else if (defvarperbufferflag) commas = 3; else if (defvarflag) @@ -841,7 +894,12 @@ scanned = fscanf (infile, "%d", &minargs); else /* Pick up maxargs. */ if (c == 'M' || c == 'U') /* MANY || UNEVALLED */ - maxargs = -1; + { + if (generate_globals) + maxargs = (c == 'M') ? -1 : -2; + else + maxargs = -1; + } else scanned = fscanf (infile, "%d", &maxargs); if (scanned < 0) @@ -854,6 +912,12 @@ c = getc (infile); } + if (generate_globals) + { + add_global (FUNCTION, name, maxargs); + continue; + } + while (c == ' ' || c == '\n' || c == '\r' || c == '\t') c = getc (infile); === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 17:47:32 +0000 +++ src/ChangeLog 2012-07-03 18:24:42 +0000 @@ -1,3 +1,41 @@ +2012-07-03 Tom Tromey + + * window.c (Fset_window_margins, Fset_window_fringes) + (Fset_window_scroll_bars, Fset_window_vscroll): No longer static. + * textprop.c (Fprevious_property_change): No longer static. + * syntax.c (Fsyntax_table_p): No longer static. + * process.c (Fget_process, Fprocess_datagram_address): No longer + static. + * keymap.c (Flookup_key, Fcopy_keymap): No longer static. + * keyboard.c (Fcommand_execute): No longer static. + Remove EXFUN. + * insdel.c (Fcombine_after_change_execute): No longer static. + * image.c (Finit_image_library): No longer static. + * fileio.c (Fmake_symbolic_link): No longer static. + * eval.c (Ffetch_bytecode): No longer static. + * editfns.c (Fuser_full_name): No longer static. + * doc.c: (Fdocumentation_property, Fsnarf_documentation): No + longer static. + * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer + static. + * dired.c (Ffile_attributes): No longer static. + * composite.c (Fcomposition_get_gstring): No longer static. + * callproc.c (Fgetenv_internal): No longer static. + + * ccl.h: Remove EXFUNs. + * buffer.h: Remove EXFUNs. + * dispextern.h: Remove EXFUNs. + * intervals.h: Remove EXFUNs. + * fontset.h: Remove EXFUN. + * font.h: Remove EXFUNs. + * dosfns.c (system_process_attributes): Remove EXFUN. + * keymap.h: Remove EXFUNs. + * lisp.h: Remove EXFUNs. + * w32term.h: Remove EXFUNs. + * window.h: Remove EXFUNs. + * xsettings.h: Remove EXFUN. + * xterm.h: Remove EXFUN. + 2012-07-03 Glenn Morris * lisp.h (Frandom): Make it visible to C. === modified file 'src/buffer.c' --- src/buffer.c 2012-07-03 17:47:32 +0000 +++ src/buffer.c 2012-07-03 18:24:42 +0000 @@ -107,8 +107,6 @@ int last_per_buffer_idx; -static Lisp_Object Fset_buffer_major_mode (Lisp_Object); -static Lisp_Object Fdelete_overlay (Lisp_Object); static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); === modified file 'src/buffer.h' --- src/buffer.h 2012-07-03 03:57:52 +0000 +++ src/buffer.h 2012-07-03 18:24:42 +0000 @@ -930,11 +930,6 @@ } \ } while (0) -EXFUN (Fbuffer_live_p, 1); -EXFUN (Fbuffer_name, 1); -EXFUN (Fnext_overlay_change, 1); -EXFUN (Fbuffer_local_value, 2); - extern Lisp_Object Qbefore_change_functions; extern Lisp_Object Qafter_change_functions; extern Lisp_Object Qfirst_change_hook; === modified file 'src/callproc.c' --- src/callproc.c 2012-06-16 12:24:15 +0000 +++ src/callproc.c 2012-07-03 18:24:42 +0000 @@ -97,8 +97,6 @@ /* Nonzero if this is termination due to exit. */ static int call_process_exited; -static Lisp_Object Fgetenv_internal (Lisp_Object, Lisp_Object); - static Lisp_Object call_process_kill (Lisp_Object fdpid) { === modified file 'src/ccl.h' --- src/ccl.h 2011-09-21 17:41:20 +0000 +++ src/ccl.h 2012-07-03 18:24:42 +0000 @@ -1,6 +1,6 @@ /* Header for CCL (Code Conversion Language) interpreter. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H14PRO021 Copyright (C) 2003 @@ -101,8 +101,6 @@ extern Lisp_Object Qccl, Qcclp; -EXFUN (Fccl_program_p, 1); - #define CHECK_CCL_PROGRAM(x) \ do { \ if (NILP (Fccl_program_p (x))) \ === modified file 'src/composite.c' --- src/composite.c 2012-06-19 16:56:28 +0000 +++ src/composite.c 2012-07-03 18:24:42 +0000 @@ -158,9 +158,6 @@ auto-compositions. */ #define MAX_AUTO_COMPOSITION_LOOKBACK 3 -static Lisp_Object Fcomposition_get_gstring (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); - /* Temporary variable used in macros COMPOSITION_XXX. */ Lisp_Object composition_temp; === modified file 'src/dired.c' --- src/dired.c 2012-06-22 21:17:42 +0000 +++ src/dired.c 2012-07-03 18:24:42 +0000 @@ -88,7 +88,6 @@ static Lisp_Object Qfile_attributes_lessp; static ptrdiff_t scmp (const char *, const char *, ptrdiff_t); -static Lisp_Object Ffile_attributes (Lisp_Object, Lisp_Object); #ifdef WINDOWSNT Lisp_Object === modified file 'src/dispextern.h' --- src/dispextern.h 2012-06-28 07:50:50 +0000 +++ src/dispextern.h 2012-07-03 18:24:42 +0000 @@ -3244,7 +3244,6 @@ extern Lisp_Object tip_frame; extern Window tip_window; -EXFUN (Fx_hide_tip, 0); extern void start_hourglass (void); extern void cancel_hourglass (void); extern int hourglass_shown_p; @@ -3356,8 +3355,6 @@ extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); extern void set_tty_color_mode (struct tty_display_info *, struct frame *); extern struct terminal *get_named_tty (const char *); -EXFUN (Ftty_type, 1); -EXFUN (Fcontrolling_tty_p, 1); extern void create_tty_output (struct frame *); extern struct terminal *init_tty (const char *, const char *, int); extern void tty_append_glyph (struct it *); === modified file 'src/doc.c' --- src/doc.c 2012-06-27 05:47:14 +0000 +++ src/doc.c 2012-07-03 18:24:42 +0000 @@ -42,9 +42,6 @@ static ptrdiff_t get_doc_string_buffer_size; static unsigned char *read_bytecode_pointer; -static Lisp_Object Fdocumentation_property (Lisp_Object, Lisp_Object, - Lisp_Object); -static Lisp_Object Fsnarf_documentation (Lisp_Object); /* readchar in lread.c calls back here to fetch the next byte. If UNREADFLAG is 1, we unread a byte. */ === modified file 'src/dosfns.c' --- src/dosfns.c 2012-07-02 08:00:05 +0000 +++ src/dosfns.c 2012-07-03 18:24:42 +0000 @@ -546,7 +546,6 @@ int i; Lisp_Object cmd_str, decoded_cmd, tem; double pmem; - EXFUN (Fget_internal_run_time, 0); #ifndef SYSTEM_MALLOC extern unsigned long ret_lim_data (); #endif === modified file 'src/editfns.c' --- src/editfns.c 2012-06-29 02:19:32 +0000 +++ src/editfns.c 2012-07-03 18:24:42 +0000 @@ -79,7 +79,6 @@ static void update_buffer_properties (ptrdiff_t, ptrdiff_t); static Lisp_Object Qbuffer_access_fontify_functions; -static Lisp_Object Fuser_full_name (Lisp_Object); /* Symbol for the text property used to mark fields. */ === modified file 'src/eval.c' --- src/eval.c 2012-06-26 23:09:09 +0000 +++ src/eval.c 2012-07-03 18:24:42 +0000 @@ -133,7 +133,6 @@ static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); static int interactive_p (int); static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); -static Lisp_Object Ffetch_bytecode (Lisp_Object); void init_eval_once (void) === modified file 'src/fileio.c' --- src/fileio.c 2012-06-22 21:17:42 +0000 +++ src/fileio.c 2012-07-03 18:24:42 +0000 @@ -148,7 +148,6 @@ static Lisp_Object Qcar_less_than_car; -static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object); static int a_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t, Lisp_Object *, struct coding_system *); static int e_write (int, Lisp_Object, ptrdiff_t, ptrdiff_t, === modified file 'src/font.h' --- src/font.h 2012-05-25 18:19:24 +0000 +++ src/font.h 2012-07-03 18:24:42 +0000 @@ -734,13 +734,8 @@ struct font_data_list *next; }; -EXFUN (Ffont_spec, MANY); extern Lisp_Object copy_font_spec (Lisp_Object); extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object); -EXFUN (Ffont_get, 2); -EXFUN (Ffont_put, 3); -EXFUN (Flist_fonts, 4); -EXFUN (Ffont_xlfd_name, 2); extern Lisp_Object font_make_entity (void); extern Lisp_Object font_make_object (int, Lisp_Object, int); === modified file 'src/fontset.h' --- src/fontset.h 2012-01-19 07:21:25 +0000 +++ src/fontset.h 2012-07-03 18:24:42 +0000 @@ -39,7 +39,6 @@ extern int make_fontset_for_ascii_face (FRAME_PTR, int, struct face *); extern int fontset_from_font (Lisp_Object); extern int fs_query_fontset (Lisp_Object, int); -EXFUN (Fquery_fontset, 2); extern Lisp_Object list_fontsets (struct frame *, Lisp_Object, int); extern Lisp_Object Qlatin; === modified file 'src/image.c' --- src/image.c 2012-06-28 07:50:50 +0000 +++ src/image.c 2012-07-03 18:24:42 +0000 @@ -138,7 +138,6 @@ static void free_color_table (void); static unsigned long *colors_in_color_table (int *n); #endif -static Lisp_Object Finit_image_library (Lisp_Object, Lisp_Object); /* Code to deal with bitmaps. Bitmaps are referenced by their bitmap id, which is just an int that this section returns. Bitmaps are === modified file 'src/insdel.c' --- src/insdel.c 2012-06-16 12:24:15 +0000 +++ src/insdel.c 2012-07-03 18:24:42 +0000 @@ -41,8 +41,6 @@ static void gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap); static void gap_right (ptrdiff_t charpos, ptrdiff_t bytepos); -static Lisp_Object Fcombine_after_change_execute (void); - /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) describing changes which happened while combine_after_change_calls was nonzero. We use this to decide how to call them === modified file 'src/intervals.h' --- src/intervals.h 2012-02-10 18:58:48 +0000 +++ src/intervals.h 2012-07-03 18:24:42 +0000 @@ -308,16 +308,6 @@ /* Sticky properties. */ extern Lisp_Object Qfront_sticky, Qrear_nonsticky; -EXFUN (Fget_char_property, 3); -EXFUN (Fget_text_property, 3); -EXFUN (Ftext_properties_at, 2); -EXFUN (Fnext_property_change, 3); -EXFUN (Fadd_text_properties, 4); -EXFUN (Fset_text_properties, 4); -EXFUN (Fremove_text_properties, 4); -EXFUN (Fremove_list_of_text_properties, 4); -EXFUN (Ftext_property_any, 5); -EXFUN (Fprevious_single_char_property_change, 4); extern Lisp_Object copy_text_properties (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); === modified file 'src/keyboard.c' --- src/keyboard.c 2012-06-28 19:09:41 +0000 +++ src/keyboard.c 2012-07-03 18:24:42 +0000 @@ -459,8 +459,6 @@ #ifdef SIGIO static void input_available_signal (int signo); #endif -static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); static void handle_interrupt (void); static _Noreturn void quit_throw_to_read_char (int); static void process_special_events (void); @@ -1324,7 +1322,6 @@ /* FIXME: This is wrong rather than test window-system, we should call a new set-selection, which will then dispatch to x-set-selection, or tty-set-selection, or w32-set-selection, ... */ -EXFUN (Fwindow_system, 1); Lisp_Object command_loop_1 (void) === modified file 'src/keymap.c' --- src/keymap.c 2012-06-16 12:24:15 +0000 +++ src/keymap.c 2012-07-03 18:24:42 +0000 @@ -92,7 +92,6 @@ /* Which keymaps are reverse-stored in the cache. */ static Lisp_Object where_is_cache_keymaps; -static Lisp_Object Flookup_key (Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object); @@ -956,8 +955,6 @@ return def; } -static Lisp_Object Fcopy_keymap (Lisp_Object); - static Lisp_Object copy_keymap_item (Lisp_Object elt) { === modified file 'src/keymap.h' --- src/keymap.h 2012-05-30 14:08:58 +0000 +++ src/keymap.h 2012-07-03 18:24:42 +0000 @@ -34,19 +34,9 @@ extern Lisp_Object Qremap; extern Lisp_Object Qmenu_item; extern Lisp_Object current_global_map; -EXFUN (Fmake_sparse_keymap, 1); -EXFUN (Fkeymap_prompt, 1); -EXFUN (Fdefine_key, 3); -EXFUN (Fcommand_remapping, 3); -EXFUN (Fkey_binding, 4); -EXFUN (Fkey_description, 2); extern char *push_key_description (EMACS_INT, char *, int); -EXFUN (Fsingle_key_description, 2); -EXFUN (Fwhere_is_internal, 5); -EXFUN (Fcurrent_active_maps, 2); extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int); extern Lisp_Object get_keymap (Lisp_Object, int, int); -EXFUN (Fset_keymap_parent, 2); extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, const char *, int, int, int, int); extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); === modified file 'src/lisp.h' --- src/lisp.h 2012-07-03 17:47:32 +0000 +++ src/lisp.h 2012-07-03 18:24:42 +0000 @@ -2308,56 +2308,12 @@ extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; -EXFUN (Finteractive_form, 1); -EXFUN (Fbyteorder, 0); - /* Defined in frame.c */ extern Lisp_Object Qframep; /* Defined in data.c */ -EXFUN (Fcar, 1); -EXFUN (Fcar_safe, 1); -EXFUN (Fcdr, 1); -EXFUN (Fcdr_safe, 1); -EXFUN (Fsetcar, 2); -EXFUN (Fsetcdr, 2); -EXFUN (Fboundp, 1); -EXFUN (Ffboundp, 1); -EXFUN (Fsymbol_function, 1); -EXFUN (Fsymbol_name, 1); extern Lisp_Object indirect_function (Lisp_Object); -EXFUN (Findirect_function, 2); -EXFUN (Ffset, 2); -EXFUN (Fsymbol_value, 1); extern Lisp_Object find_symbol_value (Lisp_Object); -EXFUN (Fset, 2); -EXFUN (Fdefault_value, 1); -EXFUN (Fset_default, 2); -EXFUN (Fdefault_boundp, 1); -EXFUN (Fmake_local_variable, 1); -EXFUN (Flocal_variable_p, 2); - -EXFUN (Faref, 2); -EXFUN (Faset, 3); - -EXFUN (Fstring_to_number, 2); -EXFUN (Fnumber_to_string, 1); -EXFUN (Fgtr, 2); -EXFUN (Flss, 2); -EXFUN (Fgeq, 2); -EXFUN (Fleq, 2); -EXFUN (Fzerop, 1); -EXFUN (Fplus, MANY); -EXFUN (Fminus, MANY); -EXFUN (Ftimes, MANY); -EXFUN (Fquo, MANY); -EXFUN (Frem, 2); -EXFUN (Fmax, MANY); -EXFUN (Fmin, MANY); - -EXFUN (Fadd1, 1); -EXFUN (Fsub1, 1); -EXFUN (Fmake_variable_buffer_local, 1); /* Convert the integer I to an Emacs representation, either the integer itself, or a cons of two or three integers, or if all else fails a float. @@ -2399,22 +2355,11 @@ extern void swap_in_global_binding (struct Lisp_Symbol *); /* Defined in cmds.c */ -EXFUN (Fend_of_line, 1); -EXFUN (Fforward_char, 1); -EXFUN (Fforward_line, 1); extern void syms_of_cmds (void); extern void keys_of_cmds (void); /* Defined in coding.c */ extern Lisp_Object Qcharset; -EXFUN (Fcoding_system_p, 1); -EXFUN (Fcoding_system_base, 1); -EXFUN (Fcoding_system_eol_type, 1); -EXFUN (Fcheck_coding_system, 1); -EXFUN (Fread_coding_system, 2); -EXFUN (Fread_non_nil_coding_system, 1); -EXFUN (Ffind_operation_coding_system, MANY); -EXFUN (Fdecode_coding_string, 4); extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, ptrdiff_t, int, int, Lisp_Object); extern void init_coding (void); @@ -2422,8 +2367,6 @@ extern void syms_of_coding (void); /* Defined in character.c */ -EXFUN (Fchar_width, 1); -EXFUN (Fstring, MANY); extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t); extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t); extern int multibyte_char_to_unibyte (int); @@ -2442,9 +2385,6 @@ extern void syms_of_composite (void); /* Defined in syntax.c */ -EXFUN (Fforward_word, 1); -EXFUN (Fskip_chars_forward, 2); -EXFUN (Fskip_chars_backward, 2); extern void init_syntax_once (void); extern void syms_of_syntax (void); @@ -2467,47 +2407,10 @@ EMACS_UINT); void init_weak_hash_tables (void); extern void init_fns (void); -EXFUN (Fmake_hash_table, MANY); -EXFUN (Fgethash, 3); -EXFUN (Fputhash, 3); -EXFUN (Fremhash, 2); -EXFUN (Fidentity, 1); -EXFUN (Frandom, 1); -EXFUN (Flength, 1); -EXFUN (Fappend, MANY); -EXFUN (Fconcat, MANY); -EXFUN (Fvconcat, MANY); -EXFUN (Fcopy_sequence, 1); -EXFUN (Fstring_make_multibyte, 1); -EXFUN (Fstring_make_unibyte, 1); -EXFUN (Fstring_as_multibyte, 1); -EXFUN (Fstring_as_unibyte, 1); -EXFUN (Fstring_to_multibyte, 1); -EXFUN (Fsubstring, 3); extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -EXFUN (Fnth, 2); -EXFUN (Fnthcdr, 2); -EXFUN (Fmemq, 2); -EXFUN (Fassq, 2); -EXFUN (Fassoc, 2); -EXFUN (Felt, 2); -EXFUN (Fmember, 2); -EXFUN (Frassq, 2); -EXFUN (Fdelq, 2); -EXFUN (Fdelete, 2); -EXFUN (Fsort, 2); -EXFUN (Freverse, 1); -EXFUN (Fnreverse, 1); -EXFUN (Fget, 2); -EXFUN (Fput, 3); -EXFUN (Fequal, 2); -EXFUN (Fnconc, MANY); -EXFUN (Fmapcar, 2); -EXFUN (Fmapconcat, 3); extern Lisp_Object do_yes_or_no_p (Lisp_Object); -EXFUN (Fprovide, 2); extern Lisp_Object concat2 (Lisp_Object, Lisp_Object); extern Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object nconc2 (Lisp_Object, Lisp_Object); @@ -2518,20 +2421,10 @@ extern ptrdiff_t string_byte_to_char (Lisp_Object, ptrdiff_t); extern Lisp_Object string_to_multibyte (Lisp_Object); extern Lisp_Object string_make_unibyte (Lisp_Object); -EXFUN (Fcopy_alist, 1); -EXFUN (Fplist_get, 2); -EXFUN (Fplist_put, 3); -EXFUN (Fplist_member, 2); -EXFUN (Frassoc, 2); -EXFUN (Fstring_equal, 2); -EXFUN (Fcompare_strings, 7); -EXFUN (Fstring_lessp, 2); extern void syms_of_fns (void); /* Defined in floatfns.c */ extern double extract_float (Lisp_Object); -EXFUN (Ffloat, 1); -EXFUN (Ftruncate, 2); extern void init_floatfns (void); extern void syms_of_floatfns (void); extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y); @@ -2604,11 +2497,7 @@ #endif extern Lisp_Object selected_frame; extern Lisp_Object Vwindow_system; -EXFUN (Fding, 1); -EXFUN (Fredraw_frame, 1); void duration_to_sec_usec (double, int *, int *); -EXFUN (Fsleep_for, 2); -EXFUN (Fredisplay, 1); extern Lisp_Object sit_for (Lisp_Object, int, int); extern void init_display (void); extern void syms_of_display (void); @@ -2685,22 +2574,14 @@ #endif extern const char *pending_malloc_warning; extern Lisp_Object *stack_base; -EXFUN (Fcons, 2); extern Lisp_Object list1 (Lisp_Object); extern Lisp_Object list2 (Lisp_Object, Lisp_Object); extern Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -EXFUN (Flist, MANY); -EXFUN (Fmake_list, 2); extern Lisp_Object allocate_misc (void); -EXFUN (Fmake_vector, 2); -EXFUN (Fvector, MANY); -EXFUN (Fmake_symbol, 1); -EXFUN (Fmake_marker, 0); extern _Noreturn void string_overflow (void); -EXFUN (Fmake_string, 2); extern Lisp_Object make_string (const char *, ptrdiff_t); extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t); extern Lisp_Object make_multibyte_string (const char *, ptrdiff_t, ptrdiff_t); @@ -2710,7 +2591,6 @@ extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t); extern Lisp_Object make_specified_string (const char *, ptrdiff_t, ptrdiff_t, int); -EXFUN (Fpurecopy, 1); extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, int); extern Lisp_Object make_pure_c_string (const char *data); @@ -2724,10 +2604,7 @@ } extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object); -EXFUN (Fgarbage_collect, 0); extern void make_byte_code (struct Lisp_Vector *); -EXFUN (Fmake_byte_code, MANY); -EXFUN (Fmake_bool_vector, 2); extern Lisp_Object Qchar_table_extra_slots; extern struct Lisp_Vector *allocate_vector (EMACS_INT); extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, int tag); @@ -2764,12 +2641,6 @@ #endif /* Defined in chartab.c */ -EXFUN (Fmake_char_table, 2); -EXFUN (Fset_char_table_parent, 2); -EXFUN (Fchar_table_extra_slot, 2); -EXFUN (Fset_char_table_extra_slot, 3); -EXFUN (Fset_char_table_range, 3); -EXFUN (Foptimize_char_table, 2); extern Lisp_Object copy_char_table (Lisp_Object); extern Lisp_Object char_table_ref (Lisp_Object, int); extern Lisp_Object char_table_ref_and_range (Lisp_Object, int, @@ -2791,11 +2662,6 @@ /* Defined in print.c */ extern Lisp_Object Vprin1_to_string_buffer; extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; -EXFUN (Fprin1, 2); -EXFUN (Fprin1_to_string, 2); -EXFUN (Fterpri, 1); -EXFUN (Fprint, 2); -EXFUN (Ferror_message_string, 1); extern Lisp_Object Qstandard_output; extern Lisp_Object Qexternal_debugging_output; extern void temp_output_buffer_setup (const char *); @@ -2825,15 +2691,6 @@ /* Defined in lread.c. */ extern Lisp_Object Qvariable_documentation, Qstandard_input; extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; -EXFUN (Fread, 1); -EXFUN (Fread_from_string, 3); -EXFUN (Fintern, 2); -EXFUN (Fintern_soft, 2); -EXFUN (Funintern, 2); -EXFUN (Fload, 5); -EXFUN (Fget_load_suffixes, 0); -EXFUN (Fread_char, 3); -EXFUN (Fread_event, 3); extern Lisp_Object check_obarray (Lisp_Object); extern Lisp_Object intern (const char *); extern Lisp_Object intern_c_string (const char *); @@ -2873,17 +2730,10 @@ should no longer be used. */ extern Lisp_Object Vrun_hooks; -EXFUN (Frun_hooks, MANY); -EXFUN (Frun_hook_with_args, MANY); -EXFUN (Frun_hook_with_args_until_failure, MANY); extern void run_hook_with_args_2 (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object run_hook_with_args (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object (*funcall) (ptrdiff_t nargs, Lisp_Object *args)); -EXFUN (Fprogn, UNEVALLED); -EXFUN (Finteractive_p, 0); -_Noreturn EXFUN (Fthrow, 2); -EXFUN (Fsignal, 2); extern _Noreturn void xsignal (Lisp_Object, Lisp_Object); extern _Noreturn void xsignal0 (Lisp_Object); extern _Noreturn void xsignal1 (Lisp_Object, Lisp_Object); @@ -2891,12 +2741,7 @@ extern _Noreturn void xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern _Noreturn void signal_error (const char *, Lisp_Object); -EXFUN (Fcommandp, 2); -EXFUN (Ffunctionp, 1); -EXFUN (Feval, 2); extern Lisp_Object eval_sub (Lisp_Object form); -EXFUN (Fapply, MANY); -EXFUN (Ffuncall, MANY); extern Lisp_Object apply1 (Lisp_Object, Lisp_Object); extern Lisp_Object call0 (Lisp_Object); extern Lisp_Object call1 (Lisp_Object, Lisp_Object); @@ -2906,7 +2751,6 @@ extern Lisp_Object call5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object call6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object call7 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -EXFUN (Fdo_auto_save, 2); extern Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object internal_lisp_condition_case (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)); @@ -2933,57 +2777,24 @@ /* Defined in editfns.c */ extern Lisp_Object Qfield; -EXFUN (Fcurrent_message, 0); -EXFUN (Fgoto_char, 1); -EXFUN (Fpoint_max_marker, 0); -EXFUN (Fpoint, 0); -EXFUN (Fpoint_marker, 0); -EXFUN (Fline_beginning_position, 1); -EXFUN (Fline_end_position, 1); -EXFUN (Ffollowing_char, 0); -EXFUN (Fprevious_char, 0); -EXFUN (Fchar_after, 1); -EXFUN (Finsert, MANY); -EXFUN (Finsert_char, 3); extern void insert1 (Lisp_Object); -EXFUN (Feolp, 0); -EXFUN (Feobp, 0); -EXFUN (Fbolp, 0); -EXFUN (Fbobp, 0); -EXFUN (Fformat, MANY); -EXFUN (Fmessage, MANY); extern Lisp_Object format2 (const char *, Lisp_Object, Lisp_Object); -EXFUN (Fbuffer_substring, 2); -EXFUN (Fbuffer_string, 0); extern Lisp_Object save_excursion_save (void); extern Lisp_Object save_restriction_save (void); extern Lisp_Object save_excursion_restore (Lisp_Object); extern Lisp_Object save_restriction_restore (Lisp_Object); -EXFUN (Fchar_to_string, 1); -EXFUN (Fdelete_region, 2); -EXFUN (Fnarrow_to_region, 2); -EXFUN (Fwiden, 0); -EXFUN (Fuser_login_name, 1); -EXFUN (Fsystem_name, 0); extern _Noreturn void time_overflow (void); -EXFUN (Fcurrent_time, 0); -EXFUN (Fget_internal_run_time, 0); extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, int); extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, int); extern void init_editfns (void); const char *get_system_name (void); extern void syms_of_editfns (void); -EXFUN (Fconstrain_to_field, 5); -EXFUN (Ffield_end, 3); extern void set_time_zone_rule (const char *); /* Defined in buffer.c */ extern int mouse_face_overlay_overlaps (Lisp_Object); extern _Noreturn void nsberror (Lisp_Object); -EXFUN (Fset_buffer_multibyte, 1); -EXFUN (Foverlay_start, 1); -EXFUN (Foverlay_end, 1); extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); @@ -2991,27 +2802,11 @@ Lisp_Object, Lisp_Object, Lisp_Object); extern int overlay_touches_p (ptrdiff_t); extern Lisp_Object Vbuffer_alist; -EXFUN (Fget_buffer, 1); -EXFUN (Fget_buffer_create, 1); -EXFUN (Fgenerate_new_buffer_name, 2); -EXFUN (Fset_buffer, 1); extern Lisp_Object set_buffer_if_live (Lisp_Object); -EXFUN (Fbarf_if_buffer_read_only, 0); -EXFUN (Fcurrent_buffer, 0); -EXFUN (Fother_buffer, 3); extern Lisp_Object other_buffer_safely (Lisp_Object); -EXFUN (Foverlay_get, 2); -EXFUN (Fbuffer_modified_p, 1); -EXFUN (Fset_buffer_modified_p, 1); -EXFUN (Fkill_buffer, 1); -EXFUN (Fkill_all_local_variables, 0); -EXFUN (Fbuffer_enable_undo, 1); -EXFUN (Ferase_buffer, 0); extern Lisp_Object Qpriority, Qwindow, Qbefore_string, Qafter_string; extern Lisp_Object get_truename_buffer (Lisp_Object); extern struct buffer *all_buffers; -EXFUN (Fprevious_overlay_change, 1); -EXFUN (Fbuffer_file_name, 1); extern void init_buffer_once (void); extern void init_buffer (void); extern void syms_of_buffer (void); @@ -3019,10 +2814,6 @@ /* Defined in marker.c */ -EXFUN (Fmarker_position, 1); -EXFUN (Fmarker_buffer, 1); -EXFUN (Fcopy_marker, 2); -EXFUN (Fset_marker, 3); extern ptrdiff_t marker_position (Lisp_Object); extern ptrdiff_t marker_byte_position (Lisp_Object); extern void clear_charpos_cache (struct buffer *); @@ -3043,24 +2834,7 @@ extern Lisp_Object Qfile_directory_p; extern Lisp_Object Qinsert_file_contents; extern Lisp_Object Qfile_name_history; -EXFUN (Ffind_file_name_handler, 2); -EXFUN (Ffile_name_as_directory, 1); -EXFUN (Fexpand_file_name, 2); -EXFUN (Ffile_name_nondirectory, 1); -EXFUN (Fsubstitute_in_file_name, 1); -EXFUN (Ffile_symlink_p, 1); -EXFUN (Fverify_visited_file_modtime, 1); -EXFUN (Ffile_exists_p, 1); -EXFUN (Ffile_name_absolute_p, 1); -EXFUN (Fdirectory_file_name, 1); -EXFUN (Ffile_name_directory, 1); extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); -EXFUN (Ffile_accessible_directory_p, 1); -EXFUN (Funhandled_file_name_directory, 1); -EXFUN (Ffile_directory_p, 1); -EXFUN (Fwrite_region, 7); -EXFUN (Ffile_readable_p, 1); -EXFUN (Fread_file_name, 6); extern Lisp_Object close_file_unwind (Lisp_Object); extern Lisp_Object restore_point_unwind (Lisp_Object); extern _Noreturn void report_file_error (const char *, Lisp_Object); @@ -3071,12 +2845,7 @@ /* Defined in search.c */ extern void shrink_regexp_cache (void); -EXFUN (Fstring_match, 3); extern void restore_search_regs (void); -EXFUN (Fmatch_data, 3); -EXFUN (Fset_match_data, 2); -EXFUN (Fmatch_beginning, 1); -EXFUN (Fmatch_end, 1); extern void record_unwind_save_match_data (void); struct re_registers; extern struct re_pattern_buffer *compile_pattern (Lisp_Object, @@ -3102,14 +2871,6 @@ extern Lisp_Object Qcompletion_ignore_case; extern Lisp_Object Vminibuffer_list; extern Lisp_Object last_minibuf_string; -EXFUN (Fcompleting_read, 8); -EXFUN (Fread_from_minibuffer, 7); -EXFUN (Fread_variable, 2); -EXFUN (Fread_buffer, 3); -EXFUN (Fread_minibuffer, 2); -EXFUN (Feval_minibuffer, 2); -EXFUN (Fread_string, 5); -EXFUN (Fassoc_string, 3); extern Lisp_Object get_minibuffer (EMACS_INT); extern void init_minibuf_once (void); extern void syms_of_minibuf (void); @@ -3119,24 +2880,16 @@ extern Lisp_Object Qminus, Qplus; extern Lisp_Object Qwhen; extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; -EXFUN (Fprefix_numeric_value, 1); extern void syms_of_callint (void); /* Defined in casefiddle.c */ extern Lisp_Object Qidentity; -EXFUN (Fdowncase, 1); -EXFUN (Fupcase, 1); -EXFUN (Fupcase_region, 2); -EXFUN (Fupcase_initials, 1); -EXFUN (Fupcase_initials_region, 2); extern void syms_of_casefiddle (void); extern void keys_of_casefiddle (void); /* Defined in casetab.c */ -EXFUN (Fset_case_table, 1); -EXFUN (Fset_standard_case_table, 1); extern void init_casetab_once (void); extern void syms_of_casetab (void); @@ -3149,16 +2902,9 @@ extern Lisp_Object Qup, Qdown, Qbottom; extern Lisp_Object Qtop; extern int input_pending; -EXFUN (Fdiscard_input, 0); -EXFUN (Frecursive_edit, 0); -_Noreturn EXFUN (Ftop_level, 0); extern Lisp_Object menu_bar_items (Lisp_Object); extern Lisp_Object tool_bar_items (Lisp_Object, int *); extern void discard_mouse_events (void); -EXFUN (Fevent_convert_list, 1); -EXFUN (Fread_key_sequence, 5); -EXFUN (Fset_input_interrupt_mode, 1); -EXFUN (Fset_input_mode, 4); extern Lisp_Object pending_funcalls; extern int detect_input_pending (void); extern int detect_input_pending_ignore_squeezables (void); @@ -3176,9 +2922,6 @@ extern void keys_of_keyboard (void); /* Defined in indent.c */ -EXFUN (Fvertical_motion, 2); -EXFUN (Findent_to, 2); -EXFUN (Fmove_to_column, 2); extern ptrdiff_t current_column (void); extern void invalidate_current_column (void); extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT); @@ -3196,14 +2939,6 @@ extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); #endif extern Lisp_Object frame_buffer_predicate (Lisp_Object); -EXFUN (Fselect_frame, 2); -EXFUN (Fselected_frame, 0); -EXFUN (Fmake_frame_visible, 1); -EXFUN (Ficonify_frame, 1); -EXFUN (Fframe_parameter, 2); -EXFUN (Fmodify_frame_parameters, 2); -EXFUN (Fraise_frame, 1); -EXFUN (Fredirect_frame_focus, 2); extern void frames_discard_buffer (Lisp_Object); extern void syms_of_frame (void); @@ -3220,7 +2955,6 @@ extern void fatal_error_signal (int); #endif extern Lisp_Object Qkill_emacs; -_Noreturn EXFUN (Fkill_emacs, 1); #if HAVE_SETLOCALE void fixup_locale (void); void synchronize_system_messages_locale (void); @@ -3250,10 +2984,6 @@ /* Defined in process.c. */ extern Lisp_Object QCtype, Qlocal; -EXFUN (Fget_buffer_process, 1); -EXFUN (Fprocess_status, 1); -EXFUN (Fkill_process, 2); -EXFUN (Fwaiting_for_user_input_p, 0); extern Lisp_Object Qprocessp; extern void kill_buffer_processes (Lisp_Object); extern int wait_reading_process_output (intmax_t, int, int, int, @@ -3279,7 +3009,6 @@ extern void syms_of_process (void); extern void setup_process_coding_systems (Lisp_Object); -EXFUN (Fcall_process, MANY); #ifndef DOS_NT _Noreturn #endif @@ -3291,7 +3020,6 @@ /* Defined in doc.c */ extern Lisp_Object Qfunction_documentation; -EXFUN (Fsubstitute_command_keys, 1); extern Lisp_Object read_doc_string (Lisp_Object); extern Lisp_Object get_doc_string (Lisp_Object, int, int); extern void syms_of_doc (void); @@ -3310,15 +3038,12 @@ /* Defined in macros.c */ extern Lisp_Object Qexecute_kbd_macro; -EXFUN (Fexecute_kbd_macro, 3); -EXFUN (Fcancel_kbd_macro_events, 0); extern void init_macros (void); extern void syms_of_macros (void); /* Defined in undo.c */ extern Lisp_Object Qapply; extern Lisp_Object Qinhibit_read_only; -EXFUN (Fundo_boundary, 0); extern void truncate_undo_list (struct buffer *); extern void record_marker_adjustment (Lisp_Object, ptrdiff_t); extern void record_insert (ptrdiff_t, ptrdiff_t); @@ -3335,21 +3060,12 @@ extern Lisp_Object Qfront_sticky, Qrear_nonsticky; extern Lisp_Object Qminibuffer_prompt; -EXFUN (Fnext_single_property_change, 4); -EXFUN (Fnext_single_char_property_change, 4); -EXFUN (Fprevious_single_property_change, 4); -EXFUN (Fget_text_property, 3); -EXFUN (Fput_text_property, 5); -EXFUN (Fprevious_char_property_change, 2); -EXFUN (Fnext_char_property_change, 2); extern void report_interval_modification (Lisp_Object, Lisp_Object); /* Defined in menu.c */ extern void syms_of_menu (void); /* Defined in xmenu.c */ -EXFUN (Fx_popup_menu, 2); -EXFUN (Fx_popup_dialog, 3); extern void syms_of_xmenu (void); /* Defined in termchar.h */ @@ -3386,7 +3102,6 @@ enum { READLINK_BUFSIZE = 1024 }; extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]); -EXFUN (Funlock_buffer, 0); extern void unlock_all_files (void); extern void lock_file (Lisp_Object); extern void unlock_file (Lisp_Object); @@ -3420,8 +3135,6 @@ ATTRIBUTE_FORMAT_PRINTF (1, 2); /* Defined in terminal.c */ -EXFUN (Fframe_terminal, 1); -EXFUN (Fdelete_terminal, 2); extern void syms_of_terminal (void); /* Defined in font.c */ @@ -3434,8 +3147,6 @@ /* Defined in xfns.c, w32fns.c, or macfns.c */ extern Lisp_Object Qfont_param; -EXFUN (Fxw_display_color_p, 1); -EXFUN (Fx_focus_frame, 1); #endif /* Defined in xfaces.c */ @@ -3448,8 +3159,6 @@ extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground; extern Lisp_Object Vface_alternative_font_family_alist; extern Lisp_Object Vface_alternative_font_registry_alist; -EXFUN (Fclear_face_cache, 1); -EXFUN (Fx_load_color_file, 1); extern void syms_of_xfaces (void); #ifdef HAVE_X_WINDOWS @@ -3471,11 +3180,6 @@ extern char *x_get_keysym_name (int); #endif /* HAVE_WINDOW_SYSTEM */ -#ifdef MSDOS -/* Defined in msdos.c */ -EXFUN (Fmsdos_downcase_filename, 1); -#endif - #ifdef HAVE_LIBXML2 /* Defined in xml.c */ extern void syms_of_xml (void); === modified file 'src/nsterm.h' --- src/nsterm.h 2012-06-22 21:17:42 +0000 +++ src/nsterm.h 2012-07-03 18:24:42 +0000 @@ -707,8 +707,6 @@ #define NS_DUMPGLYPH_MOUSEFACE 3 -EXFUN (Fx_display_grayscale_p, 1); -EXFUN (Fx_display_planes, 1); /* In nsfont, called from fontset.c */ extern void nsfont_make_fontset_for_font (Lisp_Object name, === modified file 'src/process.c' --- src/process.c 2012-06-30 15:55:27 +0000 +++ src/process.c 2012-07-03 18:24:42 +0000 @@ -249,7 +249,6 @@ #define process_output_delay_count 0 #endif -static Lisp_Object Fget_process (Lisp_Object); static void create_process (Lisp_Object, char **, Lisp_Object); #ifdef SIGIO static int keyboard_bit_set (SELECT_TYPE *); @@ -1089,10 +1088,6 @@ return (XPROCESS (process)->kill_without_query ? Qnil : Qt); } -#ifdef DATAGRAM_SOCKETS -static Lisp_Object Fprocess_datagram_address (Lisp_Object); -#endif - DEFUN ("process-contact", Fprocess_contact, Sprocess_contact, 1, 2, 0, doc: /* Return the contact info of PROCESS; t for a real child. === modified file 'src/syntax.c' --- src/syntax.c 2012-06-19 16:56:28 +0000 +++ src/syntax.c 2012-07-03 18:24:42 +0000 @@ -143,7 +143,6 @@ static EMACS_INT find_start_modiff; -static Lisp_Object Fsyntax_table_p (Lisp_Object); static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int); static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object); static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int); === modified file 'src/textprop.c' --- src/textprop.c 2012-06-24 17:39:14 +0000 +++ src/textprop.c 2012-07-03 18:24:42 +0000 @@ -72,9 +72,6 @@ static Lisp_Object interval_insert_behind_hooks; static Lisp_Object interval_insert_in_front_hooks; -static Lisp_Object Fprevious_property_change (Lisp_Object, Lisp_Object, - Lisp_Object); - /* Signal a `text-read-only' error. This function makes it easier to capture that error in GDB by putting a breakpoint on it. */ === modified file 'src/w32term.h' --- src/w32term.h 2012-05-28 17:22:40 +0000 +++ src/w32term.h 2012-07-03 18:24:42 +0000 @@ -688,9 +688,6 @@ XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); struct frame * check_x_frame (Lisp_Object); -EXFUN (Fx_display_color_p, 1); -EXFUN (Fx_display_grayscale_p, 1); - typedef DWORD (WINAPI * ClipboardSequence_Proc) (void); typedef BOOL (WINAPI * AppendMenuW_Proc) ( IN HMENU, === modified file 'src/window.c' --- src/window.c 2012-06-30 09:13:54 +0000 +++ src/window.c 2012-07-03 18:24:42 +0000 @@ -2873,13 +2873,6 @@ return 1; } -static Lisp_Object Fset_window_margins (Lisp_Object, Lisp_Object, Lisp_Object); -static Lisp_Object Fset_window_fringes (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object); -static Lisp_Object Fset_window_scroll_bars (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); -static Lisp_Object Fset_window_vscroll (Lisp_Object, Lisp_Object, Lisp_Object); - /* The following three routines are needed for running a window's configuration change hook. */ static void === modified file 'src/window.h' --- src/window.h 2012-06-29 11:48:08 +0000 +++ src/window.h 2012-07-03 18:24:42 +0000 @@ -815,14 +815,9 @@ extern Lisp_Object Vmouse_event; -EXFUN (Fnext_window, 3); -EXFUN (Fselect_window, 2); -EXFUN (Fset_window_buffer, 3); -EXFUN (Fset_window_point, 2); extern Lisp_Object make_window (void); extern Lisp_Object window_from_coordinates (struct frame *, int, int, enum window_part *, int); -EXFUN (Fwindow_dedicated_p, 1); extern void resize_frame_windows (struct frame *, int, int); extern void delete_all_child_windows (Lisp_Object); extern void freeze_window_starts (struct frame *, int); @@ -893,21 +888,10 @@ extern Lisp_Object Qwindowp, Qwindow_live_p; extern Lisp_Object Vwindow_list; -EXFUN (Fwindow_buffer, 1); -EXFUN (Fget_buffer_window, 2); -EXFUN (Fwindow_minibuffer_p, 1); -EXFUN (Fselected_window, 0); -EXFUN (Fframe_root_window, 1); -EXFUN (Fframe_first_window, 1); -EXFUN (Fset_frame_selected_window, 3); -EXFUN (Fset_window_configuration, 1); -EXFUN (Fcurrent_window_configuration, 1); extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); -EXFUN (Fpos_visible_in_window_p, 3); extern void mark_window_cursors_off (struct window *); extern int window_internal_height (struct window *); extern int window_body_cols (struct window *w); -EXFUN (Frecenter, 1); extern void temp_output_buffer_show (Lisp_Object); extern void replace_buffer_in_windows (Lisp_Object); extern void replace_buffer_in_windows_safely (Lisp_Object); === modified file 'src/xsettings.h' --- src/xsettings.h 2012-01-19 07:21:25 +0000 +++ src/xsettings.h 2012-07-03 18:24:42 +0000 @@ -20,8 +20,6 @@ #ifndef XSETTINGS_H #define XSETTINGS_H -EXFUN (Ftool_bar_get_system_style, 0); - extern void xsettings_initialize (struct x_display_info *dpyinfo); extern void xft_settings_event (struct x_display_info *dpyinfo, XEvent *); === modified file 'src/xterm.h' --- src/xterm.h 2012-05-31 05:08:37 +0000 +++ src/xterm.h 2012-07-03 18:24:42 +0000 @@ -937,7 +937,6 @@ /* From xfns.c. */ struct frame *check_x_frame (Lisp_Object); -EXFUN (Fx_display_grayscale_p, 1); extern void x_free_gcs (struct frame *); /* From xrdb.c. */ ------------------------------------------------------------ revno: 108844 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-07-03 13:47:32 -0400 message: Speed up generate-new-buffer-name for invisible buffers (bug#1229) * src/buffer.c (Fgenerate_new_buffer_name): Speed up finding a new buffer for invisible buffers. * src/lisp.h (Frandom): Make it visible to C. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 16:35:53 +0000 +++ src/ChangeLog 2012-07-03 17:47:32 +0000 @@ -1,3 +1,9 @@ +2012-07-03 Glenn Morris + + * lisp.h (Frandom): Make it visible to C. + * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new + buffer for invisible buffers. (Bug#1229) + 2012-07-03 Dmitry Antipov Fix block vector allocation code to allow VECTOR_BLOCK_SIZE === modified file 'src/buffer.c' --- src/buffer.c 2012-07-03 03:57:52 +0000 +++ src/buffer.c 2012-07-03 17:47:32 +0000 @@ -838,10 +838,14 @@ Otherwise modify name by appending `', incrementing NUMBER \(starting at 2) until an unused name is found, and then return that name. Optional second argument IGNORE specifies a name that is okay to use (if -it is in the sequence to be tried) even if a buffer with that name exists. */) +it is in the sequence to be tried) even if a buffer with that name exists. + +If NAME begins with a space (i.e., a buffer that is not normally +visible to users), then if buffer NAME already exists a random number +is first appended to NAME, to speed up finding a non-existent buffer. */) (register Lisp_Object name, Lisp_Object ignore) { - register Lisp_Object gentemp, tem; + register Lisp_Object gentemp, tem, tem2; ptrdiff_t count; char number[INT_BUFSIZE_BOUND (ptrdiff_t) + sizeof "<>"]; @@ -854,11 +858,23 @@ if (NILP (tem)) return name; + if (!strncmp (SSDATA (name), " ", 1)) /* see bug#1229 */ + { + /* Note fileio.c:make_temp_name does random differently. */ + sprintf (number, "-%"pD"d", Frandom (make_number (999999))); + tem2 = concat2 (name, build_string (number)); + tem = Fget_buffer (tem2); + if (NILP (tem)) + return tem2; + } + else + tem2 = name; + count = 1; while (1) { sprintf (number, "<%"pD"d>", ++count); - gentemp = concat2 (name, build_string (number)); + gentemp = concat2 (tem2, build_string (number)); tem = Fstring_equal (gentemp, ignore); if (!NILP (tem)) return gentemp; === modified file 'src/lisp.h' --- src/lisp.h 2012-07-03 14:37:55 +0000 +++ src/lisp.h 2012-07-03 17:47:32 +0000 @@ -2473,6 +2473,7 @@ EXFUN (Fremhash, 2); EXFUN (Fidentity, 1); +EXFUN (Frandom, 1); EXFUN (Flength, 1); EXFUN (Fappend, MANY); EXFUN (Fconcat, MANY); ------------------------------------------------------------ revno: 108843 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-07-03 20:35:53 +0400 message: Fix block vector allocation code to allow VECTOR_BLOCK_SIZE values which aren't power of 2. * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users accordingly. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 14:37:55 +0000 +++ src/ChangeLog 2012-07-03 16:35:53 +0000 @@ -1,3 +1,11 @@ +2012-07-03 Dmitry Antipov + + Fix block vector allocation code to allow VECTOR_BLOCK_SIZE + values which aren't power of 2. + * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify + it's value and the value of VECTOR_BLOCK_SIZE. Adjust users + accordingly. + 2012-07-03 Stefan Monnier * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-03 14:37:55 +0000 +++ src/alloc.c 2012-07-03 16:35:53 +0000 @@ -2869,6 +2869,12 @@ #define VECTOR_BLOCK_SIZE 4096 +/* This special value is used to calculate vector size when the vector is + on a free list. It should be VECTOR_BLOCK_SIZE rounded up to nearest + power of two, minus one. */ + +#define VECTOR_FREE_LIST_SIZE_MASK 4095 + /* Handy constants for vectorlike objects. */ enum { @@ -2881,6 +2887,11 @@ /* ROUNDUP_SIZE must be a power of 2. */ verify ((roundup_size & (roundup_size - 1)) == 0); +/* Verify assumptions described above. */ +verify ((VECTOR_BLOCK_SIZE % roundup_size) == 0); +verify ((VECTOR_FREE_LIST_SIZE_MASK + 1) >= VECTOR_BLOCK_SIZE); +verify ((VECTOR_FREE_LIST_SIZE_MASK & (VECTOR_FREE_LIST_SIZE_MASK + 1)) == 0); + /* Round up X to nearest mult-of-ROUNDUP_SIZE. */ #define vroundup(x) (((x) + (roundup_size - 1)) & ~(roundup_size - 1)) @@ -2908,7 +2919,7 @@ this special value ORed with vector's memory footprint size. */ #define VECTOR_FREE_LIST_FLAG (~(ARRAY_MARK_FLAG | PSEUDOVECTOR_FLAG \ - | (VECTOR_BLOCK_SIZE - 1))) + | VECTOR_FREE_LIST_SIZE_MASK)) /* Common shortcut to advance vector pointer over a block data. */ @@ -3087,7 +3098,7 @@ if ((vector->header.size & VECTOR_FREE_LIST_FLAG) == VECTOR_FREE_LIST_FLAG) vector->header.next.nbytes = - vector->header.size & (VECTOR_BLOCK_SIZE - 1); + vector->header.size & VECTOR_FREE_LIST_SIZE_MASK; next = ADVANCE (vector, vector->header.next.nbytes); @@ -3100,7 +3111,7 @@ break; if ((next->header.size & VECTOR_FREE_LIST_FLAG) == VECTOR_FREE_LIST_FLAG) - nbytes = next->header.size & (VECTOR_BLOCK_SIZE - 1); + nbytes = next->header.size & VECTOR_FREE_LIST_SIZE_MASK; else nbytes = next->header.next.nbytes; vector->header.next.nbytes += nbytes; @@ -4334,7 +4345,7 @@ if ((vector->header.size & VECTOR_FREE_LIST_FLAG) == VECTOR_FREE_LIST_FLAG) vector = ADVANCE (vector, (vector->header.size - & (VECTOR_BLOCK_SIZE - 1))); + & VECTOR_FREE_LIST_SIZE_MASK)); else if (vector == p) return 1; else ------------------------------------------------------------ revno: 108842 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-07-03 10:37:55 -0400 message: * src/alloc.c (mark_object): Revert part of last patch to use `switch'. * src/lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 11:09:36 +0000 +++ src/ChangeLog 2012-07-03 14:37:55 +0000 @@ -1,3 +1,9 @@ +2012-07-03 Stefan Monnier + + * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better. + + * alloc.c (mark_object): Revert part of last patch to use `switch'. + 2012-07-03 Dmitry Antipov * alloc.c (allocate_vector_block): Remove redundant === modified file 'src/alloc.c' --- src/alloc.c 2012-07-03 11:09:36 +0000 +++ src/alloc.c 2012-07-03 14:37:55 +0000 @@ -5730,15 +5730,15 @@ ptrdiff_t i; eassert (!VECTOR_MARKED_P (ptr)); - VECTOR_MARK (ptr); /* Else mark it */ + VECTOR_MARK (ptr); /* Else mark it. */ if (size & PSEUDOVECTOR_FLAG) size &= PSEUDOVECTOR_SIZE_MASK; /* Note that this size is not the memory-footprint size, but only the number of Lisp_Object fields that we should trace. The distinction is used e.g. by Lisp_Process which places extra - non-Lisp_Object fields at the end of the structure. */ - for (i = 0; i < size; i++) /* and then mark its elements */ + non-Lisp_Object fields at the end of the structure... */ + for (i = 0; i < size; i++) /* ...and then mark its elements. */ mark_object (ptr->contents[i]); } @@ -5875,11 +5875,11 @@ if (STRING_MARKED_P (ptr)) break; CHECK_ALLOCATED_AND_LIVE (live_string_p); + MARK_STRING (ptr); MARK_INTERVAL_TREE (ptr->intervals); - MARK_STRING (ptr); #ifdef GC_CHECK_STRING_BYTES /* Check that the string size recorded in the string is the - same as the one recorded in the sdata structure. */ + same as the one recorded in the sdata structure. */ CHECK_STRING_BYTES (ptr); #endif /* GC_CHECK_STRING_BYTES */ } @@ -6034,7 +6034,7 @@ ptr = ptr->next; if (ptr) { - ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun */ + ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun. */ XSETSYMBOL (obj, ptrx); goto loop; } @@ -6044,34 +6044,42 @@ case Lisp_Misc: CHECK_ALLOCATED_AND_LIVE (live_misc_p); - if (XMISCTYPE (obj) == Lisp_Misc_Overlay) - mark_overlay (XOVERLAY (obj)); - else + if (XMISCANY (obj)->gcmarkbit) + break; + + switch (XMISCTYPE (obj)) { - if (XMISCANY (obj)->gcmarkbit) - break; - XMISCANY (obj)->gcmarkbit = 1; - - /* Note that we don't mark thru the marker's - chain. The buffer's markers chain does not - preserve markers from GC; instead, markers - are removed from the chain when freed by GC. */ - + case Lisp_Misc_Marker: + /* DO NOT mark thru the marker's chain. + The buffer's markers chain does not preserve markers from gc; + instead, markers are removed from the chain when freed by gc. */ + XMISCANY (obj)->gcmarkbit = 1; + break; + + case Lisp_Misc_Save_Value: + XMISCANY (obj)->gcmarkbit = 1; #if GC_MARK_STACK - if (XMISCTYPE (obj) == Lisp_Misc_Save_Value) - { - register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); - /* If DOGC is set, POINTER is the address of a memory - area containing INTEGER potential Lisp_Objects. */ - if (ptr->dogc) - { - Lisp_Object *p = (Lisp_Object *) ptr->pointer; - ptrdiff_t nelt; - for (nelt = ptr->integer; nelt > 0; nelt--, p++) - mark_maybe_object (*p); - } - } + { + register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); + /* If DOGC is set, POINTER is the address of a memory + area containing INTEGER potential Lisp_Objects. */ + if (ptr->dogc) + { + Lisp_Object *p = (Lisp_Object *) ptr->pointer; + ptrdiff_t nelt; + for (nelt = ptr->integer; nelt > 0; nelt--, p++) + mark_maybe_object (*p); + } + } #endif + break; + + case Lisp_Misc_Overlay: + mark_overlay (XOVERLAY (obj)); + break; + + default: + abort (); } break; === modified file 'src/lisp.h' --- src/lisp.h 2012-06-30 09:13:54 +0000 +++ src/lisp.h 2012-07-03 14:37:55 +0000 @@ -542,11 +542,11 @@ /* The cast to struct vectorlike_header * avoids aliasing issues. */ #define XSETPSEUDOVECTOR(a, b, code) \ - XSETTYPED_PSEUDOVECTOR(a, b, \ - (((struct vectorlike_header *) \ - XUNTAG (a, Lisp_Vectorlike)) \ - ->size), \ - code) + XSETTYPED_PSEUDOVECTOR (a, b, \ + (((struct vectorlike_header *) \ + XUNTAG (a, Lisp_Vectorlike)) \ + ->size), \ + code) #define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \ (XSETVECTOR (a, b), \ eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ @@ -1258,6 +1258,63 @@ ptrdiff_t bytepos; }; +/* START and END are markers in the overlay's buffer, and + PLIST is the overlay's property list. */ +struct Lisp_Overlay +/* An overlay's real data content is: + - plist + - buffer + - insertion type of both ends + - start & start_byte + - end & end_byte + - next (singly linked list of overlays). + - start_next and end_next (singly linked list of markers). + I.e. 9words plus 2 bits, 3words of which are for external linked lists. +*/ + { + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ + unsigned gcmarkbit : 1; + int spacer : 15; + struct Lisp_Overlay *next; + Lisp_Object start, end, plist; + }; + +/* Hold a C pointer for later use. + This type of object is used in the arg to record_unwind_protect. */ +struct Lisp_Save_Value + { + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ + unsigned gcmarkbit : 1; + int spacer : 14; + /* If DOGC is set, POINTER is the address of a memory + area containing INTEGER potential Lisp_Objects. */ + unsigned int dogc : 1; + void *pointer; + ptrdiff_t integer; + }; + + +/* A miscellaneous object, when it's on the free list. */ +struct Lisp_Free + { + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */ + unsigned gcmarkbit : 1; + int spacer : 15; + union Lisp_Misc *chain; + }; + +/* To get the type field of a union Lisp_Misc, use XMISCTYPE. + It uses one of these struct subtypes to get the type field. */ + +union Lisp_Misc + { + struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ + struct Lisp_Free u_free; + struct Lisp_Marker u_marker; + struct Lisp_Overlay u_overlay; + struct Lisp_Save_Value u_save_value; + }; + /* Forwarding pointer to an int variable. This is allowed only in the value cell of a symbol, and it means that the symbol's value really lives in the @@ -1324,13 +1381,13 @@ struct Lisp_Buffer_Local_Value { /* 1 means that merely setting the variable creates a local - binding for the current buffer */ + binding for the current buffer. */ unsigned int local_if_set : 1; /* 1 means this variable can have frame-local bindings, otherwise, it is can have buffer-local bindings. The two cannot be combined. */ unsigned int frame_local : 1; /* 1 means that the binding now loaded was found. - Presumably equivalent to (defcell!=valcell) */ + Presumably equivalent to (defcell!=valcell). */ unsigned int found : 1; /* If non-NULL, a forwarding to the C var where it should also be set. */ union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */ @@ -1355,27 +1412,6 @@ #define BLV_VALUE(blv) (XCDR ((blv)->valcell)) #define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v)) -/* START and END are markers in the overlay's buffer, and - PLIST is the overlay's property list. */ -struct Lisp_Overlay -/* An overlay's real data content is: - - plist - - buffer - - insertion type of both ends - - start & start_byte - - end & end_byte - - next (singly linked list of overlays). - - start_next and end_next (singly linked list of markers). - I.e. 9words plus 2 bits, 3words of which are for external linked lists. -*/ - { - ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ - unsigned gcmarkbit : 1; - int spacer : 15; - struct Lisp_Overlay *next; - Lisp_Object start, end, plist; - }; - /* Like Lisp_Objfwd except that value lives in a slot in the current kboard. */ struct Lisp_Kboard_Objfwd @@ -1384,42 +1420,6 @@ int offset; }; -/* Hold a C pointer for later use. - This type of object is used in the arg to record_unwind_protect. */ -struct Lisp_Save_Value - { - ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ - unsigned gcmarkbit : 1; - int spacer : 14; - /* If DOGC is set, POINTER is the address of a memory - area containing INTEGER potential Lisp_Objects. */ - unsigned int dogc : 1; - void *pointer; - ptrdiff_t integer; - }; - - -/* A miscellaneous object, when it's on the free list. */ -struct Lisp_Free - { - ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */ - unsigned gcmarkbit : 1; - int spacer : 15; - union Lisp_Misc *chain; - }; - -/* To get the type field of a union Lisp_Misc, use XMISCTYPE. - It uses one of these struct subtypes to get the type field. */ - -union Lisp_Misc - { - struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ - struct Lisp_Free u_free; - struct Lisp_Marker u_marker; - struct Lisp_Overlay u_overlay; - struct Lisp_Save_Value u_save_value; - }; - union Lisp_Fwd { struct Lisp_Intfwd u_intfwd; @@ -1429,7 +1429,7 @@ struct Lisp_Kboard_Objfwd u_kboard_objfwd; }; -/* Lisp floating point type */ +/* Lisp floating point type. */ struct Lisp_Float { union ------------------------------------------------------------ revno: 108841 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-07-03 15:09:36 +0400 message: * alloc.c (allocate_vector_block): Remove redundant calls to mallopt if DOUG_LEA_MALLOC is defined. (allocate_vectorlike): If DOUG_LEA_MALLOC is defined, avoid calls to mallopt if zero_vector is returned. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 10:21:01 +0000 +++ src/ChangeLog 2012-07-03 11:09:36 +0000 @@ -1,5 +1,12 @@ 2012-07-03 Dmitry Antipov + * alloc.c (allocate_vector_block): Remove redundant + calls to mallopt if DOUG_LEA_MALLOC is defined. + (allocate_vectorlike): If DOUG_LEA_MALLOC is defined, + avoid calls to mallopt if zero_vector is returned. + +2012-07-03 Dmitry Antipov + * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES is enabled, avoid dereferencing NULL current_sblock if running undumped. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-03 10:21:01 +0000 +++ src/alloc.c 2012-07-03 11:09:36 +0000 @@ -2958,17 +2958,7 @@ static struct vector_block * allocate_vector_block (void) { - struct vector_block *block; - -#ifdef DOUG_LEA_MALLOC - mallopt (M_MMAP_MAX, 0); -#endif - - block = xmalloc (sizeof (struct vector_block)); - -#ifdef DOUG_LEA_MALLOC - mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); -#endif + struct vector_block *block = xmalloc (sizeof (struct vector_block)); #if GC_MARK_STACK && !defined GC_MALLOC_CHECK mem_insert (block->data, block->data + VECTOR_BLOCK_BYTES, @@ -3166,45 +3156,43 @@ allocate_vectorlike (ptrdiff_t len) { struct Lisp_Vector *p; - size_t nbytes; MALLOC_BLOCK_INPUT; -#ifdef DOUG_LEA_MALLOC - /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed - because mapped region contents are not preserved in - a dumped Emacs. */ - mallopt (M_MMAP_MAX, 0); -#endif - /* This gets triggered by code which I haven't bothered to fix. --Stef */ /* eassert (!handling_signal); */ if (len == 0) - { - MALLOC_UNBLOCK_INPUT; - return zero_vector; - } - - nbytes = header_size + len * word_size; - - if (nbytes <= VBLOCK_BYTES_MAX) - p = allocate_vector_from_block (vroundup (nbytes)); + p = zero_vector; else { - p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE); - p->header.next.vector = large_vectors; - large_vectors = p; + size_t nbytes = header_size + len * word_size; + +#ifdef DOUG_LEA_MALLOC + /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed + because mapped region contents are not preserved in + a dumped Emacs. */ + mallopt (M_MMAP_MAX, 0); +#endif + + if (nbytes <= VBLOCK_BYTES_MAX) + p = allocate_vector_from_block (vroundup (nbytes)); + else + { + p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE); + p->header.next.vector = large_vectors; + large_vectors = p; + } + +#ifdef DOUG_LEA_MALLOC + /* Back to a reasonable maximum of mmap'ed areas. */ + mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); +#endif + + consing_since_gc += nbytes; + vector_cells_consed += len; } -#ifdef DOUG_LEA_MALLOC - /* Back to a reasonable maximum of mmap'ed areas. */ - mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); -#endif - - consing_since_gc += nbytes; - vector_cells_consed += len; - MALLOC_UNBLOCK_INPUT; return p; ------------------------------------------------------------ revno: 108840 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-07-03 14:21:01 +0400 message: * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES is enabled, avoid dereferencing NULL current_sblock if running undumped. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-03 03:57:52 +0000 +++ src/ChangeLog 2012-07-03 10:21:01 +0000 @@ -1,5 +1,11 @@ 2012-07-03 Dmitry Antipov + * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES + is enabled, avoid dereferencing NULL current_sblock if + running undumped. + +2012-07-03 Dmitry Antipov + Cleanup basic buffer management. * buffer.h (struct buffer): Change layout to use generic vector marking code. Fix some comments. Change type of 'clip_changed' === modified file 'src/alloc.c' --- src/alloc.c 2012-07-03 03:57:52 +0000 +++ src/alloc.c 2012-07-03 10:21:01 +0000 @@ -1872,7 +1872,7 @@ for (b = oldest_sblock; b; b = b->next) check_sblock (b); } - else + else if (current_sblock) check_sblock (current_sblock); } ------------------------------------------------------------ revno: 108839 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-07-03 09:42:31 +0200 message: * vc/ediff-diff.el (ediff-same-file-contents): Fix it for remote files on the same host. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-03 07:12:22 +0000 +++ lisp/ChangeLog 2012-07-03 07:42:31 +0000 @@ -1,3 +1,8 @@ +2012-07-03 Michael Albinus + + * vc/ediff-diff.el (ediff-same-file-contents): Fix it for remote + files on the same host. + 2012-07-03 Andreas Schwab * help-fns.el (describe-function-1): Only call === modified file 'lisp/vc/ediff-diff.el' --- lisp/vc/ediff-diff.el 2012-04-09 13:05:48 +0000 +++ lisp/vc/ediff-diff.el 2012-07-03 07:42:31 +0000 @@ -1407,9 +1407,14 @@ (if (and (not (file-directory-p f1)) (not (file-directory-p f2))) (let ((res - (apply 'call-process ediff-cmp-program nil nil nil - (append ediff-cmp-options (list (expand-file-name f1) - (expand-file-name f2)))) + ;; In the remote case, this works only if F1 and F2 are + ;; located on the same remote host. + (apply 'process-file ediff-cmp-program nil nil nil + (append ediff-cmp-options + (list (or (file-remote-p f1 'localname) + (expand-file-name f1)) + (or (file-remote-p f2 'localname) + (expand-file-name f2))))) )) (and (numberp res) (eq res 0))) )) ------------------------------------------------------------ revno: 108838 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-07-03 09:12:22 +0200 message: Fixes: debbugs:11848 * help-fns.el (describe-function-1): Only call help-fns--autoloaded-p when we have a file name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-03 05:28:42 +0000 +++ lisp/ChangeLog 2012-07-03 07:12:22 +0000 @@ -1,3 +1,8 @@ +2012-07-03 Andreas Schwab + + * help-fns.el (describe-function-1): Only call + help-fns--autoloaded-p when we have a file name. (Bug#11848) + 2012-07-03 Chong Yidong * xml.el: Protect parser against XML bombs. === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2012-06-27 05:47:14 +0000 +++ lisp/help-fns.el 2012-07-03 07:12:22 +0000 @@ -444,6 +444,7 @@ (beg (if (and (or (byte-code-function-p def) (keymapp def) (memq (car-safe def) '(macro lambda closure))) + file-name (help-fns--autoloaded-p function file-name)) (if (commandp def) "an interactive autoloaded " ------------------------------------------------------------ revno: 108837 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-07-03 13:28:42 +0800 message: * xml.el: Protect parser against XML bombs. (xml-entity-expansion-limit): New variable. (xml-parse-string, xml-substitute-special): Use it. (xml-parse-dtd): Avoid infloop if the DTD is not terminated. * test/automated/xml-parse-tests.el: Update testcases. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-03 02:16:11 +0000 +++ lisp/ChangeLog 2012-07-03 05:28:42 +0000 @@ -1,3 +1,10 @@ +2012-07-03 Chong Yidong + + * xml.el: Protect parser against XML bombs. + (xml-entity-expansion-limit): New variable. + (xml-parse-string, xml-substitute-special): Use it. + (xml-parse-dtd): Avoid infloop if the DTD is not terminated. + 2012-07-03 Glenn Morris * progmodes/bug-reference.el (bug-reference-bug-regexp): === modified file 'lisp/xml.el' --- lisp/xml.el 2012-07-02 16:21:54 +0000 +++ lisp/xml.el 2012-07-03 05:28:42 +0000 @@ -98,6 +98,13 @@ ("amp" . "&")) "Alist mapping XML entities to their replacement text.") +(defvar xml-entity-expansion-limit 20000 + "The maximum size of entity reference expansions. +If the size of the buffer increases by this many characters while +expanding entity references in a segment of character data, the +XML parser signals an error. Setting this to nil removes the +limit (making the parser vulnerable to XML bombs).") + (defvar xml-parameter-entity-alist nil "Alist of defined XML parametric entities.") @@ -471,7 +478,7 @@ (while (not (looking-at end)) (cond ((eobp) - (error "XML: (Not Well-Formed) End of buffer while reading element `%s'" + (error "XML: (Not Well-Formed) End of document while reading element `%s'" node-name)) ((looking-at " (- (buffer-size) (point)) + (+ old-remaining-size xml-entity-expansion-limit)) + (error "XML: Entity reference expansion \ +surpassed `xml-entity-expansion-limit'")))) ;; [2.11] Clean up line breaks. (let ((end-marker (point-marker))) (goto-char start) @@ -689,6 +704,8 @@ (while (not (looking-at "\\s-*\\]")) (skip-syntax-forward " ") (cond + ((eobp) + (error "XML: (Well-Formed) End of document while reading DTD")) ;; Element declaration [45]: ((and (looking-at (eval-when-compile (concat "") (goto-char (match-end 0)))) @@ -876,6 +895,7 @@ (let ((ref-re (eval-when-compile (concat "&\\(?:#\\(x\\)?\\([0-9]+\\)\\|\\(" xml-name-re "\\)\\);"))) + (strlen (length string)) children) (while (string-match ref-re string) (push (substring string 0 (match-beginning 0)) children) @@ -891,7 +911,8 @@ (error "XML: (Validity) Undefined character `x%s'" ref)) (t xml-undefined-entity)) children) - (setq string remainder)) + (setq string remainder + strlen (length string))) ;; [4.4.5] Entity references are "included in literal". ;; Note that we don't need do anything special to treat ;; quotes as normal data characters. @@ -900,7 +921,11 @@ (if xml-validating-parser (error "XML: (Validity) Undefined entity `%s'" ref) xml-undefined-entity)))) - (setq string (concat val remainder)))))) + (setq string (concat val remainder))) + (and xml-entity-expansion-limit + (> (length string) (+ strlen xml-entity-expansion-limit)) + (error "XML: Passed `xml-entity-expansion-limit' while expanding `&%s;'" + ref))))) (mapconcat 'identity (nreverse (cons string children)) ""))) (defun xml-substitute-numeric-entities (string) === modified file 'test/ChangeLog' --- test/ChangeLog 2012-07-02 16:21:54 +0000 +++ test/ChangeLog 2012-07-03 05:28:42 +0000 @@ -1,3 +1,7 @@ +2012-07-03 Chong Yidong + + * automated/xml-parse-tests.el (xml-parse-tests--bad-data): New. + 2012-07-02 Chong Yidong * automated/xml-parse-tests.el (xml-parse-tests--data): More === modified file 'test/automated/xml-parse-tests.el' --- test/automated/xml-parse-tests.el 2012-07-02 16:21:54 +0000 +++ test/automated/xml-parse-tests.el 2012-07-03 05:28:42 +0000 @@ -55,14 +55,29 @@ ("&amp;" . ((foo () "&")))) "Alist of XML strings and their expected parse trees.") +(defvar xml-parse-tests--bad-data + '(;; XML bomb in content + "]>&lol2;" + ;; XML bomb in attribute value + "]>!" + ;; Non-terminating DTD + "" + "asdf" + "asdf&abc;") + "List of XML strings that should signal an error in the parser") + (ert-deftest xml-parse-tests () "Test XML parsing." (with-temp-buffer (dolist (test xml-parse-tests--data) (erase-buffer) (insert (car test)) - (should (equal (cdr test) - (xml-parse-region (point-min) (point-max))))))) + (should (equal (cdr test) (xml-parse-region)))) + (let ((xml-entity-expansion-limit 50)) + (dolist (test xml-parse-tests--bad-data) + (erase-buffer) + (insert test) + (should-error (xml-parse-region)))))) ;; Local Variables: ;; no-byte-compile: t