------------------------------------------------------------ revno: 117982 committer: Vincent Bela?che branch nick: trunk timestamp: Tue 2014-09-30 10:06:28 +0200 message: * ses.el (ses-calculate-cell): bind row and col dynamically to their values with 'cl-progv'. (ses-dorange): bind row, col, maxrow and maxcol dynamically to their values with 'cl-progv', also use non-interned symbols for row, minrow, maxrow, mincol and maxcol. (maxrow maxcol): New defvar, to make the compiler happy. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 00:48:31 +0000 +++ lisp/ChangeLog 2014-09-30 08:06:28 +0000 @@ -1,3 +1,12 @@ +2014-09-30 Vincent Belaïche + + * ses.el (ses-calculate-cell): bind row and col dynamically to + their values with 'cl-progv'. + (ses-dorange): bind row, col, maxrow and maxcol dynamically to + their values with 'cl-progv', also use non-interned symbols for + row, minrow, maxrow, mincol and maxcol. + (maxrow maxcol): New defvar, to make the compiler happy. + 2014-09-30 Stefan Monnier * minibuffer.el (completion-at-point): Emit warning for ill-behaved === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-29 20:25:19 +0000 +++ lisp/ses.el 2014-09-30 08:06:28 +0000 @@ -592,30 +592,37 @@ t) (defmacro ses-dorange (curcell &rest body) - "Execute BODY repeatedly, with the variables `row' and `col' set to each -cell in the range specified by CURCELL. The range is available in the -variables `minrow', `maxrow', `mincol', and `maxcol'." + "Execute BODY repeatedly, with the variables `row', `col', +`maxrow' and `maxcol' dynamically scoped to each cell in the +range specified by CURCELL." (declare (indent defun) (debug (form body))) (let ((cur (make-symbol "cur")) (min (make-symbol "min")) (max (make-symbol "max")) (r (make-symbol "r")) - (c (make-symbol "c"))) + (c (make-symbol "c")) + (row (make-symbol "row")) + ;; The range is available in the variables `minrow', `maxrow', + ;; `mincol', and `maxcol'. + (minrow (make-symbol "minrow")) + (mincol (make-symbol "mincol")) + (maxrow (make-symbol "maxrow")) + (maxcol (make-symbol "maxcol")) ) `(let* ((,cur ,curcell) (,min (ses-sym-rowcol (if (consp ,cur) (car ,cur) ,cur))) (,max (ses-sym-rowcol (if (consp ,cur) (cdr ,cur) ,cur)))) - (let ((minrow (car ,min)) - (maxrow (car ,max)) - (mincol (cdr ,min)) - (maxcol (cdr ,max)) - row col) - (if (or (> minrow maxrow) (> mincol maxcol)) + (let ((,minrow (car ,min)) + (,maxrow (car ,max)) + (,mincol (cdr ,min)) + (,maxcol (cdr ,max)) + ,row) + (if (or (> ,minrow ,maxrow) (> ,mincol ,maxcol)) (error "Empty range")) - (dotimes (,r (- maxrow minrow -1)) - (setq row (+ ,r minrow)) - (dotimes (,c (- maxcol mincol -1)) - (setq col (+ ,c mincol)) - ,@body)))))) + (dotimes (,r (- ,maxrow ,minrow -1)) + (setq ,row (+ ,r ,minrow)) + (dotimes (,c (- ,maxcol ,mincol -1)) + (cl-progv '(row col maxrow maxcol) (list ,row (+ ,c ,mincol) ,maxrow ,maxcol) + ,@body))))))) ;;Support for coverage testing. (defmacro 1value (form) @@ -939,7 +946,9 @@ (setq formula (ses-safe-formula (cadr formula))) (ses-set-cell row col 'formula formula)) (condition-case sig - (setq newval (eval formula)) + (setq newval (cl-progv '(row col) + (list row col) + (eval formula))) (error ;; Variable `sig' can't be nil. (nconc sig (list (ses-cell-symbol cell))) @@ -2177,6 +2186,14 @@ (setq ses--Dijkstra-attempt-nb (1+ ses--Dijkstra-attempt-nb) ses--Dijkstra-weight-bound (* ses--numrows ses--numcols))) +;; These functions use the variables 'row' and 'col' that are dynamically bound +;; by ses-print-cell. We define these variables at compile-time to make the +;; compiler happy. +(defvar row) +(defvar col) +(defvar maxrow) +(defvar maxcol) + (defun ses-recalculate-cell () "Recalculate and reprint the current cell or range. @@ -3676,12 +3693,6 @@ ;; Standard print functions ;;---------------------------------------------------------------------------- -;; These functions use the variables 'row' and 'col' that are dynamically bound -;; by ses-print-cell. We define these variables at compile-time to make the -;; compiler happy. -(defvar row) -(defvar col) - (defun ses-center (value &optional span fill) "Print VALUE, centered within column. FILL is the fill character for centering (default = space). ------------------------------------------------------------ revno: 117981 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-09-29 22:49:54 -0700 message: * TODO: Remove char/unsigned char, long long, IRIX unexelf.c. The first two are done, and IRIX support has been dropped. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-09-29 19:49:44 +0000 +++ etc/ChangeLog 2014-09-30 05:49:54 +0000 @@ -1,3 +1,8 @@ +2014-09-30 Paul Eggert + + * TODO: Remove char/unsigned char, long long, IRIX unexelf.c. + The first two are done, and IRIX support has been dropped. + 2014-09-29 Eli Zaretskii * refcards/ru-refcard.tex: Bump version to 25.0.50. === modified file 'etc/TODO' --- etc/TODO 2014-09-26 22:19:12 +0000 +++ etc/TODO 2014-09-30 05:49:54 +0000 @@ -531,12 +531,6 @@ [Basic support added 2013/10: http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00904.html ] -** Eliminate the storm of warnings concerning char/unsigned char - mismatches that we get with GCC 4.x and proprietary compilers on - various systems. They make it difficult to spot the important warnings. - -** Fix anything necessary to use `long long' EMACS_INTs with GCC. - ** Split out parts of lisp.h. ** Update the FAQ. @@ -1337,9 +1331,6 @@ ** a two-char comment-starter whose two chars are symbol constituents will not be noticed if it appears within a word. -** Fix unexelf.c to handle the .data.rel and .data.rel.local - sections made by GCC 3.4 on IRIX. - This file is part of GNU Emacs. ------------------------------------------------------------ revno: 117980 committer: Bill Wohler branch nick: trunk timestamp: Mon 2014-09-29 22:06:42 -0700 message: Merge from emacs-24; up to r117522. diff: === modified file 'etc/MH-E-NEWS' --- etc/MH-E-NEWS 2014-01-16 06:24:06 +0000 +++ etc/MH-E-NEWS 2014-09-30 05:06:42 +0000 @@ -3,6 +3,28 @@ Copyright (C) 2001-2014 Free Software Foundation, Inc. See the end of the file for license conditions. +* Changes in MH-E 8.6 + +Version 8.6 fixes composition errors in nmh 1.6. + +** Bug Fixes in MH-E 8.6 + +*** Add support for nmh 1.5 + +A components file is now generated that works with nmh 1.5 (partially +closes SF #468). + +*** Error if mh-x-face-file is nil + +Ensure that `mh-x-face-file' is a string before trying to use it +(closes SF #474). + +*** MH-Folder buffer includes "scan: bad message list unseen" + +Fix this error (closes SF #471). + + + * Changes in MH-E 8.5 Version 8.5 fixes bugs when incorporating or forwarding mail. === modified file 'etc/NEWS' --- etc/NEWS 2014-09-29 18:14:08 +0000 +++ etc/NEWS 2014-09-30 05:06:42 +0000 @@ -918,7 +918,7 @@ *** Recognition and better indentation of continuations in array comprehensions. -** MH-E has been updated to version 8.5 - see separate MH-E-NEWS file. +** MH-E has been updated to version 8.6 - see separate MH-E-NEWS file. ** Octave mode === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2014-05-09 07:02:00 +0000 +++ lisp/mh-e/ChangeLog 2014-09-30 05:06:42 +0000 @@ -1,3 +1,21 @@ +2014-09-30 Bill Wohler + + Release MH-E version 8.6. + + * mh-e.el (Version, mh-version): Update for release 8.6. + +2014-09-30 Mike Kupfer + + * mh-comp.el (mh-insert-x-face): Ensure that mh-x-face-file is a + string before trying to use it (closes SF #474). + (mh-bare-components): New function to create a temporary initial + components file; replaces mh-find-components. Improve the temp + folder and file names as per a suggestion from Bill Wohler. Also + address XEmacs compatibility issues: use mm-make-temp-file instead + of make-temp-file, and only pass one argument to delete-directory. + (mh-edit-again, mh-send-sub): Use mh-bare-components instead of + mh-find-components (partially closes SF #468). + 2014-05-09 Glenn Morris * mh-e.el (mh-variants): Use file-accessible-directory-p. === modified file 'lisp/mh-e/mh-comp.el' --- lisp/mh-e/mh-comp.el 2014-01-01 07:43:34 +0000 +++ lisp/mh-e/mh-comp.el 2014-09-30 05:06:42 +0000 @@ -411,6 +411,7 @@ (interactive (list (mh-get-msg-num t))) (let* ((from-folder mh-current-folder) (config (current-window-configuration)) + (components-file (mh-bare-components)) (draft (cond ((and mh-draft-folder (equal from-folder mh-draft-folder)) (pop-to-buffer (find-file-noselect (mh-msg-filename message)) @@ -467,7 +468,8 @@ ;; Text field, that's an easy case (t (mh-modify-header-field field value)))))) - (mh-components-to-list (mh-find-components))) + (mh-components-to-list components-file)) + (delete-file components-file) (goto-char (point-min)) (save-buffer) (mh-compose-and-send-mail @@ -885,22 +887,6 @@ (t nil)))) -(defun mh-find-components () - "Return the path to the components file." - (let (components) - (cond - ((file-exists-p - (setq components - (expand-file-name mh-comp-formfile mh-user-path))) - components) - ((file-exists-p - (setq components - (expand-file-name mh-comp-formfile mh-lib))) - components) - (t - (error "Can't find %s in %s or %s" - mh-comp-formfile mh-user-path mh-lib))))) - (defun mh-send-sub (to cc subject config) "Do the real work of composing and sending a letter. Expects the TO, CC, and SUBJECT fields as arguments. @@ -910,8 +896,8 @@ (message "Composing a message...") (let ((draft (mh-read-draft "message" - (mh-find-components) - nil))) + (mh-bare-components) + t))) (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc) (goto-char (point-max)) (mh-compose-and-send-mail draft "" folder msg-num @@ -920,6 +906,29 @@ (mh-letter-mode-message) (mh-letter-adjust-point)))) +(defun mh-bare-components () + "Generate a temporary, clean components file and return its path." + ;; Let comp(1) create the skeleton for us. This is particularly + ;; important with nmh-1.5, because its default "components" needs + ;; some processing before it can be used. Unfortunately, comp(1) + ;; doesn't have a -build option. So, to avoid the possibility of + ;; clobbering an existing draft, create a temporary directory and + ;; use it as the drafts folder. Then copy the skeleton to a regular + ;; temp file, and return the regular temp file. + (let (new + (temp-folder (mm-make-temp-file + (concat mh-user-path "draftfolder.") t))) + (mh-exec-cmd "comp" "-nowhatnowproc" + "-draftfolder" (format "+%s" + (file-name-nondirectory temp-folder)) + (if (stringp mh-comp-formfile) + (list "-form" mh-comp-formfile))) + (setq new (mm-make-temp-file "comp.")) + (rename-file (concat temp-folder "/" "1") new t) + (delete-file (concat temp-folder "/" ".mh_sequences")) + (delete-directory temp-folder) + new)) + (defun mh-read-draft (use initial-contents delete-contents-file) "Read draft file into a draft buffer and make that buffer the current one. @@ -1069,7 +1078,8 @@ (defun mh-insert-x-face () "Append X-Face, Face or X-Image-URL field to header. If the field already exists, this function does nothing." - (when (and (file-exists-p mh-x-face-file) + (when (and (stringp mh-x-face-file) + (file-exists-p mh-x-face-file) (file-readable-p mh-x-face-file)) (save-excursion (unless (or (mh-position-on-field "X-Face") === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2014-05-09 07:02:00 +0000 +++ lisp/mh-e/mh-e.el 2014-09-30 05:06:42 +0000 @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 8.5+bzr +;; Version: 8.6 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -127,7 +127,7 @@ ;; Try to keep variables local to a single file. Provide accessors if ;; variables are shared. Use this section as a last resort. -(defconst mh-version "8.5+bzr" "Version number of MH-E.") +(defconst mh-version "8.6" "Version number of MH-E.") ;; Variants ------------------------------------------------------------ revno: 117979 committer: Bill Wohler branch nick: trunk timestamp: Mon 2014-09-29 21:58:10 -0700 message: Add TODO to replace cl with cl-lib. diff: === modified file 'lisp/mh-e/mh-acros.el' --- lisp/mh-e/mh-acros.el 2014-01-12 16:37:42 +0000 +++ lisp/mh-e/mh-acros.el 2014-09-30 04:58:10 +0000 @@ -46,6 +46,10 @@ ;;; Compatibility +;; TODO: Replace `cl' with `cl-lib'. +;; `cl' is deprecated in Emacs 24.3. Use `cl-lib' instead. However, +;; we'll likely have to insert `cl-' before each use of a Common Lisp +;; function. ;;;###mh-autoload (defmacro mh-require-cl () "Macro to load \"cl\" if needed. ------------------------------------------------------------ revno: 117978 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-09-29 19:43:23 -0700 message: Simplify stack-allocated Lisp objects, and make them more portable. The build_local_string macro was used in two ways: (1) string literals for which scoped allocation suffices, and (2) file name components, where it's not safe in general to assume bounded-size ASCII data. Simplify by defining a new macro SCOPED_STRING that allocates a block-scope string, and by using SCOPED_STRING for (1) and build_string for (2). Furthermore, actually use stack allocation only for objects known to have sufficient alignment. This simpler implementation means Emacs can make USE_STACK_LISP_OBJECTS the default unless GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. * lisp.h (GCALIGNED): Align even if !USE_STACK_LISP_OBJECTS, for fewer differences among implementations. (struct Lisp_String): Now GCALIGNED. (USE_STACK_LISP_OBJECTS): Default to true, since the implementation no longer insists on a nonempty GCALIGNED. But make it false if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. (SCOPED_CONS_INITIALIZER): Remove, since it's no longer needed separately. Move definiens to scoped_cons. The old definition was incorrect when GCALIGNED was defined to be empty. (union Aligned_String): New type. (USE_STACK_CONS, USE_STACK_STRING): New constants, so that the implementation ports to compilers that don't align strictly enough. Don't worry about the union sizes; it's not worth bothering about. (scoped_cons, scoped_list1, scoped_list3, scoped_list4): Rewrite using USE_STACK_CONS. (scoped_cons): Assume the use of union Aligned_Cons. (lisp_string_size, make_local_string, build_local_string): Remove. Unless otherwise specified, all callers of build_local_string changed to use SCOPED_STRING. (SCOPED_STRING): New macro. * data.c (wrong_choice): * menu.c (single_menu_item): * process.c (Fformat_network_address): Hoist use of SCOPED_STRING out of a scope, so that its returned object lives long enough. * fileio.c (Fexpand_file_name): Use build_string, not SCOPED_STRING, as the string might be long or might not be ASCII. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-29 19:49:44 +0000 +++ src/ChangeLog 2014-09-30 02:43:23 +0000 @@ -1,3 +1,44 @@ +2014-09-30 Paul Eggert + + Simplify stack-allocated Lisp objects, and make them more portable. + The build_local_string macro was used in two ways: (1) string + literals for which scoped allocation suffices, and (2) file name + components, where it's not safe in general to assume bounded-size + ASCII data. Simplify by defining a new macro SCOPED_STRING that + allocates a block-scope string, and by using SCOPED_STRING for (1) + and build_string for (2). Furthermore, actually use stack + allocation only for objects known to have sufficient alignment. + This simpler implementation means Emacs can make + USE_STACK_LISP_OBJECTS the default unless GC_MARK_STACK != + GC_MAKE_GCPROS_NOOPS. + * lisp.h (GCALIGNED): Align even if !USE_STACK_LISP_OBJECTS, + for fewer differences among implementations. + (struct Lisp_String): Now GCALIGNED. + (USE_STACK_LISP_OBJECTS): Default to true, since the + implementation no longer insists on a nonempty GCALIGNED. + But make it false if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. + (SCOPED_CONS_INITIALIZER): Remove, since it's no longer needed + separately. Move definiens to scoped_cons. The old definition + was incorrect when GCALIGNED was defined to be empty. + (union Aligned_String): New type. + (USE_STACK_CONS, USE_STACK_STRING): New constants, so that the + implementation ports to compilers that don't align strictly enough. + Don't worry about the union sizes; it's not worth bothering about. + (scoped_cons, scoped_list1, scoped_list3, scoped_list4): + Rewrite using USE_STACK_CONS. + (scoped_cons): Assume the use of union Aligned_Cons. + (lisp_string_size, make_local_string, build_local_string): Remove. + Unless otherwise specified, all callers of build_local_string + changed to use SCOPED_STRING. + (SCOPED_STRING): New macro. + * data.c (wrong_choice): + * menu.c (single_menu_item): + * process.c (Fformat_network_address): + Hoist use of SCOPED_STRING out of a scope, so that its returned + object lives long enough. + * fileio.c (Fexpand_file_name): Use build_string, not SCOPED_STRING, + as the string might be long or might not be ASCII. + 2014-09-29 Eli Zaretskii * msdos.c (internal_terminal_init): Bump version to 25. === modified file 'src/buffer.c' --- src/buffer.c 2014-09-29 06:44:31 +0000 +++ src/buffer.c 2014-09-30 02:43:23 +0000 @@ -1552,10 +1552,10 @@ return notsogood; else { - buf = Fget_buffer (build_local_string ("*scratch*")); + buf = Fget_buffer (SCOPED_STRING ("*scratch*")); if (NILP (buf)) { - buf = Fget_buffer_create (build_local_string ("*scratch*")); + buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); Fset_buffer_major_mode (buf); } return buf; @@ -1575,10 +1575,10 @@ if (candidate_buffer (buf, buffer)) return buf; - buf = Fget_buffer (build_local_string ("*scratch*")); + buf = Fget_buffer (SCOPED_STRING ("*scratch*")); if (NILP (buf)) { - buf = Fget_buffer_create (build_local_string ("*scratch*")); + buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); Fset_buffer_major_mode (buf); } @@ -5289,7 +5289,7 @@ (void) initialized; #endif /* USE_MMAP_FOR_BUFFERS */ - Fset_buffer (Fget_buffer_create (build_local_string ("*scratch*"))); + Fset_buffer (Fget_buffer_create (SCOPED_STRING ("*scratch*"))); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -5328,7 +5328,7 @@ && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) bset_directory (current_buffer, - concat2 (build_local_string ("/:"), BVAR (current_buffer, directory))); + concat2 (SCOPED_STRING ("/:"), BVAR (current_buffer, directory))); temp = get_minibuffer (0); bset_directory (XBUFFER (temp), BVAR (current_buffer, directory)); === modified file 'src/charset.c' --- src/charset.c 2014-09-29 06:44:31 +0000 +++ src/charset.c 2014-09-30 02:43:23 +0000 @@ -490,8 +490,7 @@ int n_entries; ptrdiff_t count; - suffixes = scoped_list2 (build_local_string (".map"), - build_local_string (".TXT")); + suffixes = scoped_list2 (SCOPED_STRING (".map"), SCOPED_STRING (".TXT")); count = SPECPDL_INDEX (); record_unwind_protect_nothing (); === modified file 'src/chartab.c' --- src/chartab.c 2014-09-29 06:44:31 +0000 +++ src/chartab.c 2014-09-30 02:43:23 +0000 @@ -1302,7 +1302,7 @@ { struct gcpro gcpro1; GCPRO1 (val); - result = Fload (concat2 (build_local_string ("international/"), table), + result = Fload (concat2 (SCOPED_STRING ("international/"), table), Qt, Qt, Qt, Qt); UNGCPRO; if (NILP (result)) === modified file 'src/data.c' --- src/data.c 2014-09-29 06:44:31 +0000 +++ src/data.c 2014-09-30 02:43:23 +0000 @@ -979,18 +979,20 @@ { ptrdiff_t i = 0, len = XINT (Flength (choice)); Lisp_Object obj, *args; + Lisp_Object should_be_specified = SCOPED_STRING (" should be specified"); + Lisp_Object or = SCOPED_STRING (" or "); + Lisp_Object comma = SCOPED_STRING (", "); USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (args, len * 2 + 1); - args[i++] = build_local_string ("One of "); + args[i++] = SCOPED_STRING ("One of "); for (obj = choice; !NILP (obj); obj = XCDR (obj)) { args[i++] = SYMBOL_NAME (XCAR (obj)); - args[i++] = build_local_string - (NILP (XCDR (obj)) ? " should be specified" - : (NILP (XCDR (XCDR (obj))) ? " or " : ", ")); + args[i++] = (NILP (XCDR (obj)) ? should_be_specified + : NILP (XCDR (XCDR (obj))) ? or : comma); } obj = Fconcat (i, args); @@ -1005,9 +1007,9 @@ wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) { xsignal2 (Qerror, Fconcat (4, ((Lisp_Object []) - { build_local_string ("Value should be from "), + { SCOPED_STRING ("Value should be from "), Fnumber_to_string (min), - build_local_string (" to "), + SCOPED_STRING (" to "), Fnumber_to_string (max) })), wrong); } === modified file 'src/doc.c' --- src/doc.c 2014-09-24 04:12:37 +0000 +++ src/doc.c 2014-09-30 02:43:23 +0000 @@ -146,8 +146,8 @@ if (fd < 0) { SAFE_FREE (); - return concat3 (build_local_string ("Cannot open doc string file \""), - file, build_local_string ("\"\n")); + return concat3 (SCOPED_STRING ("Cannot open doc string file \""), + file, SCOPED_STRING ("\"\n")); } } count = SPECPDL_INDEX (); === modified file 'src/editfns.c' --- src/editfns.c 2014-09-29 06:44:31 +0000 +++ src/editfns.c 2014-09-30 02:43:23 +0000 @@ -4362,8 +4362,7 @@ Lisp_Object format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) { - return Fformat (3, ((Lisp_Object []) - { build_local_string (string1), arg0, arg1 })); + return Fformat (3, (Lisp_Object []) { SCOPED_STRING (string1), arg0, arg1 }); } DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, === modified file 'src/emacs.c' --- src/emacs.c 2014-09-29 06:44:31 +0000 +++ src/emacs.c 2014-09-30 02:43:23 +0000 @@ -423,7 +423,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (raw_name, Qt); if (! NILP (handler)) - raw_name = concat2 (build_local_string ("/:"), raw_name); + raw_name = concat2 (SCOPED_STRING ("/:"), raw_name); Vinvocation_name = Ffile_name_nondirectory (raw_name); Vinvocation_directory = Ffile_name_directory (raw_name); @@ -441,7 +441,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (found, Qt); if (! NILP (handler)) - found = concat2 (build_local_string ("/:"), found); + found = concat2 (SCOPED_STRING ("/:"), found); Vinvocation_directory = Ffile_name_directory (found); } } @@ -2323,7 +2323,7 @@ } if (! NILP (tem)) - element = concat2 (build_local_string ("/:"), element); + element = concat2 (SCOPED_STRING ("/:"), element); } /* !NILP (element) */ lpath = Fcons (element, lpath); === modified file 'src/fileio.c' --- src/fileio.c 2014-09-29 06:44:31 +0000 +++ src/fileio.c 2014-09-30 02:43:23 +0000 @@ -1111,7 +1111,7 @@ name = make_specified_string (nm, -1, p - nm, multibyte); temp[0] = DRIVE_LETTER (drive); - name = concat2 (build_local_string (temp), name); + name = concat2 (SCOPED_STRING (temp), name); } #ifdef WINDOWSNT if (!NILP (Vw32_downcase_file_names)) @@ -1162,11 +1162,11 @@ char newdir_utf8[MAX_UTF8_PATH]; filename_from_ansi (newdir, newdir_utf8); - tem = build_local_string (newdir_utf8); + tem = build_string (newdir_utf8); } else #endif - tem = build_local_string (newdir); + tem = build_string (newdir); newdirlim = newdir + SBYTES (tem); if (multibyte && !STRING_MULTIBYTE (tem)) { @@ -1198,7 +1198,7 @@ /* `getpwnam' may return a unibyte string, which will bite us since we expect the directory to be multibyte. */ - tem = build_local_string (newdir); + tem = build_string (newdir); newdirlim = newdir + SBYTES (tem); if (multibyte && !STRING_MULTIBYTE (tem)) { @@ -1231,7 +1231,7 @@ adir = NULL; else if (multibyte) { - Lisp_Object tem = build_local_string (adir); + Lisp_Object tem = build_string (adir); tem = DECODE_FILE (tem); newdirlim = adir + SBYTES (tem); @@ -1334,7 +1334,7 @@ getcwd (adir, adir_size); if (multibyte) { - Lisp_Object tem = build_local_string (adir); + Lisp_Object tem = build_string (adir); tem = DECODE_FILE (tem); newdirlim = adir + SBYTES (tem); @@ -5420,7 +5420,7 @@ ring_bell (XFRAME (selected_frame)); msg = Fformat (3, ((Lisp_Object []) - { build_local_string ("Auto-saving %s: %s"), + { SCOPED_STRING ("Auto-saving %s: %s"), BVAR (current_buffer, name), Ferror_message_string (error_val) })); GCPRO1 (msg); === modified file 'src/fns.c' --- src/fns.c 2014-09-29 06:44:31 +0000 +++ src/fns.c 2014-09-30 02:43:23 +0000 @@ -2726,7 +2726,7 @@ } prompt = Fconcat (2, ((Lisp_Object []) - { prompt, build_local_string ("(yes or no) ") })); + { prompt, SCOPED_STRING ("(yes or no) ") })); GCPRO1 (prompt); while (1) === modified file 'src/font.c' --- src/font.c 2014-09-29 06:44:31 +0000 +++ src/font.c 2014-09-30 02:43:23 +0000 @@ -1187,12 +1187,12 @@ { val = prop[XLFD_ENCODING_INDEX]; if (! NILP (val)) - val = concat2 (build_local_string ("*-"), SYMBOL_NAME (val)); + val = concat2 (SCOPED_STRING ("*-"), SYMBOL_NAME (val)); } else if (NILP (prop[XLFD_ENCODING_INDEX])) - val = concat2 (SYMBOL_NAME (val), build_local_string ("-*")); + val = concat2 (SYMBOL_NAME (val), SCOPED_STRING ("-*")); else - val = concat3 (SYMBOL_NAME (val), build_local_string ("-"), + val = concat3 (SYMBOL_NAME (val), SCOPED_STRING ("-"), SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); if (! NILP (val)) ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); @@ -1790,9 +1790,9 @@ if (! p1) { if (SDATA (registry)[len - 1] == '*') - registry = concat2 (registry, build_local_string ("-*")); + registry = concat2 (registry, SCOPED_STRING ("-*")); else - registry = concat2 (registry, build_local_string ("*-*")); + registry = concat2 (registry, SCOPED_STRING ("*-*")); } registry = Fdowncase (registry); ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); @@ -5019,7 +5019,7 @@ if (FONTP (arg)) { Lisp_Object tail, elt; - Lisp_Object equalstr = build_local_string ("="); + Lisp_Object equalstr = SCOPED_STRING ("="); val = Ffont_xlfd_name (arg, Qt); for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); @@ -5053,7 +5053,7 @@ val = Ffont_xlfd_name (result, Qt); if (! FONT_SPEC_P (result)) val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), - build_local_string (":"), val); + SCOPED_STRING (":"), val); result = val; } else if (CONSP (result)) === modified file 'src/fontset.c' --- src/fontset.c 2014-09-29 06:44:31 +0000 +++ src/fontset.c 2014-09-30 02:43:23 +0000 @@ -1462,7 +1462,7 @@ registry = AREF (font_spec, FONT_REGISTRY_INDEX); if (! NILP (registry)) registry = Fdowncase (SYMBOL_NAME (registry)); - encoding = find_font_encoding (concat3 (family, build_local_string ("-"), + encoding = find_font_encoding (concat3 (family, SCOPED_STRING ("-"), registry)); if (NILP (encoding)) encoding = Qascii; === modified file 'src/frame.c' --- src/frame.c 2014-09-29 06:44:31 +0000 +++ src/frame.c 2014-09-30 02:43:23 +0000 @@ -4149,8 +4149,8 @@ if (attribute && dpyinfo) { tem = display_x_get_resource - (dpyinfo, build_local_string (attribute), - build_local_string (class), Qnil, Qnil); + (dpyinfo, SCOPED_STRING (attribute), + SCOPED_STRING (class), Qnil, Qnil); if (NILP (tem)) return Qunbound; === modified file 'src/keyboard.c' --- src/keyboard.c 2014-09-29 06:44:31 +0000 +++ src/keyboard.c 2014-09-30 02:43:23 +0000 @@ -566,10 +566,10 @@ if (XINT (last_char) == '-' && XINT (prev_char) != ' ') Faset (echo_string, idx, make_number (' ')); else - echo_string = concat2 (echo_string, build_local_string (" ")); + echo_string = concat2 (echo_string, SCOPED_STRING (" ")); } else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) - echo_string = concat2 (echo_string, build_local_string (" ")); + echo_string = concat2 (echo_string, SCOPED_STRING (" ")); kset_echo_string (current_kboard, @@ -632,7 +632,7 @@ but make it go away when the next character is added. */ kset_echo_string (current_kboard, - concat2 (KVAR (current_kboard, echo_string), build_local_string ("-"))); + concat2 (KVAR (current_kboard, echo_string), SCOPED_STRING ("-"))); echo_now (); } @@ -1896,7 +1896,7 @@ hook = args[0]; fun = args[1]; Fmessage (4, ((Lisp_Object []) - { build_local_string ("Error in %s (%S): %S"), hook, fun, error })); + { SCOPED_STRING ("Error in %s (%S): %S"), hook, fun, error })); if (SYMBOLP (hook)) { @@ -7889,7 +7889,7 @@ /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) - keyeq = concat2 (build_local_string (" "), + keyeq = concat2 (SCOPED_STRING (" "), Fsubstitute_command_keys (keyeq)); else { @@ -7933,7 +7933,7 @@ if (STRINGP (XCDR (prefix))) tem = concat2 (tem, XCDR (prefix)); } - keyeq = concat2 (build_local_string (" "), tem); + keyeq = concat2 (SCOPED_STRING (" "), tem); } else keyeq = Qnil; @@ -8638,9 +8638,9 @@ Lisp_Object selected = AREF (item_properties, ITEM_PROPERTY_SELECTED); if (EQ (tem, QCradio)) - tem = build_local_string (NILP (selected) ? "(*) " : "( ) "); + tem = SCOPED_STRING (NILP (selected) ? "(*) " : "( ) "); else - tem = build_local_string (NILP (selected) ? "[X] " : "[ ] "); + tem = SCOPED_STRING (NILP (selected) ? "[X] " : "[ ] "); s = concat2 (tem, s); } === modified file 'src/keymap.c' --- src/keymap.c 2014-09-29 06:44:31 +0000 +++ src/keymap.c 2014-09-30 02:43:23 +0000 @@ -1338,7 +1338,7 @@ *p = 0; c = reorder_modifiers (c); - keystring = concat2 (build_local_string (new_mods), XCDR (assoc)); + keystring = concat2 (SCOPED_STRING (new_mods), XCDR (assoc)); error ("To bind the key %s, use [?%s], not [%s]", SDATA (SYMBOL_NAME (c)), SDATA (keystring), @@ -2243,7 +2243,7 @@ if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) /* An interval from a map-char-table. */ return concat3 (Fsingle_key_description (XCAR (key), no_angles), - build_local_string (".."), + SCOPED_STRING (".."), Fsingle_key_description (XCDR (key), no_angles)); key = EVENT_HEAD (key); @@ -3441,7 +3441,7 @@ { Lisp_Object tem; tem = Fkey_description (prefix, Qnil); - elt_prefix = concat2 (tem, build_local_string (" ")); + elt_prefix = concat2 (tem, SCOPED_STRING (" ")); } prefix = Qnil; } === modified file 'src/lisp.h' --- src/lisp.h 2014-09-29 06:44:31 +0000 +++ src/lisp.h 2014-09-30 02:43:23 +0000 @@ -282,23 +282,7 @@ # endif #endif -/* This should work with GCC. Clang has known problems; see - http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00506.html. */ -#ifndef USE_STACK_LISP_OBJECTS -# if defined __GNUC__ && !defined __clang__ - /* 32-bit MinGW builds need at least GCC 4.2 to support this. */ -# if defined __MINGW32__ && !defined _W64 \ - && __GNUC__ + (__GNUC_MINOR__ > 1) < 5 -# define USE_STACK_LISP_OBJECTS false -# else /* !(__MINGW32__ && __GNUC__ < 4.2) */ -# define USE_STACK_LISP_OBJECTS true -# endif -# else -# define USE_STACK_LISP_OBJECTS false -# endif -#endif - -#if defined HAVE_STRUCT_ATTRIBUTE_ALIGNED && USE_STACK_LISP_OBJECTS +#ifdef HAVE_STRUCT_ATTRIBUTE_ALIGNED # define GCALIGNED __attribute__ ((aligned (GCALIGNMENT))) #else # define GCALIGNED /* empty */ @@ -1088,7 +1072,7 @@ /* In a string or vector, the sign bit of the `size' is the gc mark bit. */ -struct Lisp_String +struct GCALIGNED Lisp_String { ptrdiff_t size; ptrdiff_t size_byte; @@ -4598,27 +4582,26 @@ /* If USE_STACK_LISP_OBJECTS, define macros that and functions that allocate - block-scoped conses and function-scoped strings. These objects are not + block-scoped conses and strings. These objects are not managed by the garbage collector, so they are dangerous: passing them out of their scope (e.g., to user code) results in undefined behavior. Conversely, they have better performance because GC is not involved. - This feature is experimental and requires careful debugging. It's enabled - by default if GCC or a compiler that mimics GCC well (like Intel C/C++) is - used, except clang (see notice above). For other compilers, brave users can - compile with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=1' to get into the game. - Note that this feature requires GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. */ - -#ifdef GCALIGNED - -/* No tricks if struct Lisp_Cons is always aligned. */ - -# define SCOPED_CONS_INITIALIZER(a, b) &((struct Lisp_Cons) { a, { b } }) - -#else /* not GCALIGNED */ - -/* A struct Lisp_Cons inside a union that is no larger and may be - better-aligned. */ + This feature is experimental and requires careful debugging. + Build with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=0' to disable it. */ + +#ifndef USE_STACK_LISP_OBJECTS +# define USE_STACK_LISP_OBJECTS true +#endif + +/* USE_STACK_LISP_OBJECTS requires GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. */ + +#if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS +# undef USE_STACK_LISP_OBJECTS +# define USE_STACK_LISP_OBJECTS false +#endif + +/* Struct inside unions that are typically no larger and aligned enough. */ union Aligned_Cons { @@ -4626,88 +4609,61 @@ double d; intmax_t i; void *p; }; -verify (alignof (union Aligned_Cons) % GCALIGNMENT == 0); -verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons)); - -# define SCOPED_CONS_INITIALIZER(a, b) \ - &((union Aligned_Cons) { { a, { b } } }.s) - -#endif /* GCALIGNED */ - -/* Basic stack-based cons allocation. */ - -#if USE_STACK_LISP_OBJECTS -# define scoped_cons(a, b) \ - make_lisp_ptr (SCOPED_CONS_INITIALIZER (a, b), Lisp_Cons) -# define scoped_list1(a) scoped_cons (a, Qnil) -# define scoped_list2(a, b) scoped_cons (a, scoped_list1 (b)) -# define scoped_list3(a, b, c) scoped_cons (a, scoped_list2 (b, c)) -# define scoped_list4(a, b, c, d) scoped_cons (a, scoped_list3 (b, c, d)) -#else -# define scoped_cons(a, b) Fcons (a, b) -# define scoped_list1(a) list1 (a) -# define scoped_list2(a, b) list2 (a, b) -# define scoped_list3(a, b, c) list3 (a, b, c) -# define scoped_list4(a, b, c, d) list4 (a, b, c, d) -#endif - -/* On-stack string allocation requires __builtin_constant_p, statement - expressions and GCALIGNMENT-aligned alloca. All from the above is - assumed for GCC. At least for clang < 3.6, alloca isn't properly - aligned in some cases. In the absence of solid information, play - it safe for other non-GCC compilers. */ - -#if USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ - -/* Used to check whether stack-allocated strings are ASCII-only. */ +union Aligned_String +{ + struct Lisp_String s; + double d; intmax_t i; void *p; +}; + +/* True for stack-based cons and string implementations. */ + +enum + { + USE_STACK_CONS = (USE_STACK_LISP_OBJECTS + && alignof (union Aligned_Cons) % GCALIGNMENT == 0), + USE_STACK_STRING = (USE_STACK_LISP_OBJECTS + && alignof (union Aligned_String) % GCALIGNMENT == 0) + }; + +/* Build a stack-based Lisp cons or short list if possible, a GC-based + one otherwise. The resulting object should not be modified or made + visible to user code. */ + +#define scoped_cons(a, b) \ + (USE_STACK_CONS \ + ? make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) \ + : Fcons (a, b)) +#define scoped_list1(a) \ + (USE_STACK_CONS ? scoped_cons (a, Qnil) : list1 (a)) +#define scoped_list2(a, b) \ + (USE_STACK_CONS ? scoped_cons (a, scoped_list1 (b)) : list2 (a,b)) +#define scoped_list3(a, b, c) \ + (USE_STACK_CONS ? scoped_cons (a, scoped_list2 (b, c)) : list3 (a, b, c)) +#define scoped_list4(a, b, c, d) \ + (USE_STACK_CONS \ + ? scoped_cons (a, scoped_list3 (b, c, d)) : \ + list4 (a, b, c, d)) + +/* Check whether stack-allocated strings are ASCII-only. */ #ifdef ENABLE_CHECKING -extern const char * verify_ascii (const char *); +extern const char *verify_ascii (const char *); #else -#define verify_ascii(str) (str) +# define verify_ascii(str) (str) #endif -/* Return number of bytes needed for Lisp string of length NBYTES. */ - -INLINE ptrdiff_t -lisp_string_size (ptrdiff_t nbytes) -{ - return sizeof (struct Lisp_String) + nbytes + 1; -} - -/* Return function-scoped unibyte Lisp string with contents STR of length - NBYTES and memory footprint of MEMSIZE bytes if the latter doesn't exceed - MAX_ALLOCA, abort otherwise. */ - -# define make_local_string(str, memsize, nbytes) \ - ((memsize < MAX_ALLOCA) \ - ? ({ struct Lisp_String *s_ = alloca (memsize); \ - s_->data = (unsigned char *) (s_ + 1); \ - memcpy (s_->data, verify_ascii (str), nbytes + 1); \ - s_->size = nbytes, s_->size_byte = -1; \ - s_->intervals = NULL; \ - make_lisp_ptr (s_, Lisp_String); }) \ - : (emacs_abort (), Qnil)) - -/* If STR is a compile-time string constant, build function-scoped Lisp string - from it, fall back to regular Lisp string otherwise. We assume compile-time - string constants never exceeds MAX_ALLOCA - sizeof (Lisp_String) - 1. */ - -# define build_local_string(str) \ - (__builtin_constant_p (str) \ - ? make_local_string \ - (str, lisp_string_size (strlen (str)), strlen (str)) \ - : build_string (str)) - -#else /* not USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ */ - -INLINE Lisp_Object -build_local_string (const char *str) -{ - return build_string (str); -} - -#endif /* not USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ */ +/* Build a stack-based Lisp string from STR if possible, a GC-based + one if not. STR is not necessarily copied and should contain only + ASCII characters. The resulting Lisp string should not be modified + or made visible to user code. */ + +#define SCOPED_STRING(str) \ + (USE_STACK_STRING \ + ? (make_lisp_ptr \ + ((&(union Aligned_String) \ + { { strlen (str), -1, 0, (unsigned char *) verify_ascii (str) } }.s), \ + Lisp_String)) \ + : build_string (verify_ascii (str))) /* Loop over all tails of a list, checking for cycles. FIXME: Make tortoise and n internal declarations. === modified file 'src/lread.c' --- src/lread.c 2014-09-29 06:44:31 +0000 +++ src/lread.c 2014-09-30 02:43:23 +0000 @@ -970,7 +970,7 @@ { if (!NILP (Vold_style_backquotes)) Fmessage (2, ((Lisp_Object []) - { build_local_string ("Loading `%s': old-style backquotes detected!"), + { SCOPED_STRING ("Loading `%s': old-style backquotes detected!"), file })); } @@ -3678,7 +3678,7 @@ in the installed Lisp directory. We don't use Fexpand_file_name because that would make the directory absolute now. */ - elt = concat2 (build_local_string ("../lisp/"), + elt = concat2 (SCOPED_STRING ("../lisp/"), Ffile_name_nondirectory (elt)); } else if (EQ (elt, Vload_file_name) === modified file 'src/menu.c' --- src/menu.c 2014-09-29 06:44:31 +0000 +++ src/menu.c 2014-09-30 02:43:23 +0000 @@ -354,7 +354,7 @@ front of them. */ if (!have_boxes ()) { - Lisp_Object prefix = Qnil; + char const *prefix = 0; Lisp_Object type = AREF (item_properties, ITEM_PROPERTY_TYPE); if (!NILP (type)) { @@ -390,7 +390,7 @@ if (!submenu && SREF (tem, 0) != '\0' && SREF (tem, 0) != '-') ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, - concat2 (build_local_string (" "), tem)); + concat2 (SCOPED_STRING (" "), tem)); idx += MENU_ITEMS_ITEM_LENGTH; } } @@ -399,24 +399,24 @@ /* Calculate prefix, if any, for this item. */ if (EQ (type, QCtoggle)) - prefix = build_local_string (NILP (selected) ? "[ ] " : "[X] "); + prefix = NILP (selected) ? "[ ] " : "[X] "; else if (EQ (type, QCradio)) - prefix = build_local_string (NILP (selected) ? "( ) " : "(*) "); + prefix = NILP (selected) ? "( ) " : "(*) "; } /* Not a button. If we have earlier buttons, then we need a prefix. */ else if (!skp->notbuttons && SREF (item_string, 0) != '\0' && SREF (item_string, 0) != '-') - prefix = build_local_string (" "); + prefix = " "; - if (!NILP (prefix)) - item_string = concat2 (prefix, item_string); + if (prefix) + item_string = concat2 (SCOPED_STRING (prefix), item_string); } if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame)) || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) && !NILP (map)) /* Indicate visually that this is a submenu. */ - item_string = concat2 (item_string, build_local_string (" >")); + item_string = concat2 (item_string, SCOPED_STRING (" >")); push_menu_item (item_string, enabled, key, AREF (item_properties, ITEM_PROPERTY_DEF), === modified file 'src/minibuf.c' --- src/minibuf.c 2014-09-29 06:44:31 +0000 +++ src/minibuf.c 2014-09-30 02:43:23 +0000 @@ -1158,7 +1158,7 @@ } prompt = Fformat (3, ((Lisp_Object []) - { build_local_string ("%s (default %s): "), + { SCOPED_STRING ("%s (default %s): "), prompt, CONSP (def) ? XCAR (def) : def })); } === modified file 'src/process.c' --- src/process.c 2014-09-29 06:44:31 +0000 +++ src/process.c 2014-09-30 02:43:23 +0000 @@ -620,7 +620,7 @@ if (c1 != c2) Faset (string, make_number (0), make_number (c2)); } - string2 = build_local_string (coredump ? " (core dumped)\n" : "\n"); + string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); return concat2 (string, string2); } else if (EQ (symbol, Qexit)) @@ -630,15 +630,15 @@ if (code == 0) return build_string ("finished\n"); string = Fnumber_to_string (make_number (code)); - string2 = build_local_string (coredump ? " (core dumped)\n" : "\n"); - return concat3 (build_local_string ("exited abnormally with code "), + string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); + return concat3 (SCOPED_STRING ("exited abnormally with code "), string, string2); } else if (EQ (symbol, Qfailed)) { string = Fnumber_to_string (make_number (code)); - string2 = build_local_string ("\n"); - return concat3 (build_local_string ("failed with code "), + string2 = SCOPED_STRING ("\n"); + return concat3 (SCOPED_STRING ("failed with code "), string, string2); } else @@ -1302,30 +1302,33 @@ ptrdiff_t size = p->header.size; Lisp_Object args[10]; int nargs, i; + char const *format; if (size == 4 || (size == 5 && !NILP (omit_port))) { - args[0] = build_local_string ("%d.%d.%d.%d"); + format = "%d.%d.%d.%d"; nargs = 4; } else if (size == 5) { - args[0] = build_local_string ("%d.%d.%d.%d:%d"); + format = "%d.%d.%d.%d:%d"; nargs = 5; } else if (size == 8 || (size == 9 && !NILP (omit_port))) { - args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x"); + format = "%x:%x:%x:%x:%x:%x:%x:%x"; nargs = 8; } else if (size == 9) { - args[0] = build_local_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); + format = "[%x:%x:%x:%x:%x:%x:%x:%x]:%d"; nargs = 9; } else return Qnil; + args[0] = SCOPED_STRING (format); + for (i = 0; i < nargs; i++) { if (! RANGED_INTEGERP (0, p->contents[i], 65535)) @@ -1344,7 +1347,7 @@ if (CONSP (address)) return Fformat (2, ((Lisp_Object []) - { build_local_string (""), Fcar (address) })); + { SCOPED_STRING (""), Fcar (address) })); return Qnil; } @@ -4060,11 +4063,11 @@ unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; host = Fformat (5, ((Lisp_Object []) - { build_local_string ("%d.%d.%d.%d"), make_number (ip[0]), + { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]), make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); service = make_number (ntohs (saddr.in.sin_port)); caller = Fformat (3, ((Lisp_Object []) - { build_local_string (" <%s:%d>"), host, service })); + { SCOPED_STRING (" <%s:%d>"), host, service })); } break; @@ -4075,13 +4078,13 @@ uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; int i; - args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x"); + args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x"); for (i = 0; i < 8; i++) args[i + 1] = make_number (ntohs (ip6[i])); host = Fformat (9, args); service = make_number (ntohs (saddr.in.sin_port)); caller = Fformat (3, ((Lisp_Object []) - { build_local_string (" <[%s]:%d>"), host, service })); + { SCOPED_STRING (" <[%s]:%d>"), host, service })); } break; #endif @@ -4092,7 +4095,7 @@ default: caller = Fnumber_to_string (make_number (connect_counter)); caller = concat3 - (build_local_string (" <"), caller, build_local_string (">")); + (SCOPED_STRING (" <"), caller, SCOPED_STRING (">")); break; } @@ -4191,14 +4194,14 @@ if (!NILP (ps->log)) call3 (ps->log, server, proc, - concat3 (build_local_string ("accept from "), - (STRINGP (host) ? host : build_local_string ("-")), - build_local_string ("\n"))); + concat3 (SCOPED_STRING ("accept from "), + (STRINGP (host) ? host : SCOPED_STRING ("-")), + SCOPED_STRING ("\n"))); exec_sentinel (proc, - concat3 (build_local_string ("open from "), - (STRINGP (host) ? host : build_local_string ("-")), - build_local_string ("\n"))); + concat3 (SCOPED_STRING ("open from "), + (STRINGP (host) ? host : SCOPED_STRING ("-")), + SCOPED_STRING ("\n"))); } /* This variable is different from waiting_for_input in keyboard.c. === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-29 06:44:31 +0000 +++ src/xdisp.c 2014-09-30 02:43:23 +0000 @@ -20928,7 +20928,7 @@ the previous non-empty line. */ if (pos >= ZV && pos > BEGV) DEC_BOTH (pos, bytepos); - if (fast_looking_at (build_local_string ("[\f\t ]*\n"), + if (fast_looking_at (SCOPED_STRING ("[\f\t ]*\n"), pos, bytepos, ZV, ZV_BYTE, Qnil) > 0) { while ((c = FETCH_BYTE (bytepos)) == '\n' === modified file 'src/xfns.c' --- src/xfns.c 2014-09-29 06:44:31 +0000 +++ src/xfns.c 2014-09-30 02:43:23 +0000 @@ -1570,11 +1570,9 @@ /* See if an X resource for the scroll bar color has been specified. */ tem = display_x_get_resource - (dpyinfo, build_local_string (foreground_p - ? "foreground" - : "background"), + (dpyinfo, SCOPED_STRING (foreground_p ? "foreground" : "background"), empty_unibyte_string, - build_local_string ("verticalScrollBar"), + SCOPED_STRING ("verticalScrollBar"), empty_unibyte_string); if (!STRINGP (tem)) { @@ -4275,8 +4273,8 @@ /* See if a visual is specified. */ Lisp_Object value = display_x_get_resource - (dpyinfo, build_local_string ("visualClass"), - build_local_string ("VisualClass"), Qnil, Qnil); + (dpyinfo, SCOPED_STRING ("visualClass"), + SCOPED_STRING ("VisualClass"), Qnil, Qnil); if (STRINGP (value)) { === modified file 'src/xselect.c' --- src/xselect.c 2014-09-29 06:44:31 +0000 +++ src/xselect.c 2014-09-30 02:43:23 +0000 @@ -2160,7 +2160,7 @@ x_clipboard_manager_error_1 (Lisp_Object err) { Fmessage (2, ((Lisp_Object []) - { build_local_string ("X clipboard manager error: %s\n\ + { SCOPED_STRING ("X clipboard manager error: %s\n\ If the problem persists, set `x-select-enable-clipboard-manager' to nil."), CAR (CDR (err)) })); return Qnil; @@ -2230,7 +2230,7 @@ if (FRAME_LIVE_P (XFRAME (local_frame))) { Fmessage (1, ((Lisp_Object []) - { build_local_string + { SCOPED_STRING ("Saving clipboard to X clipboard manager...") })); internal_condition_case_1 (x_clipboard_manager_save, local_frame, Qt, x_clipboard_manager_error_2); === modified file 'src/xterm.c' --- src/xterm.c 2014-09-29 06:44:31 +0000 +++ src/xterm.c 2014-09-30 02:43:23 +0000 @@ -10937,8 +10937,8 @@ { Lisp_Object value; value = display_x_get_resource - (dpyinfo, build_local_string ("privateColormap"), - build_local_string ("PrivateColormap"), Qnil, Qnil); + (dpyinfo, SCOPED_STRING ("privateColormap"), + SCOPED_STRING ("PrivateColormap"), Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11146,8 +11146,8 @@ for debugging X code. */ { Lisp_Object value = display_x_get_resource - (dpyinfo, build_local_string ("synchronous"), - build_local_string ("Synchronous"), Qnil, Qnil); + (dpyinfo, SCOPED_STRING ("synchronous"), + SCOPED_STRING ("Synchronous"), Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11156,8 +11156,8 @@ { Lisp_Object value = display_x_get_resource - (dpyinfo, build_local_string ("useXIM"), - build_local_string ("UseXIM"), Qnil, Qnil); + (dpyinfo, SCOPED_STRING ("useXIM"), + SCOPED_STRING ("UseXIM"), Qnil, Qnil); #ifdef USE_XIM if (STRINGP (value) && (!strcmp (SSDATA (value), "false") ------------------------------------------------------------ revno: 117977 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-09-29 20:48:31 -0400 message: * lisp/minibuffer.el (completion-at-point): Emit warning for ill-behaved completion functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-29 20:25:19 +0000 +++ lisp/ChangeLog 2014-09-30 00:48:31 +0000 @@ -1,3 +1,8 @@ +2014-09-30 Stefan Monnier + + * minibuffer.el (completion-at-point): Emit warning for ill-behaved + completion functions. + 2014-09-29 Stefan Monnier * ses.el (ses--letref): Quote value before it gets re-evaluated. === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2014-07-08 19:15:28 +0000 +++ lisp/minibuffer.el 2014-09-30 00:48:31 +0000 @@ -2106,7 +2106,11 @@ (completion-in-region start end collection (plist-get plist :predicate)))) ;; Maybe completion already happened and the function returned t. - (_ (cdr res))))) + (_ + (when (cdr res) + (message "Warning: %S failed to return valid completion data!" + (car res))) + (cdr res))))) (defun completion-help-at-point () "Display the completions on the text around point. ------------------------------------------------------------ revno: 117976 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-09-29 16:25:19 -0400 message: * lisp/ses.el (ses--letref): Quote value before it gets re-evaluated. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-28 08:03:48 +0000 +++ lisp/ChangeLog 2014-09-29 20:25:19 +0000 @@ -1,3 +1,7 @@ +2014-09-29 Stefan Monnier + + * ses.el (ses--letref): Quote value before it gets re-evaluated. + 2014-09-28 Thien-Thi Nguyen Font-lock `cl-flet*', too. === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-11 19:44:25 +0000 +++ lisp/ses.el 2014-09-29 20:25:19 +0000 @@ -457,7 +457,7 @@ (declare (indent 2) (debug (sexp form &rest body))) (gv-letplace (getter setter) place `(cl-macrolet ((,(nth 0 vars) () ',getter) - (,(nth 1 vars) (v) (funcall ,setter v))) + (,(nth 1 vars) (v) (funcall ',setter v))) ,@body))) (defmacro ses-cell-property (property-name row &optional col) @@ -3398,7 +3398,7 @@ (symbol-name new-name))) (force-mode-line-update))) -(defun ses-refresh-local-printer (name compiled-value) +(defun ses-refresh-local-printer (name _compiled-value) ;FIXME: unused arg? "Refresh printout for all cells which use printer NAME. NAME should be the name of a locally defined printer. Uses the value COMPILED-VALUE for this printer." ------------------------------------------------------------ revno: 117975 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2014-09-29 22:49:44 +0300 message: Follow-up to renaming v24.5 to 25.1. README: Bump version to 25.0.50. configure.ac (AC_INIT): Bump version to 25.0.50. nt/makefile.w32-in (VERSION): Bump version to 25.0.50. nt/emacsclient.rc: Bump version to 25.0.50. nt/emacs.rc: Bump version to 25.0.50. nt/config.nt (VERSION): Bump version to 25.0.50. msdos/sed2v2.inp: Bump version to 25.0.50. etc/refcards/ru-refcard.tex: Bump version to 25.0.50. etc/refcards/emacsver.tex: Bump version to 25.0.50. src/msdos.c (internal_terminal_init): Bump version to 25. doc/man/emacs.1: Bump version to 25.0.50. doc/emacs/emacsver.texi (EMACSVER): Bump to 20.0.50. diff: === modified file 'ChangeLog' --- ChangeLog 2014-09-29 06:44:31 +0000 +++ ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,9 @@ +2014-09-29 Eli Zaretskii + + * README: Bump version to 25.0.50. + + * configure.ac (AC_INIT): Bump version to 25.0.50. + 2014-09-29 Dmitry Antipov * configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove. === modified file 'README' --- README 2014-08-15 04:34:06 +0000 +++ README 2014-09-29 19:49:44 +0000 @@ -2,7 +2,7 @@ See the end of the file for license conditions. -This directory tree holds version 24.4.50 of GNU Emacs, the extensible, +This directory tree holds version 25.0.50 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU === modified file 'configure.ac' --- configure.ac 2014-09-29 06:44:31 +0000 +++ configure.ac 2014-09-29 19:49:44 +0000 @@ -23,7 +23,7 @@ AC_PREREQ(2.65) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT(GNU Emacs, 24.4.50, bug-gnu-emacs@gnu.org) +AC_INIT(GNU Emacs, 25.0.50, bug-gnu-emacs@gnu.org) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-09-15 00:43:29 +0000 +++ doc/emacs/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,7 @@ +2014-09-29 Eli Zaretskii + + * emacsver.texi (EMACSVER): Bump to 20.0.50. + 2014-09-15 Daniel Colascione * regs.texi (Text Registers): Update end-user documentation === modified file 'doc/emacs/emacsver.texi' --- doc/emacs/emacsver.texi 2014-08-15 04:34:06 +0000 +++ doc/emacs/emacsver.texi 2014-09-29 19:49:44 +0000 @@ -1,4 +1,4 @@ @c It would be nicer to generate this using configure and @version@. @c However, that would mean emacsver.texi would always be newer @c then the info files in release tarfiles. -@set EMACSVER 24.4.50 +@set EMACSVER 25.0.50 === modified file 'doc/man/ChangeLog' --- doc/man/ChangeLog 2014-01-12 01:35:51 +0000 +++ doc/man/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,7 @@ +2014-09-29 Eli Zaretskii + + * emacs.1: Bump version to 25.0.50. + 2014-01-12 Glenn Morris * emacs.1: Replace reference to etc/MAILINGLISTS. === modified file 'doc/man/emacs.1' --- doc/man/emacs.1 2014-08-15 04:34:06 +0000 +++ doc/man/emacs.1 2014-09-29 19:49:44 +0000 @@ -1,5 +1,5 @@ .\" See section COPYING for copyright and redistribution information. -.TH EMACS 1 "2007 April 13" "GNU Emacs 24.4.50" +.TH EMACS 1 "2007 April 13" "GNU Emacs 25.0.50" . . .SH NAME === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-09-14 23:11:52 +0000 +++ etc/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,9 @@ +2014-09-29 Eli Zaretskii + + * refcards/ru-refcard.tex: Bump version to 25.0.50. + + * refcards/emacsver.tex: Bump version to 25.0.50. + 2014-09-14 Daniel Colascione * NEWS: Mention changes to `insert-register' === modified file 'etc/refcards/emacsver.tex' --- etc/refcards/emacsver.tex 2014-01-01 07:43:34 +0000 +++ etc/refcards/emacsver.tex 2014-09-29 19:49:44 +0000 @@ -1,4 +1,4 @@ %% This file is not generated by configure, because then the provided %% pdf files would always appear out-of-date. -\def\versionemacs{24} % major version of emacs +\def\versionemacs{25} % major version of emacs \def\year{2014} % latest copyright year === modified file 'etc/refcards/ru-refcard.tex' --- etc/refcards/ru-refcard.tex 2014-01-02 19:18:24 +0000 +++ etc/refcards/ru-refcard.tex 2014-09-29 19:49:44 +0000 @@ -21,7 +21,7 @@ \newlength{\ColThreeWidth} \setlength{\ColThreeWidth}{25mm} -\newcommand{\versionemacs}[0]{24} % version of Emacs this is for +\newcommand{\versionemacs}[0]{25} % version of Emacs this is for \newcommand{\cyear}[0]{2014} % copyright year \newcommand\shortcopyrightnotice[0]{\vskip 1ex plus 2 fill === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2014-08-28 01:59:29 +0000 +++ msdos/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,7 @@ +2014-09-29 Eli Zaretskii + + * sed2v2.inp: Bump version to 25.0.50. + 2014-08-28 Eli Zaretskii * sedlibmk.inp (gl_LIBOBJS): Add execinfo.o. Reported by Juan === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2014-08-28 01:59:29 +0000 +++ msdos/sed2v2.inp 2014-09-29 19:49:44 +0000 @@ -66,7 +66,7 @@ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ /^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION ""/ /^#undef PENDING_OUTPUT_COUNT/s/^.*$/#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)/ -/^#undef VERSION/s/^.*$/#define VERSION "24.4.50"/ +/^#undef VERSION/s/^.*$/#define VERSION "25.0.50"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-09-01 15:11:25 +0000 +++ nt/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,13 @@ +2014-09-29 Eli Zaretskii + + * makefile.w32-in (VERSION): Bump version to 25.0.50. + + * emacsclient.rc: Bump version to 25.0.50. + + * emacs.rc: Bump version to 25.0.50. + + * config.nt (VERSION): Bump version to 25.0.50. + 2014-09-01 Eli Zaretskii * gnulib.mk: Synchronize with lib/gnulib.mk. === modified file 'nt/config.nt' --- nt/config.nt 2014-08-15 04:34:06 +0000 +++ nt/config.nt 2014-09-29 19:49:44 +0000 @@ -1576,7 +1576,7 @@ #undef USG_SUBTTY_WORKS /* Version number of package */ -#define VERSION "24.4.50" +#define VERSION "25.0.50" /* Define to 1 if unsetenv returns void instead of int. */ #undef VOID_UNSETENV === modified file 'nt/emacs.rc' --- nt/emacs.rc 2014-08-15 04:34:06 +0000 +++ nt/emacs.rc 2014-09-29 19:49:44 +0000 @@ -11,8 +11,8 @@ #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,4,50,0 - PRODUCTVERSION 24,4,50,0 + FILEVERSION 25,0,50,0 + PRODUCTVERSION 25,0,50,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -29,12 +29,12 @@ BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 4, 50, 0\0" + VALUE "FileVersion", "25, 0, 50, 0\0" VALUE "InternalName", "Emacs\0" VALUE "LegalCopyright", "Copyright (C) 2001-2014\0" VALUE "OriginalFilename", "emacs.exe" VALUE "ProductName", "Emacs\0" - VALUE "ProductVersion", "24, 4, 50, 0\0" + VALUE "ProductVersion", "25, 0, 50, 0\0" VALUE "OLESelfRegister", "\0" END END === modified file 'nt/emacsclient.rc' --- nt/emacsclient.rc 2014-08-15 04:34:06 +0000 +++ nt/emacsclient.rc 2014-09-29 19:49:44 +0000 @@ -5,8 +5,8 @@ #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,4,50,0 - PRODUCTVERSION 24,4,50,0 + FILEVERSION 25,0,50,0 + PRODUCTVERSION 25,0,50,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -23,12 +23,12 @@ BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 4, 50, 0\0" + VALUE "FileVersion", "25, 0, 50, 0\0" VALUE "InternalName", "EmacsClient\0" VALUE "LegalCopyright", "Copyright (C) 2001-2014\0" VALUE "OriginalFilename", "emacsclientw.exe" VALUE "ProductName", "EmacsClient\0" - VALUE "ProductVersion", "24, 4, 50, 0\0" + VALUE "ProductVersion", "25, 0, 50, 0\0" VALUE "OLESelfRegister", "\0" END END === modified file 'nt/makefile.w32-in' --- nt/makefile.w32-in 2014-08-15 04:34:06 +0000 +++ nt/makefile.w32-in 2014-09-29 19:49:44 +0000 @@ -22,7 +22,7 @@ # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out # (and remove or replace this comment). -VERSION = 24.4.50 +VERSION = 25.0.50 TMP_DIST_DIR = emacs-$(VERSION) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-29 18:14:08 +0000 +++ src/ChangeLog 2014-09-29 19:49:44 +0000 @@ -1,3 +1,7 @@ +2014-09-29 Eli Zaretskii + + * msdos.c (internal_terminal_init): Bump version to 25. + 2014-09-29 Dmitry Antipov Keep stack-allocated Lisp objects fast rather than versatile. === modified file 'src/msdos.c' --- src/msdos.c 2014-08-10 16:28:36 +0000 +++ src/msdos.c 2014-09-29 19:49:44 +0000 @@ -1792,7 +1792,7 @@ } Vinitial_window_system = Qpc; - Vwindow_system_version = make_number (24); /* RE Emacs version */ + Vwindow_system_version = make_number (25); /* RE Emacs version */ tty->terminal->type = output_msdos_raw; /* If Emacs was dumped on DOS/V machine, forget the stale VRAM ------------------------------------------------------------ revno: 117974 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-09-29 14:14:08 -0400 message: Rename 24.5 to 25.1 Except where we expect to backport the corresponding change. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-09-27 03:57:41 +0000 +++ etc/NEWS 2014-09-29 18:14:08 +0000 @@ -22,7 +22,7 @@ otherwise leave it unmarked. -* Installation Changes in Emacs 24.5 +* Installation Changes in Emacs 25.1 +++ ** Building Emacs now requires C99 or later. @@ -44,10 +44,10 @@ 'make V=0' now do a better job of suppressing chatter. -* Startup Changes in Emacs 24.5 +* Startup Changes in Emacs 25.1 -* Changes in Emacs 24.5 +* Changes in Emacs 25.1 ** `insert-register' now leaves point after the inserted text when called interactively. A prefix argument toggles this behavior. @@ -90,7 +90,7 @@ MS-Windows doesn't support UTF-8 as codeset in its locales. -* Editing Changes in Emacs 24.5 +* Editing Changes in Emacs 25.1 ** Emacs now supports "bracketed paste mode" when running on a terminal that supports it. This facility allows Emacs to understand pasted @@ -100,7 +100,7 @@ performance improvements when pasting large amounts of text. -* Changes in Specialized Modes and Packages in Emacs 24.5 +* Changes in Specialized Modes and Packages in Emacs 25.1 ** ElDoc *** New minor mode global-eldoc-mode @@ -216,10 +216,10 @@ *** vi.el, vip.el (try M-x viper instead) -* New Modes and Packages in Emacs 24.5 +* New Modes and Packages in Emacs 25.1 -* Incompatible Lisp Changes in Emacs 24.5 +* Incompatible Lisp Changes in Emacs 25.1 ** window-configurations no longer record the buffers's marks. @@ -240,7 +240,7 @@ Emacs-21. -* Lisp Changes in Emacs 24.5 +* Lisp Changes in Emacs 25.1 *** call-process-shell-command and process-file-shell-command don't take "&rest args" any more. @@ -277,7 +277,7 @@ as the first or last argument of subsequent forms. -* Changes in Frames and Windows Code in Emacs 24.5 +* Changes in Frames and Windows Code in Emacs 25.1 ** Emacs can now draw horizontal scroll bars on some platforms that provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows. @@ -311,7 +311,7 @@ specific frame does not resize that frame in order to preserve the number of columns or lines it displays. -* Changes in Emacs 24.5 on Non-Free Operating Systems +* Changes in Emacs 25.1 on Non-Free Operating Systems --- ** Building Emacs for MS-Windows requires at least Windows XP === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2014-09-13 17:44:32 +0000 +++ lisp/calendar/calendar.el 2014-09-29 18:14:08 +0000 @@ -692,7 +692,7 @@ "Symbol indicating a diary entry according to the Chinese calendar." :type 'string :group 'diary - :version "24.5") + :version "25.1") (define-obsolete-variable-alias 'hebrew-diary-entry-symbol 'diary-hebrew-entry-symbol "23.1") === modified file 'lisp/calendar/icalendar.el' --- lisp/calendar/icalendar.el 2014-09-11 19:44:25 +0000 +++ lisp/calendar/icalendar.el 2014-09-29 18:14:08 +0000 @@ -250,7 +250,7 @@ See `icalendar-export-sexp-enumerate-all' for a list of sexp entries which by default are NOT enumerated." - :version "24.5" + :version "25.1" :type 'integer :group 'icalendar) @@ -263,7 +263,7 @@ following sexp diary entries: `diary-anniversary', `diary-cyclic', `diary-date', `diary-float',`diary-block'. All other sexp entries are enumerated in any case." - :version "24.5" + :version "25.1" :type 'boolean :group 'icalendar) === modified file 'lisp/emacs-lisp/eldoc.el' --- lisp/emacs-lisp/eldoc.el 2014-09-27 10:08:59 +0000 +++ lisp/emacs-lisp/eldoc.el 2014-09-29 18:14:08 +0000 @@ -88,7 +88,7 @@ (function-item downcase) function) :group 'eldoc) -(make-obsolete-variable 'eldoc-argument-case nil "24.5") +(make-obsolete-variable 'eldoc-argument-case nil "25.1") (defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit "Allow long ElDoc messages to resize echo area display. === modified file 'lisp/emacs-lisp/subr-x.el' --- lisp/emacs-lisp/subr-x.el 2014-09-11 19:44:25 +0000 +++ lisp/emacs-lisp/subr-x.el 2014-09-29 18:14:08 +0000 @@ -159,7 +159,7 @@ "Join all STRINGS using SEPARATOR." (mapconcat 'identity strings separator)) -(define-obsolete-function-alias 'string-reverse 'reverse "24.5") +(define-obsolete-function-alias 'string-reverse 'reverse "25.1") (defsubst string-trim-left (string) "Remove leading whitespace from STRING." === modified file 'lisp/erc/erc-stamp.el' --- lisp/erc/erc-stamp.el 2014-08-12 02:56:28 +0000 +++ lisp/erc/erc-stamp.el 2014-09-29 18:14:08 +0000 @@ -151,7 +151,7 @@ "Whether the timestamps should be intangible, i.e. prevent the point from entering them and instead jump over them." :group 'erc-stamp - :version "24.5" + :version "25.1" :type 'boolean) (defface erc-timestamp-face '((t :weight bold :foreground "green")) === modified file 'lisp/eshell/esh-util.el' --- lisp/eshell/esh-util.el 2014-05-14 17:15:15 +0000 +++ lisp/eshell/esh-util.el 2014-09-29 18:14:08 +0000 @@ -539,7 +539,7 @@ (defmacro eshell-with-file-modes (modes &rest forms) "Evaluate, with file-modes set to MODES, the given FORMS." - (declare (obsolete with-file-modes "24.5")) + (declare (obsolete with-file-modes "25.1")) `(with-file-modes ,modes ,@forms)) (defmacro eshell-with-private-file-modes (&rest forms) === modified file 'lisp/faces.el' --- lisp/faces.el 2014-07-12 17:53:29 +0000 +++ lisp/faces.el 2014-09-29 18:14:08 +0000 @@ -53,7 +53,7 @@ :type '(alist :key-type (string :tag "Terminal") :value-type (string :tag "Alias")) :group 'terminals - :version "24.5") + :version "25.1") (declare-function xw-defined-colors "term/common-win" (&optional frame)) === modified file 'lisp/ffap.el' --- lisp/ffap.el 2014-06-12 02:29:50 +0000 +++ lisp/ffap.el 2014-09-29 18:14:08 +0000 @@ -167,7 +167,7 @@ "If non-nil, allow lax URL matching." :type 'boolean :group 'ffap - :version "24.5") + :version "25.1") (defcustom ffap-ftp-default-user "anonymous" "User name in FTP file names generated by `ffap-host-to-path'. === modified file 'lisp/files.el' --- lisp/files.el 2014-08-29 02:48:17 +0000 +++ lisp/files.el 2014-09-29 18:14:08 +0000 @@ -1798,7 +1798,7 @@ think it does, because \"free\" is pretty hard to define in practice." :group 'files :group 'find-file - :version "24.5" + :version "25.1" :type '(choice integer (const :tag "Never issue warning" nil))) (defun abort-if-file-too-large (size op-type filename) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-08-26 23:56:11 +0000 +++ lisp/gnus/gnus-art.el 2014-09-29 18:14:08 +0000 @@ -5983,7 +5983,7 @@ overlook them if there is a huge body. This option offers you a copy of all non-inlinable MIME parts as buttons shown in front of an article. If nil, don't show those extra buttons." - :version "24.5" + :version "25.1" :group 'gnus-article-mime :type 'boolean) === modified file 'lisp/gnus/gnus-fun.el' --- lisp/gnus/gnus-fun.el 2014-09-11 19:44:25 +0000 +++ lisp/gnus/gnus-fun.el 2014-09-29 18:14:08 +0000 @@ -42,19 +42,19 @@ (defcustom gnus-x-face-omit-files nil "Regexp to match faces in `gnus-x-face-directory' to be omitted." - :version "24.5" + :version "25.1" :group 'gnus-fun :type 'string) (defcustom gnus-face-directory (expand-file-name "faces" gnus-directory) "*Directory where Face PNG files are stored." - :version "24.5" + :version "25.1" :group 'gnus-fun :type 'directory) (defcustom gnus-face-omit-files nil "Regexp to match faces in `gnus-face-directory' to be omitted." - :version "24.5" + :version "25.1" :group 'gnus-fun :type 'string) === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2014-04-15 23:37:21 +0000 +++ lisp/gnus/message.el 2014-09-29 18:14:08 +0000 @@ -619,7 +619,7 @@ "If non-nil, delete non-matching headers when forwarding a message. Only headers that match this regexp will be included. This variable should be a regexp or a list of regexps." - :version "24.5" + :version "25.1" :group 'message-forwarding :type '(repeat :value-to-internal (lambda (widget value) (custom-split-regexp-maybe value)) === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2014-05-09 06:43:52 +0000 +++ lisp/gnus/mml2015.el 2014-09-29 18:14:08 +0000 @@ -149,7 +149,7 @@ (defcustom mml2015-display-key-image t "If t, try to display key images." - :version "24.5" + :version "25.1" :group 'mime-security :type 'boolean) === modified file 'lisp/ls-lisp.el' --- lisp/ls-lisp.el 2014-09-11 19:44:25 +0000 +++ lisp/ls-lisp.el 2014-09-29 18:14:08 +0000 @@ -128,7 +128,7 @@ differ only in punctuation characters. On MS-Windows, customize the option `ls-lisp-UCA-like-collation' to a non-nil value to get similar behavior." - :version "24.5" + :version "25.1" :set-after '(ls-lisp-emulation) :type 'boolean :group 'ls-lisp) @@ -150,7 +150,7 @@ This option is ignored on platforms other than MS-Windows; to control the collation ordering of the file names on those other systems, set your locale instead." - :version "24.5" + :version "25.1" :type 'boolean :group 'ls-lisp) === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2014-09-13 09:25:38 +0000 +++ lisp/mail/rmailmm.el 2014-09-29 18:14:08 +0000 @@ -139,7 +139,7 @@ extracted from message in a temporary buffer. Converts to text in current buffer. If NIL, display HTML source." :group 'rmail - :version "24.5" + :version "25.1" :type '(choice function (const nil))) (defcustom rmail-mime-prefer-html @@ -148,7 +148,7 @@ "If non-nil, default to showing HTML part rather than text part when both are available" :group 'rmail - :version "24.5" + :version "25.1" :type 'boolean) ;;; End of user options. === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2014-09-18 19:18:34 +0000 +++ lisp/net/eww.el 2014-09-29 18:14:08 +0000 @@ -59,7 +59,7 @@ (defcustom eww-bookmarks-directory user-emacs-directory "Directory where bookmark files will be stored." - :version "24.5" + :version "25.1" :group 'eww :type 'string) === modified file 'lisp/net/newst-treeview.el' --- lisp/net/newst-treeview.el 2014-09-24 17:33:54 +0000 +++ lisp/net/newst-treeview.el 2014-09-29 18:14:08 +0000 @@ -87,7 +87,7 @@ "%d.%m.%y, %H:%M" "Format for the date column in the treeview list buffer. See `format-time-string' for a list of valid specifiers." - :version "24.5" + :version "25.1" :type 'string :group 'newsticker-treeview) === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2014-07-21 01:41:59 +0000 +++ lisp/net/rcirc.el 2014-09-29 18:14:08 +0000 @@ -661,7 +661,7 @@ (defcustom rcirc-reconnect-delay 0 "The minimum interval in seconds between reconnect attempts. When 0, do not auto-reconnect." - :version "24.5" + :version "25.1" :type 'integer :group 'rcirc) === modified file 'lisp/printing.el' --- lisp/printing.el 2014-05-14 17:15:15 +0000 +++ lisp/printing.el 2014-09-29 18:14:08 +0000 @@ -3172,7 +3172,7 @@ (defmacro pr-save-file-modes (&rest body) "Execute BODY with file permissions temporarily set to `pr-file-modes'." - (declare (obsolete with-file-modes "24.5")) + (declare (obsolete with-file-modes "25.1")) `(with-file-modes pr-file-modes ,@body)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2014-09-11 19:44:25 +0000 +++ lisp/progmodes/hideif.el 2014-09-29 18:14:08 +0000 @@ -139,7 +139,7 @@ (defcustom hide-ifdef-exclude-define-regexp nil "Ignore #define names if those names match this exclusion pattern." :type 'string - :version "24.5") + :version "25.1") (defcustom hide-ifdef-expand-reinclusion-protection t "Non-nil means don't hide an entire header file enclosed by #ifndef...#endif. @@ -161,7 +161,7 @@ This behavior is generally undesirable. If this option is non-nil, the outermost #if is always visible." :type 'boolean - :version "24.5") + :version "25.1") (defcustom hide-ifdef-header-regexp "\\.h\\(h\\|xx\\|pp\\)?\\'" @@ -169,7 +169,7 @@ Effective only if `hide-ifdef-expand-reinclusion-protection' is t." :type 'string :group 'hide-ifdef - :version "24.5") + :version "25.1") (defvar hide-ifdef-mode-submap ;; Set up the submap that goes after the prefix key. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-09-11 19:44:25 +0000 +++ lisp/progmodes/python.el 2014-09-29 18:14:08 +0000 @@ -1801,7 +1801,7 @@ :type 'string) (define-obsolete-variable-alias - 'python-shell-enable-font-lock 'python-shell-font-lock-enable "24.5") + 'python-shell-enable-font-lock 'python-shell-font-lock-enable "25.1") (defcustom python-shell-font-lock-enable t "Should syntax highlighting be enabled in the Python shell buffer? @@ -2179,7 +2179,7 @@ (define-obsolete-function-alias 'python-comint-output-filter-function 'ansi-color-filter-apply - "24.5") + "25.1") (defun python-comint-postoutput-scroll-to-bottom (output) "Faster version of `comint-postoutput-scroll-to-bottom'. @@ -2881,7 +2881,7 @@ (define-obsolete-variable-alias 'python-shell-completion-pdb-string-code 'python-shell-completion-string-code - "24.5" + "25.1" "Completion string code must work for (i)pdb.") (defun python-shell-completion-get-completions (process import input) @@ -2952,7 +2952,7 @@ (define-obsolete-function-alias 'python-shell-completion-complete-at-point 'python-shell-completion-at-point - "24.5") + "25.1") (defun python-shell-completion-complete-or-indent () "Complete or indent depending on the context. @@ -3072,7 +3072,7 @@ (define-obsolete-function-alias 'python-completion-complete-at-point 'python-completion-at-point - "24.5") + "25.1") ;;; Fill paragraph === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2014-09-22 19:18:29 +0000 +++ lisp/progmodes/sql.el 2014-09-29 18:14:08 +0000 @@ -284,7 +284,7 @@ (defcustom sql-default-directory nil "Default directory for SQL processes." - :version "24.5" + :version "25.1" :type '(choice (const nil) string) :group 'SQL :safe 'stringp) @@ -5074,20 +5074,20 @@ (defcustom sql-vertica-program "vsql" "Command to start the Vertica client." - :version "24.5" + :version "25.1" :type 'file :group 'SQL) (defcustom sql-vertica-options '("-P" "pager=off") "List of additional options for `sql-vertica-program'. The default value disables the internal pager." - :version "24.5" + :version "25.1" :type '(repeat string) :group 'SQL) (defcustom sql-vertica-login-params '(user password database server) "List of login parameters needed to connect to Vertica." - :version "24.5" + :version "25.1" :type 'sql-login-params :group 'SQL) === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2014-09-11 19:44:25 +0000 +++ lisp/progmodes/subword.el 2014-09-29 18:14:08 +0000 @@ -88,7 +88,7 @@ ;;;###autoload (define-obsolete-function-alias - 'capitalized-words-mode 'subword-mode "24.5") + 'capitalized-words-mode 'subword-mode "25.1") ;;;###autoload (define-minor-mode subword-mode === modified file 'lisp/progmodes/vera-mode.el' --- lisp/progmodes/vera-mode.el 2014-05-29 03:45:29 +0000 +++ lisp/progmodes/vera-mode.el 2014-09-29 18:14:08 +0000 @@ -684,7 +684,7 @@ :group 'font-lock-highlighting-faces) (define-obsolete-function-alias 'vera-fontify-buffer - 'font-lock-fontify-buffer "24.5") + 'font-lock-fontify-buffer "25.1") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Indentation === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2014-06-02 06:45:11 +0000 +++ lisp/progmodes/verilog-mode.el 2014-09-29 18:14:08 +0000 @@ -1027,7 +1027,7 @@ If 'single', then a single input or output will be put onto each line." - :version "24.5" + :version "25.1" :type '(radio (const :tag "Line up Assignments and Declarations" packed) (const :tag "Line up Assignment statements" single)) :group 'verilog-mode-auto) === modified file 'lisp/rect.el' --- lisp/rect.el 2014-09-11 19:44:25 +0000 +++ lisp/rect.el 2014-09-29 18:14:08 +0000 @@ -35,7 +35,7 @@ (defgroup rectangle nil "Operations on rectangles." - :version "24.5" + :version "25.1" :group 'editing) ;; FIXME: this function should be replaced by `apply-on-rectangle' === modified file 'lisp/simple.el' --- lisp/simple.el 2014-09-27 03:57:41 +0000 +++ lisp/simple.el 2014-09-29 18:14:08 +0000 @@ -2515,6 +2515,7 @@ "Test whether UNDO-ELT crosses one edge of that region START ... END. This assumes we have already decided that UNDO-ELT is not *inside* the region START...END." + (declare (obsolete nil "25.1")) (cond ((atom undo-elt) nil) ((null (car undo-elt)) ;; (nil PROPERTY VALUE BEG . END) @@ -2525,7 +2526,6 @@ ;; (BEGIN . END) (and (< (car undo-elt) end) (> (cdr undo-elt) start))))) -(make-obsolete 'undo-elt-crosses-region nil "24.5") (defun undo-adjust-elt (elt deltas) "Return adjustment of undo element ELT by the undo DELTAS @@ -3758,7 +3758,7 @@ "Whether appending to kill ring also makes \\[undo] restore both pieces of text simultaneously." :type 'boolean :group 'killing - :version "24.5") + :version "25.1") (defun kill-append (string before-p) "Append STRING to the end of the latest kill in the kill ring. === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2014-09-11 19:44:25 +0000 +++ lisp/textmodes/tex-mode.el 2014-09-29 18:14:08 +0000 @@ -2579,7 +2579,7 @@ `tex-dvi-view-command' and `tex-dvi-print-command' appropriately." :type 'string :group 'tex-view - :version "24.5") + :version "25.1") (defun tex-print (&optional alt) "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. === modified file 'lisp/url/url-handlers.el' --- lisp/url/url-handlers.el 2014-08-07 11:49:36 +0000 +++ lisp/url/url-handlers.el 2014-09-29 18:14:08 +0000 @@ -122,7 +122,7 @@ like URLs \(Gnus is particularly bad at this\)." :group 'url :type 'regexp - :version "24.5" + :version "25.1" :set (lambda (symbol value) (let ((enable url-handler-mode)) (url-handler-mode 0) === modified file 'lisp/url/url-tramp.el' --- lisp/url/url-tramp.el 2014-04-01 12:41:56 +0000 +++ lisp/url/url-tramp.el 2014-09-29 18:14:08 +0000 @@ -33,7 +33,7 @@ "List of URL protocols the work is handled by Tramp. They must also be covered by `url-handler-regexp'." :group 'url - :version "24.5" + :version "25.1" :type '(list string)) (defun url-tramp-convert-url-to-tramp (url) === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2014-08-16 19:51:27 +0000 +++ lisp/vc/diff-mode.el 2014-09-29 18:14:08 +0000 @@ -304,7 +304,7 @@ (defface diff-changed '((t nil)) "`diff-mode' face used to highlight changed lines." - :version "24.5" + :version "25.1" :group 'diff-mode) (define-obsolete-face-alias 'diff-changed-face 'diff-changed "22.1") (defvar diff-changed-face 'diff-changed) @@ -343,7 +343,7 @@ (((class color grayscale) (min-colors 88) (background dark)) :foreground "#dddddd")) "`diff-mode' face used to highlight context and other side-information." - :version "24.5" + :version "25.1" :group 'diff-mode) (define-obsolete-face-alias 'diff-context-face 'diff-context "22.1") (defvar diff-context-face 'diff-context) === modified file 'lisp/vc/vc-annotate.el' --- lisp/vc/vc-annotate.el 2014-08-12 06:51:21 +0000 +++ lisp/vc/vc-annotate.el 2014-09-29 18:14:08 +0000 @@ -60,7 +60,7 @@ (with-demoted-errors ;; Update the value of the dependent variable. (custom-reevaluate-setting 'vc-annotate-color-map)))) - :version "24.5" + :version "25.1" :group 'vc) (defcustom vc-annotate-color-map === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-29 06:44:31 +0000 +++ src/ChangeLog 2014-09-29 18:14:08 +0000 @@ -4435,8 +4435,7 @@ * doc.c (store_function_docstring): Warn when we don't know where to put a docstring. (Fsubstitute_command_keys): Don't advertise the fact that - text-properties are dropped, since we think it's a bug that we'll fix - in 24.5. + text-properties are dropped, since we think it's a bug that we'll fix. * frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date. * xterm.c (handle_one_xevent) : Don't garbage the frame. ------------------------------------------------------------ revno: 117973 committer: Daiki Ueno branch nick: trunk timestamp: Mon 2014-09-29 20:05:40 +0900 message: mml: Signal error on invalid <#secure> tag * mml.el (mml-parse-1): Error out if unknown mode is specified in <#secure> tag (bug#18513). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-09-11 19:44:25 +0000 +++ lisp/gnus/ChangeLog 2014-09-29 11:05:40 +0000 @@ -1,3 +1,8 @@ +2014-09-29 Daiki Ueno + + * mml.el (mml-parse-1): Error out if unknown mode is specified in + <#secure> tag (bug#18513). + 2014-09-11 Paul Eggert * gnus-cloud.el (gnus-cloud-parse-version-1): Fix misspelling === modified file 'lisp/gnus/mml.el' --- lisp/gnus/mml.el 2014-03-24 01:56:03 +0000 +++ lisp/gnus/mml.el 2014-09-29 11:05:40 +0000 @@ -257,7 +257,9 @@ ((string= mode "encrypt") (setq tags (list "encrypt" method))) ((string= mode "signencrypt") - (setq tags (list "sign" method "encrypt" method)))) + (setq tags (list "sign" method "encrypt" method))) + (t + (error "Unknown secure mode %s" mode))) (eval `(mml-insert-tag ,secure-mode ,@tags ,(if keyfile "keyfile") ------------------------------------------------------------ revno: 117972 [merge] committer: Ulf Jasper branch nick: trunk timestamp: Mon 2014-09-29 10:18:32 +0200 message: Do not set `url-gateway-method' in `url-https'. (Bug#16543) Currently, when `url-retrieve' is called for an https url it modifies the variable `url-gateway-method'. This has been changed to explicitly pass the requested gateway method to other functions. When `url-retrieve' is being processed then (via `accept-process-output') another `url-retrieve' call from a pending timer can be started. The second call would always see the modified `url-gateway-method' of the first one, which in general does not match the url. 2014-09-28 Ulf Jasper * url-gw.el (url-open-stream): New optional parameter `gateway-method'. If non-nil use it instead of global variable `url-gateway-method'. * url/url-http.el (url-http): New optional parameter `gateway-method', pass it to `url-http-find-free-connection'. (url-http-find-free-connection): New optional parameter gateway-method, pass it to `url-open-stream'. (url-https-create-secure-wrapper): Do not modify `url-gateway-method' but explicitly provide 'tls as gateway-method parameter to `url-https'. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2014-09-22 19:20:45 +0000 +++ lisp/url/ChangeLog 2014-09-28 18:00:54 +0000 @@ -1,3 +1,17 @@ +2014-09-28 Ulf Jasper + + * url-gw.el (url-open-stream): New optional parameter + `gateway-method'. If non-nil use it instead of global variable + `url-gateway-method'. + + * url/url-http.el (url-http): New optional parameter + `gateway-method', pass it to `url-http-find-free-connection'. + (url-http-find-free-connection): New optional parameter + gateway-method, pass it to `url-open-stream'. + (url-https-create-secure-wrapper): Do not modify + `url-gateway-method' but explicitly provide 'tls as gateway-method + parameter to `url-https'. + 2014-09-22 Dmitry Gutov * url.el (url-retrieve-internal): Clarify the docstring. === modified file 'lisp/url/url-gw.el' --- lisp/url/url-gw.el 2014-03-29 00:55:44 +0000 +++ lisp/url/url-gw.el 2014-09-28 18:00:54 +0000 @@ -203,20 +203,24 @@ proc))) ;;;###autoload -(defun url-open-stream (name buffer host service) +(defun url-open-stream (name buffer host service &optional gateway-method) "Open a stream to HOST, possibly via a gateway. Args per `open-network-stream'. Will not make a connection if `url-gateway-unplugged' is non-nil. -Might do a non-blocking connection; use `process-status' to check." +Might do a non-blocking connection; use `process-status' to check. + +Optional arg GATEWAY-METHOD specifies the gateway to be used, +overriding the value of `url-gateway-method'." (unless url-gateway-unplugged - (let ((gw-method (if (and url-gateway-local-host-regexp - (not (eq 'tls url-gateway-method)) - (not (eq 'ssl url-gateway-method)) - (string-match - url-gateway-local-host-regexp - host)) - 'native - url-gateway-method)) + (let* ((gwm (or gateway-method url-gateway-method)) + (gw-method (if (and url-gateway-local-host-regexp + (not (eq 'tls gwm)) + (not (eq 'ssl gwm)) + (string-match + url-gateway-local-host-regexp + host)) + 'native + gwm)) ;; An attempt to deal with denied connections, and attempt ;; to reconnect (cur-retries 0) === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2014-09-22 19:20:45 +0000 +++ lisp/url/url-http.el 2014-09-28 18:00:54 +0000 @@ -171,7 +171,7 @@ url-http-open-connections)) nil) -(defun url-http-find-free-connection (host port) +(defun url-http-find-free-connection (host port &optional gateway-method) (let ((conns (gethash (cons host port) url-http-open-connections)) (connection nil)) (while (and conns (not connection)) @@ -193,7 +193,7 @@ ;; `url-open-stream' needs a buffer in which to do things ;; like authentication. But we use another buffer afterwards. (unwind-protect - (let ((proc (url-open-stream host buf host port))) + (let ((proc (url-open-stream host buf host port gateway-method))) ;; url-open-stream might return nil. (when (processp proc) ;; Drop the temp buffer link before killing the buffer. @@ -1167,7 +1167,7 @@ (when (eq process-buffer (current-buffer)) (goto-char (point-max))))) -(defun url-http (url callback cbargs &optional retry-buffer) +(defun url-http (url callback cbargs &optional retry-buffer gateway-method) "Retrieve URL via HTTP asynchronously. URL must be a parsed URL. See `url-generic-parse-url' for details. @@ -1178,11 +1178,14 @@ doubt, specify nil). Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a -previous `url-http' call, which is being re-attempted." +previous `url-http' call, which is being re-attempted. + +Optional arg GATEWAY-METHOD specifies the gateway to be used, +overriding the value of `url-gateway-method'." (cl-check-type url vector "Need a pre-parsed URL.") (let* ((host (url-host (or url-using-proxy url))) (port (url-port (or url-using-proxy url))) - (connection (url-http-find-free-connection host port)) + (connection (url-http-find-free-connection host port gateway-method)) (buffer (or retry-buffer (generate-new-buffer (format " *http %s:%d*" host port))))) @@ -1440,9 +1443,8 @@ (defmacro url-https-create-secure-wrapper (method args) `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args ,(format "HTTPS wrapper around `%s' call." (or method "url-http")) - (let ((url-gateway-method 'tls)) - (,(intern (format (if method "url-http-%s" "url-http") method)) - ,@(remove '&rest (remove '&optional args)))))) + (,(intern (format (if method "url-http-%s" "url-http") method)) + ,@(remove '&rest (remove '&optional (append args (if method nil '(nil 'tls)))))))) ;;;###autoload (autoload 'url-https "url-http") (url-https-create-secure-wrapper nil (url callback cbargs)) ------------------------------------------------------------ revno: 117971 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-09-29 10:44:31 +0400 message: Keep stack-allocated Lisp objects fast rather than versatile. * configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove. For USE_STACK_LISP_OBJECTS, we always assume __GNUC__. * lisp.h (union Aligned_Cons) [!GCALIGNED]: Define as such. (SCOPED_CONS_INITIALIZER): New macro. (scoped_cons) [USE_STACK_LISP_OBJECTS]: Use it. (USE_LOCAL_ALLOCA): Remove. (local_cons, local_list1, local_list2, local_list3, local_list4): Remove. Stack overflow checking makes them too slow. (make_local_vector): Likewise. Also we just don't have enough users for it. (enum LISP_STRING_OVERHEAD): Remove. (local_string_init, local_vector_init): Remove prototypes. (make_local_string, build_local_string): Redesign to target short compile-time string constants, fall back to regular string allocation where appropriate. (lisp_string_size): New function. (verify_ascii) [ENABLE_CHECKING]: Add prototype. * alloc.c (local_string_init, local_vector_init): Remove. (verify_ascii) [ENABLE_CHECKING]: New function. * buffer.c, charset.c, chartab.c, data.c, editfns.c, emacs.c, fileio.c: * fns.c, font.c, fontset.c, frame.c, keyboard.c, keymap.c, lread.c: * menu.c, minibuf.c, process.c, textprop.c, xdisp.c, xfns.c, xfont.c: * xselect.c, xterm.c: All related users changed. diff: === modified file 'ChangeLog' --- ChangeLog 2014-09-27 23:35:50 +0000 +++ ChangeLog 2014-09-29 06:44:31 +0000 @@ -1,3 +1,8 @@ +2014-09-29 Dmitry Antipov + + * configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove. + For USE_STACK_LISP_OBJECTS, we always assume __GNUC__. + 2014-09-27 Ken Brown * configure.ac [CYGWIN]: Enable sound support. === modified file 'configure.ac' --- configure.ac 2014-09-27 23:35:50 +0000 +++ configure.ac 2014-09-29 06:44:31 +0000 @@ -4838,17 +4838,6 @@ structure to an N-byte boundary.]) fi -AC_CACHE_CHECK([for statement expressions], - [emacs_cv_statement_expressions], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([], [[return ({ int x = 5; x-x; });]])], - [emacs_cv_statement_expressions=yes], - [emacs_cv_statement_expressions=no])]) -if test "$emacs_cv_statement_expressions" = yes; then - AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], 1, - [Define to 1 if statement expressions work.]) -fi - if test "${GNU_MALLOC}" = "yes" ; then AC_DEFINE(GNU_MALLOC, 1, [Define to 1 if you want to use the GNU memory allocator.]) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-28 22:31:59 +0000 +++ src/ChangeLog 2014-09-29 06:44:31 +0000 @@ -1,3 +1,28 @@ +2014-09-29 Dmitry Antipov + + Keep stack-allocated Lisp objects fast rather than versatile. + * lisp.h (union Aligned_Cons) [!GCALIGNED]: Define as such. + (SCOPED_CONS_INITIALIZER): New macro. + (scoped_cons) [USE_STACK_LISP_OBJECTS]: Use it. + (USE_LOCAL_ALLOCA): Remove. + (local_cons, local_list1, local_list2, local_list3, local_list4): + Remove. Stack overflow checking makes them too slow. + (make_local_vector): Likewise. Also we just don't have enough + users for it. + (enum LISP_STRING_OVERHEAD): Remove. + (local_string_init, local_vector_init): Remove prototypes. + (make_local_string, build_local_string): Redesign to target short + compile-time string constants, fall back to regular string allocation + where appropriate. + (lisp_string_size): New function. + (verify_ascii) [ENABLE_CHECKING]: Add prototype. + * alloc.c (local_string_init, local_vector_init): Remove. + (verify_ascii) [ENABLE_CHECKING]: New function. + * buffer.c, charset.c, chartab.c, data.c, editfns.c, emacs.c, fileio.c: + * fns.c, font.c, fontset.c, frame.c, keyboard.c, keymap.c, lread.c: + * menu.c, minibuf.c, process.c, textprop.c, xdisp.c, xfns.c, xfont.c: + * xselect.c, xterm.c: All related users changed. + 2014-09-28 Ken Brown * sheap.c (bss_sbrk_buffer_beg): Remove redundant variable. === modified file 'src/alloc.c' --- src/alloc.c 2014-09-17 18:27:36 +0000 +++ src/alloc.c 2014-09-29 06:44:31 +0000 @@ -69,7 +69,7 @@ static bool valgrind_p; #endif -#ifdef USE_LOCAL_ALLOCATORS +#if USE_STACK_LISP_OBJECTS # if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS # error "Stack-allocated Lisp objects are not compatible with GCPROs" # endif @@ -2232,33 +2232,6 @@ return val; } -#ifdef USE_LOCAL_ALLOCATORS - -/* Initialize the string S from DATA and SIZE. S must be followed by - SIZE + 1 bytes of memory that can be used. Return S tagged as a - Lisp object. */ - -Lisp_Object -local_string_init (struct Lisp_String *s, char const *data, ptrdiff_t size) -{ - unsigned char *data_copy = (unsigned char *) (s + 1); - parse_str_as_multibyte ((unsigned char const *) data, - size, &s->size, &s->size_byte); - if (size == s->size || size != s->size_byte) - { - s->size = size; - s->size_byte = -1; - } - s->intervals = NULL; - s->data = data_copy; - memcpy (data_copy, data, size); - data_copy[size] = '\0'; - return make_lisp_ptr (s, Lisp_String); -} - -#endif - - /* Make an unibyte string from LENGTH bytes at CONTENTS. */ Lisp_Object @@ -3320,23 +3293,6 @@ return vector; } -#ifdef USE_LOCAL_ALLOCATORS - -/* Initialize V with LENGTH objects each with value INIT, - and return it tagged as a Lisp Object. */ - -Lisp_Object -local_vector_init (struct Lisp_Vector *v, ptrdiff_t length, Lisp_Object init) -{ - v->header.size = length; - for (ptrdiff_t i = 0; i < length; i++) - v->contents[i] = init; - return make_lisp_ptr (v, Lisp_Vectorlike); -} - -#endif - - DEFUN ("vector", Fvector, Svector, 0, MANY, 0, doc: /* Return a newly created vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. @@ -7157,7 +7113,22 @@ #endif /* ENABLE_CHECKING */ -#if defined (ENABLE_CHECKING) && defined (USE_STACK_LISP_OBJECTS) +#if defined (ENABLE_CHECKING) && USE_STACK_LISP_OBJECTS + +/* Debugging check whether STR is ASCII-only. */ + +const char * +verify_ascii (const char *str) +{ + const unsigned char *ptr = (unsigned char *) str, *end = ptr + strlen (str); + while (ptr < end) + { + int c = STRING_CHAR_ADVANCE (ptr); + if (!ASCII_CHAR_P (c)) + emacs_abort (); + } + return str; +} /* Stress alloca with inconveniently sized requests and check whether all allocated areas may be used for Lisp_Object. */ @@ -7175,7 +7146,7 @@ } } -#else /* not (ENABLE_CHECKING && USE_STACK_LISP_OBJECTS) */ +#else /* not ENABLE_CHECKING && USE_STACK_LISP_OBJECTS */ #define verify_alloca() ((void) 0) === modified file 'src/buffer.c' --- src/buffer.c 2014-09-25 02:01:14 +0000 +++ src/buffer.c 2014-09-29 06:44:31 +0000 @@ -1511,7 +1511,6 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) (Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) { - USE_LOCAL_ALLOCA; struct frame *f = decode_any_frame (frame); Lisp_Object tail = f->buffer_list, pred = f->buffer_predicate; Lisp_Object buf, notsogood = Qnil; @@ -1570,7 +1569,6 @@ Lisp_Object other_buffer_safely (Lisp_Object buffer) { - USE_LOCAL_ALLOCA; Lisp_Object tail, buf; FOR_EACH_LIVE_BUFFER (tail, buf) @@ -5240,7 +5238,6 @@ void init_buffer (int initialized) { - USE_LOCAL_ALLOCA; char *pwd; Lisp_Object temp; ptrdiff_t len; === modified file 'src/charset.c' --- src/charset.c 2014-09-25 02:01:14 +0000 +++ src/charset.c 2014-09-29 06:44:31 +0000 @@ -481,7 +481,6 @@ load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int control_flag) { - USE_LOCAL_ALLOCA; unsigned min_code = CHARSET_MIN_CODE (charset); unsigned max_code = CHARSET_MAX_CODE (charset); int fd; @@ -1551,7 +1550,6 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) (Lisp_Object beg, Lisp_Object end, Lisp_Object table) { - USE_LOCAL_ALLOCA; Lisp_Object charsets; ptrdiff_t from, from_byte, to, stop, stop_byte; int i; @@ -1572,7 +1570,7 @@ from_byte = CHAR_TO_BYTE (from); - charsets = make_local_vector (charset_table_used, Qnil); + charsets = Fmake_vector (make_number (charset_table_used), Qnil); while (1) { find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from, @@ -1603,14 +1601,13 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) (Lisp_Object str, Lisp_Object table) { - USE_LOCAL_ALLOCA; Lisp_Object charsets; int i; Lisp_Object val; CHECK_STRING (str); - charsets = make_local_vector (charset_table_used, Qnil); + charsets = Fmake_vector (make_number (charset_table_used), Qnil); find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str), charsets, table, STRING_MULTIBYTE (str)); === modified file 'src/chartab.c' --- src/chartab.c 2014-09-25 02:01:14 +0000 +++ src/chartab.c 2014-09-29 06:44:31 +0000 @@ -1249,7 +1249,6 @@ static Lisp_Object uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value) { - USE_LOCAL_ALLOCA; Lisp_Object *value_table = XVECTOR (XCHAR_TABLE (table)->extras[4])->contents; int i, size = ASIZE (XCHAR_TABLE (table)->extras[4]); @@ -1260,7 +1259,7 @@ value = make_number (i); if (i == size) set_char_table_extras (table, 4, Fvconcat (2, ((Lisp_Object []) { - XCHAR_TABLE (table)->extras[4], make_local_vector (1, value) }))); + XCHAR_TABLE (table)->extras[4], Fmake_vector (make_number (1), value) }))); return make_number (i); } @@ -1293,7 +1292,6 @@ Lisp_Object uniprop_table (Lisp_Object prop) { - USE_LOCAL_ALLOCA; Lisp_Object val, table, result; val = Fassq (prop, Vchar_code_property_alist); === modified file 'src/data.c' --- src/data.c 2014-09-25 02:01:14 +0000 +++ src/data.c 2014-09-29 06:44:31 +0000 @@ -1004,7 +1004,6 @@ static void wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) { - USE_LOCAL_ALLOCA; xsignal2 (Qerror, Fconcat (4, ((Lisp_Object []) { build_local_string ("Value should be from "), Fnumber_to_string (min), === modified file 'src/editfns.c' --- src/editfns.c 2014-09-25 02:01:14 +0000 +++ src/editfns.c 2014-09-29 06:44:31 +0000 @@ -3531,7 +3531,6 @@ usage: (propertize STRING &rest PROPERTIES) */) (ptrdiff_t nargs, Lisp_Object *args) { - USE_LOCAL_ALLOCA; Lisp_Object properties, string; struct gcpro gcpro1, gcpro2; ptrdiff_t i; @@ -3548,7 +3547,7 @@ string = Fcopy_sequence (args[0]); for (i = 1; i < nargs; i += 2) - properties = local_cons (args[i], local_cons (args[i + 1], properties)); + properties = Fcons (args[i], Fcons (args[i + 1], properties)); Fadd_text_properties (make_number (0), make_number (SCHARS (string)), @@ -4363,7 +4362,6 @@ Lisp_Object format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) { - USE_LOCAL_ALLOCA; return Fformat (3, ((Lisp_Object []) { build_local_string (string1), arg0, arg1 })); } === modified file 'src/emacs.c' --- src/emacs.c 2014-09-25 02:01:14 +0000 +++ src/emacs.c 2014-09-29 06:44:31 +0000 @@ -396,7 +396,6 @@ static void init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) { - USE_LOCAL_ALLOCA; int i; Lisp_Object name, dir, handler; ptrdiff_t count = SPECPDL_INDEX (); @@ -2209,7 +2208,6 @@ Lisp_Object decode_env_path (const char *evarname, const char *defalt, bool empty) { - USE_LOCAL_ALLOCA; const char *path, *p; Lisp_Object lpath, element, tem; /* Default is to use "." for empty path elements. === modified file 'src/fileio.c' --- src/fileio.c 2014-09-25 02:01:14 +0000 +++ src/fileio.c 2014-09-29 06:44:31 +0000 @@ -5411,7 +5411,6 @@ static Lisp_Object auto_save_error (Lisp_Object error_val) { - USE_LOCAL_ALLOCA; Lisp_Object msg; int i; struct gcpro gcpro1; === modified file 'src/fns.c' --- src/fns.c 2014-09-25 02:01:14 +0000 +++ src/fns.c 2014-09-29 06:44:31 +0000 @@ -2706,7 +2706,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) (Lisp_Object prompt) { - USE_LOCAL_ALLOCA; Lisp_Object ans; struct gcpro gcpro1; === modified file 'src/font.c' --- src/font.c 2014-09-25 02:01:14 +0000 +++ src/font.c 2014-09-29 06:44:31 +0000 @@ -357,7 +357,6 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, bool noerror) { - USE_LOCAL_ALLOCA; Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); int len; @@ -402,7 +401,7 @@ ASET (elt, 1, val); ASET (font_style_table, prop - FONT_WEIGHT_INDEX, Fvconcat (2, ((Lisp_Object []) - { table, make_local_vector (1, elt) }))); + { table, Fmake_vector (make_number (1), elt) }))); return (100 << 8) | (i << 4); } else @@ -1050,7 +1049,6 @@ int font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font) { - USE_LOCAL_ALLOCA; int i, j, n; char *f[XLFD_LAST_INDEX + 1]; Lisp_Object val; @@ -1760,7 +1758,6 @@ void font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Object font_spec) { - USE_LOCAL_ALLOCA; ptrdiff_t len; char *p0, *p1; @@ -2686,7 +2683,6 @@ static Lisp_Object font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) { - USE_LOCAL_ALLOCA; Lisp_Object entity, val; enum font_property_index prop; ptrdiff_t i; @@ -2717,7 +2713,7 @@ } if (NILP (spec)) { - val = local_cons (entity, val); + val = Fcons (entity, val); continue; } for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++) @@ -2748,7 +2744,7 @@ AREF (entity, FONT_AVGWIDTH_INDEX))) prop = FONT_SPEC_MAX; if (prop < FONT_SPEC_MAX) - val = local_cons (entity, val); + val = Fcons (entity, val); } return (Fvconcat (1, &val)); } @@ -5006,7 +5002,6 @@ void font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) { - USE_LOCAL_ALLOCA; Lisp_Object val; int i; === modified file 'src/fontset.c' --- src/fontset.c 2014-09-25 02:01:14 +0000 +++ src/fontset.c 2014-09-29 06:44:31 +0000 @@ -1420,7 +1420,6 @@ appended. By default, FONT-SPEC overrides the previous settings. */) (Lisp_Object name, Lisp_Object target, Lisp_Object font_spec, Lisp_Object frame, Lisp_Object add) { - USE_LOCAL_ALLOCA; Lisp_Object fontset; Lisp_Object font_def, registry, family; Lisp_Object range_list; === modified file 'src/frame.c' --- src/frame.c 2014-09-25 07:01:35 +0000 +++ src/frame.c 2014-09-29 06:44:31 +0000 @@ -4122,7 +4122,6 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, const char *attribute, const char *class, enum resource_types type) { - USE_LOCAL_ALLOCA; Lisp_Object tem; tem = Fassq (param, alist); === modified file 'src/keyboard.c' --- src/keyboard.c 2014-09-27 15:52:28 +0000 +++ src/keyboard.c 2014-09-29 06:44:31 +0000 @@ -573,7 +573,7 @@ kset_echo_string (current_kboard, - concat2 (echo_string, make_local_string (buffer, ptr - buffer))); + concat2 (echo_string, make_string (buffer, ptr - buffer))); SAFE_FREE (); } @@ -597,8 +597,6 @@ static void echo_dash (void) { - USE_LOCAL_ALLOCA; - /* Do nothing if not echoing at all. */ if (NILP (KVAR (current_kboard, echo_string))) return; @@ -1892,7 +1890,6 @@ static Lisp_Object safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) { - USE_LOCAL_ALLOCA; Lisp_Object hook, fun; eassert (nargs == 2); @@ -7699,7 +7696,6 @@ bool parse_menu_item (Lisp_Object item, int inmenubar) { - USE_LOCAL_ALLOCA; Lisp_Object def, tem, item_string, start; Lisp_Object filter; Lisp_Object keyhint; @@ -8523,7 +8519,6 @@ read_char_minibuf_menu_prompt (int commandflag, Lisp_Object map) { - USE_LOCAL_ALLOCA; Lisp_Object name; ptrdiff_t nlength; /* FIXME: Use the minibuffer's frame width. */ === modified file 'src/keymap.c' --- src/keymap.c 2014-09-25 02:01:14 +0000 +++ src/keymap.c 2014-09-29 06:44:31 +0000 @@ -1308,7 +1308,6 @@ static void silly_event_symbol_error (Lisp_Object c) { - USE_LOCAL_ALLOCA; Lisp_Object parsed, base, name, assoc; int modifiers; @@ -3418,7 +3417,6 @@ bool partial, Lisp_Object shadow, Lisp_Object entire_map, bool keymap_p, bool mention_shadow) { - USE_LOCAL_ALLOCA; Lisp_Object definition; Lisp_Object tem2; Lisp_Object elt_prefix = Qnil; === modified file 'src/lisp.h' --- src/lisp.h 2014-09-25 17:49:02 +0000 +++ src/lisp.h 2014-09-29 06:44:31 +0000 @@ -3705,8 +3705,6 @@ extern Lisp_Object bool_vector_fill (Lisp_Object, Lisp_Object); extern _Noreturn void string_overflow (void); extern Lisp_Object make_string (const char *, ptrdiff_t); -extern Lisp_Object local_string_init (struct Lisp_String *, char const *, - ptrdiff_t); extern Lisp_Object make_formatted_string (char *, const char *, ...) ATTRIBUTE_FORMAT_PRINTF (2, 3); extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t); @@ -3795,8 +3793,6 @@ extern struct window *allocate_window (void); extern struct frame *allocate_frame (void); extern struct Lisp_Process *allocate_process (void); -extern Lisp_Object local_vector_init (struct Lisp_Vector *, ptrdiff_t, - Lisp_Object); extern struct terminal *allocate_terminal (void); extern bool gc_in_progress; extern bool abort_on_gc; @@ -4602,17 +4598,25 @@ /* If USE_STACK_LISP_OBJECTS, define macros that and functions that allocate - block-scoped conses and function-scoped vectors and strings. These objects - are not managed by the garbage collector, so they are dangerous: passing - them out of their scope (e.g., to user code) results in undefined behavior. + block-scoped conses and function-scoped strings. These objects are not + managed by the garbage collector, so they are dangerous: passing them + out of their scope (e.g., to user code) results in undefined behavior. Conversely, they have better performance because GC is not involved. This feature is experimental and requires careful debugging. It's enabled by default if GCC or a compiler that mimics GCC well (like Intel C/C++) is used, except clang (see notice above). For other compilers, brave users can - compile with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS' to get into the game. + compile with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=1' to get into the game. Note that this feature requires GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. */ +#ifdef GCALIGNED + +/* No tricks if struct Lisp_Cons is always aligned. */ + +# define SCOPED_CONS_INITIALIZER(a, b) &((struct Lisp_Cons) { a, { b } }) + +#else /* not GCALIGNED */ + /* A struct Lisp_Cons inside a union that is no larger and may be better-aligned. */ @@ -4621,153 +4625,89 @@ struct Lisp_Cons s; double d; intmax_t i; void *p; }; + +verify (alignof (union Aligned_Cons) % GCALIGNMENT == 0); verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons)); -/* Allocate a block-scoped cons. */ - -#define scoped_cons(car, cdr) \ - ((USE_STACK_LISP_OBJECTS \ - && alignof (union Aligned_Cons) % GCALIGNMENT == 0) \ - ? make_lisp_ptr (&((union Aligned_Cons) {{car, {cdr}}}).s, Lisp_Cons) \ - : Fcons (car, cdr)) - -/* Convenient utility macros similar to listX functions. */ +# define SCOPED_CONS_INITIALIZER(a, b) \ + &((union Aligned_Cons) { { a, { b } } }.s) + +#endif /* GCALIGNED */ + +/* Basic stack-based cons allocation. */ #if USE_STACK_LISP_OBJECTS +# define scoped_cons(a, b) \ + make_lisp_ptr (SCOPED_CONS_INITIALIZER (a, b), Lisp_Cons) # define scoped_list1(a) scoped_cons (a, Qnil) # define scoped_list2(a, b) scoped_cons (a, scoped_list1 (b)) # define scoped_list3(a, b, c) scoped_cons (a, scoped_list2 (b, c)) # define scoped_list4(a, b, c, d) scoped_cons (a, scoped_list3 (b, c, d)) #else +# define scoped_cons(a, b) Fcons (a, b) # define scoped_list1(a) list1 (a) # define scoped_list2(a, b) list2 (a, b) # define scoped_list3(a, b, c) list3 (a, b, c) # define scoped_list4(a, b, c, d) list4 (a, b, c, d) #endif -/* Local allocators require both statement expressions and a - GCALIGNMENT-aligned alloca. clang's alloca isn't properly aligned - in some cases. In the absence of solid information, play it safe - for other non-GCC compilers. */ -#if (USE_STACK_LISP_OBJECTS && HAVE_STATEMENT_EXPRESSIONS \ - && __GNUC__ && !__clang__) -# define USE_LOCAL_ALLOCATORS -#endif - -/* Any function that uses a local allocator should start with either - 'USE_SAFE_ALLOCA; or 'USE_LOCAL_ALLOCA;' (but not both). */ -#ifdef USE_LOCAL_ALLOCATORS -# define USE_LOCAL_ALLOCA ptrdiff_t sa_avail = MAX_ALLOCA -#else -# define USE_LOCAL_ALLOCA -#endif - -#ifdef USE_LOCAL_ALLOCATORS - -/* Return a function-scoped cons whose car is X and cdr is Y. */ - -# define local_cons(x, y) \ - (sizeof (struct Lisp_Cons) <= sa_avail \ - ? ({ \ - struct Lisp_Cons *c_ = AVAIL_ALLOCA (sizeof (struct Lisp_Cons)); \ - c_->car = (x); \ - c_->u.cdr = (y); \ - make_lisp_ptr (c_, Lisp_Cons); \ - }) \ - : Fcons (x, y)) - -# define local_list1(a) local_cons (a, Qnil) -# define local_list2(a, b) local_cons (a, local_list1 (b)) -# define local_list3(a, b, c) local_cons (a, local_list2 (b, c)) -# define local_list4(a, b, c, d) local_cons (a, local_list3 (b, c, d)) - -/* Return a function-scoped vector of length SIZE, with each element - being INIT. */ - -# define make_local_vector(size, init) \ - ({ \ - ptrdiff_t size_ = size; \ - Lisp_Object vec_; \ - if (size_ <= lisp_word_count (sa_avail - header_size)) \ - { \ - void *ptr_ = AVAIL_ALLOCA (size_ * word_size + header_size); \ - vec_ = local_vector_init (ptr_, size_, init); \ - } \ - else \ - vec_ = Fmake_vector (make_number (size_), init); \ - vec_; \ - }) - -enum { LISP_STRING_OVERHEAD = sizeof (struct Lisp_String) + 1 }; - -/* Return a function-scoped string with contents DATA and length NBYTES. */ - -# define make_local_string(data, nbytes) \ - ({ \ - ptrdiff_t nbytes_ = nbytes; \ - Lisp_Object string_; \ - if (nbytes_ <= sa_avail - LISP_STRING_OVERHEAD) \ - { \ - struct Lisp_String *ptr_ = AVAIL_ALLOCA (LISP_STRING_OVERHEAD \ - + nbytes_); \ - string_ = local_string_init (ptr_, data, nbytes_); \ - } \ - else \ - string_ = make_string (data, nbytes_); \ - string_; \ - }) - -/* Return a function-scoped string with contents DATA. */ - -# define build_local_string(data) \ - ({ char const *data1_ = (data); \ - make_local_string (data1_, strlen (data1_)); }) - -#else - -/* Safer but slower implementations. */ -INLINE Lisp_Object -local_cons (Lisp_Object car, Lisp_Object cdr) -{ - return Fcons (car, cdr); -} -INLINE Lisp_Object -local_list1 (Lisp_Object a) -{ - return list1 (a); -} -INLINE Lisp_Object -local_list2 (Lisp_Object a, Lisp_Object b) -{ - return list2 (a, b); -} -INLINE Lisp_Object -local_list3 (Lisp_Object a, Lisp_Object b, Lisp_Object c) -{ - return list3 (a, b, c); -} -INLINE Lisp_Object -local_list4 (Lisp_Object a, Lisp_Object b, Lisp_Object c, Lisp_Object d) -{ - return list4 (a, b, c, d); -} -INLINE Lisp_Object -make_local_vector (ptrdiff_t size, Lisp_Object init) -{ - return Fmake_vector (make_number (size), init); -} -INLINE Lisp_Object -make_local_string (char const *str, ptrdiff_t nbytes) -{ - return make_string (str, nbytes); -} +/* On-stack string allocation requires __builtin_constant_p, statement + expressions and GCALIGNMENT-aligned alloca. All from the above is + assumed for GCC. At least for clang < 3.6, alloca isn't properly + aligned in some cases. In the absence of solid information, play + it safe for other non-GCC compilers. */ + +#if USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ + +/* Used to check whether stack-allocated strings are ASCII-only. */ + +#ifdef ENABLE_CHECKING +extern const char * verify_ascii (const char *); +#else +#define verify_ascii(str) (str) +#endif + +/* Return number of bytes needed for Lisp string of length NBYTES. */ + +INLINE ptrdiff_t +lisp_string_size (ptrdiff_t nbytes) +{ + return sizeof (struct Lisp_String) + nbytes + 1; +} + +/* Return function-scoped unibyte Lisp string with contents STR of length + NBYTES and memory footprint of MEMSIZE bytes if the latter doesn't exceed + MAX_ALLOCA, abort otherwise. */ + +# define make_local_string(str, memsize, nbytes) \ + ((memsize < MAX_ALLOCA) \ + ? ({ struct Lisp_String *s_ = alloca (memsize); \ + s_->data = (unsigned char *) (s_ + 1); \ + memcpy (s_->data, verify_ascii (str), nbytes + 1); \ + s_->size = nbytes, s_->size_byte = -1; \ + s_->intervals = NULL; \ + make_lisp_ptr (s_, Lisp_String); }) \ + : (emacs_abort (), Qnil)) + +/* If STR is a compile-time string constant, build function-scoped Lisp string + from it, fall back to regular Lisp string otherwise. We assume compile-time + string constants never exceeds MAX_ALLOCA - sizeof (Lisp_String) - 1. */ + +# define build_local_string(str) \ + (__builtin_constant_p (str) \ + ? make_local_string \ + (str, lisp_string_size (strlen (str)), strlen (str)) \ + : build_string (str)) + +#else /* not USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ */ + INLINE Lisp_Object build_local_string (const char *str) { return build_string (str); } -#endif +#endif /* not USE_STACK_LISP_OBJECTS && __GNUC__ && !__clang__ */ /* Loop over all tails of a list, checking for cycles. FIXME: Make tortoise and n internal declarations. === modified file 'src/lread.c' --- src/lread.c 2014-09-25 02:01:14 +0000 +++ src/lread.c 2014-09-29 06:44:31 +0000 @@ -968,7 +968,6 @@ static void load_warn_old_style_backquotes (Lisp_Object file) { - USE_LOCAL_ALLOCA; if (!NILP (Vold_style_backquotes)) Fmessage (2, ((Lisp_Object []) { build_local_string ("Loading `%s': old-style backquotes detected!"), @@ -3639,7 +3638,6 @@ static Lisp_Object read_list (bool flag, Lisp_Object readcharfun) { - USE_LOCAL_ALLOCA; Lisp_Object val, tail; Lisp_Object elt, tem; struct gcpro gcpro1, gcpro2; === modified file 'src/menu.c' --- src/menu.c 2014-09-25 02:01:14 +0000 +++ src/menu.c 2014-09-29 06:44:31 +0000 @@ -324,7 +324,6 @@ static void single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *skp_v) { - USE_LOCAL_ALLOCA; Lisp_Object map, item_string, enabled; struct gcpro gcpro1, gcpro2; bool res; === modified file 'src/minibuf.c' --- src/minibuf.c 2014-09-25 02:01:14 +0000 +++ src/minibuf.c 2014-09-29 06:44:31 +0000 @@ -1123,7 +1123,6 @@ function, instead of the usual behavior. */) (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match) { - USE_LOCAL_ALLOCA; Lisp_Object result; char *s; ptrdiff_t len; === modified file 'src/process.c' --- src/process.c 2014-09-25 02:01:14 +0000 +++ src/process.c 2014-09-29 06:44:31 +0000 @@ -592,7 +592,6 @@ static Lisp_Object status_message (struct Lisp_Process *p) { - USE_LOCAL_ALLOCA; Lisp_Object status = p->status; Lisp_Object symbol; int code; @@ -1291,8 +1290,6 @@ Returns nil if format of ADDRESS is invalid. */) (Lisp_Object address, Lisp_Object omit_port) { - USE_LOCAL_ALLOCA; - if (NILP (address)) return Qnil; @@ -4006,7 +4003,6 @@ static void server_accept_connection (Lisp_Object server, int channel) { - USE_LOCAL_ALLOCA; Lisp_Object proc, caller, name, buffer; Lisp_Object contact, host, service; struct Lisp_Process *ps= XPROCESS (server); === modified file 'src/textprop.c' --- src/textprop.c 2014-09-25 02:01:14 +0000 +++ src/textprop.c 2014-09-29 06:44:31 +0000 @@ -1913,7 +1913,6 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop) { - USE_LOCAL_ALLOCA; INTERVAL i; Lisp_Object res; Lisp_Object stuff; @@ -1967,9 +1966,8 @@ if (! NILP (plist)) /* Must defer modifications to the interval tree in case src and dest refer to the same string or buffer. */ - stuff = local_cons - (local_list3 (make_number (p), make_number (p + len), plist), - stuff); + stuff = Fcons (list3 (make_number (p), make_number (p + len), plist), + stuff); i = next_interval (i); if (!i) === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-25 07:01:35 +0000 +++ src/xdisp.c 2014-09-29 06:44:31 +0000 @@ -20892,7 +20892,6 @@ See also `bidi-paragraph-direction'. */) (Lisp_Object buffer) { - USE_LOCAL_ALLOCA; struct buffer *buf = current_buffer; struct buffer *old = buf; === modified file 'src/xfns.c' --- src/xfns.c 2014-09-26 16:49:10 +0000 +++ src/xfns.c 2014-09-29 06:44:31 +0000 @@ -1559,9 +1559,6 @@ const char *xprop, const char *xclass, int foreground_p) { -#ifdef USE_TOOLKIT_SCROLL_BARS - USE_LOCAL_ALLOCA; -#endif struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); Lisp_Object tem; @@ -4273,7 +4270,6 @@ void select_visual (struct x_display_info *dpyinfo) { - USE_LOCAL_ALLOCA; Display *dpy = dpyinfo->display; Screen *screen = dpyinfo->screen; === modified file 'src/xfont.c' --- src/xfont.c 2014-09-25 02:01:14 +0000 +++ src/xfont.c 2014-09-29 06:44:31 +0000 @@ -677,7 +677,6 @@ static Lisp_Object xfont_open (struct frame *f, Lisp_Object entity, int pixel_size) { - USE_LOCAL_ALLOCA; Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); Display *display = dpyinfo->display; char name[512]; @@ -776,7 +775,7 @@ if (dashes >= 13) { len = xfont_decode_coding_xlfd (p0, -1, name); - fullname = Fdowncase (make_local_string (name, len)); + fullname = Fdowncase (make_string (name, len)); } XFree (p0); } === modified file 'src/xselect.c' --- src/xselect.c 2014-09-25 02:01:14 +0000 +++ src/xselect.c 2014-09-29 06:44:31 +0000 @@ -2159,7 +2159,6 @@ static Lisp_Object x_clipboard_manager_error_1 (Lisp_Object err) { - USE_LOCAL_ALLOCA; Fmessage (2, ((Lisp_Object []) { build_local_string ("X clipboard manager error: %s\n\ If the problem persists, set `x-select-enable-clipboard-manager' to nil."), @@ -2213,7 +2212,6 @@ x_clipboard_manager_save_all (void) { /* Loop through all X displays, saving owned clipboards. */ - USE_LOCAL_ALLOCA; struct x_display_info *dpyinfo; Lisp_Object local_selection, local_frame; === modified file 'src/xterm.c' --- src/xterm.c 2014-09-25 11:16:25 +0000 +++ src/xterm.c 2014-09-29 06:44:31 +0000 @@ -10666,7 +10666,6 @@ struct x_display_info * x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) { - USE_LOCAL_ALLOCA; Display *dpy; struct terminal *terminal; struct x_display_info *dpyinfo; ------------------------------------------------------------ revno: 117970 committer: Ken Brown branch nick: trunk timestamp: Sun 2014-09-28 18:31:59 -0400 message: * src/sheap.c (bss_sbrk_buffer_beg): Remove redundant variable. * src/gmalloc.c [CYGWIN]: Adapt to change in sheap.c. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-27 20:58:05 +0000 +++ src/ChangeLog 2014-09-28 22:31:59 +0000 @@ -1,3 +1,8 @@ +2014-09-28 Ken Brown + + * sheap.c (bss_sbrk_buffer_beg): Remove redundant variable. + * gmalloc.c [CYGWIN]: Adapt to change in sheap.c. + 2014-09-27 Ken Brown Fix implementation of HYBRID_MALLOC on Cygwin. === modified file 'src/gmalloc.c' --- src/gmalloc.c 2014-09-27 20:58:05 +0000 +++ src/gmalloc.c 2014-09-28 22:31:59 +0000 @@ -75,11 +75,11 @@ #ifdef CYGWIN extern void *bss_sbrk (ptrdiff_t size); extern int bss_sbrk_did_unexec; -extern void *bss_sbrk_buffer_beg; +extern char bss_sbrk_buffer[]; extern void *bss_sbrk_buffer_end; #define DUMPED bss_sbrk_did_unexec #define ALLOCATED_BEFORE_DUMPING(P) \ - ((P) < bss_sbrk_buffer_end && (P) >= bss_sbrk_buffer_beg) + ((P) < bss_sbrk_buffer_end && (P) >= (void *) bss_sbrk_buffer) #endif #ifdef __cplusplus === modified file 'src/sheap.c' --- src/sheap.c 2014-09-27 20:58:05 +0000 +++ src/sheap.c 2014-09-28 22:31:59 +0000 @@ -44,8 +44,7 @@ #define BLOCKSIZE 4096 char bss_sbrk_buffer[STATIC_HEAP_SIZE]; -/* The following two variables are needed in gmalloc.c */ -void *bss_sbrk_buffer_beg = bss_sbrk_buffer; +/* The following is needed in gmalloc.c */ void *bss_sbrk_buffer_end = bss_sbrk_buffer + STATIC_HEAP_SIZE; char *bss_sbrk_ptr; char *max_bss_sbrk_ptr; ------------------------------------------------------------ revno: 117969 committer: Thien-Thi Nguyen branch nick: trunk timestamp: Sun 2014-09-28 10:03:48 +0200 message: Font-lock `cl-flet*', too. * lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2): Add "flet*" to intermediate var `cl-lib-kw'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-27 16:26:54 +0000 +++ lisp/ChangeLog 2014-09-28 08:03:48 +0000 @@ -1,3 +1,9 @@ +2014-09-28 Thien-Thi Nguyen + + Font-lock `cl-flet*', too. + * emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2): + Add "flet*" to intermediate var `cl-lib-kw'. + 2014-09-27 Stefan Monnier * epg-config.el (epg-gpg-program): Use the plain program names rather === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2014-09-27 03:57:41 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2014-09-28 08:03:48 +0000 @@ -233,7 +233,7 @@ "etypecase" "ccase" "ctypecase" "loop" "do" "do*" "the" "locally" "proclaim" "declaim" "letf" "go" ;; "lexical-let" "lexical-let*" - "symbol-macrolet" "flet" "destructuring-bind" + "symbol-macrolet" "flet" "flet*" "destructuring-bind" "labels" "macrolet" "tagbody" "multiple-value-bind" "block" "return" "return-from")) (cl-lib-errs '("assert" "check-type")) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.