Now on revision 106726. ------------------------------------------------------------ revno: 106726 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-12-23 16:51:51 +0200 message: Fix assertion violation in pop_it when org-indent-mode is used. src/xdisp.c (handle_invisible_prop): Handle correctly an invisible property that ends at ZV, so that the bidi iteration could be resumed from there (after widening). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-22 13:58:40 +0000 +++ src/ChangeLog 2011-12-23 14:51:51 +0000 @@ -1,3 +1,9 @@ +2011-12-23 Eli Zaretskii + + * xdisp.c (handle_invisible_prop): Handle correctly an invisible + property that ends at ZV, so that the bidi iteration could be + resumed from there (after widening). + 2011-12-22 Jan Djärv * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc. === modified file 'src/xdisp.c' --- src/xdisp.c 2011-12-10 19:54:45 +0000 +++ src/xdisp.c 2011-12-23 14:51:51 +0000 @@ -4090,10 +4090,11 @@ while (invis_p); /* The position newpos is now either ZV or on visible text. */ - if (it->bidi_p && newpos < ZV) + if (it->bidi_p) { EMACS_INT bpos = CHAR_TO_BYTE (newpos); - int on_newline = FETCH_BYTE (bpos) == '\n'; + int on_newline = + bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n'; int after_newline = newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n'; @@ -4111,16 +4112,16 @@ SET_TEXT_POS (tpos, newpos, bpos); reseat_1 (it, tpos, 0); - /* If we reseat on a newline, we need to prep the + /* If we reseat on a newline/ZV, we need to prep the bidi iterator for advancing to the next character - after the newline, keeping the current paragraph + after the newline/EOB, keeping the current paragraph direction (so that PRODUCE_GLYPHS does TRT wrt prepending/appending glyphs to a glyph row). */ if (on_newline) { it->bidi_it.first_elt = 0; it->bidi_it.paragraph_dir = pdir; - it->bidi_it.ch = '\n'; + it->bidi_it.ch = (bpos == ZV_BYTE) ? -1 : '\n'; it->bidi_it.nchars = 1; it->bidi_it.ch_len = 1; } ------------------------------------------------------------ revno: 106725 committer: Michael Albinus branch nick: trunk timestamp: Fri 2011-12-23 15:31:35 +0100 message: * net/ange-ftp.el (ange-ftp-copy-file-internal): Check for existence of source file. (Bug#10325) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-23 11:48:54 +0000 +++ lisp/ChangeLog 2011-12-23 14:31:35 +0000 @@ -1,3 +1,8 @@ +2011-12-23 Michael Albinus + + * net/ange-ftp.el (ange-ftp-copy-file-internal): Check for + existence of source file. (Bug#10325) + 2011-12-23 Alan Mackenzie Fix unstable fontification inside templates. === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2011-12-12 05:32:49 +0000 +++ lisp/net/ange-ftp.el 2011-12-23 14:31:35 +0000 @@ -3637,6 +3637,10 @@ (setq filename (expand-file-name filename) newname (expand-file-name newname)) + (or (file-exists-p filename) + (signal 'file-error + (list "Copy file" "no such file or directory" filename))) + ;; canonicalize newname if a directory. (if (file-directory-p newname) (setq newname (expand-file-name (file-name-nondirectory filename) newname))) ------------------------------------------------------------ revno: 106724 fixes bug(s): http://debbugs.gnu.org/10354 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2011-12-23 14:14:12 +0100 message: Fix bug#10354. * doc/lispref/variables.texi (Variables with Restricted Values): Change reference to variable. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-12-13 13:37:48 +0000 +++ doc/lispref/ChangeLog 2011-12-23 13:14:12 +0000 @@ -1,3 +1,8 @@ +2011-12-23 Juanma Barranquero + + * variables.texi (Variables with Restricted Values): + Change reference to variable (bug#10354). + 2011-12-13 Martin Rudalics * windows.texi (Splitting Windows): Use t instead of non-nil === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2011-07-15 12:45:51 +0000 +++ doc/lispref/variables.texi 2011-12-23 13:14:12 +0000 @@ -1998,6 +1998,6 @@ Attempting to assign them any other value will result in an error: @example -(setq window-min-height 5.0) -@error{} Wrong type argument: integerp, 5.0 +(setq undo-limit 1000.0) +@error{} Wrong type argument: integerp, 1000.0 @end example ------------------------------------------------------------ revno: 106723 committer: Alan Mackenzie branch nick: trunk timestamp: Fri 2011-12-23 11:48:54 +0000 message: Fix unstable fontification inside templates. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-23 00:44:27 +0000 +++ lisp/ChangeLog 2011-12-23 11:48:54 +0000 @@ -1,3 +1,21 @@ +2011-12-23 Alan Mackenzie + + Fix unstable fontification inside templates. + + * progmodes/cc-langs.el (c-before-font-lock-functions): newly + created from the singular version. The (c c++ objc) entry now + additionally has c-set-fl-decl-start. The other languages (apart + from AWK) have that as a single entry. + + * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): The + functionality for "local" declarations has been extracted to + c-set-fl-decl-start. + + * progmodes/cc-mode.el: (c-common-init, c-after-change): Changes + due to pluralisation of c-before-font-lock-functions. + (c-set-fl-decl-start): New function, extracted from + c-font-lock-enclosing-decls and enhanced. + 2011-12-23 Juanma Barranquero * desktop.el (desktop-internal-v2s): Fix typos in docstring (bug#10353). === modified file 'lisp/progmodes/cc-fonts.el' --- lisp/progmodes/cc-fonts.el 2011-12-13 18:47:08 +0000 +++ lisp/progmodes/cc-fonts.el 2011-12-23 11:48:54 +0000 @@ -1538,25 +1538,8 @@ ;; prevent a repeat invocation. See elisp/lispref page "Search-based ;; Fontification". (let* ((paren-state (c-parse-state)) - (start (point)) - (bod-lim (max (- (point) 500) (point-min))) - decl-context bo-decl in-typedef type-type ps-elt) - - ;; First, are we actually in a "local" declaration? - (setq decl-context (c-beginning-of-decl-1 bod-lim) - bo-decl (point) - in-typedef (looking-at c-typedef-key)) - (if in-typedef (c-forward-token-2)) - (when (and (eq (car decl-context) 'same) - (< bo-decl start)) - ;; Are we genuinely at a type? - (setq type-type (c-forward-type t)) - (if (and type-type - (or (not (eq type-type 'maybe)) - (looking-at c-symbol-key))) - (c-font-lock-declarators limit t in-typedef))) - - ;; Secondly, are we in any nested struct/union/class/etc. braces? + decl-context in-typedef ps-elt) + ;; Are we in any nested struct/union/class/etc. braces? (while paren-state (setq ps-elt (car paren-state) paren-state (cdr paren-state)) === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2011-12-13 21:13:51 +0000 +++ lisp/progmodes/cc-langs.el 2011-12-23 11:48:54 +0000 @@ -485,28 +485,34 @@ When the mode is initialized, the functions are called with parameters \(point-min) and \(point-max).") -(c-lang-defconst c-before-font-lock-function - "If non-nil, a function called just before font locking. -Typically it will extend the region about to be fontified \(see +(c-lang-defconst c-before-font-lock-functions + ;; For documentation see the following c-lang-defvar of the same name. + ;; The value here may be a list of functions or a single function. + t 'c-set-fl-decl-start + (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP c-set-fl-decl-start) + awk 'c-awk-extend-and-syntax-tablify-region) +(c-lang-defvar c-before-font-lock-functions + (let ((fs (c-lang-const c-before-font-lock-functions))) + (if (listp fs) + fs + (list fs))) + "If non-nil, a list of functions called just before font locking. +Typically they will extend the region about to be fontified \(see below) and will set `syntax-table' text properties on the region. -It takes 3 parameters, the BEG, END, and OLD-LEN supplied to -every after-change function; point is undefined on both entry and -exit; on entry, the buffer will have been widened and match-data -will have been saved; the return value is ignored. +These functions will be run in the order given. Each of them +takes 3 parameters, the BEG, END, and OLD-LEN supplied to every +after-change function; point is undefined on both entry and exit; +on entry, the buffer will have been widened and match-data will +have been saved; the return value is ignored. -The function may extend the region to be fontified by setting the +The functions may extend the region to be fontified by setting the buffer local variables c-new-BEG and c-new-END. -The function is called even when font locking is disabled. +The functions are called even when font locking is disabled. -When the mode is initialized, this function is called with -parameters \(point-min), \(point-max) and ." - t nil - (c c++ objc) 'c-neutralize-syntax-in-and-mark-CPP - awk 'c-awk-extend-and-syntax-tablify-region) -(c-lang-defvar c-before-font-lock-function - (c-lang-const c-before-font-lock-function)) +When the mode is initialized, these functions are called with +parameters \(point-min), \(point-max) and .") ;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK). === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2011-12-13 18:47:08 +0000 +++ lisp/progmodes/cc-mode.el 2011-12-23 11:48:54 +0000 @@ -633,13 +633,13 @@ (setq c-new-BEG (point-min)) (setq c-new-END (point-max)) (save-excursion - (if c-get-state-before-change-functions - (mapc (lambda (fn) - (funcall fn (point-min) (point-max))) - c-get-state-before-change-functions)) - (if c-before-font-lock-function - (funcall c-before-font-lock-function (point-min) (point-max) - (- (point-max) (point-min)))))) + (mapc (lambda (fn) + (funcall fn (point-min) (point-max))) + c-get-state-before-change-functions) + (mapc (lambda (fn) + (funcall fn (point-min) (point-max) + (- (point-max) (point-min)))) + c-before-font-lock-functions))) (set (make-local-variable 'outline-regexp) "[^#\n\^M]") (set (make-local-variable 'outline-level) 'c-outline-level) @@ -881,7 +881,7 @@ ;; Point is undefined both before and after this function call, the buffer ;; has been widened, and match-data saved. The return value is ignored. ;; - ;; This function is the C/C++/ObjC value of `c-before-font-lock-function'. + ;; This function is in the C/C++/ObjC value of `c-before-font-lock-functions'. ;; ;; Note: SPEED _MATTERS_ IN THIS FUNCTION!!! ;; @@ -1026,7 +1026,7 @@ ;; these caches from inside them, and we must thus be sure that this ;; has already been executed. ;; - ;; This calls the language variable c-before-font-lock-function, if non nil. + ;; This calls the language variable c-before-font-lock-functions, if non nil. ;; This typically sets `syntax-table' properties. (c-save-buffer-state () @@ -1066,9 +1066,53 @@ ;; larger than (beg end). (setq c-new-BEG beg c-new-END end) - (if c-before-font-lock-function - (save-excursion - (funcall c-before-font-lock-function beg end old-len))))))) + (save-excursion + (mapc (lambda (fn) + (funcall fn beg end old-len)) + c-before-font-lock-functions)))))) + +(defun c-set-fl-decl-start (beg end old-len) + ;; If the beginning of line containing c-new-BEG is in the middle of a + ;; "local" declaration (i.e. one which does not start outside of braces + ;; enclosing this pos, such as a struct), set c-new-BEG to (at most) the + ;; beginning of that declaration. Note that declarations, in this sense, + ;; can be nested. c-new-BEG will be used later by c-font-lock-declarations. + ;; + ;; This function is an element of c-before-font-lock-functions, being called + ;; (indirectly) from an after-change function. The after-change-functions' + ;; parameters BEG, OLD and OLD-LEN are ignored here. + (when font-lock-mode + (goto-char (c-point 'bol c-new-BEG)) + (let ((lit-limits (c-literal-limits)) + bod-lim bo-decl) + + (when lit-limits ; Comment or string. + (goto-char (car lit-limits))) + (setq bod-lim (max (- (point) 500) (point-min))) + + (while + ;; Go to a less nested declaration each time round this loop. + (and + (eq (car (c-beginning-of-decl-1 bod-lim)) 'same) + (progn (setq bo-decl (point)) + ;; Are we looking at a keyword such as "template" or + ;; "typedef" which can decorate a type, or the type itself? + (when (or (looking-at c-prefix-spec-kwds-re) + (c-forward-type t)) + ;; We've found another candidate position. + (setq c-new-BEG (min c-new-BEG bo-decl)) + (goto-char bo-decl)) + t) + ;; Try and go out a level to search again. + (progn + (c-backward-syntactic-ws bod-lim) + (or (memq (char-before) '(?\( ?\[)) + (and (eq (char-before) ?\<) + (eq (c-get-char-property + (1- (point)) 'syntax-table) + c-<-as-paren-syntax)))) + (not (bobp))) + (backward-char))))) ; back over (, [, <. (defun c-after-font-lock-init () ;; Put on `font-lock-mode-hook'. ------------------------------------------------------------ revno: 106722 fixes bug(s): http://debbugs.gnu.org/10353 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2011-12-23 01:44:27 +0100 message: lisp/desktop.el (desktop-internal-v2s): Fix typos in docstring (bug#10353). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-22 22:32:46 +0000 +++ lisp/ChangeLog 2011-12-23 00:44:27 +0000 @@ -1,3 +1,7 @@ +2011-12-23 Juanma Barranquero + + * desktop.el (desktop-internal-v2s): Fix typos in docstring (bug#10353). + 2011-12-22 Juri Linkov * progmodes/grep.el (rgrep): Fix docstring. (Bug#10185) === modified file 'lisp/desktop.el' --- lisp/desktop.el 2011-11-17 17:40:48 +0000 +++ lisp/desktop.el 2011-12-23 00:44:27 +0000 @@ -702,9 +702,9 @@ ;; ---------------------------------------------------------------------------- (defun desktop-internal-v2s (value) "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. -TXT is a string that when read and evaluated yields value. +TXT is a string that when read and evaluated yields VALUE. QUOTE may be `may' (value may be quoted), -`must' (values must be quoted), or nil (value may not be quoted)." +`must' (value must be quoted), or nil (value must not be quoted)." (cond ((or (numberp value) (null value) (eq t value) (keywordp value)) (cons 'may (prin1-to-string value)))