------------------------------------------------------------ revno: 117422 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-06-27 11:31:20 +0300 message: src/w32heap.c: Minor formatting and whitespace changes. diff: === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-04 12:00:34 +0000 +++ src/w32heap.c 2014-06-27 08:31:20 +0000 @@ -200,12 +200,11 @@ as requests arrive. */ *CommitAddress = data_region_base + committed; committed += *CommitSize; + /* Check that the private heap area does not overlap the big chunks area. */ if (((unsigned char *)(*CommitAddress)) + *CommitSize >= bc_limit) { - /* Check that the private heap area does not overlap the big - chunks area. */ - fprintf(stderr, - "dumped_data_commit: memory exhausted.\nEnlarge dumped_data[]!\n"); + fprintf (stderr, + "dumped_data_commit: memory exhausted.\nEnlarge dumped_data[]!\n"); exit (-1); } return 0; @@ -243,18 +242,20 @@ data_region_end = data_region_base; /* Create the private heap. */ - heap = HeapCreate(0, 0, 0); + heap = HeapCreate (0, 0, 0); #ifndef _W64 /* Set the low-fragmentation heap for OS before Vista. */ - HMODULE hm_kernel32dll = LoadLibrary("kernel32.dll"); - HeapSetInformation_Proc s_pfn_Heap_Set_Information = (HeapSetInformation_Proc) GetProcAddress(hm_kernel32dll, "HeapSetInformation"); + HMODULE hm_kernel32dll = LoadLibrary ("kernel32.dll"); + HeapSetInformation_Proc s_pfn_Heap_Set_Information = (HeapSetInformation_Proc) GetProcAddress (hm_kernel32dll, "HeapSetInformation"); if (s_pfn_Heap_Set_Information != NULL) - if (s_pfn_Heap_Set_Information ((PVOID) heap, - HeapCompatibilityInformation, - &enable_lfh, sizeof(enable_lfh)) == 0) - DebPrint (("Enabling Low Fragmentation Heap failed: error %ld\n", - GetLastError ())); + { + if (s_pfn_Heap_Set_Information ((PVOID) heap, + HeapCompatibilityInformation, + &enable_lfh, sizeof(enable_lfh)) == 0) + DebPrint (("Enabling Low Fragmentation Heap failed: error %ld\n", + GetLastError ())); + } #endif the_malloc_fn = malloc_after_dump; @@ -271,7 +272,7 @@ = (RtlCreateHeap_Proc) GetProcAddress (hm_ntdll, "RtlCreateHeap"); /* Specific parameters for the private heap. */ RTL_HEAP_PARAMETERS params; - ZeroMemory(¶ms, sizeof(params)); + ZeroMemory (¶ms, sizeof(params)); params.Length = sizeof(RTL_HEAP_PARAMETERS); data_region_base = (unsigned char *)ROUND_UP (dumped_data, 0x1000); @@ -284,6 +285,11 @@ params.CommitRoutine = &dumped_data_commit; /* Create the private heap. */ + if (s_pfn_Rtl_Create_Heap == NULL) + { + fprintf (stderr, "Cannot build Emacs without RtlCreateHeap being available; exiting.\n"); + exit (-1); + } heap = s_pfn_Rtl_Create_Heap (0, data_region_base, 0, 0, NULL, ¶ms); the_malloc_fn = malloc_before_dump; the_realloc_fn = realloc_before_dump; @@ -358,8 +364,8 @@ array. */ if (blocks_number >= MAX_BLOCKS) { - fprintf(stderr, - "malloc_before_dump: no more big chunks available.\nEnlarge MAX_BLOCKS!\n"); + fprintf (stderr, + "malloc_before_dump: no more big chunks available.\nEnlarge MAX_BLOCKS!\n"); exit (-1); } bc_limit -= size; @@ -369,11 +375,11 @@ blocks[blocks_number].size = size; blocks[blocks_number].occupied = TRUE; blocks_number++; + /* Check that areas do not overlap. */ if (bc_limit < dumped_data + committed) { - /* Check that areas do not overlap. */ - fprintf(stderr, - "malloc_before_dump: memory exhausted.\nEnlarge dumped_data[]!\n"); + fprintf (stderr, + "malloc_before_dump: memory exhausted.\nEnlarge dumped_data[]!\n"); exit (-1); } } ------------------------------------------------------------ revno: 117421 committer: Luke Lee branch nick: trunk timestamp: Fri 2014-06-27 16:25:21 +0800 message: * lisp/progmodes/hideif.el: Style fixes. Fix doc-strings and comment style, also add a change log entry for the latest hideif.el changes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-26 21:51:25 +0000 +++ lisp/ChangeLog 2014-06-27 08:25:21 +0000 @@ -1,3 +1,29 @@ +2014-06-26 Luke Lee + + * lisp/progmodes/hideif.el (hif-string-to-number): Fix return value bug. + (hif-simple-token-only, hif-tokenize): Commented in detail mainly for + performance enhancements. + (hif-parse-if-exp): Rename to `hif-parse-exp'. Enhanced for macro + expansion. + (hif-factor, hif-string-concatenation, intern-safe): Support string + concatenation and argumented macro expansion. + (hif-if-valid-identifier-p, hif-define-operator, hif-flatten) + (hif-expand-token-list, hif-get-argument-list, hif-define-macro) + (hif-delimit, hif-macro-supply-arguments, hif-invoke, hif-canonicalize) + (hif-canonicalize-tokens, hif-place-macro-invocation) + (hif-parse-macro-arglist): Mostly new functions for supporting + argumented macro expansion. + (hif-string-concatenation, hif-stringify, hif-token-concat) + (hif-token-stringification, hif-token-concatenation): Stringification + and concatenation. + (hif-find-next-relevant): Fix comments. + (hif-ifdef-to-endif, hif-looking-at-elif, hif-hide-line): Bug fix for + some cases involving #elif. + (hif-find-define, hif-add-new-defines): New functions for automatically + scanning of defined symbols. + (hide-ifdef-guts): Fix for defined symbol auto scanning. + (hide-ifdef-undef): Fix behavior to match CPP. + 2014-06-26 Glenn Morris * Makefile.in (update-authors): Update for moved authors.el. === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2014-06-26 06:55:15 +0000 +++ lisp/progmodes/hideif.el 2014-06-27 08:25:21 +0000 @@ -36,7 +36,7 @@ ;; ;; Hide-ifdef suppresses the display of code that the preprocessor wouldn't ;; pass through. Support complete C/C++ expression and precedence. -;; It will automatically scans for new #define symbols and macros on the way +;; It will automatically scan for new #define symbols and macros on the way ;; parsing. ;; ;; The hidden code is marked by ellipses (...). Be @@ -204,7 +204,7 @@ (cons '(hide-ifdef-hiding " Hiding") minor-mode-alist))) -;; fix c-mode syntax table so we can recognize whole symbols. +;; Fix c-mode syntax table so we can recognize whole symbols. (defvar hide-ifdef-syntax-table (let ((st (copy-syntax-table c-mode-syntax-table))) (modify-syntax-entry ?_ "w" st) @@ -333,7 +333,7 @@ (defun hif-set-var (var value) - "Prepend (var value) pair to `hide-ifdef-env'." + "Prepend (VAR VALUE) pair to `hide-ifdef-env'." (setq hide-ifdef-env (cons (cons var value) hide-ifdef-env))) (declare-function semantic-c-hideif-lookup "semantic/bovine/c" (var)) @@ -389,8 +389,8 @@ ")" "\\)?" )) -;; Used to store the current token and the whole token list during parsing. -;; Only bound dynamically. +;; Store the current token and the whole token list during parsing. +;; Bound dynamically. (defvar hif-token) (defvar hif-token-list) @@ -456,6 +456,7 @@ ;; speeding up macro evaluation on those very simple cases like integers or ;; literals. ;; Check the long comments before `hif-find-define' for more details. [lukelee] +(defvar hif-simple-token-only) (defun hif-tokenize (start end) "Separate string between START and END into a list of tokens." @@ -539,8 +540,7 @@ (stringp id)))) (defun hif-define-operator (tokens) - "`Upgrade' hif-define xxx to '(hif-define xxx)' so that it won't be -subsitituted" + "`Upgrade' hif-define xxx to '(hif-define xxx)' so it won't be subsitituted." (let ((result nil) (tok nil)) (while (setq tok (pop tokens)) @@ -563,15 +563,17 @@ (nreverse result))) (defun hif-flatten (l) - "Flatten a tree" + "Flatten a tree." (apply #'nconc (mapcar (lambda (x) (if (listp x) (hif-flatten x) (list x))) l))) (defun hif-expand-token-list (tokens &optional macroname expand_list) - "Perform expansion till everything expanded. No self-reference expansion. - EXPAND_LIST is the list of macro names currently being expanded." + "Perform expansion on TOKENS till everything expanded. +Self-reference (directly or indirectly) tokens are not expanded. +EXPAND_LIST is the list of macro names currently being expanded, use for +detecting self-reference." (catch 'self-referencing (let ((expanded nil) (remains (hif-define-operator @@ -594,9 +596,9 @@ ((setq rep (hif-lookup tok)) (if (and (listp rep) - (eq (car rep) 'hif-define-macro)) ;; a defined macro + (eq (car rep) 'hif-define-macro)) ; A defined macro ;; Recursively expand it - (if (cadr rep) ;; Argument list is not nil + (if (cadr rep) ; Argument list is not nil (if (not (eq (car remains) 'hif-lparen)) ;; No argument, no invocation tok @@ -616,7 +618,7 @@ result)) ;; Argument list is nil, direct expansion (setq rep (hif-expand-token-list - (caddr rep) ;; Macro's token list + (caddr rep) ; Macro's token list tok expand_list)) ;; Replace all remaining references immediately (setq remains (substitute tok rep remains)) @@ -627,12 +629,12 @@ ;;[2013-10-22 16:06:12 +0800] Must keep the token, removing ;; this token might results in an incomplete expression that ;; cannot be parsed further. - ;;((= 1 (hif-defined tok)) ;; defined (hif-defined tok)=1, + ;;((= 1 (hif-defined tok)) ; defined (hif-defined tok)=1, ;; ;;but empty (hif-lookup tok)=nil, thus remove this token ;; (setq remains (delete tok remains)) ;; nil) - (t ;; Usual IDs + (t ; Usual IDs tok)) expanded)) @@ -640,8 +642,9 @@ (hif-flatten (nreverse expanded))))) (defun hif-parse-exp (token-list &optional macroname) - "Parse the TOKEN-LIST. Return translated list in prefix form. MACRONAME -is applied when invoking macros to prevent self-referencing macros." + "Parse the TOKEN-LIST. +Return translated list in prefix form. MACRONAME is applied when invoking +macros to prevent self-reference." (let ((hif-token-list (hif-expand-token-list token-list macroname))) (hif-nexttoken) (prog1 @@ -651,7 +654,7 @@ (error "Error: unexpected token: %s" hif-token))))) (defun hif-exprlist () - "Parse an exprlist: expr { ',' expr}" + "Parse an exprlist: expr { ',' expr}." (let ((result (hif-expr))) (if (eq hif-token 'hif-comma) (let ((temp (list result))) @@ -772,8 +775,9 @@ result)) (defun hif-factor () - "Parse a factor: '!' factor | '~' factor | '(' expr ')' | -'defined(' id ')' | 'id(parmlist)' | strings | id." + "Parse a factor. +factor : '!' factor | '~' factor | '(' expr ')' | 'defined(' id ')' | + 'id(parmlist)' | strings | id." (cond ((eq hif-token 'hif-not) (hif-nexttoken) @@ -822,7 +826,7 @@ (defun hif-get-argument-list (ident) (let ((nest 0) - (parmlist nil) ;; A "token" list of parameters, will later be parsed + (parmlist nil) ; A "token" list of parameters, will later be parsed (parm nil)) (while (or (not (eq (hif-nexttoken) 'hif-rparen)) @@ -840,8 +844,8 @@ (setq parm nil))) (push hif-token parm)) - (push (nreverse parm) parmlist) ;; Okay even if parm is nil - (hif-nexttoken) ;; Drop the hif-rparen, get next token + (push (nreverse parm) parmlist) ; Okay even if PARM is nil + (hif-nexttoken) ; Drop the `hif-rparen', get next token (nreverse parmlist))) (defun hif-place-macro-invocation (ident) @@ -849,7 +853,7 @@ `(hif-invoke (quote ,ident) (quote ,parmlist)))) (defun hif-string-concatenation () - "Parse concatenated strings: string | strings string" + "Parse concatenated strings: string | strings string." (let ((result (substring-no-properties hif-token))) (while (stringp (hif-nexttoken)) (setq result (concat @@ -858,11 +862,11 @@ result)) (defun hif-define-macro (parmlist token-body) - "A marker for defined macro with arguments, cannot be evaluated alone with -no parameters inputed." + "A marker for defined macro with arguments. +This macro cannot be evaluated alone without parameters inputed." ;;TODO: input arguments at run time, use minibuffer to query all arguments (error - "Argumented macro cannot be evaluated without passing any parameter.")) + "Argumented macro cannot be evaluated without passing any parameter")) (defun hif-stringify (a) "Stringify a number, string or symbol." @@ -881,11 +885,11 @@ (intern str))) (defun hif-token-concat (a b) - "Concatenate two tokens into a longer token, currently support only simple -token concatenation. Also support weird (but valid) token concatenation like -'>' ## '>' becomes '>>'. Here we take care only those that can be evaluated -during preprocessing time and ignore all those that can only be evaluated at -C(++) runtime (like '++', '--' and '+='...)." + "Concatenate two tokens into a longer token. +Currently support only simple token concatenation. Also support weird (but +valid) token concatenation like '>' ## '>' becomes '>>'. Here we take care only +those that can be evaluated during preprocessing time and ignore all those that +can only be evaluated at C(++) runtime (like '++', '--' and '+='...)." (if (or (memq a hif-valid-token-list) (memq b hif-valid-token-list)) (let* ((ra (car (rassq a hif-token-alist))) @@ -895,7 +899,7 @@ (or result ;;(error "Invalid token to concatenate") (error "Concatenating \"%s\" and \"%s\" does not give a valid \ -preprocessing token." +preprocessing token" (or ra (symbol-name a)) (or rb (symbol-name b))))) (intern-safe (concat (hif-stringify a) @@ -955,7 +959,7 @@ (defun hif-comma (&rest expr) - "Evaluate a list of expr, return the result of the last item." + "Evaluate a list of EXPR, return the result of the last item." (let ((result nil)) (dolist (e expr) (ignore-errors @@ -963,8 +967,7 @@ result)) (defun hif-token-stringification (l) - "Scan token list for 'hif-stringify' ('#') token and stringify the next -token." + "Scan token list for `hif-stringify' ('#') token and stringify the next token." (let (result) (while l (push (if (eq (car l) 'hif-stringify) @@ -979,8 +982,7 @@ (nreverse result))) (defun hif-token-concatenation (l) - "Scan token list for 'hif-token-concat' ('##') token and concatenate two -tokens." + "Scan token list for `hif-token-concat' ('##') token and concatenate two tokens." (let ((prev nil) result) (while l @@ -1014,7 +1016,6 @@ (cddr SA))) (formal-parms (and macro (car macro))) (macro-body (and macro (cadr macro))) - (hide-ifdef-local-env nil) ; dynamic binding local table actual-count formal-count actual @@ -1023,10 +1024,10 @@ (when (and actual-parms formal-parms macro-body) ;; For each actual parameter, evaluate each one and associate it - ;; with the associated actual parameter, put it into local table and finally + ;; with an actual parameter, put it into local table and finally ;; evaluate the macro body. (if (setq etc (eq (car formal-parms) 'hif-etc)) - ;; Take care of 'hif-etc first. Prefix 'hif-comma back if needed. + ;; Take care of `hif-etc' first. Prefix `hif-comma' back if needed. (setq formal-parms (cdr formal-parms))) (setq formal-count (length formal-parms) actual-count (length actual-parms)) @@ -1037,9 +1038,9 @@ (or etc (error "Too many parameters for macro %S" macro-name)))) - ;; Perform token replacement on the macro-body on the parameters + ;; Perform token replacement on the MACRO-BODY with the parameters (while (setq formal (pop formal-parms)) - ;; Prevent repetitive substitutation, thus cannot use 'subst' + ;; Prevent repetitive substitutation, thus cannot use `subst' ;; for example: ;; #define mac(a,b) (a+b) ;; #define testmac mac(b,y) @@ -1051,7 +1052,7 @@ ;; 2. formal parm #2 'b' replaced by actual parm 'y', thus (b+b) ;; becomes (y+y). (setq macro-body - ;; Unlike 'subst', 'substitute' replace only the top level + ;; Unlike `subst', `substitute' replace only the top level ;; instead of the whole tree; more importantly, it's not ;; destructive. (substitute (if (and etc (null formal-parms)) @@ -1067,8 +1068,7 @@ (hif-token-concatenation (hif-token-stringification macro-body))))) (defun hif-invoke (macro-name actual-parms) - "Invoke a macro by first expanding it, then reparse the macro-body, -finally invoke the macro." + "Invoke a macro by expanding it, reparse macro-body and finally invoke it." ;; Reparse the macro body and evaluate it (funcall hide-ifdef-evaluator (hif-parse-exp @@ -1078,7 +1078,7 @@ ;;;----------- end of parser ----------------------- -(defun hif-canonicalize-tokens (regexp) ;; for debugging +(defun hif-canonicalize-tokens (regexp) ; For debugging "Return the expanded result of the scanned tokens." (save-excursion (re-search-forward regexp) @@ -1096,8 +1096,8 @@ tokens))) (defun hif-canonicalize (regexp) - "When at beginning of `regexp' (i.e. #ifX), return a Lisp expression for -its condition." + "Return a Lisp expression for its condition by scanning current buffer. +Do this when cursor is at the beginning of `regexp' (i.e. #ifX)." (let ((case-fold-search nil)) (save-excursion (re-search-forward regexp) @@ -1105,7 +1105,7 @@ (defined (string-match hif-ifxdef-regexp curr-regexp)) (negate (and defined (string= (match-string 2 curr-regexp) "n"))) - (hif-simple-token-only nil) ;; Dynamic binding for `hif-tokenize' + (hif-simple-token-only nil) ; Dynamic binding for `hif-tokenize' (tokens (hif-tokenize (point) (progn (hif-end-of-line) (point))))) (if defined @@ -1139,8 +1139,8 @@ (beginning-of-line))) -(defun hif-looking-at-ifX () ;; Should eventually see #if - (looking-at hif-ifx-regexp)) +(defun hif-looking-at-ifX () + (looking-at hif-ifx-regexp)) ; Should eventually see #if (defun hif-looking-at-endif () (looking-at hif-endif-regexp)) (defun hif-looking-at-else () @@ -1155,12 +1155,12 @@ ;; (message "hif-ifdef-to-endif at %d" (point)) (sit-for 1) (hif-find-next-relevant) (cond ((hif-looking-at-ifX) - (hif-ifdef-to-endif) ; find endif of nested if - (hif-ifdef-to-endif)) ; find outer endif or else + (hif-ifdef-to-endif) ; Find endif of nested if + (hif-ifdef-to-endif)) ; Find outer endif or else ((hif-looking-at-elif) (hif-ifdef-to-endif)) ((hif-looking-at-else) - (hif-ifdef-to-endif)) ; find endif following else + (hif-ifdef-to-endif)) ; Find endif following else ((hif-looking-at-endif) 'done) (t @@ -1328,10 +1328,11 @@ (hif-make-range start end else)))) -;;; A bit slimy. +;; A bit slimy. (defun hif-hide-line (point) - "Hide the line containing point. Does nothing if `hide-ifdef-lines' is nil." + "Hide the line containing point. +Does nothing if `hide-ifdef-lines' is nil." (when hide-ifdef-lines (save-excursion (goto-char point) @@ -1404,13 +1405,13 @@ (end-of-line))) (defun hif-parse-macro-arglist (str) - "Parse argument list formatted as '( arg1 [ , argn] [...] )', including -the '...'. Return a list of the arguments, if '...' exists the first arg -will be hif-etc." - (let* ((hif-simple-token-only nil) ;; Dynamic binding var for `hif-tokenize' + "Parse argument list formatted as '( arg1 [ , argn] [...] )'. +The '...' is also included. Return a list of the arguments, if '...' exists the +first arg will be `hif-etc'." + (let* ((hif-simple-token-only nil) ; Dynamic binding var for `hif-tokenize' (tokenlist (cdr (hif-tokenize - (- (point) (length str)) (point)))) ; remove hif-lparen + (- (point) (length str)) (point)))) ; Remove `hif-lparen' etc result token) (while (not (eq (setq token (pop tokenlist)) 'hif-rparen)) (cond @@ -1462,7 +1463,7 @@ (name (and (re-search-forward hif-macroref-regexp max t) (match-string 1))) (parsed nil) - (parmlist (and (match-string 3) ;; First arg id found + (parmlist (and (match-string 3) ; First arg id found (hif-parse-macro-arglist (match-string 2))))) (if defining ;; Ignore name (still need to return 't), or define the name @@ -1472,7 +1473,7 @@ (let* ((start (point)) (end (progn (hif-end-of-line) (point))) - (hif-simple-token-only nil) ;; Dynamic binding + (hif-simple-token-only nil) ; Dynamic binding (tokens (and name ;; `hif-simple-token-only' is set/clear @@ -1516,7 +1517,7 @@ (defun hif-add-new-defines (&optional min max) - "Scan and add all #define macros between MIN and MAX" + "Scan and add all #define macros between MIN and MAX." (interactive) (save-excursion (save-restriction @@ -1596,13 +1597,6 @@ (setq hide-ifdef-env (delete (assoc var hide-ifdef-env) hide-ifdef-env))) -;;(defun hide-ifdef-undef (var) -;; "Undefine a VAR so that #ifdef VAR would not be included." -;; (interactive "SUndefine what? ") -;; ;;(hif-set-var var nil);;Luke fixed: set it nil is still considered -;; ;;defined so #ifdef VAR is still true. -;; (hif-undefine-symbol var) -;; (if hide-ifdef-hiding (hide-ifdefs))) (defun hide-ifdef-undef (start end) "Undefine a VAR so that #ifdef VAR would not be included." ------------------------------------------------------------ revno: 117420 fixes bug: http://debbugs.gnu.org/2151 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-06-26 20:41:23 -0400 message: Replace BOOTSTRAPEMACS with an order-only dependence on bootstrap-emacs * Makefile.in (src): No more need to pass BOOTSTRAPEMACS. * src/Makefile.in (.el.elc): Replace suffix rule with pattern rule. (%.elc): New pattern rule, with order-only prerequisite. ($(lisp)): No more need to depend on BOOTSTRAPEMACS. ($(lispsource)/loaddefs.el): Use an order-only prerequisite in place of BOOTSTRAPEMACS. diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-27 00:36:06 +0000 +++ ChangeLog 2014-06-27 00:41:23 +0000 @@ -1,5 +1,7 @@ 2014-06-27 Glenn Morris + * Makefile.in (src): No more need to pass BOOTSTRAPEMACS. + * make-dist: Exclude test/automated/*.log. 2014-06-26 Glenn Morris === modified file 'Makefile.in' --- Makefile.in 2014-06-26 05:47:10 +0000 +++ Makefile.in 2014-06-27 00:41:23 +0000 @@ -368,16 +368,6 @@ lib lib-src lisp nt: Makefile $(MAKE) -C $@ all -# Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which -# is either set to bootstrap-emacs (in case bootstrap-emacs has not been -# constructed yet) or the empty string (otherwise). -# src/Makefile.in uses it to implement conditional dependencies, so that -# files that need bootstrap-emacs to be built do not additionally need -# to be kept fresher than bootstrap-emacs. Otherwise changing a single -# file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling -# all preloaded elisp files, and only then dump the actual src/emacs, which -# is not wrong, but is overkill in 99.99% of the cases. -# # Note the use of single quotes in the value of vcswitness. # This passes an unexpanded $srcdir to src's Makefile, which then # expands it using its own value of srcdir (which points to the @@ -386,10 +376,7 @@ dirstate='.bzr/checkout/dirstate'; \ vcswitness='$$(srcdir)/../'$$dirstate; \ [ -r "$(srcdir)/$$dirstate" ] || vcswitness=''; \ - cd $@ || exit; \ - boot=bootstrap-emacs$(EXEEXT); \ - [ ! -x "$$boot" ] || boot=''; \ - $(MAKE) all BOOTSTRAPEMACS="$$boot" VCSWITNESS="$$vcswitness" + $(MAKE) -C $@ all VCSWITNESS="$$vcswitness" blessmail: Makefile src $(MAKE) -C lib-src maybe-blessmail === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-26 07:13:13 +0000 +++ src/ChangeLog 2014-06-27 00:41:23 +0000 @@ -1,3 +1,13 @@ +2014-06-27 Glenn Morris + + * Makefile.in: Replace BOOTSTRAPEMACS sleight-of-hand + with an order-only dependence on bootstrap-emacs. (Bug#2151) + (.el.elc): Replace suffix rule with pattern rule. + (%.elc): New pattern rule, with order-only prerequisite. + ($(lisp)): No more need to depend on BOOTSTRAPEMACS. + ($(lispsource)/loaddefs.el): Use an order-only prerequisite + in place of BOOTSTRAPEMACS. + 2014-06-26 Dmitry Antipov * fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE. === modified file 'src/Makefile.in' --- src/Makefile.in 2014-06-16 22:38:17 +0000 +++ src/Makefile.in 2014-06-27 00:41:23 +0000 @@ -1,7 +1,7 @@ ### @configure_input@ -# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 Free Software -# Foundation, Inc. +# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 +# Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -594,40 +594,28 @@ ## such as loaddefs.el or *.elc can typically be produced by any old ## Emacs executable, so we would like to avoid rebuilding them whenever ## we build a new Emacs executable. +## +## (In other words, changing a single file src/foo.c would force +## dumping a new bootstrap-emacs, then re-byte-compiling all preloaded +## elisp files, and only then dump the actual src/emacs, which is not +## wrong, but is overkill in 99.99% of the cases.) +## ## To solve the circularity, we use 2 different Emacs executables, ## "emacs" is the main target and "bootstrap-emacs" is the one used ## to build the *.elc and loaddefs.el files. -## To solve the freshness issue, we used to use a third file "witness-emacs" -## which was used to witness the fact that there is a bootstrap-emacs -## executable, and then have dependencies on witness-emacs rather than -## bootstrap-emacs, but that lead to problems in parallel builds (because -## witness-emacs needed to be free from dependencies (to avoid rebuilding -## it), so it was compiled in parallel, leading typically to having 2 -## processes dumping bootstrap-emacs at the same time). -## So instead, we replace the witness-emacs dependencies by conditional -## bootstrap-dependencies (via $(BOOTSTRAPEMACS)). Of course, since we do -## not want to rely on GNU Make features, we have to rely on an external -## script to do the conditional part of the dependency -## (i.e. see the $(SUBDIR) rule ../Makefile.in). - -.SUFFIXES: .elc .el - -## These suffix rules do not allow additional dependencies, sadly, so -## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it -## separately below. -## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" -.el.elc: +## To solve the freshness issue, in the past we tried various clever tricks, +## but now that we require GNU make, we can simply specify +## bootstrap-emacs$(EXEEXT) as an order-only prerequisite. + +%.elc: %.el | bootstrap-emacs$(EXEEXT) @$(MAKE) -C ../lisp compile-onefile THEFILE=$< EMACS="$(bootstrap_exe)" -## Since the .el.elc rule cannot specify an extra dependency, we do it here. -$(lisp): $(BOOTSTRAPEMACS) - ## VCSWITNESS points to the file that holds info about the current checkout. ## We use it as a heuristic to decide when to rebuild loaddefs.el. ## If empty it is ignored; the parent makefile can set it to some other value. VCSWITNESS = -$(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS) +$(lispsource)/loaddefs.el: $(VCSWITNESS) | bootstrap-emacs$(EXEEXT) $(MAKE) -C ../lisp autoloads EMACS="$(bootstrap_exe)" ## Dump an Emacs executable named bootstrap-emacs containing the ------------------------------------------------------------ revno: 117419 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-06-26 20:36:06 -0400 message: * make-dist: Exclude test/automated/*.log. diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-26 05:47:10 +0000 +++ ChangeLog 2014-06-27 00:36:06 +0000 @@ -1,3 +1,7 @@ +2014-06-27 Glenn Morris + + * make-dist: Exclude test/automated/*.log. + 2014-06-26 Glenn Morris * Makefile.in (mostlyclean, clean): Maybe clean test/automated. === modified file 'make-dist' --- make-dist 2014-04-11 06:43:20 +0000 +++ make-dist 2014-06-27 00:36:06 +0000 @@ -1,8 +1,7 @@ #!/bin/sh ### make-dist: create an Emacs distribution tar file from current srcdir -## Copyright (C) 1995, 1997-1998, 2000-2014 Free Software Foundation, -## Inc. +## Copyright (C) 1995, 1997-1998, 2000-2014 Free Software Foundation, Inc. ## This file is part of GNU Emacs. @@ -461,6 +460,7 @@ echo "Making links to \`test' and its subdirectories" for f in `find test -type f`; do case $f in + test/automated/*.log) continue ;; test/automated/flymake/warnpred/a.out) continue ;; test/automated/Makefile) continue ;; esac ------------------------------------------------------------ revno: 117418 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-06-26 17:51:25 -0400 message: * lisp/Makefile.in (update-authors): Update for moved authors.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-26 14:21:46 +0000 +++ lisp/ChangeLog 2014-06-26 21:51:25 +0000 @@ -1,3 +1,7 @@ +2014-06-26 Glenn Morris + + * Makefile.in (update-authors): Update for moved authors.el. + 2014-06-26 Leo Liu * skeleton.el (skeleton-end-hook): Default to nil and move the === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2014-06-25 23:51:10 +0000 +++ lisp/Makefile.in 2014-06-26 21:51:25 +0000 @@ -238,7 +238,8 @@ # Update the AUTHORS file. update-authors: - $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir) + $(emacs) -L "$(top_srcdir)/admin" -l authors \ + -f batch-update-authors "$(top_srcdir)/etc/AUTHORS" "$(top_srcdir)" ETAGS = ../lib-src/etags ------------------------------------------------------------ revno: 117417 fixes bug: http://debbugs.gnu.org/17850 committer: Leo Liu branch nick: trunk timestamp: Thu 2014-06-26 22:21:46 +0800 message: * skeleton.el (skeleton-end-hook): Default to nil and move the work to skeleton-insert. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-26 07:13:13 +0000 +++ lisp/ChangeLog 2014-06-26 14:21:46 +0000 @@ -1,3 +1,8 @@ +2014-06-26 Leo Liu + + * skeleton.el (skeleton-end-hook): Default to nil and move the + work to skeleton-insert. (Bug#17850) + 2014-06-26 Dmitry Antipov * calc/calc-alg.el (math-beforep): === modified file 'lisp/skeleton.el' --- lisp/skeleton.el 2014-06-24 07:15:26 +0000 +++ lisp/skeleton.el 2014-06-26 14:21:46 +0000 @@ -62,12 +62,8 @@ "If non-nil, make sure that the skeleton inserted ends with a newline. This just influences the way the default `skeleton-end-hook' behaves.") -(defvar skeleton-end-hook - (lambda () - (or (eolp) (not skeleton-end-newline) (newline-and-indent))) +(defvar skeleton-end-hook nil "Hook called at end of skeleton but before going to point of interest. -By default this moves out anything following to next line, - unless `skeleton-end-newline' is set to nil. The variables `v1' and `v2' are still set when calling this.") @@ -268,6 +264,7 @@ (mapcar #'car skeleton-further-elements) (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements) (skeleton-internal-list skeleton str)) + (or (eolp) (not skeleton-end-newline) (newline-and-indent)) (run-hooks 'skeleton-end-hook) (sit-for 0) (or (pos-visible-in-window-p beg) ------------------------------------------------------------ revno: 117416 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-06-26 00:34:09 -0700 message: * test/automated/package-x-test.el: Do not mess with load-path. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-06-26 07:32:16 +0000 +++ test/ChangeLog 2014-06-26 07:34:09 +0000 @@ -1,5 +1,7 @@ 2014-06-26 Glenn Morris + * automated/package-x-test.el: Do not mess with load-path. + * automated/Makefile.in (%.log): If error, dump log to stdout. 2014-06-26 Stefan Monnier === modified file 'test/automated/package-x-test.el' --- test/automated/package-x-test.el 2014-01-01 07:43:34 +0000 +++ test/automated/package-x-test.el 2014-06-26 07:34:09 +0000 @@ -22,27 +22,12 @@ ;;; Commentary: -;; You may want to run this from a separate Emacs instance from your -;; main one, because a bug in the code below could mess with your -;; installed packages. - -;; Run this in a clean Emacs session using: -;; -;; $ emacs -Q --batch -L . -l package-x-test.el -f ert-run-tests-batch-and-exit - ;;; Code: (require 'package-x) (require 'ert) (require 'cl-lib) -(eval-when-compile (require 'package-test)) - -;; package-test is not normally in `load-path', so temporarily set -;; `load-path' to contain the current directory. -(let ((load-path (append (list (file-name-directory (or load-file-name - buffer-file-name))) - load-path))) - (require 'package-test)) +(require 'package-test) (defvar package-x-test--single-archive-entry-1-3 (cons 'simple-single