Now on revision 106420. ------------------------------------------------------------ revno: 106420 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-11-18 10:29:29 -0800 message: Fix minor problems found by static checking. * dispextern.h, xdisp.c (row_hash): Declare extern only if XASSERTS. * dispnew.c (verify_row_hash): Now static. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-18 16:50:16 +0000 +++ src/ChangeLog 2011-11-18 18:29:29 +0000 @@ -1,3 +1,9 @@ +2011-11-18 Paul Eggert + + Fix minor problems found by static checking. + * dispextern.h, xdisp.c (row_hash): Declare extern only if XASSERTS. + * dispnew.c (verify_row_hash): Now static. + 2011-11-18 Dmitry Antipov * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs. === modified file 'src/dispextern.h' --- src/dispextern.h 2011-11-18 12:21:42 +0000 +++ src/dispextern.h 2011-11-18 18:29:29 +0000 @@ -3127,7 +3127,9 @@ void w32_reset_fringes (void); #endif +#if XASSERTS extern unsigned row_hash (struct glyph_row *); +#endif /* Defined in image.c */ === modified file 'src/dispnew.c' --- src/dispnew.c 2011-11-18 12:41:36 +0000 +++ src/dispnew.c 2011-11-18 18:29:29 +0000 @@ -431,7 +431,7 @@ #if XASSERTS /* Return non-zero if ROW's hash value is correct, zero if not. */ -int +static int verify_row_hash (struct glyph_row *row) { return row->hash == row_hash (row); === modified file 'src/xdisp.c' --- src/xdisp.c 2011-11-18 12:21:42 +0000 +++ src/xdisp.c 2011-11-18 18:29:29 +0000 @@ -17950,6 +17950,9 @@ } /* Compute the hash code for ROW. */ +#if !XASSERTS +static +#endif unsigned row_hash (struct glyph_row *row) { ------------------------------------------------------------ revno: 106419 author: Dmitry Antipov committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 11:50:16 -0500 message: * src/keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-18 16:00:40 +0000 +++ src/ChangeLog 2011-11-18 16:50:16 +0000 @@ -1,3 +1,7 @@ +2011-11-18 Dmitry Antipov + + * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs. + 2011-11-18 Stefan Monnier * intervals.c: Fix grafting over the whole buffer (bug#10071). === modified file 'src/keymap.c' --- src/keymap.c 2011-11-17 17:40:48 +0000 +++ src/keymap.c 2011-11-18 16:50:16 +0000 @@ -2624,11 +2624,11 @@ /* We have a list of advertised bindings. */ while (CONSP (tem)) if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition)) - return XCAR (tem); + RETURN_UNGCPRO (XCAR (tem)); else tem = XCDR (tem); if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition)) - return tem; + RETURN_UNGCPRO (tem); } sequences = Freverse (where_is_internal (definition, keymaps, ------------------------------------------------------------ revno: 106418 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 11:30:43 -0500 message: * lisp/emacs-lisp/smie.el: Improve warnings and conflict detection. (smie-warning-count): New var. (smie-set-prec2tab): Use it. (smie-bnf->prec2): Improve warnings. Add docstring. (smie-bnf--closer-alist): Rename from smie-bnf-closer-alist. (smie-bnf--set-class): New function. (smie-bnf--classify): Rename from smie-bnf-classify. Rewrite to fix corner case. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-18 15:09:42 +0000 +++ lisp/ChangeLog 2011-11-18 16:30:43 +0000 @@ -1,5 +1,14 @@ 2011-11-18 Stefan Monnier + * emacs-lisp/smie.el: Improve warnings and conflict detection. + (smie-warning-count): New var. + (smie-set-prec2tab): Use it. + (smie-bnf->prec2): Improve warnings. Add docstring. + (smie-bnf--closer-alist): Rename from smie-bnf-closer-alist. + (smie-bnf--set-class): New function. + (smie-bnf--classify): Rename from smie-bnf-classify. Rewrite to fix + corner case. + * progmodes/compile.el: Obey compilation-first-column in dest buffer. (compilation-error-properties, compilation-move-to-column): Handle compilation-first-column while in the target buffer. === modified file 'lisp/emacs-lisp/smie.el' --- lisp/emacs-lisp/smie.el 2011-11-17 09:09:20 +0000 +++ lisp/emacs-lisp/smie.el 2011-11-18 16:30:43 +0000 @@ -69,13 +69,23 @@ ;; (exp ("IF" exp "ELSE" exp "END") ("CASE" cases "END")) ;; (cases (cases "ELSE" insts) ...) ;; The IF-rule implies ELSE=END and the CASE-rule implies ELSE>END. -;; FIXME: we could try to resolve such conflicts automatically by changing -;; the way BNF rules such as the IF-rule is handled. I.e. rather than -;; IF=ELSE and ELSE=END, we could turn them into IFEND -;; and IF=END, +;; This can be resolved simply with: +;; (exp ("IF" expelseexp "END") ("CASE" cases "END")) +;; (expelseexp (exp) (exp "ELSE" exp)) +;; (cases (cases "ELSE" insts) ...) +;; - Another source of conflict is when a terminator/separator is used to +;; terminate elements at different levels, as in: +;; (decls ("VAR" vars) (decls "," decls)) +;; (vars (id) (vars "," vars)) +;; often these can be resolved by making the lexer distinguish the two +;; kinds of commas, e.g. based on the following token. ;; TODO & BUGS: ;; +;; - We could try to resolve conflicts such as the IFexpELSEexpEND -vs- +;; CASE(casesELSEexp)END automatically by changing the way BNF rules such as +;; the IF-rule is handled. I.e. rather than IF=ELSE and ELSE=END, we could +;; turn them into IFEND and IF=END. ;; - Using the structural information SMIE gives us, it should be possible to ;; implement a `smie-align' command that would automatically figure out what ;; there is to align and how to do it (something like: align the token of @@ -107,6 +117,10 @@ ;;; Code: +;; FIXME: +;; - smie-indent-comment doesn't interact well with mis-indented lines (where +;; the indent rules don't do what the user wants). Not sure what to do. + (eval-when-compile (require 'cl)) (defgroup smie nil @@ -138,6 +152,8 @@ ;; turns them into a levels table, which is what's used by the rest of ;; the SMIE code. +(defvar smie-warning-count 0) + (defun smie-set-prec2tab (table x y val &optional override) (assert (and x y)) (let* ((key (cons x y)) @@ -149,7 +165,8 @@ ;; be able to distinguish the two cases so that overrides ;; don't hide real conflicts. (puthash key (gethash key override) table) - (display-warning 'smie (format "Conflict: %s %s/%s %s" x old val y))) + (display-warning 'smie (format "Conflict: %s %s/%s %s" x old val y)) + (incf smie-warning-count)) (puthash key val table)))) (put 'smie-precs->prec2 'pure t) @@ -193,21 +210,54 @@ prec2))) (put 'smie-bnf->prec2 'pure t) -(defun smie-bnf->prec2 (bnf &rest precs) +(defun smie-bnf->prec2 (bnf &rest resolvers) + "Convert the BNF grammar into a prec2 table. +BNF is a list of nonterminal definitions of the form: + \(NONTERM RHS1 RHS2 ...) +where each RHS is a (non-empty) list of terminals (aka tokens) or non-terminals. +Not all grammars are accepted: +- an RHS cannot be an empty list (this is not needed, since SMIE allows all + non-terminals to match the empty string anyway). +- an RHS cannot have 2 consecutive non-terminals: between each non-terminal + needs to be a terminal (aka token). This is a fundamental limitation of + the parsing technology used (operator precedence grammar). +Additionally, conflicts can occur: +- The returned prec2 table holds constraints between pairs of + token, and for any given pair only one constraint can be + present, either: T1 < T2, T1 = T2, or T1 > T2. +- A token can either be an `opener' (something similar to an open-paren), + a `closer' (like a close-paren), or `neither' of the two (e.g. an infix + operator, or an inner token like \"else\"). +Conflicts can be resolved via RESOLVERS, which is a list of elements that can +be either: +- a precs table (see `smie-precs->prec2') to resolve conflicting constraints, +- a constraint (T1 REL T2) where REL is one of = < or >." ;; FIXME: Add repetition operator like (repeat ). ;; Maybe also add (or ...) for things like ;; (exp (exp (or "+" "*" "=" ..) exp)). ;; Basically, make it EBNF (except for the specification of a separator in ;; the repetition, maybe). - (let ((nts (mapcar 'car bnf)) ;Non-terminals - (first-ops-table ()) - (last-ops-table ()) - (first-nts-table ()) - (last-nts-table ()) - (prec2 (make-hash-table :test 'equal)) - (override (apply 'smie-merge-prec2s - (mapcar 'smie-precs->prec2 precs))) - again) + (let* ((nts (mapcar 'car bnf)) ;Non-terminals. + (first-ops-table ()) + (last-ops-table ()) + (first-nts-table ()) + (last-nts-table ()) + (smie-warning-count 0) + (prec2 (make-hash-table :test 'equal)) + (override + (let ((precs ()) + (over (make-hash-table :test 'equal))) + (dolist (resolver resolvers) + (cond + ((and (= 3 (length resolver)) (memq (nth 1 resolver) '(= < >))) + (smie-set-prec2tab + over (nth 0 resolver) (nth 2 resolver) (nth 1 resolver))) + ((memq (caar resolver) '(left right assoc nonassoc)) + (push resolver precs)) + (t (error "Unknown resolver %S" resolver)))) + (apply #'smie-merge-prec2s over + (mapcar 'smie-precs->prec2 precs)))) + again) (dolist (rules bnf) (let ((nt (car rules)) (last-ops ()) @@ -287,8 +337,11 @@ (setq rhs (cdr rhs))))) ;; Keep track of which tokens are openers/closer, so they can get a nil ;; precedence in smie-prec2->grammar. - (puthash :smie-open/close-alist (smie-bnf-classify bnf) prec2) - (puthash :smie-closer-alist (smie-bnf-closer-alist bnf) prec2) + (puthash :smie-open/close-alist (smie-bnf--classify bnf) prec2) + (puthash :smie-closer-alist (smie-bnf--closer-alist bnf) prec2) + (if (> smie-warning-count 0) + (display-warning + 'smie (format "Total: %d warnings" smie-warning-count))) prec2)) ;; (defun smie-prec2-closer-alist (prec2 include-inners) @@ -343,7 +396,7 @@ ;; openers) ;; alist))) -(defun smie-bnf-closer-alist (bnf &optional no-inners) +(defun smie-bnf--closer-alist (bnf &optional no-inners) ;; We can also build this closer-alist table from a prec2 table, ;; but it takes more work, and the order is unpredictable, which ;; is a problem for smie-close-block. @@ -371,37 +424,33 @@ (pushnew (cons (car rhs) term) alist :test #'equal))))))) (nreverse alist))) -(defun smie-bnf-classify (bnf) +(defun smie-bnf--set-class (table token class) + (let ((prev (gethash token table class))) + (puthash token + (cond + ((eq prev class) class) + ((eq prev t) t) ;Non-terminal. + (t (display-warning + 'smie + (format "token %s is both %s and %s" token class prev)) + 'neither)) + table))) + +(defun smie-bnf--classify (bnf) "Return a table classifying terminals. -Each terminal can either be an `opener', a `closer', or neither." +Each terminal can either be an `opener', a `closer', or `neither'." (let ((table (make-hash-table :test #'equal)) - (nts (mapcar #'car bnf)) (alist '())) (dolist (category bnf) - (puthash (car category) 'neither table) ;Remove non-terminals. + (puthash (car category) t table)) ;Mark non-terminals. + (dolist (category bnf) (dolist (rhs (cdr category)) (if (null (cdr rhs)) - (puthash (pop rhs) 'neither table) - (let ((first (pop rhs))) - (puthash first - (if (memq (gethash first table) '(nil opener)) - 'opener - (unless (member first nts) - (error "SMIE: token %s is both opener and non-opener" - first)) - 'neither) - table)) - (while (cdr rhs) - (puthash (pop rhs) 'neither table)) ;Remove internals. - (let ((last (pop rhs))) - (puthash last - (if (memq (gethash last table) '(nil closer)) - 'closer - (unless (member last nts) - (error "SMIE: token %s is both closer and non-closer" - last)) - 'neither) - table))))) + (smie-bnf--set-class table (pop rhs) 'neither) + (smie-bnf--set-class table (pop rhs) 'opener) + (while (cdr rhs) ;Remove internals. + (smie-bnf--set-class table (pop rhs) 'neither)) + (smie-bnf--set-class table (pop rhs) 'closer)))) (maphash (lambda (tok v) (when (memq v '(closer opener)) (push (cons tok v) alist))) @@ -692,8 +741,22 @@ ;; Keep looking as long as we haven't matched the ;; topmost operator. (levels - (if (numberp (funcall op-forw toklevels)) - (push toklevels levels))) + (cond + ((numberp (funcall op-forw toklevels)) + (push toklevels levels)) + ;; FIXME: For some languages, we can express the grammar + ;; OK, but next-sexp doesn't stop where we'd want it to. + ;; E.g. in SML, we'd want to stop right in front of + ;; "local" if we're scanning (both forward and backward) + ;; from a "val/fun/..." at the same level. + ;; Same for Pascal/Modula2's "procedure" w.r.t + ;; "type/var/const". + ;; + ;; ((and (functionp (cadr (funcall op-forw toklevels))) + ;; (funcall (cadr (funcall op-forw toklevels)) + ;; levels)) + ;; (setq levels nil)) + )) ;; We matched the topmost operator. If the new operator ;; is the last in the corresponding BNF rule, we're done. ((not (numberp (funcall op-forw toklevels))) @@ -980,7 +1043,7 @@ OFFSET can be: nil use the default indentation rule. -`(column . COLUMN) indent to column COLUMN. +\(column . COLUMN) indent to column COLUMN. NUMBER offset by NUMBER, relative to a base token which is the current token for :after and its parent for :before. ------------------------------------------------------------ revno: 106417 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10071 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 11:00:40 -0500 message: * src/intervals.c: Fix grafting over the whole buffer. (graft_intervals_into_buffer): Simplify. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-18 12:41:36 +0000 +++ src/ChangeLog 2011-11-18 16:00:40 +0000 @@ -1,3 +1,8 @@ +2011-11-18 Stefan Monnier + + * intervals.c: Fix grafting over the whole buffer (bug#10071). + (graft_intervals_into_buffer): Simplify. + 2011-11-18 Eli Zaretskii * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the @@ -394,7 +399,7 @@ Fix the `xbytecode' command. * .gdbinit (xprintbytestr): New command. - (xwhichsymbols): Renamed from `which'; all callers changed. + (xwhichsymbols): Rename from `which'; all callers changed. (xbytecode): Print the byte-code string as well. 2011-10-29 Kim Storm === modified file 'src/insdel.c' --- src/insdel.c 2011-09-09 01:06:52 +0000 +++ src/insdel.c 2011-11-18 16:00:40 +0000 @@ -1316,7 +1316,7 @@ UNGCPRO; - /* Make args be valid */ + /* Make args be valid. */ if (from < BEGV) from = BEGV; if (to > ZV) === modified file 'src/intervals.c' --- src/intervals.c 2011-11-08 20:05:27 +0000 +++ src/intervals.c 2011-11-18 16:00:40 +0000 @@ -1317,7 +1317,7 @@ if (NULL_INTERVAL_P (tree)) return 0; - /* Left branch */ + /* Left branch. */ if (relative_position < LEFT_TOTAL_LENGTH (tree)) { EMACS_INT subtract = interval_deletion_adjustment (tree->left, @@ -1327,7 +1327,7 @@ CHECK_TOTAL_LENGTH (tree); return subtract; } - /* Right branch */ + /* Right branch. */ else if (relative_position >= (TOTAL_LENGTH (tree) - RIGHT_TOTAL_LENGTH (tree))) { @@ -1699,54 +1699,37 @@ Qnil, buf, 0); } if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) - /* Shouldn't be necessary. -stef */ + /* Shouldn't be necessary. --Stef */ BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); return; } - if (NULL_INTERVAL_P (tree)) - { - /* The inserted text constitutes the whole buffer, so + eassert (length == TOTAL_LENGTH (source)); + + if ((BUF_Z (buffer) - BUF_BEG (buffer)) == length) + { /* The inserted text constitutes the whole buffer, so simply copy over the interval structure. */ - if ((BUF_Z (buffer) - BUF_BEG (buffer)) == TOTAL_LENGTH (source)) - { Lisp_Object buf; XSETBUFFER (buf, buffer); BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); - BUF_INTERVALS (buffer)->position = BEG; - BUF_INTERVALS (buffer)->up_obj = 1; - + BUF_INTERVALS (buffer)->position = BUF_BEG (buffer); + eassert (BUF_INTERVALS (buffer)->up_obj == 1); return; } - - /* Create an interval tree in which to place a copy + else if (NULL_INTERVAL_P (tree)) + { /* Create an interval tree in which to place a copy of the intervals of the inserted string. */ - { Lisp_Object buf; XSETBUFFER (buf, buffer); tree = create_root_interval (buf); } - } - else if (TOTAL_LENGTH (tree) == TOTAL_LENGTH (source)) - /* If the buffer contains only the new string, but - there was already some interval tree there, then it may be - some zero length intervals. Eventually, do something clever - about inserting properly. For now, just waste the old intervals. */ - { - BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree)); - BUF_INTERVALS (buffer)->position = BEG; - BUF_INTERVALS (buffer)->up_obj = 1; - /* Explicitly free the old tree here. */ - - return; - } /* Paranoia -- the text has already been added, so this buffer should be of non-zero length. */ else if (TOTAL_LENGTH (tree) == 0) abort (); this = under = find_interval (tree, position); - if (NULL_INTERVAL_P (under)) /* Paranoia */ + if (NULL_INTERVAL_P (under)) /* Paranoia. */ abort (); over = find_interval (source, interval_start_pos (source)); === modified file 'src/intervals.h' --- src/intervals.h 2011-04-20 08:04:17 +0000 +++ src/intervals.h 2011-11-18 16:00:40 +0000 @@ -64,71 +64,71 @@ Lisp_Object plist; }; -/* These are macros for dealing with the interval tree. */ +/* These are macros for dealing with the interval tree. */ -/* Size of the structure used to represent an interval */ +/* Size of the structure used to represent an interval. */ #define INTERVAL_SIZE (sizeof (struct interval)) -/* Size of a pointer to an interval structure */ +/* Size of a pointer to an interval structure. */ #define INTERVAL_PTR_SIZE (sizeof (struct interval *)) #define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) -/* True if this interval has no right child. */ +/* True if this interval has no right child. */ #define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) -/* True if this interval has no left child. */ +/* True if this interval has no left child. */ #define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL) -/* True if this interval has no parent. */ +/* True if this interval has no parent. */ #define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0) -/* True if this interval is the left child of some other interval. */ +/* True if this interval is the left child of some other interval. */ #define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \ && INTERVAL_PARENT (i)->left == (i)) -/* True if this interval is the right child of some other interval. */ +/* True if this interval is the right child of some other interval. */ #define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \ && INTERVAL_PARENT (i)->right == (i)) -/* True if this interval has no children. */ +/* True if this interval has no children. */ #define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \ && (i)->right == NULL_INTERVAL) -/* True if this interval has no parent and is therefore the root. */ +/* True if this interval has no parent and is therefore the root. */ #define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) -/* True if this interval is the only interval in the interval tree. */ +/* True if this interval is the only interval in the interval tree. */ #define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) -/* True if this interval has both left and right children. */ +/* True if this interval has both left and right children. */ #define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \ && (i)->right != NULL_INTERVAL) /* The total size of all text represented by this interval and all its - children in the tree. This is zero if the interval is null. */ + children in the tree. This is zero if the interval is null. */ #define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length) -/* The size of text represented by this interval alone. */ +/* The size of text represented by this interval alone. */ #define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \ - TOTAL_LENGTH ((i)->right) \ - TOTAL_LENGTH ((i)->left))) /* The position of the character just past the end of I. Note that - the position cache i->position must be valid for this to work. */ + the position cache i->position must be valid for this to work. */ #define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) -/* The total size of the left subtree of this interval. */ +/* The total size of the left subtree of this interval. */ #define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) -/* The total size of the right subtree of this interval. */ +/* The total size of the right subtree of this interval. */ #define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0) -/* These macros are for dealing with the interval properties. */ +/* These macros are for dealing with the interval properties. */ /* True if this is a default interval, which is the same as being null - or having no properties. */ + or having no properties. */ #define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil)) /* Test what type of parent we have. Three possibilities: another @@ -169,7 +169,7 @@ } \ while (0) -/* Reset this interval to its vanilla, or no-property state. */ +/* Reset this interval to its vanilla, or no-property state. */ #define RESET_INTERVAL(i) \ { \ (i)->total_length = (i)->position = 0; \ @@ -181,7 +181,7 @@ (i)->plist = Qnil; \ } -/* Copy the cached property values of interval FROM to interval TO. */ +/* Copy the cached property values of interval FROM to interval TO. */ #define COPY_INTERVAL_CACHE(from,to) \ { \ (to)->write_protect = (from)->write_protect; \ @@ -190,7 +190,7 @@ (to)->rear_sticky = (from)->rear_sticky; \ } -/* Copy only the set bits of FROM's cache. */ +/* Copy only the set bits of FROM's cache. */ #define MERGE_INTERVAL_CACHE(from,to) \ { \ if ((from)->write_protect) (to)->write_protect = 1; \ @@ -201,18 +201,18 @@ /* Macro determining whether the properties of an interval being inserted should be merged with the properties of the text where - they are being inserted. */ + they are being inserted. */ #define MERGE_INSERTIONS(i) 1 /* Macro determining if an invisible interval should be displayed - as a special glyph, or not at all. */ + as a special glyph, or not at all. */ #define DISPLAY_INVISIBLE_GLYPH(i) 0 -/* Is this interval visible? Replace later with cache access */ +/* Is this interval visible? Replace later with cache access. */ #define INTERVAL_VISIBLE_P(i) \ (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible))) -/* Is this interval writable? Replace later with cache access */ +/* Is this interval writable? Replace later with cache access. */ #define INTERVAL_WRITABLE_P(i) \ (! NULL_INTERVAL_P (i) \ && (NILP (textget ((i)->plist, Qread_only)) \ @@ -222,7 +222,7 @@ : !NILP (Vinhibit_read_only))))) \ /* Macros to tell whether insertions before or after this interval - should stick to it. */ + should stick to it. */ /* Replace later with cache access */ /*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0) #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/ @@ -245,11 +245,11 @@ ? !NILP (prop) \ : invisible_p (prop, BVAR (current_buffer, invisibility_spec))) -/* Declared in alloc.c */ +/* Declared in alloc.c. */ extern INTERVAL make_interval (void); -/* Declared in intervals.c */ +/* Declared in intervals.c. */ extern INTERVAL create_root_interval (Lisp_Object); extern void copy_properties (INTERVAL, INTERVAL); @@ -288,12 +288,12 @@ Lisp_Object *, int); extern INTERVAL interval_of (EMACS_INT, Lisp_Object); -/* Defined in xdisp.c */ +/* Defined in xdisp.c. */ extern int invisible_p (Lisp_Object, Lisp_Object); -/* Declared in textprop.c */ +/* Declared in textprop.c. */ -/* Types of hooks. */ +/* Types of hooks. */ extern Lisp_Object Qpoint_left; extern Lisp_Object Qpoint_entered; extern Lisp_Object Qmodification_hooks; @@ -301,11 +301,11 @@ extern Lisp_Object Qlocal_map; extern Lisp_Object Qkeymap; -/* Visual properties text (including strings) may have. */ +/* Visual properties text (including strings) may have. */ extern Lisp_Object Qfont; extern Lisp_Object Qinvisible, Qintangible; -/* Sticky properties */ +/* Sticky properties. */ extern Lisp_Object Qfront_sticky, Qrear_nonsticky; EXFUN (Fget_char_property, 3); ------------------------------------------------------------ revno: 106416 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 10:09:42 -0500 message: * lisp/progmodes/compile.el: Obey compilation-first-column in dest buffer. (compilation-error-properties, compilation-move-to-column): Handle compilation-first-column while in the target buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-18 15:06:20 +0000 +++ lisp/ChangeLog 2011-11-18 15:09:42 +0000 @@ -1,5 +1,9 @@ 2011-11-18 Stefan Monnier + * progmodes/compile.el: Obey compilation-first-column in dest buffer. + (compilation-error-properties, compilation-move-to-column): + Handle compilation-first-column while in the target buffer. + * progmodes/cc-engine.el (c-remove-stale-state-cache-backwards): Don't hardcode point-min==1. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-11-09 15:39:32 +0000 +++ lisp/progmodes/compile.el 2011-11-18 15:09:42 +0000 @@ -1013,11 +1013,11 @@ (setq col (funcall col)) (and (setq col (match-string-no-properties col)) - (setq col (- (string-to-number col) compilation-first-column))))) + (setq col (string-to-number col))))) (if (and end-col (functionp end-col)) (setq end-col (funcall end-col)) (if (and end-col (setq end-col (match-string-no-properties end-col))) - (setq end-col (- (string-to-number end-col) compilation-first-column -1)) + (setq end-col (- (string-to-number end-col) -1)) (if end-line (setq end-col -1)))) (if (consp type) ; not a static type, check what it is. (setq type (or (and (car type) (match-end (car type)) 1) @@ -1037,6 +1037,7 @@ "Go to column COL on the current line. If SCREEN is non-nil, columns are screen columns, otherwise, they are just char-counts." + (setq col (- col compilation-first-column)) (if screen (move-to-column (max col 0)) (goto-char (min (+ (line-beginning-position) col) (line-end-position))))) ------------------------------------------------------------ revno: 106415 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 10:06:20 -0500 message: * lisp/progmodes/cc-engine.el (c-remove-stale-state-cache-backwards): Don't hardcode point-min==1. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-18 14:49:42 +0000 +++ lisp/ChangeLog 2011-11-18 15:06:20 +0000 @@ -1,5 +1,8 @@ 2011-11-18 Stefan Monnier + * progmodes/cc-engine.el (c-remove-stale-state-cache-backwards): + Don't hardcode point-min==1. + * eshell/esh-cmd.el (eshell-do-eval): Handle `setq' (bug#9907). (eshell-rewrite-for-command): Remove workaround. (eshell-do-pipelines, eshell-do-pipelines-synchronously) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2011-11-16 12:34:47 +0000 +++ lisp/progmodes/cc-engine.el 2011-11-18 15:06:20 +0000 @@ -2820,7 +2820,7 @@ ; or `here' itself. here- here+ ; start/end of macro around HERE, or HERE (here-bol (c-point 'bol here)) - (too-far-back (max (- here c-state-cache-too-far) 1))) + (too-far-back (max (- here c-state-cache-too-far) (point-min)))) ;; Remove completely irrelevant entries from `c-state-cache'. (while (and c-state-cache @@ -2964,9 +2964,9 @@ c-state-cache-good-pos nil c-state-min-scan-pos nil) -;;; Truncate `c-state-cache' and set `c-state-cache-good-pos' to a value below -;;; `here'. To maintain its consistency, we may need to insert a new brace -;;; pair. + ;; Truncate `c-state-cache' and set `c-state-cache-good-pos' to a value + ;; below `here'. To maintain its consistency, we may need to insert a new + ;; brace pair. (let ((here-bol (c-point 'bol here)) too-high-pa ; recorded {/(/[ next above here, or nil. dropped-cons ; was the last removed element a brace pair? ------------------------------------------------------------ revno: 106414 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9907 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 09:49:42 -0500 message: * lisp/eshell/esh-cmd.el (eshell-do-eval): Handle `setq'. (eshell-rewrite-for-command): Remove workaround. (eshell-do-pipelines, eshell-do-pipelines-synchronously) (eshell-do-eval, eshell-exec-lisp): Avoid gratuitous setq. * lisp/eshell/esh-util.el (eshell-condition-case, eshell-for): Use declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-18 14:34:39 +0000 +++ lisp/ChangeLog 2011-11-18 14:49:42 +0000 @@ -1,5 +1,11 @@ 2011-11-18 Stefan Monnier + * eshell/esh-cmd.el (eshell-do-eval): Handle `setq' (bug#9907). + (eshell-rewrite-for-command): Remove workaround. + (eshell-do-pipelines, eshell-do-pipelines-synchronously) + (eshell-do-eval, eshell-exec-lisp): Avoid gratuitous setq. + * eshell/esh-util.el (eshell-condition-case, eshell-for): Use declare. + * files-x.el (modify-file-local-variable): Obey commenting conventions. 2011-11-17 Glenn Morris === modified file 'lisp/eshell/esh-cmd.el' --- lisp/eshell/esh-cmd.el 2011-11-14 23:59:56 +0000 +++ lisp/eshell/esh-cmd.el 2011-11-18 14:49:42 +0000 @@ -480,25 +480,20 @@ (let ((body (car (last terms)))) (setcdr (last terms 2) nil) `(let ((for-items - ;; Apparently, eshell-do-eval only works for immutable - ;; let-bindings, i.e. we cannot use `setq' on `for-items'. - ;; Instead we store the list in the car of a cons-cell (which - ;; acts as a ref-cell) so we can setcar instead of setq. - (list - (append - ,@(mapcar - (lambda (elem) - (if (listp elem) - elem - `(list ,elem))) - (cdr (cddr terms)))))) + (append + ,@(mapcar + (lambda (elem) + (if (listp elem) + elem + `(list ,elem))) + (cdr (cddr terms))))) (eshell-command-body '(nil)) (eshell-test-body '(nil))) - (while (consp (car for-items)) - (let ((,(intern (cadr terms)) (caar for-items))) + (while (consp for-items) + (let ((,(intern (cadr terms)) (car for-items))) (eshell-protect ,(eshell-invokify-arg body t))) - (setcar for-items (cdar for-items))) + (setq for-items (cdr for-items))) (eshell-close-handles eshell-last-command-status (list 'quote eshell-last-command-result)))))) @@ -766,9 +761,8 @@ `(eshell-copy-handles (progn ,(when (cdr pipeline) - `(let (nextproc) - (setq nextproc - (eshell-do-pipelines (quote ,(cdr pipeline)) t)) + `(let ((nextproc + (eshell-do-pipelines (quote ,(cdr pipeline)) t))) (eshell-set-output-handle ,eshell-output-handle 'append nextproc) (eshell-set-output-handle ,eshell-error-handle @@ -796,10 +790,9 @@ Output of each command is passed as input to the next one in the pipeline. This is used on systems where `start-process' is not supported." (when (setq pipeline (cadr pipeline)) - `(let (result) + `(progn ,(when (cdr pipeline) - `(let (output-marker) - (setq output-marker ,(point-marker)) + `(let ((output-marker ,(point-marker))) (eshell-set-output-handle ,eshell-output-handle 'append output-marker) (eshell-set-output-handle ,eshell-error-handle @@ -811,21 +804,21 @@ (when (memq (car head) eshell-deferrable-commands) (ignore (setcar head - (intern-soft - (concat (symbol-name (car head)) "*")))))) - ;; The last process in the pipe should get its handles + (intern-soft + (concat (symbol-name (car head)) "*")))))) + ;; The last process in the pipe should get its handles ;; redirected as we found them before running the pipe. ,(if (null (cdr pipeline)) `(progn (setq eshell-current-handles tail-handles) (setq eshell-in-pipeline-p nil))) - (setq result ,(car pipeline)) - ;; tailproc gets the result of the last successful process in - ;; the pipeline. - (setq tailproc (or result tailproc)) - ,(if (cdr pipeline) - `(eshell-do-pipelines-synchronously (quote ,(cdr pipeline)))) - result))) + (let ((result ,(car pipeline))) + ;; tailproc gets the result of the last successful process in + ;; the pipeline. + (setq tailproc (or result tailproc)) + ,(if (cdr pipeline) + `(eshell-do-pipelines-synchronously (quote ,(cdr pipeline)))) + result)))) (defalias 'eshell-process-identity 'identity) @@ -890,8 +883,7 @@ (eshell-print "errors\n")) (if eshell-debug-command (eshell-print "commands\n"))) - ((or (string= (car args) "-h") - (string= (car args) "--help")) + ((member (car args) '("-h" "--help")) (eshell-print "usage: eshell-debug [kinds] This command is used to aid in debugging problems related to Eshell @@ -1091,6 +1083,11 @@ (eshell-manipulate "handling special form" (setcar args `(eshell-do-eval ',(car args) ,synchronous-p)))) (eval form)) + ((eq (car form) 'setq) + (if (cddr args) (error "Unsupported form (setq X1 E1 X2 E2..)")) + (eshell-manipulate "evaluating arguments to setq" + (setcar (cdr args) (eshell-do-eval (cadr args) synchronous-p))) + (list 'quote (eval form))) (t (if (and args (not (memq (car form) '(run-hooks)))) (eshell-manipulate @@ -1127,11 +1124,12 @@ ;; Thus, aliases can even contain references to asynchronous ;; sub-commands, and things will still work out as they ;; should. - (let (result new-form) - (if (setq new-form - (catch 'eshell-replace-command - (ignore - (setq result (eval form))))) + (let* (result + (new-form + (catch 'eshell-replace-command + (ignore + (setq result (eval form)))))) + (if new-form (progn (eshell-manipulate "substituting replacement form" (setcar form (car new-form)) @@ -1247,25 +1245,23 @@ PRINTER and ERRPRINT are functions to use for printing regular messages, and errors. FORM-P should be non-nil if FUNC-OR-FORM represent a lisp form; ARGS will be ignored in that case." - (let (result) - (eshell-condition-case err - (progn - (setq result - (save-current-buffer - (if form-p - (eval func-or-form) - (apply func-or-form args)))) - (and result (funcall printer result)) - result) - (error - (let ((msg (error-message-string err))) - (if (and (not form-p) - (string-match "^Wrong number of arguments" msg) - (fboundp 'eldoc-get-fnsym-args-string)) - (let ((func-doc (eldoc-get-fnsym-args-string func-or-form))) - (setq msg (format "usage: %s" func-doc)))) - (funcall errprint msg)) - nil)))) + (eshell-condition-case err + (let ((result + (save-current-buffer + (if form-p + (eval func-or-form) + (apply func-or-form args))))) + (and result (funcall printer result)) + result) + (error + (let ((msg (error-message-string err))) + (if (and (not form-p) + (string-match "^Wrong number of arguments" msg) + (fboundp 'eldoc-get-fnsym-args-string)) + (let ((func-doc (eldoc-get-fnsym-args-string func-or-form))) + (setq msg (format "usage: %s" func-doc)))) + (funcall errprint msg)) + nil))) (defsubst eshell-apply* (printer errprint func args) "Call FUNC, with ARGS, trapping errors and return them as output. === modified file 'lisp/eshell/esh-util.el' --- lisp/eshell/esh-util.el 2011-03-10 07:16:04 +0000 +++ lisp/eshell/esh-util.el 2011-11-18 14:49:42 +0000 @@ -140,14 +140,13 @@ (defmacro eshell-condition-case (tag form &rest handlers) "If `eshell-handle-errors' is non-nil, this is `condition-case'. Otherwise, evaluates FORM with no error handling." + (declare (indent 2)) (if eshell-handle-errors `(condition-case ,tag ,form ,@handlers) form)) -(put 'eshell-condition-case 'lisp-indent-function 2) - (defun eshell-find-delimiter (open close &optional bound reverse-p backslash-p) "From point, find the CLOSE delimiter corresponding to OPEN. @@ -275,14 +274,14 @@ text)) (defmacro eshell-for (for-var for-list &rest forms) - "Iterate through a list" + "Iterate through a list." + (declare (indent 2)) `(let ((list-iter ,for-list)) (while list-iter (let ((,for-var (car list-iter))) ,@forms) (setq list-iter (cdr list-iter))))) -(put 'eshell-for 'lisp-indent-function 2) (make-obsolete 'eshell-for 'dolist "24.1") ------------------------------------------------------------ revno: 106413 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-11-18 09:34:39 -0500 message: * lisp/files-x.el (modify-file-local-variable): Obey commenting conventions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-17 21:34:16 +0000 +++ lisp/ChangeLog 2011-11-18 14:34:39 +0000 @@ -1,3 +1,7 @@ +2011-11-18 Stefan Monnier + + * files-x.el (modify-file-local-variable): Obey commenting conventions. + 2011-11-17 Glenn Morris * emacs-lisp/autoload.el (autoload-generate-file-autoloads): === modified file 'lisp/files-x.el' --- lisp/files-x.el 2011-04-19 13:44:55 +0000 +++ lisp/files-x.el 2011-11-18 14:34:39 +0000 @@ -149,7 +149,7 @@ (goto-char (point-max)) (let ((comment-style 'plain) - (comment-start (or comment-start ";;; "))) + (comment-start (or comment-start ";; "))) (comment-region (prog1 (setq beg (point)) (insert "\nLocal Variables:\nEnd:\n")) ------------------------------------------------------------ revno: 106412 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-11-18 14:41:36 +0200 message: Add assertion for hash values of rows. src/dispnew.c (add_row_entry): Add xassert to verify that ROW's hash code is valid. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-18 12:21:42 +0000 +++ src/ChangeLog 2011-11-18 12:41:36 +0000 @@ -4,6 +4,7 @@ hash values of the two rows. (copy_row_except_pointers): Preserve the used[] arrays and the hash values of the two rows. (Bug#10035) + (add_row_entry): Add xassert to verify that ROW's hash code is valid. * xdisp.c (row_hash): New function, body extracted from compute_line_metrics. === modified file 'src/dispnew.c' --- src/dispnew.c 2011-11-18 12:21:42 +0000 +++ src/dispnew.c 2011-11-18 12:41:36 +0000 @@ -4240,6 +4240,7 @@ ptrdiff_t i = row->hash % row_table_size; entry = row_table[i]; + xassert (entry || verify_row_hash (row)); while (entry && !row_equal_p (entry->row, row, 1)) entry = entry->next; ------------------------------------------------------------ revno: 106411 fixes bug(s): http://debbugs.gnu.org/10035 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-11-18 14:21:42 +0200 message: Fix another crash due to incorrect hash value of glyph rows, bug #10035. src/dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the hash values of the two rows. (copy_row_except_pointers): Preserve the used[] arrays and the hash values of the two rows. src/xdisp.c (row_hash): New function, body extracted from compute_line_metrics. (compute_line_metrics): Call row_hash, instead of computing the hash code inline. src/dispnew.c (verify_row_hash): Call row_hash for computing the hash code of a row, instead of duplicating code from xdisp.c. src/dispextern.h (row_hash): Add prototype. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-18 09:36:59 +0000 +++ src/ChangeLog 2011-11-18 12:21:42 +0000 @@ -1,3 +1,20 @@ +2011-11-18 Eli Zaretskii + + * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the + hash values of the two rows. + (copy_row_except_pointers): Preserve the used[] arrays and the + hash values of the two rows. (Bug#10035) + + * xdisp.c (row_hash): New function, body extracted from + compute_line_metrics. + (compute_line_metrics): Call row_hash, instead of computing the + hash code inline. + + * dispnew.c (verify_row_hash): Call row_hash for computing the + hash code of a row, instead of duplicating code from xdisp.c. + + * dispextern.h (row_hash): Add prototype. + 2011-11-18 Tassilo Horn * frame.c (delete_frame): Don't delete the terminal when the last === modified file 'src/dispextern.h' --- src/dispextern.h 2011-11-08 20:05:27 +0000 +++ src/dispextern.h 2011-11-18 12:21:42 +0000 @@ -3126,6 +3126,9 @@ void w32_init_fringe (struct redisplay_interface *); void w32_reset_fringes (void); #endif + +extern unsigned row_hash (struct glyph_row *); + /* Defined in image.c */ #ifdef HAVE_WINDOW_SYSTEM === modified file 'src/dispnew.c' --- src/dispnew.c 2011-11-17 17:40:48 +0000 +++ src/dispnew.c 2011-11-18 12:21:42 +0000 @@ -434,18 +434,7 @@ int verify_row_hash (struct glyph_row *row) { - int area, k; - unsigned row_hash = 0; - - for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) - for (k = 0; k < row->used[area]; ++k) - row_hash = ((((row_hash << 4) + (row_hash >> 24)) & 0x0fffffff) - + row->glyphs[area][k].u.val - + row->glyphs[area][k].face_id - + row->glyphs[area][k].padding_p - + (row->glyphs[area][k].type << 2)); - - return row_hash == row->hash; + return row->hash == row_hash (row); } #endif @@ -1083,37 +1072,55 @@ #endif /* 0 */ -/* Exchange pointers to glyph memory between glyph rows A and B. */ +/* Exchange pointers to glyph memory between glyph rows A and B. Also + exchange the used[] array and the hash values of the rows, because + these should all go together for the row's hash value to be + correct. */ static inline void swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b) { int i; + unsigned hash_tem = a->hash; + for (i = 0; i < LAST_AREA + 1; ++i) { struct glyph *temp = a->glyphs[i]; + short used_tem = a->used[i]; + a->glyphs[i] = b->glyphs[i]; b->glyphs[i] = temp; + a->used[i] = b->used[i]; + b->used[i] = used_tem; } + a->hash = b->hash; + b->hash = hash_tem; } /* Copy glyph row structure FROM to glyph row structure TO, except - that glyph pointers in the structures are left unchanged. */ + that glyph pointers, the `used' counts, and the hash values in the + structures are left unchanged. */ static inline void copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) { struct glyph *pointers[1 + LAST_AREA]; + short used[1 + LAST_AREA]; + unsigned hashval; /* Save glyph pointers of TO. */ memcpy (pointers, to->glyphs, sizeof to->glyphs); + memcpy (used, to->used, sizeof to->used); + hashval = to->hash; /* Do a structure assignment. */ *to = *from; /* Restore original pointers of TO. */ memcpy (to->glyphs, pointers, sizeof to->glyphs); + memcpy (to->used, used, sizeof to->used); + to->hash = hashval; } === modified file 'src/xdisp.c' --- src/xdisp.c 2011-11-15 07:55:13 +0000 +++ src/xdisp.c 2011-11-18 12:21:42 +0000 @@ -17949,6 +17949,23 @@ } } +/* Compute the hash code for ROW. */ +unsigned +row_hash (struct glyph_row *row) +{ + int area, k; + unsigned hashval = 0; + + for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) + for (k = 0; k < row->used[area]; ++k) + hashval = ((((hashval << 4) + (hashval >> 24)) & 0x0fffffff) + + row->glyphs[area][k].u.val + + row->glyphs[area][k].face_id + + row->glyphs[area][k].padding_p + + (row->glyphs[area][k].type << 2)); + + return hashval; +} /* Compute the pixel height and width of IT->glyph_row. @@ -18035,17 +18052,7 @@ } /* Compute a hash code for this row. */ - { - int area, i; - row->hash = 0; - for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) - for (i = 0; i < row->used[area]; ++i) - row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff) - + row->glyphs[area][i].u.val - + row->glyphs[area][i].face_id - + row->glyphs[area][i].padding_p - + (row->glyphs[area][i].type << 2)); - } + row->hash = row_hash (row); it->max_ascent = it->max_descent = 0; it->max_phys_ascent = it->max_phys_descent = 0; ------------------------------------------------------------ revno: 106410 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2011-11-18 10:36:59 +0100 message: Work around GTK bug crashing emacs GTK builds. * frame.c (delete_frame): Don't delete the terminal when the last X frame is closed if emacs is built with GTK toolkit. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-17 12:16:44 +0000 +++ src/ChangeLog 2011-11-18 09:36:59 +0000 @@ -1,3 +1,8 @@ +2011-11-18 Tassilo Horn + + * frame.c (delete_frame): Don't delete the terminal when the last + X frame is closed if emacs is built with GTK toolkit. + 2011-11-17 Juanma Barranquero * window.c (syms_of_window) : Fix typo. === modified file 'src/frame.c' --- src/frame.c 2011-11-17 09:09:20 +0000 +++ src/frame.c 2011-11-18 09:36:59 +0000 @@ -1359,6 +1359,13 @@ /* If needed, delete the terminal that this frame was on. (This must be done after the frame is killed.) */ terminal->reference_count--; +#ifdef USE_GTK + /* FIXME: Deleting the terminal crashes emacs because of a GTK + bug. + http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00363.html */ + if (terminal->reference_count == 0 && terminal->type == output_x_window) + terminal->reference_count = 1; +#endif /* USE_GTK */ if (terminal->reference_count == 0) { Lisp_Object tmp; ------------------------------------------------------------ revno: 106409 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-11-18 00:31:02 -0800 message: Spelling fixes. diff: === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2011-11-17 09:09:20 +0000 +++ doc/misc/org.texi 2011-11-18 08:31:02 +0000 @@ -15533,7 +15533,7 @@ @i{Jambunathan K} contributed the OpenDocumentText exporter. @item @i{Sebastien Vauban} reported many issues with LaTeX and BEAMER export and -enabled source code highlighling in Gnus. +enabled source code highlighting in Gnus. @item @i{Stefan Vollmar} organized a video-recorded talk at the Max-Planck-Institute for Neurology. He also inspired the creation of a === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-11-14 23:59:56 +0000 +++ etc/ChangeLog 2011-11-18 08:31:02 +0000 @@ -4107,7 +4107,7 @@ 2002-02-01 ShengHuo ZHU - * gnus.xpm: Remove garbages. + * gnus.xpm: Remove garbage. 2002-01-27 Pavel Janík === modified file 'etc/NEWS.1-17' --- etc/NEWS.1-17 2011-11-17 17:40:48 +0000 +++ etc/NEWS.1-17 2011-11-18 08:31:02 +0000 @@ -2423,7 +2423,7 @@ or show the text or subheadings under each heading line independently. Hidden text or subheadings are invisibly attached to the end of the preceding heading line, so that - if you kill the hading line and yank it back elsewhere + if you kill the heading line and yank it back elsewhere all the invisible lines accompany it. All editing commands treat hidden outline-mode lines === modified file 'etc/themes/manoj-dark-theme.el' --- etc/themes/manoj-dark-theme.el 2011-11-14 23:59:56 +0000 +++ etc/themes/manoj-dark-theme.el 2011-11-18 08:31:02 +0000 @@ -37,7 +37,7 @@ ;; (blueish) or mail (greenish), have states (large number of under ;; messages, normal, and empty). The large number unread groups have ;; highest luminance (appear brighter), and the empty one have lower -;; luminance (appear greyer), but have the same chroma and saturation. +;; luminance (appear grayer), but have the same chroma and saturation. ;; Sub states and group priorities are rendered using a color series ;; which has constant luminance and saturation, and vary in hue by a ;; constant separation -- so all the related groups have the same @@ -53,7 +53,7 @@ ;; In the message itself, quoted mail messages from different people ;; are color coordinated, with high contrast between citations that are -;; close to each other in the heirarchy, so it is less likely that one +;; close to each other in the hierarchy, so it is less likely that one ;; misunderstands who said what in a long conversation. ;; The following scheme covers programming languages, Gnus, Erc, mail, === modified file 'lisp/calc/calc-misc.el' --- lisp/calc/calc-misc.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc-misc.el 2011-11-18 08:31:02 +0000 @@ -260,13 +260,13 @@ (length msg)) 32) " [?=MORE]") "")))))))) - + ;;;; Stack and buffer management. -;; The variable calc-last-why-command is set in calc-do-handly-whys +;; The variable calc-last-why-command is set in calc-do-handle-whys ;; and used in calc-why (in calc-stuff.el). (defvar calc-last-why-command) === modified file 'lisp/cedet/ede/proj.el' --- lisp/cedet/ede/proj.el 2011-01-26 08:36:39 +0000 +++ lisp/cedet/ede/proj.el 2011-11-18 08:31:02 +0000 @@ -584,7 +584,7 @@ link))) -;;; Target type specific autogenerating gobbldegook. +;;; Target type specific autogenerating gobbledygook. ;; (defun ede-proj-makefile-type (&optional proj) === modified file 'lisp/cedet/pulse.el' --- lisp/cedet/pulse.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/pulse.el 2011-11-18 08:31:02 +0000 @@ -77,7 +77,7 @@ (:background "#AAAA33")) (((class color) (background light)) (:background "#FFFFAA"))) - "*Face used at beginning of a highight." + "*Face used at beginning of a highlight." :group 'pulse) (defface pulse-highlight-face === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2011-10-05 05:30:03 +0000 +++ lisp/emacs-lisp/edebug.el 2011-11-18 08:31:02 +0000 @@ -1285,7 +1285,7 @@ ;; Wrap a form, usually a defining form, but any evaluated one. ;; If speclist is non-nil, this is being called by edebug-defining-form. ;; Otherwise it is being called from edebug-read-and-maybe-wrap-form1. - ;; This is a hack, but I havent figured out a simpler way yet. + ;; This is a hack, but I haven't figured out a simpler way yet. (let* ((form-data-entry (edebug-get-form-data-entry form-begin form-end)) ;; Set this marker before parsing. (edebug-form-begin-marker === modified file 'lisp/emulation/cua-rect.el' --- lisp/emulation/cua-rect.el 2011-05-23 17:57:17 +0000 +++ lisp/emulation/cua-rect.el 2011-11-18 08:31:02 +0000 @@ -741,7 +741,7 @@ ;; We try to reuse overlays where possible because this is more efficient ;; and results in less flicker. ;; If cua--rectangle-virtual-edges is nil and the buffer contains tabs or short lines, - ;; the higlighted region may not be perfectly rectangular. + ;; the highlighted region may not be perfectly rectangular. (let ((deactivate-mark deactivate-mark) (old cua--rectangle-overlays) (new nil) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2011-11-16 17:47:25 +0000 +++ lisp/gnus/gnus-sum.el 2011-11-18 08:31:02 +0000 @@ -364,7 +364,7 @@ This variable can either be the symbols `first' (place point on the first subject), `unread' (place point on the subject line of the first unread article), `best' (place point on the subject line of the -higest-scored article), `unseen' (place point on the subject line of +highest-scored article), `unseen' (place point on the subject line of the first unseen article), `unseen-or-unread' (place point on the subject line of the first unseen article or, if all articles have been seen, on the subject line of the first unread article), or a function to be called to === modified file 'lisp/gnus/spam-report.el' --- lisp/gnus/spam-report.el 2011-01-26 08:36:39 +0000 +++ lisp/gnus/spam-report.el 2011-11-18 08:31:02 +0000 @@ -102,7 +102,7 @@ (customize-set-variable spam-report-resend-to (read-from-minibuffer "email address to resend SPAM/HAM to? "))) - ;; This is ganked from the `gnus-summary-resend-message' function. + ;; This is yanked from the `gnus-summary-resend-message' function. ;; It involves rendering the SPAM, which is undesirable, but there does ;; not seem to be a nicer way to achieve this. ;; select this particular article === modified file 'lisp/info-xref.el' --- lisp/info-xref.el 2011-04-19 13:44:55 +0000 +++ lisp/info-xref.el 2011-11-18 08:31:02 +0000 @@ -313,7 +313,7 @@ (interactive) (info-xref-check-list (info-xref-all-info-files))) -;; An alternative for geting only top-level files here would be to simply +;; An alternative for getting only top-level files here would be to simply ;; return all files and have info-xref-check-list not follow "Indirect:". ;; The current way seems better because it (potentially) gets the proper ;; top-level filename into the error messages, and suppresses duplicate "not === modified file 'lisp/international/quail.el' --- lisp/international/quail.el 2011-11-15 17:37:37 +0000 +++ lisp/international/quail.el 2011-11-18 08:31:02 +0000 @@ -2701,7 +2701,7 @@ (put 'quail-decode-map 'char-table-extra-slots 0) -;; Generate a halfly-cooked decode map (char-table) for the current +;; Generate a half-cooked decode map (char-table) for the current ;; Quail map. An element for a character C is a key string or a list ;; of a key strings to type to input C. The lenth of key string is at ;; most 2. If it is 2, more keys may be required to input C. @@ -2974,7 +2974,7 @@ (if (not (re-search-forward leim-list-entry-regexp nil t)) nil - ;; Remove garbages after the header. + ;; Remove garbage after the header. (goto-char (match-beginning 0)) (if (< pos (point)) (delete-region pos (point))) === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-10-17 16:30:02 +0000 +++ lisp/minibuffer.el 2011-11-18 08:31:02 +0000 @@ -51,7 +51,7 @@ ;; - choose-completion doesn't know how to quote the text it inserts. ;; E.g. it fails to double the dollars in file-name completion, or ;; to backslash-escape spaces and other chars in comint completion. -;; - when completing ~/tmp/fo$$o, the highligting in *Completions* +;; - when completing ~/tmp/fo$$o, the highlighting in *Completions* ;; is off by one position. ;; - all code like PCM which relies on all-completions to match ;; its argument gets confused because all-completions returns unquoted === modified file 'lisp/net/browse-url.el' --- lisp/net/browse-url.el 2011-11-14 06:27:12 +0000 +++ lisp/net/browse-url.el 2011-11-18 08:31:02 +0000 @@ -100,7 +100,7 @@ ;; ; hm--html-menus can be used ;; with this. -;; This package generalises function html-previewer-process in Marc +;; This package generalizes function html-previewer-process in Marc ;; Andreessen's html-mode (LCD modes/html-mode.el.Z). See also the ;; ffap.el package. The huge hyperbole package also contains similar ;; functions. === modified file 'lisp/org/org-taskjuggler.el' --- lisp/org/org-taskjuggler.el 2011-08-18 20:41:06 +0000 +++ lisp/org/org-taskjuggler.el 2011-11-18 08:31:02 +0000 @@ -70,7 +70,7 @@ ;; "taskjuggler_project" (or whatever you customized ;; `org-export-taskjuggler-project-tag' to). You are now ready to ;; export the project plan with `org-export-as-taskjuggler-and-open' -;; which will export the project plan and open a gant chart in +;; which will export the project plan and open a Gantt chart in ;; TaskJugglerUI. ;; ;; * Resources @@ -354,8 +354,8 @@ (let* ((props (org-entry-properties)) (components (org-heading-components)) (level (nth 1 components)) - (headline - (replace-regexp-in-string + (headline + (replace-regexp-in-string "\"" "\\\"" (nth 4 components) t t)) ; quote double quotes in headlines (parent-ordered (org-taskjuggler-parent-is-ordered-p))) (push (cons "level" level) props) @@ -405,10 +405,10 @@ (successor (car (cdr tasks)))) (cond ;; if a task has no successors it is a leaf - ((null successor) + ((null successor) (push (cons (cons "leaf-node" t) task) new-list)) ;; if the successor has a lower level than task it is a leaf - ((<= (cdr (assoc "level" successor)) (cdr (assoc "level" task))) + ((<= (cdr (assoc "level" successor)) (cdr (assoc "level" task))) (push (cons (cons "leaf-node" t) task) new-list)) ;; otherwise examine the rest of the tasks (t (push task new-list)))) === modified file 'lisp/play/bubbles.el' --- lisp/play/bubbles.el 2011-04-21 12:24:46 +0000 +++ lisp/play/bubbles.el 2011-11-18 08:31:02 +0000 @@ -55,7 +55,7 @@ ;; 0.3 (2007-03-11) ;; - Renamed shift modes and thus names of score files. All -;; highscores are lost, unless you rename the score files from +;; high scores are lost, unless you rename the score files from ;; bubbles-shift-... to bubbles-...! ;; - Bugfixes: Check for successful image creation. ;; Disable menus and counter when game is over. === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2011-11-17 09:09:20 +0000 +++ lisp/progmodes/cperl-mode.el 2011-11-18 08:31:02 +0000 @@ -927,7 +927,7 @@ A1) CPerl may work around these deficiencies (for big chunks, mostly PODs and HERE-documents), or - A2) On capable Emaxen CPerl will use improved syntax-handlings + A2) On capable Emaxen CPerl will use improved syntax-handling which reads mark-up hints directly. The scan in case A2 is much more comprehensive, thus may be slower. @@ -4540,7 +4540,7 @@ (forward-char 2)) (and (eq (following-char) ?\] ) (forward-char 1))) - (setq REx-subgr-end qtag) ;EndOf smart-highlighed + (setq REx-subgr-end qtag) ;End smart-highlighted ;; Apparently, I can't put \] into a charclass ;; in m]]: m][\\\]\]] produces [\\]] ;;; POSIX? [:word:] [:^word:] only inside [] === modified file 'lisp/progmodes/ebnf2ps.el' --- lisp/progmodes/ebnf2ps.el 2011-11-17 09:09:20 +0000 +++ lisp/progmodes/ebnf2ps.el 2011-11-18 08:31:02 +0000 @@ -6069,7 +6069,7 @@ (defun ebnf-make-terminal1 (name gen-func dim-func) - (vector gen-func ; 0 generatore + (vector gen-func ; 0 generator 'ignore ; 1 width fun dim-func ; 2 dimension fun 0.0 ; 3 entry === modified file 'lisp/progmodes/ps-mode.el' --- lisp/progmodes/ps-mode.el 2011-11-13 07:48:23 +0000 +++ lisp/progmodes/ps-mode.el 2011-11-18 08:31:02 +0000 @@ -267,7 +267,7 @@ . (1 font-lock-function-name-face)) '("/\\w+" . font-lock-variable-name-face) (cons ps-mode-operators 'font-lock-keyword-face))) - "High level highliting for PostScript mode.") + "High level highlighting for PostScript mode.") (defconst ps-mode-font-lock-keywords ps-mode-font-lock-keywords-1 "Default expressions to highlight in PostScript mode.") === modified file 'lisp/shell.el' --- lisp/shell.el 2011-10-19 12:54:24 +0000 +++ lisp/shell.el 2011-11-18 08:31:02 +0000 @@ -293,7 +293,7 @@ (getenv "ESHELL") shell-file-name)) (name (file-name-nondirectory prog))) ;; Tell bash not to use readline, except for bash 1.x which - ;; doesn't grook --noediting. Bash 1.x has -nolineediting, but + ;; doesn't grok --noediting. Bash 1.x has -nolineediting, but ;; process-send-eof cannot terminate bash if we use it. (if (and (not purify-flag) (equal name "bash") === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2011-11-15 07:55:13 +0000 +++ lisp/textmodes/flyspell.el 2011-11-18 08:31:02 +0000 @@ -715,7 +715,7 @@ (remove-hook 'after-change-functions 'flyspell-after-change-function t) (remove-hook 'hack-local-variables-hook (function flyspell-hack-local-variables-hook) t) - ;; we remove all the flyspell hilightings + ;; we remove all the flyspell highlightings (flyspell-delete-all-overlays) ;; we have to erase pre cache variables (setq flyspell-pre-buffer nil) === modified file 'lwlib/xlwmenu.c' --- lwlib/xlwmenu.c 2011-10-13 14:55:46 +0000 +++ lwlib/xlwmenu.c 2011-11-18 08:31:02 +0000 @@ -1486,7 +1486,7 @@ if (new_selection && !new_selection->enabled) new_selection = NULL; - /* Call callback when the hightlighted item changes. */ + /* Call callback when the highlighted item changes. */ if (old_selection || new_selection) XtCallCallbackList ((Widget)mw, mw->menu.highlight, (XtPointer) new_selection); === modified file 'nt/INSTALL' --- nt/INSTALL 2011-11-05 11:34:56 +0000 +++ nt/INSTALL 2011-11-18 08:31:02 +0000 @@ -29,7 +29,7 @@ "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Debug - if you are goiung to compile a debug version, or + if you are going to compile a debug version, or "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Release @@ -268,7 +268,7 @@ "Error in --cflags argument: ... Backslashes and quotes cannot be used with --cflags. Please use forward slashes for filenames and paths (e.g. when passing directories to -I)." - + N.B. It is normal to see a few error messages output while configure is running, when gcc support is being tested. These cannot be suppressed because of limitations in the Windows 9X command.com shell. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2011-11-17 09:09:20 +0000 +++ src/gtkutil.c 2011-11-18 08:31:02 +0000 @@ -348,7 +348,7 @@ /* For the image defined in IMG, make and return a GtkImage. For displays with 8 planes or less we must make a GdkPixbuf and apply the mask manually. - Otherwise the highlightning and dimming the tool bar code in GTK does + Otherwise the highlighting and dimming the tool bar code in GTK does will look bad. For display with more than 8 planes we just use the pixmap and mask directly. For monochrome displays, GTK doesn't seem able to use external pixmaps, it looks bad whatever we do. === modified file 'src/w32.c' --- src/w32.c 2011-11-07 16:42:34 +0000 +++ src/w32.c 2011-11-18 08:31:02 +0000 @@ -3403,7 +3403,7 @@ FILE_FLAG_BACKUP_SEMANTICS, NULL)) != INVALID_HANDLE_VALUE) { - /* This is more accurate in terms of gettting the correct number + /* This is more accurate in terms of getting the correct number of links, but is quite slow (it is noticeable when Emacs is making a list of file name completions). */ BY_HANDLE_FILE_INFORMATION info; ------------------------------------------------------------ revno: 106408 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-11-18 00:25:45 -0800 message: Typo fix. diff: === modified file 'doc/misc/ada-mode.texi' --- doc/misc/ada-mode.texi 2011-11-17 17:40:48 +0000 +++ doc/misc/ada-mode.texi 2011-11-18 08:25:45 +0000 @@ -1357,7 +1357,7 @@ included, separated from the word by a space. If the word starts with an asterisk (@key{*}), it defines the casing -af a word fragment (or ``substring''); part of a word between two +as a word fragment (or ``substring''); part of a word between two underscores or word boundary. For example: ------------------------------------------------------------ revno: 106407 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-11-17 16:34:16 -0500 message: autoload.el fix for bug#10049 * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads): Ignore buffer-local generated-autoload-file if it is the same as the global value. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-17 12:16:44 +0000 +++ lisp/ChangeLog 2011-11-17 21:34:16 +0000 @@ -1,3 +1,9 @@ +2011-11-17 Glenn Morris + + * emacs-lisp/autoload.el (autoload-generate-file-autoloads): + Ignore buffer-local generated-autoload-file if it is the same + as the global value. (Bug#10049) + 2011-11-17 Juanma Barranquero * textmodes/reftex-toc.el (reftex-toc-return-marker, reftex-toc-help) === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2011-05-19 06:04:16 +0000 +++ lisp/emacs-lisp/autoload.el 2011-11-17 21:34:16 +0000 @@ -514,6 +514,13 @@ (let ((secondary-autoloads-file-buf (if (local-variable-p 'generated-autoload-file) (current-buffer)))) + ;; Ignore a buffer-local setting if it points to the + ;; global value. Otherwise we end up writing a mix of md5s + ;; and time-stamps to the global file. (Bug#10049) + (and secondary-autoloads-file-buf + outfile + (not otherbuf) + (setq secondary-autoloads-file-buf nil)) (with-current-buffer (marker-buffer output-start) (save-excursion ;; Insert the section-header line which lists the file name