Merge from emacs-24; up to 2012-12-14T15:22:24Z!monnier@iro.umontreal.ca

This commit is contained in:
Glenn Morris 2013-02-06 22:23:54 -08:00
commit 8c4b24b2ab
8 changed files with 257 additions and 215 deletions

View file

@ -1,3 +1,23 @@
2013-02-07 Glenn Morris <rgm@gnu.org>
* cl.texi (Equality Predicates): Mention memql.
2013-02-07 Eric Ludlam <zappo@gnu.org>
* doc/misc/ede.texi (Creating a project): Make ede-new doc less
specific, and only about items it supports, indicating that there
might be more. Remove refs to simple project and direct automake
from ede new.
(Simple projects): Re-write to not talk about ede-simple-project
which is deprecated, and instead use the term to mean projects
that don't do much management, just project wrapping. Add
ede-generic-project link.
(ede-generic-project): New node (bug#11441).
2013-02-07 Glenn Morris <rgm@gnu.org>
* cl.texi (Equality Predicates): Fix eq/eql pedantry.
2013-02-01 Glenn Morris <rgm@gnu.org> 2013-02-01 Glenn Morris <rgm@gnu.org>
* calc.texi (Help Commands): Update calc-view-news description. * calc.texi (Help Commands): Update calc-view-news description.

View file

@ -817,8 +817,9 @@ not compare strings against vectors of integers.
Also note that the Common Lisp functions @code{member} and @code{assoc} Also note that the Common Lisp functions @code{member} and @code{assoc}
use @code{eql} to compare elements, whereas Emacs Lisp follows the use @code{eql} to compare elements, whereas Emacs Lisp follows the
MacLisp tradition and uses @code{equal} for these two functions. MacLisp tradition and uses @code{equal} for these two functions.
In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or The functions @code{cl-member} and @code{cl-assoc} use @code{eql},
@code{cl-assoc}) to get functions which use @code{eql} for comparisons. as in Common Lisp. The standard Emacs Lisp functions @code{memq} and
@code{assq} use @code{eq}, and the standard @code{memql} uses @code{eql}.
@node Control Structure @node Control Structure
@chapter Control Structure @chapter Control Structure

View file

@ -450,9 +450,11 @@ ede-new}, or click on the @samp{Create Project} item in the
The @command{ede-new} command prompts for the type of project you The @command{ede-new} command prompts for the type of project you
would like to create. Each project type has its own benefits or would like to create. Each project type has its own benefits or
language specific enhancements. @ede{} supports four different language specific enhancements. Not all projects that @ede{} supports
project types: @samp{Make}, @samp{Automake}, @samp{direct Automake}, also allow creating a new project. Projects such as @code{emacs}
and @samp{Simple}. or @code{linux} are designed to recognize existing projects only.
Project types such as @samp{Make} and @samp{Automake} do support
creating new project types with @command{ede-new}.
@itemize @itemize
@item @item
@ -468,21 +470,6 @@ Unlike a @samp{Make} project, this project autogenerates a
@file{Makefile.am} file. @ede{} handles the Automake bootstrapping @file{Makefile.am} file. @ede{} handles the Automake bootstrapping
routines, which import and maintain a @file{configure.am} script and routines, which import and maintain a @file{configure.am} script and
other required files. other required files.
@item
For the @samp{direct Automake} project type, @ede{} reads directly
from the Automake files.
You cannot create direct Automake projects with the @command{ede-new}
command. Instead, when you visit a project with existing Automake
files, @ede{} automatically detects them.
@item
The @samp{Simple} project type provides light-weight constructs for
identifying a project root and looking up files. If you already have
a non-@ede{} project infrastructure, you can use a @samp{Simple}
project to provide other Emacs packages, such as Semantic, with some
information about the project. @xref{Simple projects}.
@end itemize @end itemize
A subproject is merely a project in a subdirectory of another project. A subproject is merely a project in a subdirectory of another project.
@ -795,24 +782,19 @@ able to find your SDK and compile your programs.
@node Simple projects @node Simple projects
@section Simple Projects @section Simple Projects
There is a wide array of Simple projects. The root for simple There is a wide array of simple projects. In this case a simple
projects is the class @code{ede-simple-project}. This handles the project is one that detects, or is directed to identify a directory as
infrastructure of storing a .ede file if needed. belonging to a project, but doesn't provide many features of a typical
@ede{} project. Having the project however allows tools such as
@semantic{} to find sources and perform project level completions.
The class @code{ede-simple-project} is designed to be subclassed.
Then key @ede{} methods can be overridden to provide a quick wrapper
over any project.
A second project type is @code{ede-cpp-root}. This project type is
designed to be created for a directory hierarchy full of C/C++ code.
It can be configured with minimal lisp knowledge to do header file
lookup for @semantic{}, improving code completion performance.
@menu @menu
* ede-cpp-root:: This project marks the root of a C/C++ code project. * ede-cpp-root:: This project marks the root of a C/C++ code project.
* ede-java-root:: This project marks the root of a Java project. * ede-java-root:: This project marks the root of a Java project.
* ede-emacs:: A project for working with Emacs. * ede-emacs:: A project for working with Emacs.
* ede-linux:: A project for working with Linux kernels. * ede-linux:: A project for working with Linux kernels.
* ede-generic-project:: A project type for wrapping build systems with EDE.
* Custom Locate:: Customizing how to locate files in a simple project * Custom Locate:: Customizing how to locate files in a simple project
@end menu @end menu
@ -1045,7 +1027,7 @@ tree, and enables EDE project mode for it.
It pre-populates the C Preprocessor symbol map for correct parsing, It pre-populates the C Preprocessor symbol map for correct parsing,
and has an optimized include file identification function. and has an optimized include file identification function.
@node ede-linux, Custom Locate, ede-emacs, Simple projects @node ede-linux, ede-generic-project, ede-emacs, Simple projects
@subsection ede-linux @subsection ede-linux
The @code{ede-linux} project will automatically identify a Linux The @code{ede-linux} project will automatically identify a Linux
@ -1054,7 +1036,60 @@ Kernel source tree, and enable EDE project mode for it.
It pre-populates the C Preprocessor symbol map for reasonable parsing, It pre-populates the C Preprocessor symbol map for reasonable parsing,
and has an optimized include file identification function. and has an optimized include file identification function.
@node Custom Locate, , ede-linux, Simple projects @node ede-generic-project, Custom Locate, ede-linux, Simple projects
@subsection ede-generic-project
The @code{ede-generic-project} is a project system that makes it easy
to wrap up different kinds of build systems as an EDE project.
Projects such as @ref{ede-emacs} require coding skills to create.
Generic projects also require writing Emacs Lisp code, but the
requirements are minimal. You can then use
@command{customize-project} to configure build commands, includes, and
other options for that project. The configuration is saved in
@file{EDEConfig.el}.
Generic projects are disabled by default because they have the
potential to interfere with other projects. To use the generic
project sytem to start detecting projects, you need to enable it.
@deffn Command ede-enable-generic-projects
Enable generic project loaders.
This enables generic loaders for projects that are detected using
either a @file{Makefile}, @file{SConstruct}, or @file{CMakeLists}.
You do not need to use this command if you create your own generic
project type.
@end deffn
If you want to create your own generic project loader, you need to
define your own project and target classes, and create an autoloader.
The example for Makefiles looks like this:
@example
;;; MAKEFILE
(defclass ede-generic-makefile-project (ede-generic-project)
((buildfile :initform "Makefile")
)
"Generic Project for makefiles.")
(defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config)
"Setup a configuration for Make."
(oset config build-command "make -k")
(oset config debug-command "gdb ")
)
(ede-generic-new-autoloader "generic-makefile" "Make"
"Makefile" 'ede-generic-makefile-project)
@end example
This example project will detect any directory with the file
@file{Makefile} in it as belonging to this project type.
Customization of the project will allow you to make build and debug
commands more precise.
@node Custom Locate, , ede-generic-project, Simple projects
@subsection Custom Locate @subsection Custom Locate
The various simple project styles all have one major drawback, which The various simple project styles all have one major drawback, which
@ -1062,8 +1097,6 @@ is that the files in the project are not completely known to EDE@.
When the EDE API is used to try and file files by some reference name When the EDE API is used to try and file files by some reference name
in the project, then that could fail. in the project, then that could fail.
@@TODO - Add ID Utils and CScope examples
@ede{} can therefore use some external locate commands, such as the unix @ede{} can therefore use some external locate commands, such as the unix
``locate'' command, or ``GNU Global''. ``locate'' command, or ``GNU Global''.
@ -1093,6 +1126,11 @@ You can add your own locate tool but subclassing from
methods. See the code in @file{ede-locate.el} for GNU Global as a methods. See the code in @file{ede-locate.el} for GNU Global as a
simple example. simple example.
@@TODO - Add ID Utils and CScope examples
More on idutils and cscope is in the CEDET manual, and they each have
their own section.
@node Extending EDE, GNU Free Documentation License, Miscellaneous commands, Top @node Extending EDE, GNU Free Documentation License, Miscellaneous commands, Top
@chapter Extending @ede{} @chapter Extending @ede{}

View file

@ -1,3 +1,22 @@
2013-02-07 Alan Mackenzie <acm@muc.de>
Fix bug in state cache mechanism. Remove 'BOD "strategy". Refactor.
* progmodes/cc-engine.el (c-get-fallback-scan-pos): Remove.
(c-parse-state-get-strategy): Don't return 'BOD any more.
(c-append-lower-brace-pair-to-state-cache):
Extra parameter HERE instead of narrowing.
Widen to top of buffer before searching backwards for a brace pair.
(c-state-push-any-brace-pair): Add HERE parameter to function call.
(c-append-to-state-cache): Extra parameter HERE in place of narrowing.
Narrow to parameter HERE, in place of being called narrowed.
(c-remove-stale-state-cache): Extra parameter HERE in place of
narrowing. Check there's an open brace in the cache before
searching for its match.
(c-invalidate-state-cache-1): Add HERE parameter to function call.
(c-parse-state-1): Don't narrow here for 'forward strategy,
instead passing extra parameter HERE to several functions.
Remove 'BOD strategy.
2013-02-06 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change) 2013-02-06 Nicolas Richard <theonewiththeevillook@yahoo.fr> (tiny change)
* emacs-lisp/package.el (describe-package-1): Tell what archive is * emacs-lisp/package.el (describe-package-1): Tell what archive is

View file

@ -1,3 +1,8 @@
2013-02-07 Gábor Vida <gabor.v.vida@ericsson.com> (tiny change)
* auth-source.el (auth-source-format-prompt): Don't get confused by
any "\" in replacement text. (Bug#13637)
2013-01-30 Christopher Schmidt <christopher@ch.ristopher.com> 2013-01-30 Christopher Schmidt <christopher@ch.ristopher.com>
* gnus-int.el (gnus-backend-trace-elapsed): New variable. * gnus-int.el (gnus-backend-trace-elapsed): New variable.

View file

@ -913,7 +913,7 @@ while \(:host t) would find all host entries."
(when (and c v) (when (and c v)
(setq prompt (replace-regexp-in-string (format "%%%c" c) (setq prompt (replace-regexp-in-string (format "%%%c" c)
(format "%s" v) (format "%s" v)
prompt))))) prompt nil t)))))
prompt) prompt)
(defun auth-source-ensure-strings (values) (defun auth-source-ensure-strings (values)

View file

@ -2477,20 +2477,6 @@ comment at the start of cc-engine.el for more info."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Defuns which analyze the buffer, yet don't change `c-state-cache'. ;; Defuns which analyze the buffer, yet don't change `c-state-cache'.
(defun c-get-fallback-scan-pos (here)
;; Return a start position for building `c-state-cache' from
;; scratch. This will be at the top level, 2 defuns back.
(save-excursion
;; Go back 2 bods, but ignore any bogus positions returned by
;; beginning-of-defun (i.e. open paren in column zero).
(goto-char here)
(let ((cnt 2))
(while (not (or (bobp) (zerop cnt)))
(c-beginning-of-defun-1) ; Pure elisp BOD.
(if (eq (char-after) ?\{)
(setq cnt (1- cnt)))))
(point)))
(defun c-state-balance-parens-backwards (here- here+ top) (defun c-state-balance-parens-backwards (here- here+ top)
;; Return the position of the opening paren/brace/bracket before HERE- which ;; Return the position of the opening paren/brace/bracket before HERE- which
;; matches the outermost close p/b/b between HERE+ and TOP. Except when ;; matches the outermost close p/b/b between HERE+ and TOP. Except when
@ -2548,47 +2534,23 @@ comment at the start of cc-engine.el for more info."
;; o - ('forward START-POINT) - scan forward from START-POINT, ;; o - ('forward START-POINT) - scan forward from START-POINT,
;; which is not less than the highest position in `c-state-cache' below here. ;; which is not less than the highest position in `c-state-cache' below here.
;; o - ('backward nil) - scan backwards (from HERE). ;; o - ('backward nil) - scan backwards (from HERE).
;; o - ('BOD START-POINT) - scan forwards from START-POINT, which is at the
;; top level.
;; o - ('IN-LIT nil) - point is inside the literal containing point-min. ;; o - ('IN-LIT nil) - point is inside the literal containing point-min.
(let ((cache-pos (c-get-cache-scan-pos here)) ; highest position below HERE in cache (or 1) (let ((cache-pos (c-get-cache-scan-pos here)) ; highest position below HERE in cache (or 1)
BOD-pos ; position of 2nd BOD before HERE. strategy ; 'forward, 'backward, or 'IN-LIT.
strategy ; 'forward, 'backward, 'BOD, or 'IN-LIT. start-point)
start-point
how-far) ; putative scanning distance.
(setq good-pos (or good-pos (c-state-get-min-scan-pos))) (setq good-pos (or good-pos (c-state-get-min-scan-pos)))
(cond (cond
((< here (c-state-get-min-scan-pos)) ((< here (c-state-get-min-scan-pos))
(setq strategy 'IN-LIT (setq strategy 'IN-LIT))
start-point nil
cache-pos nil
how-far 0))
((<= good-pos here) ((<= good-pos here)
(setq strategy 'forward (setq strategy 'forward
start-point (max good-pos cache-pos) start-point (max good-pos cache-pos)))
how-far (- here start-point)))
((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of weighting. ((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of weighting.
(setq strategy 'backward (setq strategy 'backward))
how-far (- good-pos here)))
(t (t
(setq strategy 'forward (setq strategy 'forward
how-far (- here cache-pos) start-point cache-pos)))
start-point cache-pos))) (list strategy (and (eq strategy 'forward) start-point))))
;; Might we be better off starting from the top level, two defuns back,
;; instead? This heuristic no longer works well in C++, where
;; declarations inside namespace brace blocks are frequently placed at
;; column zero.
(when (and (not (c-major-mode-is 'c++-mode))
(> how-far c-state-cache-too-far))
(setq BOD-pos (c-get-fallback-scan-pos here)) ; somewhat EXPENSIVE!!!
(if (< (- here BOD-pos) how-far)
(setq strategy 'BOD
start-point BOD-pos)))
(list
strategy
(and (memq strategy '(forward BOD)) start-point))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2630,7 +2592,7 @@ comment at the start of cc-engine.el for more info."
(setq c-state-point-min (point-min))) (setq c-state-point-min (point-min)))
(defun c-append-lower-brace-pair-to-state-cache (from &optional upper-lim) (defun c-append-lower-brace-pair-to-state-cache (from here &optional upper-lim)
;; If there is a brace pair preceding FROM in the buffer, at the same level ;; If there is a brace pair preceding FROM in the buffer, at the same level
;; of nesting (not necessarily immediately preceding), push a cons onto ;; of nesting (not necessarily immediately preceding), push a cons onto
;; `c-state-cache' to represent it. FROM must not be inside a literal. If ;; `c-state-cache' to represent it. FROM must not be inside a literal. If
@ -2654,8 +2616,7 @@ comment at the start of cc-engine.el for more info."
;; reduce the time wasted in repeated fruitless searches in brace deserts. ;; reduce the time wasted in repeated fruitless searches in brace deserts.
(save-excursion (save-excursion
(save-restriction (save-restriction
(let* ((here (point-max)) (let* (new-cons
new-cons
(cache-pos (c-state-cache-top-lparen)) ; might be nil. (cache-pos (c-state-cache-top-lparen)) ; might be nil.
(macro-start-or-from (macro-start-or-from
(progn (goto-char from) (progn (goto-char from)
@ -2690,7 +2651,6 @@ comment at the start of cc-engine.el for more info."
;; search bound, even though the algorithm below would skip ;; search bound, even though the algorithm below would skip
;; over the new paren pair. ;; over the new paren pair.
(cache-lim (and cache-pos (< cache-pos from) cache-pos))) (cache-lim (and cache-pos (< cache-pos from) cache-pos)))
(widen)
(narrow-to-region (narrow-to-region
(cond (cond
((and desert-lim cache-lim) ((and desert-lim cache-lim)
@ -2698,7 +2658,9 @@ comment at the start of cc-engine.el for more info."
(desert-lim) (desert-lim)
(cache-lim) (cache-lim)
((point-min))) ((point-min)))
(point-max))) ;; The top limit is EOB to ensure that `bra' is inside the
;; accessible part of the buffer at the next scan operation.
(1+ (buffer-size))))
;; In the next pair of nested loops, the inner one moves back past a ;; In the next pair of nested loops, the inner one moves back past a
;; pair of (mis-)matching parens or brackets; the outer one moves ;; pair of (mis-)matching parens or brackets; the outer one moves
@ -2765,25 +2727,24 @@ comment at the start of cc-engine.el for more info."
(if (consp (car c-state-cache)) (if (consp (car c-state-cache))
(cdr c-state-cache) (cdr c-state-cache)
c-state-cache))) c-state-cache)))
;; N.B. This defsubst codes one method for the simple, normal case, ;; N.B. This defsubst codes one method for the simple, normal case,
;; and a more sophisticated, slower way for the general case. Don't ;; and a more sophisticated, slower way for the general case. Don't
;; eliminate this defsubst - it's a speed optimization. ;; eliminate this defsubst - it's a speed optimization.
(c-append-lower-brace-pair-to-state-cache (1- bra+1))))) (c-append-lower-brace-pair-to-state-cache (1- bra+1) (point-max)))))
(defun c-append-to-state-cache (from) (defun c-append-to-state-cache (from here)
;; Scan the buffer from FROM to (point-max), adding elements into ;; Scan the buffer from FROM to HERE, adding elements into `c-state-cache'
;; `c-state-cache' for braces etc. Return a candidate for ;; for braces etc. Return a candidate for `c-state-cache-good-pos'.
;; `c-state-cache-good-pos'.
;; ;;
;; FROM must be after the latest brace/paren/bracket in `c-state-cache', if ;; FROM must be after the latest brace/paren/bracket in `c-state-cache', if
;; any. Typically, it is immediately after it. It must not be inside a ;; any. Typically, it is immediately after it. It must not be inside a
;; literal. ;; literal.
(let ((here-bol (c-point 'bol (point-max))) (let ((here-bol (c-point 'bol here))
(macro-start-or-here (macro-start-or-here
(save-excursion (goto-char (point-max)) (save-excursion (goto-char here)
(if (c-beginning-of-macro) (if (c-beginning-of-macro)
(point) (point)
(point-max)))) here)))
pa+1 ; pos just after an opening PAren (or brace). pa+1 ; pos just after an opening PAren (or brace).
(ren+1 from) ; usually a pos just after an closing paREN etc. (ren+1 from) ; usually a pos just after an closing paREN etc.
; Is actually the pos. to scan for a (/{/[ from, ; Is actually the pos. to scan for a (/{/[ from,
@ -2796,75 +2757,77 @@ comment at the start of cc-engine.el for more info."
mstart) ; start of a macro. mstart) ; start of a macro.
(save-excursion (save-excursion
;; Each time round the following loop, we enter a successively deeper (save-restriction
;; level of brace/paren nesting. (Except sometimes we "continue at (narrow-to-region (point-min) here)
;; the existing level".) `pa+1' is a pos inside an opening ;; Each time round the following loop, we enter a successively deeper
;; brace/paren/bracket, usually just after it. ;; level of brace/paren nesting. (Except sometimes we "continue at
(while ;; the existing level".) `pa+1' is a pos inside an opening
(progn ;; brace/paren/bracket, usually just after it.
;; Each time round the next loop moves forward over an opening then (while
;; a closing brace/bracket/paren. This loop is white hot, so it (progn
;; plays ugly tricks to go fast. DON'T PUT ANYTHING INTO THIS ;; Each time round the next loop moves forward over an opening then
;; LOOP WHICH ISN'T ABSOLUTELY NECESSARY!!! It terminates when a ;; a closing brace/bracket/paren. This loop is white hot, so it
;; call of `scan-lists' signals an error, which happens when there ;; plays ugly tricks to go fast. DON'T PUT ANYTHING INTO THIS
;; are no more b/b/p's to scan. ;; LOOP WHICH ISN'T ABSOLUTELY NECESSARY!!! It terminates when a
(c-safe ;; call of `scan-lists' signals an error, which happens when there
(while t ;; are no more b/b/p's to scan.
(setq pa+1 (scan-lists ren+1 1 -1) ; Into (/{/[; might signal (c-safe
paren+1s (cons pa+1 paren+1s)) (while t
(setq ren+1 (scan-lists pa+1 1 1)) ; Out of )/}/]; might signal (setq pa+1 (scan-lists ren+1 1 -1) ; Into (/{/[; might signal
(if (and (eq (char-before pa+1) ?{)) ; Check for a macro later. paren+1s (cons pa+1 paren+1s))
(setq bra+1 pa+1)) (setq ren+1 (scan-lists pa+1 1 1)) ; Out of )/}/]; might signal
(setcar paren+1s ren+1))) (if (and (eq (char-before pa+1) ?{)) ; Check for a macro later.
(setq bra+1 pa+1))
(setcar paren+1s ren+1)))
(if (and pa+1 (> pa+1 ren+1)) (if (and pa+1 (> pa+1 ren+1))
;; We've just entered a deeper nesting level. ;; We've just entered a deeper nesting level.
(progn (progn
;; Insert the brace pair (if present) and the single open ;; Insert the brace pair (if present) and the single open
;; paren/brace/bracket into `c-state-cache' It cannot be ;; paren/brace/bracket into `c-state-cache' It cannot be
;; inside a macro, except one around point, because of what ;; inside a macro, except one around point, because of what
;; `c-neutralize-syntax-in-CPP' has done. ;; `c-neutralize-syntax-in-CPP' has done.
(c-state-push-any-brace-pair bra+1 macro-start-or-here) (c-state-push-any-brace-pair bra+1 macro-start-or-here)
;; Insert the opening brace/bracket/paren position. ;; Insert the opening brace/bracket/paren position.
(setq c-state-cache (cons (1- pa+1) c-state-cache)) (setq c-state-cache (cons (1- pa+1) c-state-cache))
;; Clear admin stuff for the next more nested part of the scan. ;; Clear admin stuff for the next more nested part of the scan.
(setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil)
t) ; Carry on the loop t) ; Carry on the loop
;; All open p/b/b's at this nesting level, if any, have probably ;; All open p/b/b's at this nesting level, if any, have probably
;; been closed by matching/mismatching ones. We're probably ;; been closed by matching/mismatching ones. We're probably
;; finished - we just need to check for having found an ;; finished - we just need to check for having found an
;; unmatched )/}/], which we ignore. Such a )/}/] can't be in a ;; unmatched )/}/], which we ignore. Such a )/}/] can't be in a
;; macro, due the action of `c-neutralize-syntax-in-CPP'. ;; macro, due the action of `c-neutralize-syntax-in-CPP'.
(c-safe (setq ren+1 (scan-lists ren+1 1 1)))))) ; acts as loop control. (c-safe (setq ren+1 (scan-lists ren+1 1 1)))))) ; acts as loop control.
;; Record the final, innermost, brace-pair if there is one. ;; Record the final, innermost, brace-pair if there is one.
(c-state-push-any-brace-pair bra+1 macro-start-or-here) (c-state-push-any-brace-pair bra+1 macro-start-or-here)
;; Determine a good pos ;; Determine a good pos
(while (and (setq paren+1 (car paren+1s)) (while (and (setq paren+1 (car paren+1s))
(> (if (> paren+1 macro-start-or-here) (> (if (> paren+1 macro-start-or-here)
paren+1 paren+1
(goto-char paren+1) (goto-char paren+1)
(setq mstart (and (c-beginning-of-macro) (setq mstart (and (c-beginning-of-macro)
(point))) (point)))
(or mstart paren+1)) (or mstart paren+1))
here-bol)) here-bol))
(setq paren+1s (cdr paren+1s))) (setq paren+1s (cdr paren+1s)))
(cond (cond
((and paren+1 mstart) ((and paren+1 mstart)
(min paren+1 mstart)) (min paren+1 mstart))
(paren+1) (paren+1)
(t from))))) (t from))))))
(defun c-remove-stale-state-cache (start-point pps-point) (defun c-remove-stale-state-cache (start-point here pps-point)
;; Remove stale entries from the `c-cache-state', i.e. those which will ;; Remove stale entries from the `c-cache-state', i.e. those which will
;; not be in it when it is amended for position (point-max). ;; not be in it when it is amended for position HERE. Additionally, the
;; Additionally, the "outermost" open-brace entry before (point-max) ;; "outermost" open-brace entry before HERE will be converted to a cons if
;; will be converted to a cons if the matching close-brace is scanned. ;; the matching close-brace is scanned.
;; ;;
;; START-POINT is a "maximal" "safe position" - there must be no open ;; START-POINT is a "maximal" "safe position" - there must be no open
;; parens/braces/brackets between START-POINT and (point-max). ;; parens/braces/brackets between START-POINT and HERE.
;; ;;
;; As a second thing, calculate the result of parse-partial-sexp at ;; As a second thing, calculate the result of parse-partial-sexp at
;; PPS-POINT, w.r.t. START-POINT. The motivation here is that ;; PPS-POINT, w.r.t. START-POINT. The motivation here is that
@ -2881,23 +2844,23 @@ comment at the start of cc-engine.el for more info."
;; last element to be removed from `c-state-cache', when that elt is a ;; last element to be removed from `c-state-cache', when that elt is a
;; cons, otherwise nil. ;; cons, otherwise nil.
;; o - PPS-STATE is the parse-partial-sexp state at PPS-POINT. ;; o - PPS-STATE is the parse-partial-sexp state at PPS-POINT.
(save-restriction (save-excursion
(narrow-to-region 1 (point-max)) (save-restriction
(save-excursion (narrow-to-region 1 (point-max))
(let* ((in-macro-start ; start of macro containing (point-max) or nil. (let* ((in-macro-start ; start of macro containing HERE or nil.
(save-excursion (save-excursion
(goto-char (point-max)) (goto-char here)
(and (c-beginning-of-macro) (and (c-beginning-of-macro)
(point)))) (point))))
(start-point-actual-macro-start ; Start of macro containing (start-point-actual-macro-start ; Start of macro containing
; start-point or nil ; start-point or nil
(and (< start-point (point-max)) (and (< start-point here)
(save-excursion (save-excursion
(goto-char start-point) (goto-char start-point)
(and (c-beginning-of-macro) (and (c-beginning-of-macro)
(point))))) (point)))))
(start-point-actual-macro-end ; End of this macro, (maybe (start-point-actual-macro-end ; End of this macro, (maybe
; (point-max)), or nil. ; HERE), or nil.
(and start-point-actual-macro-start (and start-point-actual-macro-start
(save-excursion (save-excursion
(goto-char start-point-actual-macro-start) (goto-char start-point-actual-macro-start)
@ -2909,14 +2872,14 @@ comment at the start of cc-engine.el for more info."
scan-back-pos scan-back-pos
pair-beg pps-point-state target-depth) pair-beg pps-point-state target-depth)
;; Remove entries beyond (point-max). Also remove any entries inside ;; Remove entries beyond HERE. Also remove any entries inside
;; a macro, unless (point-max) is in the same macro. ;; a macro, unless HERE is in the same macro.
(setq upper-lim (setq upper-lim
(if (or (null c-state-old-cpp-beg) (if (or (null c-state-old-cpp-beg)
(and (> (point-max) c-state-old-cpp-beg) (and (> here c-state-old-cpp-beg)
(< (point-max) c-state-old-cpp-end))) (< here c-state-old-cpp-end)))
(point-max) here
(min (point-max) c-state-old-cpp-beg))) (min here c-state-old-cpp-beg)))
(while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim))
(setq scan-back-pos (car-safe (car c-state-cache))) (setq scan-back-pos (car-safe (car c-state-cache)))
(setq c-state-cache (cdr c-state-cache))) (setq c-state-cache (cdr c-state-cache)))
@ -2934,7 +2897,7 @@ comment at the start of cc-engine.el for more info."
;; time round; the corresponding elements in `c-state-cache' are ;; time round; the corresponding elements in `c-state-cache' are
;; removed. `pos' is just after the brace-pair or the open paren at ;; removed. `pos' is just after the brace-pair or the open paren at
;; (car c-state-cache). There can be no open parens/braces/brackets ;; (car c-state-cache). There can be no open parens/braces/brackets
;; between `start-point'/`start-point-actual-macro-start' and (point-max), ;; between `start-point'/`start-point-actual-macro-start' and HERE,
;; due to the interface spec to this function. ;; due to the interface spec to this function.
(setq pos (if (and start-point-actual-macro-end (setq pos (if (and start-point-actual-macro-end
(not (eq start-point-actual-macro-start (not (eq start-point-actual-macro-start
@ -2944,7 +2907,9 @@ comment at the start of cc-engine.el for more info."
start-point)) start-point))
(goto-char pos) (goto-char pos)
(while (and c-state-cache (while (and c-state-cache
(< (point) (point-max))) (or (numberp (car c-state-cache)) ; Have we a { at all?
(cdr c-state-cache))
(< (point) here))
(cond (cond
((null pps-state) ; first time through ((null pps-state) ; first time through
(setq target-depth -1)) (setq target-depth -1))
@ -2956,7 +2921,7 @@ comment at the start of cc-engine.el for more info."
;; Scan! ;; Scan!
(setq pps-state (setq pps-state
(parse-partial-sexp (parse-partial-sexp
(point) (if (< (point) pps-point) pps-point (point-max)) (point) (if (< (point) pps-point) pps-point here)
target-depth target-depth
nil pps-state)) nil pps-state))
@ -3209,7 +3174,7 @@ comment at the start of cc-engine.el for more info."
;; Do we need to add in an earlier brace pair, having lopped one off? ;; Do we need to add in an earlier brace pair, having lopped one off?
(if (and dropped-cons (if (and dropped-cons
(< too-high-pa (+ here c-state-cache-too-far))) (< too-high-pa (+ here c-state-cache-too-far)))
(c-append-lower-brace-pair-to-state-cache too-high-pa here-bol)) (c-append-lower-brace-pair-to-state-cache too-high-pa here here-bol))
(setq c-state-cache-good-pos (or (c-state-cache-after-top-paren) (setq c-state-cache-good-pos (or (c-state-cache-after-top-paren)
(c-state-get-min-scan-pos))))) (c-state-get-min-scan-pos)))))
@ -3285,47 +3250,39 @@ comment at the start of cc-engine.el for more info."
strategy (car res) strategy (car res)
start-point (cadr res)) start-point (cadr res))
(when (eq strategy 'BOD)
(setq c-state-cache nil
c-state-cache-good-pos start-point))
;; SCAN! ;; SCAN!
(save-restriction (cond
(cond ((eq strategy 'forward)
((memq strategy '(forward BOD)) (setq res (c-remove-stale-state-cache start-point here here-bopl))
(narrow-to-region (point-min) here) (setq cache-pos (car res)
(setq res (c-remove-stale-state-cache start-point here-bopl)) scan-backward-pos (cadr res)
(setq cache-pos (car res) bopl-state (car (cddr res))) ; will be nil if (< here-bopl
scan-backward-pos (cadr res)
bopl-state (car (cddr res))) ; will be nil if (< here-bopl
; start-point) ; start-point)
(if scan-backward-pos (if scan-backward-pos
(c-append-lower-brace-pair-to-state-cache scan-backward-pos)) (c-append-lower-brace-pair-to-state-cache scan-backward-pos here))
(setq good-pos (setq good-pos
(c-append-to-state-cache cache-pos)) (c-append-to-state-cache cache-pos here))
(setq c-state-cache-good-pos (setq c-state-cache-good-pos
(if (and bopl-state (if (and bopl-state
(< good-pos (- here c-state-cache-too-far))) (< good-pos (- here c-state-cache-too-far)))
(c-state-cache-non-literal-place here-bopl bopl-state) (c-state-cache-non-literal-place here-bopl bopl-state)
good-pos))) good-pos)))
((eq strategy 'backward) ((eq strategy 'backward)
(setq res (c-remove-stale-state-cache-backwards here) (setq res (c-remove-stale-state-cache-backwards here)
good-pos (car res) good-pos (car res)
scan-backward-pos (cadr res) scan-backward-pos (cadr res)
scan-forward-p (car (cddr res))) scan-forward-p (car (cddr res)))
(if scan-backward-pos (if scan-backward-pos
(c-append-lower-brace-pair-to-state-cache (c-append-lower-brace-pair-to-state-cache scan-backward-pos here))
scan-backward-pos)) (setq c-state-cache-good-pos
(setq c-state-cache-good-pos (if scan-forward-p
(if scan-forward-p (c-append-to-state-cache good-pos here)
(progn (narrow-to-region (point-min) here) good-pos)))
(c-append-to-state-cache good-pos))
good-pos)))
(t ; (eq strategy 'IN-LIT) (t ; (eq strategy 'IN-LIT)
(setq c-state-cache nil (setq c-state-cache nil
c-state-cache-good-pos nil))))) c-state-cache-good-pos nil))))
c-state-cache) c-state-cache)

View file

@ -110,12 +110,14 @@
WinZip is known to create some subtle and hard to debug problems, WinZip is known to create some subtle and hard to debug problems,
such as converting files to DOS CR-LF format, not creating empty such as converting files to DOS CR-LF format, not creating empty
directories, etc. We suggest to use djtarnt.exe from the GNU FTP directories, etc. We suggest to use djtarnt.exe from the GNU FTP
site. site. For modern formats, such as .tar.xz, we suggest bsdtar.exe
from the libarchive package; its precompiled Windows binaries are
available from this site:
In addition to this file, you should also read INSTALL.BZR in the http://sourceforge.net/projects/ezwinports/files/
parent directory, and make sure that you have a version of
"touch.exe" in your path, and that it will create files that do not In addition to this file, if you build a development snapshot, you
yet exist. should also read INSTALL.BZR in the parent directory.
* Supported development environments * Supported development environments