mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-03 08:30:09 +00:00
Merge from trunk.
This commit is contained in:
commit
dfc926249a
@ -1,3 +1,7 @@
|
||||
2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.
|
||||
|
||||
2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* configure.in: Add emacsgtkfixed.o to GTK_OBJ if HAVE_GTK3.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2011-06-15 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* text.texi (Special Properties): Clarify role of font-lock-face.
|
||||
|
||||
2011-06-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* processes.texi (Process Information): Renamed `process-alive-p'
|
||||
|
@ -3003,18 +3003,18 @@ the context.
|
||||
|
||||
@item font-lock-face
|
||||
@kindex font-lock-face @r{(text property)}
|
||||
The @code{font-lock-face} property is equivalent to the @code{face}
|
||||
property when Font Lock mode is enabled. When Font Lock mode is disabled,
|
||||
This property specifies a value for the @code{face} property that Font
|
||||
Lock mode should apply to the underlying text. It is one of the
|
||||
fontification methods used by Font Lock mode, and is useful for
|
||||
special modes that implement their own highlighting.
|
||||
@xref{Precalculated Fontification}. When Font Lock mode is disabled,
|
||||
@code{font-lock-face} has no effect.
|
||||
|
||||
The @code{font-lock-face} property is useful for special modes that
|
||||
implement their own highlighting. @xref{Precalculated Fontification}.
|
||||
|
||||
@item mouse-face
|
||||
@kindex mouse-face @r{(text property)}
|
||||
The property @code{mouse-face} is used instead of @code{face} when the
|
||||
mouse is on or near the character. For this purpose, ``near'' means
|
||||
that all text between the character and where the mouse is have the same
|
||||
This property is used instead of @code{face} when the mouse is on or
|
||||
near the character. For this purpose, ``near'' means that all text
|
||||
between the character and where the mouse is have the same
|
||||
@code{mouse-face} property value.
|
||||
|
||||
@item fontified
|
||||
|
@ -40,14 +40,15 @@
|
||||
# define FLOAT_MIN LDBL_MIN
|
||||
# define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND
|
||||
# define FTOASTR ldtoastr
|
||||
# define STRTOF strtold
|
||||
# if HAVE_C99_STRTOLD
|
||||
# define STRTOF strtold
|
||||
# endif
|
||||
#elif LENGTH == 2
|
||||
# define FLOAT double
|
||||
# define FLOAT_DIG DBL_DIG
|
||||
# define FLOAT_MIN DBL_MIN
|
||||
# define FLOAT_PREC_BOUND _GL_DBL_PREC_BOUND
|
||||
# define FTOASTR dtoastr
|
||||
# define STRTOF strtod
|
||||
#else
|
||||
# define LENGTH 1
|
||||
# define FLOAT float
|
||||
@ -55,14 +56,15 @@
|
||||
# define FLOAT_MIN FLT_MIN
|
||||
# define FLOAT_PREC_BOUND _GL_FLT_PREC_BOUND
|
||||
# define FTOASTR ftoastr
|
||||
# define STRTOF strtof
|
||||
# if HAVE_STRTOF
|
||||
# define STRTOF strtof
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* On pre-C99 hosts, approximate strtof and strtold with strtod. This
|
||||
may generate one or two extra digits, but that's better than not
|
||||
working at all. Assume that strtof works if strtold does. */
|
||||
#if LENGTH != 2 && ! HAVE_C99_STRTOLD
|
||||
# undef STRTOF
|
||||
working at all. */
|
||||
#ifndef STRTOF
|
||||
# define STRTOF strtod
|
||||
#endif
|
||||
|
||||
|
@ -461,25 +461,6 @@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
|
||||
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (fseeko);
|
||||
# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
|
||||
/* Provide an fseek function that is consistent with fseeko. */
|
||||
/* In order to avoid that fseek gets defined as a macro here, the
|
||||
developer can request the 'fseek' module. */
|
||||
# if !GNULIB_defined_fseek_function
|
||||
# undef fseek
|
||||
# define fseek rpl_fseek
|
||||
static inline int _GL_ARG_NONNULL ((1))
|
||||
rpl_fseek (FILE *fp, long offset, int whence)
|
||||
{
|
||||
# if @REPLACE_FSEEKO@
|
||||
return rpl_fseeko (fp, offset, whence);
|
||||
# else
|
||||
return fseeko (fp, offset, whence);
|
||||
# endif
|
||||
}
|
||||
# define GNULIB_defined_fseek_function 1
|
||||
# endif
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# define _GL_FSEEK_WARN /* Category 1, above. */
|
||||
# undef fseek
|
||||
@ -539,25 +520,6 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ftello);
|
||||
# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
|
||||
/* Provide an ftell function that is consistent with ftello. */
|
||||
/* In order to avoid that ftell gets defined as a macro here, the
|
||||
developer can request the 'ftell' module. */
|
||||
# if !GNULIB_defined_ftell_function
|
||||
# undef ftell
|
||||
# define ftell rpl_ftell
|
||||
static inline long _GL_ARG_NONNULL ((1))
|
||||
rpl_ftell (FILE *f)
|
||||
{
|
||||
# if @REPLACE_FTELLO@
|
||||
return rpl_ftello (f);
|
||||
# else
|
||||
return ftello (f);
|
||||
# endif
|
||||
}
|
||||
# define GNULIB_defined_ftell_function 1
|
||||
# endif
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# define _GL_FTELL_WARN /* Category 1, above. */
|
||||
# undef ftell
|
||||
|
10
lib/verify.h
10
lib/verify.h
@ -221,10 +221,18 @@ template <int w>
|
||||
contexts, e.g., the top level. */
|
||||
|
||||
/* Verify requirement R at compile-time, as an integer constant expression.
|
||||
Return 1. */
|
||||
Return 1. This is equivalent to verify_expr (R, 1).
|
||||
|
||||
verify_true is obsolescent; please use verify_expr instead. */
|
||||
|
||||
# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
|
||||
|
||||
/* Verify requirement R at compile-time. Return the value of the
|
||||
expression E. */
|
||||
|
||||
# define verify_expr(R, E) \
|
||||
(_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
|
||||
|
||||
/* Verify requirement R at compile-time, as a declaration without a
|
||||
trailing ';'. */
|
||||
|
||||
|
@ -1,6 +1,20 @@
|
||||
2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* pcmpl-rpm.el (pcomplete/rpm): Minor simplification.
|
||||
|
||||
* emacs-lisp/debug.el (debug): Don't leave the buffer in Debugger.
|
||||
|
||||
* abbrev.el (define-abbrev-table): Don't add a table multiple times.
|
||||
|
||||
2011-06-15 Alan Mackenzie <acm@muc.de>
|
||||
|
||||
* progmodes/cc-fonts.el (c-font-lock-declarations): 1: Whilst checking
|
||||
for declarators, disable knr checking to speed up for normal files.
|
||||
2: Refactor, replacing a sequence of nested if forms by a cond form.
|
||||
|
||||
2011-06-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* subr.el (process-live-p): Renamed from `process-alive-p' for
|
||||
* subr.el (process-live-p): Rename from `process-alive-p' for
|
||||
consistency with other `-live-p' functions.
|
||||
|
||||
2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
@ -68,8 +82,8 @@
|
||||
(view-return-to-alist-update): Make obsolete.
|
||||
(view-mode-enter): Rename second argument to QUIT-RESTORE.
|
||||
Rewrite using quit-restore window parameters.
|
||||
(view-mode-exit): Rename second argument to EXIT-ONLY. Rewrite
|
||||
using quit-restore-window.
|
||||
(view-mode-exit): Rename second argument to EXIT-ONLY.
|
||||
Rewrite using quit-restore-window.
|
||||
(View-exit, View-exit-and-edit, View-leave, View-quit)
|
||||
(View-quit-all, View-kill-and-leave): Call view-mode-exit with
|
||||
appropriate arguments.
|
||||
@ -89,8 +103,8 @@
|
||||
(display-buffer-in-side-window, normalize-buffer-to-display)
|
||||
(display-buffer-normalize-specifiers-1)
|
||||
(display-buffer-normalize-specifiers-2)
|
||||
(display-buffer-normalize-specifiers, display-buffer-frame): New
|
||||
functions.
|
||||
(display-buffer-normalize-specifiers, display-buffer-frame):
|
||||
New functions.
|
||||
(display-buffer): Major rewrite.
|
||||
(display-buffer-other-window, display-buffer-other-frame)
|
||||
(pop-to-buffer, switch-to-buffer-other-window)
|
||||
@ -126,8 +140,8 @@
|
||||
was inadvertently removed in change from 2011-06-11. Declare as
|
||||
obsolete.
|
||||
|
||||
* calendar/calendar.el (calendar-generate-window): Use
|
||||
window-iso-combined-p instead of combination of one-window-p and
|
||||
* calendar/calendar.el (calendar-generate-window):
|
||||
Use window-iso-combined-p instead of combination of one-window-p and
|
||||
window-safely-shrinkable-p.
|
||||
|
||||
2011-06-12 Glenn Morris <rgm@gnu.org>
|
||||
@ -172,15 +186,15 @@
|
||||
(bw-adjust-window): Remove.
|
||||
(balance-windows-area-adjust): New function with functionality of
|
||||
bw-adjust-window but using resize-window.
|
||||
(set-window-text-height): Rewrite doc-string. Use
|
||||
normalize-live-window and resize-window.
|
||||
(enlarge-window-horizontally, shrink-window-horizontally): Rename
|
||||
argument to DELTA.
|
||||
(set-window-text-height): Rewrite doc-string.
|
||||
Use normalize-live-window and resize-window.
|
||||
(enlarge-window-horizontally, shrink-window-horizontally):
|
||||
Rename argument to DELTA.
|
||||
(window-buffer-height): New function.
|
||||
(fit-window-to-buffer, shrink-window-if-larger-than-buffer):
|
||||
Rewrite using new window resize routines.
|
||||
(kill-buffer-and-window, mouse-autoselect-window-select): Use
|
||||
ignore-errors instead of condition-case.
|
||||
(kill-buffer-and-window, mouse-autoselect-window-select):
|
||||
Use ignore-errors instead of condition-case.
|
||||
(quit-window): Call delete-frame instead of delete-windows-on
|
||||
for the only buffer on frame.
|
||||
|
||||
@ -191,8 +205,8 @@
|
||||
|
||||
* files.el (read-buffer-to-switch)
|
||||
(switch-to-buffer-other-window)
|
||||
(switch-to-buffer-other-frame, display-buffer-other-frame): Move
|
||||
to window.el.
|
||||
(switch-to-buffer-other-frame, display-buffer-other-frame):
|
||||
Move to window.el.
|
||||
|
||||
* simple.el (get-next-valid-buffer, last-buffer, next-buffer)
|
||||
(previous-buffer): Move to window.el.
|
||||
@ -208,8 +222,8 @@
|
||||
(switch-to-next-buffer): New functions.
|
||||
(get-next-valid-buffer, last-buffer, next-buffer): Move here
|
||||
from simple.el. Call switch-to-next-buffer.
|
||||
(previous-buffer): Move here from simple.el. Call
|
||||
switch-to-prev-buffer.
|
||||
(previous-buffer): Move here from simple.el.
|
||||
Call switch-to-prev-buffer.
|
||||
(bury-buffer): Move here from buffer.c. Switch to previous
|
||||
buffer when window cannot be deleted.
|
||||
(unbury-buffer): Move here from bindings.el.
|
||||
@ -218,8 +232,8 @@
|
||||
(read-buffer-to-switch, switch-to-buffer-other-window)
|
||||
(switch-to-buffer-other-frame): Move here from files.el.
|
||||
(normalize-buffer-to-switch-to): New functions.
|
||||
(switch-to-buffer): Move here from buffer.c. Use
|
||||
read-buffer-to-switch and normalize-buffer-to-switch-to.
|
||||
(switch-to-buffer): Move here from buffer.c.
|
||||
Use read-buffer-to-switch and normalize-buffer-to-switch-to.
|
||||
|
||||
2011-06-10 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
@ -234,8 +248,8 @@
|
||||
(window-split-min-size): New function.
|
||||
(split-window-keep-point): Mention split-window-above-each-other
|
||||
instead of split-window-vertically.
|
||||
(split-window-above-each-other, split-window-vertically): Rename
|
||||
split-window-vertically to split-window-above-each-other and
|
||||
(split-window-above-each-other, split-window-vertically):
|
||||
Rename split-window-vertically to split-window-above-each-other and
|
||||
provide defalias for old definition.
|
||||
(split-window-side-by-side, split-window-horizontally): Rename
|
||||
split-window-horizontally to split-window-side-by-side and provide
|
||||
@ -294,10 +308,10 @@
|
||||
|
||||
2011-06-08 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.el (one-window-p): Move down in code. Rewrite
|
||||
doc-string.
|
||||
(window-current-scroll-bars): Rewrite doc-string. Normalize
|
||||
live window argument.
|
||||
* window.el (one-window-p): Move down in code.
|
||||
Rewrite doc-string.
|
||||
(window-current-scroll-bars): Rewrite doc-string.
|
||||
Normalize live window argument.
|
||||
(walk-windows, get-window-with-predicate, count-windows):
|
||||
Rewrite doc-string. Use window-list-1.
|
||||
(window-in-direction-2, window-in-direction, get-mru-window):
|
||||
@ -336,20 +350,20 @@
|
||||
(image-transform-properties): Return quickly in the normal case.
|
||||
(image-animate-loop): Rename from image-animate-max-time.
|
||||
|
||||
* image.el (image-animate-max-time): Moved to image-mode.el.
|
||||
* image.el (image-animate-max-time): Move to image-mode.el.
|
||||
(create-animated-image): Remove unnecessary function.
|
||||
(image-animate): Rename from image-animate-start. New arg.
|
||||
(image-animate-stop): Removed; just use image-animate-timer.
|
||||
(image-animate-stop): Remove; just use image-animate-timer.
|
||||
(image-animate-timer): Use car-safe.
|
||||
(image-animate-timeout): Rename argument.
|
||||
|
||||
2011-06-07 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.el (get-lru-window, get-largest-window): Move here from
|
||||
window.c. Rename first argument to ALL-FRAMES. Rephrase
|
||||
doc-strings.
|
||||
(get-buffer-window-list): Rewrite using window-list-1. Rephrase
|
||||
doc-string.
|
||||
window.c. Rename first argument to ALL-FRAMES.
|
||||
Rephrase doc-strings.
|
||||
(get-buffer-window-list): Rewrite using window-list-1.
|
||||
Rephrase doc-string.
|
||||
(window-safe-min-height, window-safe-min-width): New constants.
|
||||
(window-size-ignore, window-min-size, window-min-size-1)
|
||||
(window-sizable, window-sizable-p, window-size-fixed-1)
|
||||
@ -372,8 +386,8 @@
|
||||
(walk-window-tree-1, walk-window-tree, walk-window-subtree)
|
||||
(windows-with-parameter, window-with-parameter)
|
||||
(window-atom-root, make-window-atom, window-atom-check-1)
|
||||
(window-atom-check, window-side-check, window-check): New
|
||||
functions.
|
||||
(window-atom-check, window-side-check, window-check):
|
||||
New functions.
|
||||
(ignore-window-parameters, window-sides, window-sides-vertical)
|
||||
(window-sides-slots): New variables.
|
||||
(window-size-fixed): Move down in code. Minor doc-string fix.
|
||||
@ -411,8 +425,8 @@
|
||||
|
||||
2011-06-05 Roland Winkler <winkler@gnu.org>
|
||||
|
||||
* textmodes/bibtex.el (bibtex-search-entry-globally): New
|
||||
variable.
|
||||
* textmodes/bibtex.el (bibtex-search-entry-globally):
|
||||
New variable.
|
||||
(bibtex-search-entry): Use it.
|
||||
|
||||
2011-06-05 Roland Winkler <winkler@gnu.org>
|
||||
|
@ -935,7 +935,8 @@ Properties with special meaning:
|
||||
(unless table
|
||||
(setq table (make-abbrev-table))
|
||||
(set tablename table)
|
||||
(push tablename abbrev-table-name-list))
|
||||
(unless (memq tablename abbrev-table-name-list)
|
||||
(push tablename abbrev-table-name-list)))
|
||||
;; We used to just pass them to `make-abbrev-table', but that fails
|
||||
;; if the table was pre-existing as is the case if it was created by
|
||||
;; loading the user's abbrev file.
|
||||
|
@ -238,13 +238,14 @@ first will be printed into the backtrace buffer."
|
||||
(kill-buffer debugger-buffer)))
|
||||
;; Restore the previous state of the debugger-buffer, in case we were
|
||||
;; in a recursive invocation of the debugger.
|
||||
(when (and debugger-previous-state
|
||||
(buffer-live-p debugger-buffer))
|
||||
(when (buffer-live-p debugger-buffer)
|
||||
(with-current-buffer debugger-buffer
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(insert (nth 1 debugger-previous-state))
|
||||
(funcall (nth 0 debugger-previous-state)))))
|
||||
(if (null debugger-previous-state)
|
||||
(fundamental-mode)
|
||||
(insert (nth 1 debugger-previous-state))
|
||||
(funcall (nth 0 debugger-previous-state))))))
|
||||
(with-timeout-unsuspend debugger-with-timeout-suspend)
|
||||
(set-match-data debugger-outer-match-data)))
|
||||
;; Put into effect the modified values of these variables
|
||||
|
@ -84,6 +84,26 @@
|
||||
;; - Maybe accept two juxtaposed non-terminals in the BNF under the condition
|
||||
;; that the first always ends with a terminal, or that the second always
|
||||
;; starts with a terminal.
|
||||
;; - Permit EBNF-style notation.
|
||||
;; - If the grammar has conflicts, the only way is to make the lexer return
|
||||
;; different tokens for the different cases. This extra work performed by
|
||||
;; the lexer can be costly and unnecessary: we perform this extra work every
|
||||
;; time we find the conflicting token, regardless of whether or not the
|
||||
;; difference between the various situations is relevant to the current
|
||||
;; situation. E.g. we may try to determine whether a ";" is a ";-operator"
|
||||
;; or a ";-separator" in a case where we're skipping over a "begin..end" pair
|
||||
;; where the difference doesn't matter. For frequently occurring tokens and
|
||||
;; rarely occurring conflicts, this can be a significant performance problem.
|
||||
;; We could try and let the lexer return a "set of possible tokens
|
||||
;; plus a refinement function" and then let parser call the refinement
|
||||
;; function if needed.
|
||||
;; - Make it possible to better specify the behavior in the face of
|
||||
;; syntax errors. IOW provide some control over the choice of precedence
|
||||
;; levels within the limits of the constraints. E.g. make it possible for
|
||||
;; the grammar to specify that "begin..end" has lower precedence than
|
||||
;; "Module..EndModule", so that if a "begin" is missing, scanning from the
|
||||
;; "end" will stop at "Module" rather than going past it (and similarly,
|
||||
;; scanning from "Module" should not stop at a spurious "end").
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -313,9 +313,9 @@
|
||||
(if (pcomplete-match "^-" 0)
|
||||
(pcomplete-opt "v")
|
||||
(pcomplete-here
|
||||
(if (eq mode 'test)
|
||||
(pcomplete-dirs-or-entries "\\.tar\\'")
|
||||
(pcomplete-dirs-or-entries "\\.spec\\'"))))))
|
||||
(pcomplete-dirs-or-entries (if (eq mode 'test)
|
||||
"\\.tar\\'"
|
||||
"\\.spec\\'"))))))
|
||||
(t
|
||||
(error "You must select a mode: -q, -i, -U, --verify, etc"))))))
|
||||
|
||||
|
@ -1045,12 +1045,6 @@ casts and declarations are fontified. Used on level 2 and higher."
|
||||
;; The position of the next token after the closing paren of
|
||||
;; the last detected cast.
|
||||
last-cast-end
|
||||
;; Start of containing declaration (if any); limit for searching
|
||||
;; backwards for it.
|
||||
decl-start decl-search-lim
|
||||
;; Start of containing declaration (if any); limit for searching
|
||||
;; backwards for it.
|
||||
decl-start decl-search-lim
|
||||
;; The result from `c-forward-decl-or-cast-1'.
|
||||
decl-or-cast
|
||||
;; The maximum of the end positions of all the checked type
|
||||
@ -1188,109 +1182,107 @@ casts and declarations are fontified. Used on level 2 and higher."
|
||||
(setq decl-or-cast (c-forward-decl-or-cast-1
|
||||
match-pos context last-cast-end))
|
||||
|
||||
(if (not decl-or-cast)
|
||||
;; Are we at a declarator? Try to go back to the declaration
|
||||
;; to check this. Note that `c-beginning-of-decl-1' is slow,
|
||||
;; so we cache its result between calls.
|
||||
(let (paren-state bod-res encl-pos is-typedef)
|
||||
(goto-char start-pos)
|
||||
(save-excursion
|
||||
(unless (and decl-search-lim
|
||||
(eq decl-search-lim
|
||||
(save-excursion
|
||||
(c-syntactic-skip-backward "^;" nil t)
|
||||
(point))))
|
||||
(setq decl-search-lim
|
||||
(and (c-syntactic-skip-backward "^;" nil t) (point)))
|
||||
(setq bod-res (car (c-beginning-of-decl-1 decl-search-lim)))
|
||||
(if (and (eq bod-res 'same)
|
||||
(progn
|
||||
(c-backward-syntactic-ws)
|
||||
(eq (char-before) ?\})))
|
||||
(c-beginning-of-decl-1 decl-search-lim))
|
||||
(setq decl-start (point))))
|
||||
|
||||
(save-excursion
|
||||
(goto-char decl-start)
|
||||
;; We're now putatively at the declaration.
|
||||
(setq paren-state (c-parse-state))
|
||||
;; At top level or inside a "{"?
|
||||
(if (or (not (setq encl-pos
|
||||
(c-most-enclosing-brace paren-state)))
|
||||
(eq (char-after encl-pos) ?\{))
|
||||
(progn
|
||||
(when (looking-at c-typedef-key) ; "typedef"
|
||||
(setq is-typedef t)
|
||||
(goto-char (match-end 0))
|
||||
(c-forward-syntactic-ws))
|
||||
;; At a real declaration?
|
||||
(if (memq (c-forward-type t) '(t known found))
|
||||
(progn
|
||||
(c-font-lock-declarators limit t is-typedef)
|
||||
nil)
|
||||
;; False alarm. Return t to go on to the next check.
|
||||
(goto-char start-pos)
|
||||
t))
|
||||
t)))
|
||||
|
||||
(if (eq decl-or-cast 'cast)
|
||||
;; Save the position after the previous cast so we can feed
|
||||
;; it to `c-forward-decl-or-cast-1' in the next round. That
|
||||
;; helps it discover cast chains like "(a) (b) c".
|
||||
(setq last-cast-end (point))
|
||||
|
||||
;; Set `max-type-decl-end' or `max-type-decl-end-before-token'
|
||||
;; under the assumption that we're after the first type decl
|
||||
;; expression in the declaration now. That's not really true;
|
||||
;; we could also be after a parenthesized initializer
|
||||
;; expression in C++, but this is only used as a last resort
|
||||
;; to slant ambiguous expression/declarations, and overall
|
||||
;; it's worth the risk to occasionally fontify an expression
|
||||
;; as a declaration in an initializer expression compared to
|
||||
;; getting ambiguous things in normal function prototypes
|
||||
;; fontified as expressions.
|
||||
(if inside-macro
|
||||
(when (> (point) max-type-decl-end-before-token)
|
||||
(setq max-type-decl-end-before-token (point)))
|
||||
(when (> (point) max-type-decl-end)
|
||||
(setq max-type-decl-end (point))))
|
||||
|
||||
;; Back up to the type to fontify the declarator(s).
|
||||
(goto-char (car decl-or-cast))
|
||||
|
||||
(let ((decl-list
|
||||
(if context
|
||||
;; Should normally not fontify a list of
|
||||
;; declarators inside an arglist, but the first
|
||||
;; argument in the ';' separated list of a "for"
|
||||
;; statement is an exception.
|
||||
(when (eq (char-before match-pos) ?\()
|
||||
(save-excursion
|
||||
(goto-char (1- match-pos))
|
||||
(c-backward-syntactic-ws)
|
||||
(and (c-simple-skip-symbol-backward)
|
||||
(looking-at c-paren-stmt-key))))
|
||||
t)))
|
||||
|
||||
;; Fix the `c-decl-id-start' or `c-decl-type-start' property
|
||||
;; before the first declarator if it's a list.
|
||||
;; `c-font-lock-declarators' handles the rest.
|
||||
(when decl-list
|
||||
(save-excursion
|
||||
(c-backward-syntactic-ws)
|
||||
(unless (bobp)
|
||||
(c-put-char-property (1- (point)) 'c-type
|
||||
(if (cdr decl-or-cast)
|
||||
'c-decl-type-start
|
||||
'c-decl-id-start)))))
|
||||
|
||||
(c-font-lock-declarators
|
||||
(point-max) decl-list (cdr decl-or-cast))))
|
||||
|
||||
;; A cast or declaration has been successfully identified, so do
|
||||
;; all the fontification of types and refs that's been recorded.
|
||||
(cond
|
||||
((eq decl-or-cast 'cast)
|
||||
;; Save the position after the previous cast so we can feed
|
||||
;; it to `c-forward-decl-or-cast-1' in the next round. That
|
||||
;; helps it discover cast chains like "(a) (b) c".
|
||||
(setq last-cast-end (point))
|
||||
(c-fontify-recorded-types-and-refs)
|
||||
nil))
|
||||
nil)
|
||||
|
||||
(decl-or-cast
|
||||
;; We've found a declaration.
|
||||
|
||||
;; Set `max-type-decl-end' or `max-type-decl-end-before-token'
|
||||
;; under the assumption that we're after the first type decl
|
||||
;; expression in the declaration now. That's not really true;
|
||||
;; we could also be after a parenthesized initializer
|
||||
;; expression in C++, but this is only used as a last resort
|
||||
;; to slant ambiguous expression/declarations, and overall
|
||||
;; it's worth the risk to occasionally fontify an expression
|
||||
;; as a declaration in an initializer expression compared to
|
||||
;; getting ambiguous things in normal function prototypes
|
||||
;; fontified as expressions.
|
||||
(if inside-macro
|
||||
(when (> (point) max-type-decl-end-before-token)
|
||||
(setq max-type-decl-end-before-token (point)))
|
||||
(when (> (point) max-type-decl-end)
|
||||
(setq max-type-decl-end (point))))
|
||||
|
||||
;; Back up to the type to fontify the declarator(s).
|
||||
(goto-char (car decl-or-cast))
|
||||
|
||||
(let ((decl-list
|
||||
(if context
|
||||
;; Should normally not fontify a list of
|
||||
;; declarators inside an arglist, but the first
|
||||
;; argument in the ';' separated list of a "for"
|
||||
;; statement is an exception.
|
||||
(when (eq (char-before match-pos) ?\()
|
||||
(save-excursion
|
||||
(goto-char (1- match-pos))
|
||||
(c-backward-syntactic-ws)
|
||||
(and (c-simple-skip-symbol-backward)
|
||||
(looking-at c-paren-stmt-key))))
|
||||
t)))
|
||||
|
||||
;; Fix the `c-decl-id-start' or `c-decl-type-start' property
|
||||
;; before the first declarator if it's a list.
|
||||
;; `c-font-lock-declarators' handles the rest.
|
||||
(when decl-list
|
||||
(save-excursion
|
||||
(c-backward-syntactic-ws)
|
||||
(unless (bobp)
|
||||
(c-put-char-property (1- (point)) 'c-type
|
||||
(if (cdr decl-or-cast)
|
||||
'c-decl-type-start
|
||||
'c-decl-id-start)))))
|
||||
|
||||
(c-font-lock-declarators
|
||||
(point-max) decl-list (cdr decl-or-cast)))
|
||||
|
||||
;; A declaration has been successfully identified, so do all the
|
||||
;; fontification of types and refs that've been recorded.
|
||||
(c-fontify-recorded-types-and-refs)
|
||||
nil)
|
||||
|
||||
(t
|
||||
;; Are we at a declarator? Try to go back to the declaration
|
||||
;; to check this. If we get there, check whether a "typedef"
|
||||
;; is there, then fontify the declarators accordingly.
|
||||
(let ((decl-search-lim (max (- (point) 50000) (point-min)))
|
||||
paren-state bod-res encl-pos is-typedef
|
||||
c-recognize-knr-p) ; Strictly speaking, bogus, but it
|
||||
; speeds up lisp.h tremendously.
|
||||
(save-excursion
|
||||
(setq bod-res (car (c-beginning-of-decl-1 decl-search-lim)))
|
||||
(if (and (eq bod-res 'same)
|
||||
(progn
|
||||
(c-backward-syntactic-ws)
|
||||
(eq (char-before) ?\})))
|
||||
(c-beginning-of-decl-1 decl-search-lim))
|
||||
|
||||
;; We're now putatively at the declaration.
|
||||
(setq paren-state (c-parse-state))
|
||||
;; At top level or inside a "{"?
|
||||
(if (or (not (setq encl-pos
|
||||
(c-most-enclosing-brace paren-state)))
|
||||
(eq (char-after encl-pos) ?\{))
|
||||
(progn
|
||||
(when (looking-at c-typedef-key) ; "typedef"
|
||||
(setq is-typedef t)
|
||||
(goto-char (match-end 0))
|
||||
(c-forward-syntactic-ws))
|
||||
;; At a real declaration?
|
||||
(if (memq (c-forward-type t) '(t known found))
|
||||
(progn
|
||||
(c-font-lock-declarators limit t is-typedef)
|
||||
nil)
|
||||
;; False alarm. Return t to go on to the next check.
|
||||
(goto-char start-pos)
|
||||
t))
|
||||
t))))))
|
||||
|
||||
;; It was a false alarm. Check if we're in a label (or other
|
||||
;; construct with `:' except bitfield) instead.
|
||||
|
@ -245,6 +245,10 @@
|
||||
|
||||
* alloc.c (Fmake_string): Check for out-of-range init.
|
||||
|
||||
2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* eval.c (Fdefvaralias): Also mark the target as variable-special-p.
|
||||
|
||||
2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* xfns.c (x_set_scroll_bar_default_width): Remove argument to
|
||||
|
@ -768,6 +768,7 @@ The return value is BASE-VARIABLE. */)
|
||||
}
|
||||
|
||||
sym->declared_special = 1;
|
||||
XSYMBOL (base_variable)->declared_special = 1;
|
||||
sym->redirect = SYMBOL_VARALIAS;
|
||||
SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable));
|
||||
sym->constant = SYMBOL_CONSTANT_P (base_variable);
|
||||
|
Loading…
Reference in New Issue
Block a user