Now on revision 111832. ------------------------------------------------------------ revno: 111832 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-02-19 23:57:33 -0800 message: Rework recent image-multi-frame stuff a little * image.el (image-current-frame): Change from variable to function. (image-show-frame): Rename from image-nth-frame. Update callers. * image-mode.el (image-multi-frame): New variable. (image-mode-map, image-mode, image-goto-frame): Use image-multi-frame rather than image-current-frame. (image-mode, image-goto-frame): Use image-current-frame as function rather than as variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-20 02:07:07 +0000 +++ lisp/ChangeLog 2013-02-20 07:57:33 +0000 @@ -1,5 +1,13 @@ 2013-02-20 Glenn Morris + * image.el (image-current-frame): Change from variable to function. + (image-show-frame): Rename from image-nth-frame. Update callers. + * image-mode.el (image-multi-frame): New variable. + (image-mode-map, image-mode, image-goto-frame): + Use image-multi-frame rather than image-current-frame. + (image-mode, image-goto-frame): Use image-current-frame as + function rather than as variable. + * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. * emacs-lisp/cl-macs.el (cl--make-type-test) (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2013-02-17 00:50:41 +0000 +++ lisp/image-mode.el 2013-02-20 07:57:33 +0000 @@ -329,6 +329,9 @@ "The image type for the current Image mode buffer.") (make-variable-buffer-local 'image-type) +(defvar-local image-multi-frame nil + "Non-nil if image for the current Image mode buffer has multiple frames.") + (defvar image-mode-previous-major-mode nil "Internal variable to keep the previous non-image major mode.") @@ -390,7 +393,7 @@ ["Animate Image" image-toggle-animation :style toggle :selected (let ((image (image-get-display-property))) (and image (image-animate-timer image))) - :active image-current-frame + :active image-multi-frame :help "Toggle image animation"] ["Loop Animation" (lambda () (interactive) @@ -403,13 +406,13 @@ (image-toggle-animation) (image-toggle-animation))) :style toggle :selected image-animate-loop - :active image-current-frame + :active image-multi-frame :help "Animate images once, or forever?"] - ["Next Frame" image-next-frame :active image-current-frame + ["Next Frame" image-next-frame :active image-multi-frame :help "Show the next frame of this image"] - ["Previous Frame" image-previous-frame :active image-current-frame + ["Previous Frame" image-previous-frame :active image-multi-frame :help "Show the previous frame of this image"] - ["Goto Frame..." image-goto-frame :active image-current-frame + ["Goto Frame..." image-goto-frame :active image-multi-frame :help "Show a specific frame of this image"] )) map) @@ -471,12 +474,13 @@ ((null image) (message "%s" (concat msg1 "an image."))) ((setq animated (image-multi-frame-p image)) - (setq image-current-frame (or (plist-get (cdr image) :index) 0) + (setq image-multi-frame t mode-line-process - `(:eval (propertize (format " [%s/%s]" - (1+ image-current-frame) - ,(car animated)) - 'help-echo "Frame number"))) + `(:eval (propertize + (format " [%s/%s]" + (1+ (image-current-frame ',image)) + ,(car animated)) + 'help-echo "Frame number"))) (message "%s" (concat msg1 "text. This image has multiple frames."))) ;;; (substitute-command-keys @@ -694,10 +698,13 @@ (cond ((null image) (error "No image is present")) - ((null image-current-frame) + ((null image-multi-frame) (message "No image animation.")) (t - (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) + (image-show-frame image + (if relative + (+ n (image-current-frame image)) + (1- n))))))) (defun image-next-frame (&optional n) "Switch to the next frame of a multi-frame image. === modified file 'lisp/image.el' --- lisp/image.el 2013-02-16 19:56:50 +0000 +++ lisp/image.el 2013-02-20 07:57:33 +0000 @@ -660,10 +660,11 @@ (defconst image-minimum-frame-delay 0.01 "Minimum interval in seconds between frames of an animated image.") -(defvar-local image-current-frame nil - "The frame index of the current animated image.") +(defun image-current-frame (image) + "The current frame number of IMAGE, indexed from 0." + (or (plist-get (cdr image) :index) 0)) -(defun image-nth-frame (image n &optional nocheck) +(defun image-show-frame (image n &optional nocheck) "Show frame N of IMAGE. Frames are indexed from 0. Optional argument NOCHECK non-nil means do not check N is within the range of frames present in the image." @@ -671,7 +672,6 @@ (if (< n 0) (setq n 0) (setq n (min n (1- (car (image-multi-frame-p image))))))) (plist-put (cdr image) :index n) - (setq image-current-frame n) (force-window-update)) ;; FIXME? The delay may not be the same for different sub-images, @@ -688,7 +688,7 @@ after displaying the last animation frame. Otherwise, stop after LIMIT seconds have elapsed. The minimum delay between successive frames is `image-minimum-frame-delay'." - (image-nth-frame image n t) + (image-show-frame image n t) (setq n (1+ n)) (let* ((time (float-time)) (animation (image-multi-frame-p image)) ------------------------------------------------------------ revno: 111831 [merge] committer: dancol@dancol.org branch nick: realtrunk timestamp: Tue 2013-02-19 21:56:28 -0800 message: * sheap.c (report_sheap_usage): Use message, not message1, so that we don't try to create a buffer while we're in the middle of dumping Emacs. Explain why. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-20 05:18:20 +0000 +++ src/ChangeLog 2013-02-20 05:56:28 +0000 @@ -1,5 +1,8 @@ +2013-02-19 Daniel Colascione + * sheap.c (report_sheap_usage): Use message, not message1, so + that we don't try to create a buffer while we're in the middle + of dumping Emacs. Explain why. 2013-02-20 Dmitry Antipov - * search.c (find_newline): Return byte position in bytepos. Adjust comment. (find_next_newline_no_quit, find_before_next_newline): Add === modified file 'src/sheap.c' --- src/sheap.c 2013-02-17 16:49:27 +0000 +++ src/sheap.c 2013-02-20 05:43:53 +0000 @@ -91,5 +91,8 @@ char buf[200]; sprintf (buf, "Static heap usage: %d of %d bytes", bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); - message1 (buf); + /* Don't change this call to message1! message1 can log + messages, and at this point, we're not allowed to create + buffers. */ + message ("%s", buf); } ------------------------------------------------------------ revno: 111830 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-02-20 09:18:20 +0400 message: * search.c (find_newline): Return byte position in bytepos. Adjust comment. (find_next_newline_no_quit, find_before_next_newline): Add bytepos argument. * lisp.h (find_newline, find_next_newline_no_quit) (find_before_next_newline): Adjust prototypes. * bidi.c (bidi_find_paragraph_start): * editfns.c (Fconstrain_to_field, Fline_end_position): * indent.c (compute_motion, vmotion): * xdisp.c (back_to_previous_line_start, forward_to_next_line_start): (get_visually_first_element, move_it_vertically_backward): Adjust users and avoid calls to CHAR_TO_BYTE where appropriate. diff: === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2013-02-20 05:18:20 +0000 @@ -267,7 +267,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "3b4d4e869f81f0b07ab3aa08f5478c2e") +;;;;;; "cl-macs" "cl-macs.el" "8a90c81a400a2846e7b4c3da07626d94") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-19 03:29:28 +0000 +++ src/ChangeLog 2013-02-20 05:18:20 +0000 @@ -1,3 +1,18 @@ +2013-02-20 Dmitry Antipov + + * search.c (find_newline): Return byte position in bytepos. + Adjust comment. + (find_next_newline_no_quit, find_before_next_newline): Add + bytepos argument. + * lisp.h (find_newline, find_next_newline_no_quit) + (find_before_next_newline): Adjust prototypes. + * bidi.c (bidi_find_paragraph_start): + * editfns.c (Fconstrain_to_field, Fline_end_position): + * indent.c (compute_motion, vmotion): + * xdisp.c (back_to_previous_line_start, forward_to_next_line_start): + (get_visually_first_element, move_it_vertically_backward): + Adjust users and avoid calls to CHAR_TO_BYTE where appropriate. + 2013-02-19 Eli Zaretskii * w32proc.c (new_child): Avoid leaking handles if the subprocess === modified file 'src/bidi.c' --- src/bidi.c 2013-02-11 17:27:48 +0000 +++ src/bidi.c 2013-02-20 05:18:20 +0000 @@ -1104,14 +1104,11 @@ while (pos_byte > BEGV_BYTE && n++ < MAX_PARAGRAPH_SEARCH && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0) - { - /* FIXME: What if the paragraph beginning is covered by a - display string? And what if a display string covering some - of the text over which we scan back includes - paragraph_start_re? */ - pos = find_next_newline_no_quit (pos - 1, -1); - pos_byte = CHAR_TO_BYTE (pos); - } + /* FIXME: What if the paragraph beginning is covered by a + display string? And what if a display string covering some + of the text over which we scan back includes + paragraph_start_re? */ + pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte); if (n >= MAX_PARAGRAPH_SEARCH) pos_byte = BEGV_BYTE; return pos_byte; === modified file 'src/editfns.c' --- src/editfns.c 2013-02-17 16:49:27 +0000 +++ src/editfns.c 2013-02-20 05:18:20 +0000 @@ -736,7 +736,7 @@ FIELD_BOUND are on the same line by seeing whether there's an intervening newline or not. */ || (find_newline (XFASTINT (new_pos), XFASTINT (field_bound), - fwd ? -1 : 1, &shortage, 1), + fwd ? -1 : 1, &shortage, NULL, 1), shortage != 0))) /* Constrain NEW_POS to FIELD_BOUND. */ new_pos = field_bound; @@ -821,7 +821,8 @@ CHECK_NUMBER (n); clipped_n = clip_to_bounds (PTRDIFF_MIN + 1, XINT (n), PTRDIFF_MAX); - end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0)); + end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0), + NULL); /* Return END_POS constrained to the current input field. */ return Fconstrain_to_field (make_number (end_pos), make_number (orig), === modified file 'src/indent.c' --- src/indent.c 2013-02-13 04:31:09 +0000 +++ src/indent.c 2013-02-20 05:18:20 +0000 @@ -1328,8 +1328,7 @@ TO (we need to go back below). */ if (pos <= to) { - pos = find_before_next_newline (pos, to, 1); - pos_byte = CHAR_TO_BYTE (pos); + pos = find_before_next_newline (pos, to, 1, &pos_byte); hpos = width; /* If we just skipped next_boundary, loop around in the main while @@ -1583,10 +1582,9 @@ /* Skip any number of invisible lines all at once */ do { - pos = find_before_next_newline (pos, to, 1); + pos = find_before_next_newline (pos, to, 1, &pos_byte); if (pos < to) - pos++; - pos_byte = CHAR_TO_BYTE (pos); + INC_BOTH (pos, pos_byte); } while (pos < to && indented_beyond_p (pos, pos_byte, @@ -1622,10 +1620,7 @@ everything from a ^M to the end of the line is invisible. Stop *before* the real newline. */ if (pos < to) - { - pos = find_before_next_newline (pos, to, 1); - pos_byte = CHAR_TO_BYTE (pos); - } + pos = find_before_next_newline (pos, to, 1, &pos_byte); /* If we just skipped next_boundary, loop around in the main while and handle it. */ @@ -1845,21 +1840,20 @@ while ((vpos > vtarget || first) && from > BEGV) { + ptrdiff_t bytepos; Lisp_Object propval; - prevline = find_next_newline_no_quit (from - 1, -1); + prevline = find_next_newline_no_quit (from - 1, -1, &bytepos); while (prevline > BEGV && ((selective > 0 - && indented_beyond_p (prevline, - CHAR_TO_BYTE (prevline), - selective)) + && indented_beyond_p (prevline, bytepos, selective)) /* Watch out for newlines with `invisible' property. When moving upward, check the newline before. */ || (propval = Fget_char_property (make_number (prevline - 1), Qinvisible, text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) - prevline = find_next_newline_no_quit (prevline - 1, -1); + prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); pos = *compute_motion (prevline, 0, lmargin, 0, @@ -1897,21 +1891,20 @@ from_byte = CHAR_TO_BYTE (from); if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n') { + ptrdiff_t bytepos; Lisp_Object propval; - prevline = find_next_newline_no_quit (from, -1); + prevline = find_next_newline_no_quit (from, -1, &bytepos); while (prevline > BEGV && ((selective > 0 - && indented_beyond_p (prevline, - CHAR_TO_BYTE (prevline), - selective)) + && indented_beyond_p (prevline, bytepos, selective)) /* Watch out for newlines with `invisible' property. When moving downward, check the newline after. */ || (propval = Fget_char_property (make_number (prevline), Qinvisible, text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) - prevline = find_next_newline_no_quit (prevline - 1, -1); + prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); pos = *compute_motion (prevline, 0, lmargin, 0, === modified file 'src/lisp.h' --- src/lisp.h 2013-02-19 14:44:03 +0000 +++ src/lisp.h 2013-02-20 05:18:20 +0000 @@ -3343,12 +3343,13 @@ extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, Lisp_Object); extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, - ptrdiff_t *, bool); + ptrdiff_t *, ptrdiff_t *, bool); extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT, bool); extern ptrdiff_t find_next_newline (ptrdiff_t, int); -extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t); -extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t); +extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *); +extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, + ptrdiff_t, ptrdiff_t *); extern void syms_of_search (void); extern void clear_regexp_cache (void); === modified file 'src/search.c' --- src/search.c 2013-02-15 12:26:42 +0000 +++ src/search.c 2013-02-20 05:18:20 +0000 @@ -638,15 +638,18 @@ If we don't find COUNT instances before reaching END, set *SHORTAGE to the number of newlines left unfound, and return END. + If BYTEPOS is not NULL, set *BYTEPOS to the byte position corresponding + to the returned character position. + If ALLOW_QUIT, set immediate_quit. That's good to do except when inside redisplay. */ ptrdiff_t -find_newline (ptrdiff_t start, ptrdiff_t end, - ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit) +find_newline (ptrdiff_t start, ptrdiff_t end, ptrdiff_t count, + ptrdiff_t *shortage, ptrdiff_t *bytepos, bool allow_quit) { struct region_cache *newline_cache; - ptrdiff_t end_byte = -1; + ptrdiff_t start_byte = -1, end_byte = -1; int direction; if (count > 0) @@ -680,9 +683,7 @@ the position of the last character before the next such obstacle --- the last character the dumb search loop should examine. */ - ptrdiff_t ceiling_byte = end_byte - 1; - ptrdiff_t start_byte; - ptrdiff_t tem; + ptrdiff_t tem, ceiling_byte = end_byte - 1; /* If we're looking for a newline, consult the newline cache to see where we can avoid some scanning. */ @@ -745,21 +746,22 @@ if (--count == 0) { immediate_quit = 0; + if (bytepos) + *bytepos = nl + 1 - base + start_byte; return BYTE_TO_CHAR (nl + 1 - base + start_byte); } cursor = nl + 1; } - start = BYTE_TO_CHAR (ceiling_addr - base + start_byte); + start_byte += ceiling_addr - base; + start = BYTE_TO_CHAR (start_byte); } } else while (start > end) { /* The last character to check before the next obstacle. */ - ptrdiff_t ceiling_byte = end_byte; - ptrdiff_t start_byte; - ptrdiff_t tem; + ptrdiff_t tem, ceiling_byte = end_byte; /* Consult the newline cache, if appropriate. */ if (newline_cache) @@ -816,18 +818,26 @@ if (++count >= 0) { immediate_quit = 0; + if (bytepos) + *bytepos = nl - base + start_byte; return BYTE_TO_CHAR (nl - base + start_byte); } cursor = nl - 1; } - start = BYTE_TO_CHAR (ceiling_addr - 1 - base + start_byte); + start_byte += ceiling_addr - 1 - base; + start = BYTE_TO_CHAR (start_byte); } } immediate_quit = 0; - if (shortage != 0) + if (shortage) *shortage = count * direction; + if (bytepos) + { + *bytepos = start_byte == -1 ? CHAR_TO_BYTE (start) : start_byte; + eassert (*bytepos == CHAR_TO_BYTE (start)); + } return start; } @@ -932,9 +942,9 @@ } ptrdiff_t -find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt) +find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) { - return find_newline (from, 0, cnt, (ptrdiff_t *) 0, 0); + return find_newline (from, 0, cnt, NULL, bytepos, 0); } /* Like find_next_newline, but returns position before the newline, @@ -942,14 +952,19 @@ find_next_newline (...)-1, because you might hit TO. */ ptrdiff_t -find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt) +find_before_next_newline (ptrdiff_t from, ptrdiff_t to, + ptrdiff_t cnt, ptrdiff_t *bytepos) { ptrdiff_t shortage; - ptrdiff_t pos = find_newline (from, to, cnt, &shortage, 1); + ptrdiff_t pos = find_newline (from, to, cnt, &shortage, bytepos, 1); if (shortage == 0) - pos--; - + { + if (bytepos) + DEC_BOTH (pos, *bytepos); + else + pos--; + } return pos; } === modified file 'src/xdisp.c' --- src/xdisp.c 2013-02-19 03:29:28 +0000 +++ src/xdisp.c 2013-02-20 05:18:20 +0000 @@ -5905,8 +5905,9 @@ static void back_to_previous_line_start (struct it *it) { - IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1); - IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); + IT_CHARPOS (*it) + = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, + -1, &IT_BYTEPOS (*it)); } @@ -5977,8 +5978,8 @@ short-cut. */ if (!newline_found_p) { - ptrdiff_t start = IT_CHARPOS (*it); - ptrdiff_t limit = find_next_newline_no_quit (start, 1); + ptrdiff_t bytepos, start = IT_CHARPOS (*it); + ptrdiff_t limit = find_next_newline_no_quit (start, 1, &bytepos); Lisp_Object pos; eassert (!STRINGP (it->string)); @@ -5996,7 +5997,7 @@ if (!it->bidi_p) { IT_CHARPOS (*it) = limit; - IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit); + IT_BYTEPOS (*it) = bytepos; } else { @@ -7432,11 +7433,9 @@ if (string_p) it->bidi_it.charpos = it->bidi_it.bytepos = 0; else - { - it->bidi_it.charpos = find_next_newline_no_quit (IT_CHARPOS (*it), - -1); - it->bidi_it.bytepos = CHAR_TO_BYTE (it->bidi_it.charpos); - } + it->bidi_it.charpos + = find_next_newline_no_quit (IT_CHARPOS (*it), -1, + &it->bidi_it.bytepos); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); do { @@ -9071,7 +9070,7 @@ && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') { ptrdiff_t nl_pos = - find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1); + find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1, NULL); move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); } ------------------------------------------------------------ revno: 111829 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-02-19 21:07:07 -0500 message: Make cl-floatp-safe just an alias for floatp * lisp/emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. * lisp/emacs-lisp/cl-macs.el (cl--make-type-test) (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. * doc/misc/cl.texi: Remove commented out sections about cl-floatp-safe. diff: === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/cl.texi 2013-02-20 02:07:07 +0000 @@ -703,14 +703,6 @@ The type symbols @code{character} and @code{string-char} match integers in the range from 0 to 255. -@c No longer relevant, so covered by first item above (float -> floatp). -@ignore -@item -The type symbol @code{float} uses the @code{cl-floatp-safe} predicate -defined by this package rather than @code{floatp}, so it will work -correctly even in Emacs versions without floating-point support. -@end ignore - @item The type list @code{(integer @var{low} @var{high})} represents all integers between @var{low} and @var{high}, inclusive. Either bound @@ -2921,14 +2913,6 @@ error if the argument is not an integer. @end defun -@ignore -@defun cl-floatp-safe object -This predicate tests whether @var{object} is a floating-point -number. On systems that support floating-point, this is equivalent -to @code{floatp}. On other systems, this always returns @code{nil}. -@end defun -@end ignore - @node Numerical Functions @section Numerical Functions === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-19 15:17:55 +0000 +++ lisp/ChangeLog 2013-02-20 02:07:07 +0000 @@ -1,3 +1,9 @@ +2013-02-20 Glenn Morris + + * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. + * emacs-lisp/cl-macs.el (cl--make-type-test) + (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. + 2013-02-19 Michael Albinus * net/tramp-cache.el (tramp-get-hash-table): New defun. === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/cl-lib.el 2013-02-20 02:07:07 +0000 @@ -271,11 +271,7 @@ ;;; Numbers. -(defun cl-floatp-safe (object) - "Return t if OBJECT is a floating point number. -On Emacs versions that lack floating-point support, this function -always returns nil." - (and (numberp object) (not (integerp object)))) +(define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") (defsubst cl-plusp (number) "Return t if NUMBER is positive." === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-02-20 02:07:07 +0000 @@ -2520,7 +2520,7 @@ ((memq type '(nil t)) type) ((eq type 'null) `(null ,val)) ((eq type 'atom) `(atom ,val)) - ((eq type 'float) `(cl-floatp-safe ,val)) + ((eq type 'float) `(floatp ,val)) ((eq type 'real) `(numberp ,val)) ((eq type 'fixnum) `(integerp ,val)) ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef @@ -2739,7 +2739,7 @@ (cond ((eq test 'eq) `(assq ,a ,list)) ((eq test 'equal) `(assoc ,a ,list)) ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) - (if (cl-floatp-safe (cl--const-expr-val a)) + (if (floatp (cl--const-expr-val a)) `(assoc ,a ,list) `(assq ,a ,list))) (t form)))) @@ -2776,7 +2776,7 @@ (put y 'side-effect-free t)) ;;; Things that are inline. -(cl-proclaim '(inline cl-floatp-safe cl-acons cl-map cl-concatenate cl-notany +(cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) ;;; Things that are side-effect-free. @@ -2787,7 +2787,7 @@ ;;; Things that are side-effect-and-error-free. (mapc (lambda (x) (put x 'side-effect-free 'error-free)) - '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp + '(eql cl-list* cl-subst cl-acons cl-equalp cl-random-state-p copy-tree cl-sublis)) ------------------------------------------------------------ revno: 111828 committer: Michael Albinus + + * net/tramp-cache.el (tramp-get-hash-table): New defun. + (tramp-get-file-property, tramp-set-file-property) + (tramp-get-connection-property, tramp-set-connection-property): Use it. + (tramp-flush-file-property, tramp-flush-directory-property): + Rename argument to KEY. + (tramp-flush-connection-property): Simplify a little bit. + (tramp-connection-property-p): New defun. + (top): Reapply saved values only if there isn't a corresponding + entry in `tramp-connection-properties'. + 2013-02-19 Fabián Ezequiel Gallina * progmodes/python.el (python-indent-context): === modified file 'lisp/net/tramp-cache.el' --- lisp/net/tramp-cache.el 2013-02-16 17:44:00 +0000 +++ lisp/net/tramp-cache.el 2013-02-19 15:17:55 +0000 @@ -98,16 +98,30 @@ (defvar tramp-cache-data-changed nil "Whether persistent cache data have been changed.") +(defun tramp-get-hash-table (key) + "Returns the hash table for KEY. +If it doesn't exist yet, it is created and initialized with +matching entries of `tramp-connection-properties'." + (or (gethash key tramp-cache-data) + (let ((hash + (puthash key (make-hash-table :test 'equal) tramp-cache-data))) + (when (vectorp key) + (dolist (elt tramp-connection-properties) + (when (string-match + (or (nth 0 elt) "") + (tramp-make-tramp-file-name + (aref key 0) (aref key 1) (aref key 2) nil)) + (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))) + hash))) + ;;;###tramp-autoload -(defun tramp-get-file-property (vec file property default) - "Get the PROPERTY of FILE from the cache context of VEC. +(defun tramp-get-file-property (key file property default) + "Get the PROPERTY of FILE from the cache context of KEY. Returns DEFAULT if not set." ;; Unify localname. - (setq vec (copy-sequence vec)) - (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) - (let* ((hash (or (gethash vec tramp-cache-data) - (puthash vec (make-hash-table :test 'equal) - tramp-cache-data))) + (setq key (copy-sequence key)) + (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) + (let* ((hash (tramp-get-hash-table key)) (value (when (hash-table-p hash) (gethash property hash)))) (if ;; We take the value only if there is any, and @@ -125,7 +139,7 @@ (setq value (cdr value)) (setq value default)) - (tramp-message vec 8 "%s %s %s" file property value) + (tramp-message key 8 "%s %s %s" file property value) (when (>= tramp-verbose 10) (let* ((var (intern (concat "tramp-cache-get-count-" property))) (val (or (ignore-errors (symbol-value var)) 0))) @@ -133,18 +147,16 @@ value)) ;;;###tramp-autoload -(defun tramp-set-file-property (vec file property value) - "Set the PROPERTY of FILE to VALUE, in the cache context of VEC. +(defun tramp-set-file-property (key file property value) + "Set the PROPERTY of FILE to VALUE, in the cache context of KEY. Returns VALUE." ;; Unify localname. - (setq vec (copy-sequence vec)) - (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) - (let ((hash (or (gethash vec tramp-cache-data) - (puthash vec (make-hash-table :test 'equal) - tramp-cache-data)))) + (setq key (copy-sequence key)) + (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) + (let ((hash (tramp-get-hash-table key))) ;; We put the timestamp there. (puthash property (cons (current-time) value) hash) - (tramp-message vec 8 "%s %s %s" file property value) + (tramp-message key 8 "%s %s %s" file property value) (when (>= tramp-verbose 10) (let* ((var (intern (concat "tramp-cache-set-count-" property))) (val (or (ignore-errors (symbol-value var)) 0))) @@ -152,26 +164,26 @@ value)) ;;;###tramp-autoload -(defun tramp-flush-file-property (vec file) - "Remove all properties of FILE in the cache context of VEC." +(defun tramp-flush-file-property (key file) + "Remove all properties of FILE in the cache context of KEY." ;; Remove file property of symlinks. - (let ((truename (tramp-get-file-property vec file "file-truename" nil))) + (let ((truename (tramp-get-file-property key file "file-truename" nil))) (when (and (stringp truename) (not (string-equal file truename))) - (tramp-flush-file-property vec truename))) + (tramp-flush-file-property key truename))) ;; Unify localname. - (setq vec (copy-sequence vec)) - (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) - (tramp-message vec 8 "%s" file) - (remhash vec tramp-cache-data)) + (setq key (copy-sequence key)) + (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) + (tramp-message key 8 "%s" file) + (remhash key tramp-cache-data)) ;;;###tramp-autoload -(defun tramp-flush-directory-property (vec directory) - "Remove all properties of DIRECTORY in the cache context of VEC. +(defun tramp-flush-directory-property (key directory) + "Remove all properties of DIRECTORY in the cache context of KEY. Remove also properties of all files in subdirectories." (let ((directory (tramp-run-real-handler 'directory-file-name (list directory)))) - (tramp-message vec 8 "%s" directory) + (tramp-message key 8 "%s" directory) (maphash (lambda (key value) (when (and (stringp (tramp-file-name-localname key)) @@ -216,28 +228,10 @@ (when (vectorp key) (setq key (copy-sequence key)) (aset key 3 nil)) - (let* ((hash (gethash key tramp-cache-data)) - (value - (catch 'result - (or - ;; Check for dynamic properties. - (and - (hash-table-p hash) - (maphash - (lambda (x y) (when (equal x property) (throw 'result y))) - hash)) - ;; Check for static properties. - (and - (vectorp key) - (dolist (elt tramp-connection-properties) - (when (and (string-match - (or (nth 0 elt) "") - (tramp-make-tramp-file-name - (aref key 0) (aref key 1) (aref key 2) nil)) - (string-equal (or (nth 1 elt) "") (or property ""))) - (throw 'result (nth 2 elt))))) - ;; The default value. - default)))) + (let* ((hash (tramp-get-hash-table key)) + (value (if (hash-table-p hash) + (gethash property hash default) + default))) (tramp-message key 7 "%s %s" property value) value)) @@ -251,15 +245,19 @@ (when (vectorp key) (setq key (copy-sequence key)) (aset key 3 nil)) - (let ((hash (or (gethash key tramp-cache-data) - (puthash key (make-hash-table :test 'equal) - tramp-cache-data)))) + (let ((hash (tramp-get-hash-table key))) (puthash property value hash) (setq tramp-cache-data-changed t) (tramp-message key 7 "%s %s" property value) value)) ;;;###tramp-autoload +(defun tramp-connection-property-p (key property) + "Check whether named PROPERTY of a connection is defined. +KEY identifies the connection, it is either a process or a vector." + (not (eq (tramp-get-connection-property key property 'undef) 'undef))) + +;;;###tramp-autoload (defun tramp-flush-connection-property (key) "Remove all properties identified by KEY. KEY identifies the connection, it is either a process or a vector." @@ -272,10 +270,8 @@ key 7 "%s %s" key (let ((hash (gethash key tramp-cache-data)) properties) - (if (hash-table-p hash) - (maphash - (lambda (x y) (add-to-list 'properties x 'append)) - (gethash key tramp-cache-data))) + (when (hash-table-p hash) + (maphash (lambda (x y) (add-to-list 'properties x 'append)) hash)) properties)) (setq tramp-cache-data-changed t) (remhash key tramp-cache-data)) @@ -396,7 +392,11 @@ (while (setq element (pop list)) (setq key (pop element)) (while (setq item (pop element)) - (tramp-set-connection-property key (pop item) (car item))))) + ;; We set only values which are not contained in + ;; `tramp-connection-properties'. The cache is + ;; initialized properly by side effect. + (unless (tramp-connection-property-p key (car item)) + (tramp-set-connection-property key (pop item) (car item)))))) (setq tramp-cache-data-changed nil)) (file-error ;; Most likely because the file doesn't exist yet. No message. ------------------------------------------------------------ revno: 111827 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-02-19 06:44:03 -0800 message: Spelling fixes. diff: === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-02-16 17:38:37 +0000 +++ doc/misc/tramp.texi 2013-02-19 14:44:03 +0000 @@ -2030,8 +2030,8 @@ @noindent with @samp{192.168.0.26} being the IP address of your Android device. -The user settings for the @code{$PATH} environment valiable must be -preserved. Add this setting: +The user settings for the @code{$PATH} environment variable must be +preserved. Add this setting: @lisp (add-to-list 'tramp-remote-path 'tramp-own-remote-path) === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-02-14 12:36:44 +0000 +++ etc/ChangeLog 2013-02-19 14:44:03 +0000 @@ -1519,7 +1519,7 @@ 2009-01-27 Kenichi Handa - * NEWS: New function `coding-sytem-from-name'. + * NEWS: New function `coding-system-from-name'. 2009-01-25 Carsten Dominik === modified file 'src/ChangeLog.10' --- src/ChangeLog.10 2013-01-01 09:11:05 +0000 +++ src/ChangeLog.10 2013-02-19 14:44:03 +0000 @@ -19171,7 +19171,7 @@ * coding.c (code_convert_region_unwind): Set Vlast_coding_system_used to the argument. (code_convert_region): If post-read-conversion function changed - the value of last-coding-sytem, keep the new value in + the value of last-coding-system, keep the new value in coding->symbol so that it won't be overridden. (run_pre_post_conversion_on_str): Likewise. (coding_system_accept_latin_extra_p): New function. === modified file 'src/lisp.h' --- src/lisp.h 2013-02-15 12:26:42 +0000 +++ src/lisp.h 2013-02-19 14:44:03 +0000 @@ -3048,7 +3048,7 @@ extern Lisp_Object Qchar_table_extra_slots; extern struct Lisp_Vector *allocate_vector (EMACS_INT); -/* Make an unitialized vector for SIZE objects. NOTE: you must +/* Make an uninitialized vector for SIZE objects. NOTE: you must be sure that GC cannot happen until the vector is completely initialized. E.g. the following code is likely to crash: === modified file 'src/marker.c' --- src/marker.c 2013-02-11 10:21:52 +0000 +++ src/marker.c 2013-02-19 14:44:03 +0000 @@ -500,7 +500,7 @@ register ptrdiff_t charpos, bytepos; /* Do not use CHECK_NUMBER_COERCE_MARKER because we - don't want to call buf_charpos_to_bytepos if POSTION + don't want to call buf_charpos_to_bytepos if POSITION is a marker and so we know the bytepos already. */ if (INTEGERP (position)) charpos = XINT (position), bytepos = -1; ------------------------------------------------------------ revno: 111826 [merge] committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-02-18 19:29:28 -0800 message: Merge from emacs-24; up to r111280 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-02-15 17:31:12 +0000 +++ doc/lispref/ChangeLog 2013-02-19 03:29:28 +0000 @@ -1,3 +1,7 @@ +2013-02-19 Glenn Morris + + * text.texi (Change Hooks): Fix typo. + 2013-02-15 Glenn Morris * modes.texi (Basic Major Modes): 'z' no longer bound in special-mode. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/text.texi 2013-02-19 01:20:50 +0000 @@ -4344,7 +4344,7 @@ modification. Each function receives three arguments: the beginning and end of the region just changed, and the length of the text that existed before the change. All three arguments are integers. The -buffer has been changed is always the current buffer. +buffer that has been changed is always the current buffer. The length of the old text is the difference between the buffer positions before and after that text as it was before the change. As === modified file 'etc/MORE.STUFF' --- etc/MORE.STUFF 2013-01-01 09:11:05 +0000 +++ etc/MORE.STUFF 2013-02-19 03:10:46 +0000 @@ -41,9 +41,6 @@ The Emacs Wiki has an area for storing elisp files . -* WikEmacs - is an alternative wiki for Emacs. - * Emacs slides and tutorials can be found here: @@ -55,16 +52,8 @@ * Ada-mode: - * Battery and Info Look: - * CC mode: - * CPerl: - - * Ediff and Viper: - - * ERC: - * Gnus: * MH-E: @@ -73,25 +62,11 @@ * Org mode: - * RefTeX: - - * Remember: - * CEDET: * Tramp: Remote file access via rsh/ssh -* Auxiliary files - - * (Tex)info files for use with Info-look that don't come from GNU - packages: - * Scheme: - * LaTeX: (or CTAN mirrors) - * Perl: - (or CPAN mirrors) - * GNU Zile: A lightweight Emacs clone, for when you don't have room for Emacs proper. @@ -108,6 +83,7 @@ * AUCTeX: An extensible package that supports writing and formatting TeX files (including AMS-TeX, LaTeX, Texinfo, ConTeXt, and docTeX). + Includes Preview LaTeX: embed preview LaTeX images in source buffer. Available from GNU ELPA. * BBDB: personal Info Rolodex integrated with mail/news: @@ -134,6 +110,7 @@ * Emacs Muse: An authoring and publishing environment for Emacs. + Available from GNU ELPA. * Emacs speaks statistics (ESS): statistical programming within Emacs @@ -170,9 +147,6 @@ * Planner Mode: Planner is an organizer and day planner for Emacs. - * Preview LaTeX: embed preview LaTeX images in source buffer. - - * Quack: Quack enhances Emacs support for Scheme. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-19 02:57:04 +0000 +++ lisp/ChangeLog 2013-02-19 03:29:28 +0000 @@ -1,3 +1,23 @@ +2013-02-19 Fabián Ezequiel Gallina + + * progmodes/python.el (python-indent-context): + Fix python-info-line-ends-backslash-p call. + (python-info-line-ends-backslash-p) + (python-info-beginning-of-backslash): Respect line-number argument. + (python-info-current-line-comment-p): + Fix behavior when not at beginning-of-line. + (python-util-position): Remove function. + (python-util-goto-line): New function. + +2013-02-19 Michael Albinus + + * eshell/em-unix.el (eshell/su): Require tramp. + (eshell/sudo): Require tramp. Remove now unnecessary check. + + * net/tramp-sh.el (tramp-sh-handle-start-file-process): Let-bind + `tramp-current-connection' in order to avoid an error when several + commands are invoked in a short time in eshell and friends. + 2013-02-19 Stefan Monnier Cleanup some of EIEIO's namespace. === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2013-01-02 16:13:04 +0000 +++ lisp/eshell/em-unix.el 2013-02-19 03:29:28 +0000 @@ -1040,6 +1040,7 @@ (defun eshell/su (&rest args) "Alias \"su\" to call Tramp." + (require 'tramp) (setq args (eshell-stringify-list (eshell-flatten-list args))) (let ((orig-args (copy-tree args))) (eshell-eval-using-options @@ -1077,6 +1078,7 @@ (defun eshell/sudo (&rest args) "Alias \"sudo\" to call Tramp." + (require 'tramp) (setq args (eshell-stringify-list (eshell-flatten-list args))) (let ((orig-args (copy-tree args))) (eshell-eval-using-options @@ -1111,8 +1113,6 @@ (format "%s|sudo:%s@%s:%s" (substring prefix 0 -1) user host dir) (format "/sudo:%s@%s:%s" user host dir)))) - ;; Ensure, that Tramp has connected to that construct already. - (ignore (file-exists-p default-directory)) (eshell-named-command (car orig-args) (cdr orig-args)))))))) (put 'eshell/sudo 'eshell-no-numeric-conversions t) === modified file 'lisp/info-look.el' --- lisp/info-look.el 2013-02-16 17:20:43 +0000 +++ lisp/info-look.el 2013-02-19 03:29:28 +0000 @@ -27,6 +27,14 @@ ;; Really cool code to lookup info indexes. ;; Try especially info-lookup-symbol (aka C-h S). +;; Some additional sources of (Tex)info files for non-GNU packages: +;; +;; Scheme: +;; LaTeX: +;; +;; (or CTAN mirrors) +;; Perl: (or CPAN mirrors) + ;;; Code: (require 'info) === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-02-16 17:44:00 +0000 +++ lisp/net/tramp-sh.el 2013-02-19 03:29:28 +0000 @@ -2784,7 +2784,11 @@ (or (null program) tramp-process-connection-type)) (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer))) (name1 name) - (i 0)) + (i 0) + ;; We do not want to raise an error when + ;; `start-file-process' has been started several time in + ;; `eshell' and friends. + (tramp-current-connection nil)) (unless buffer ;; BUFFER can be nil. We use a temporary buffer. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-02-15 06:35:54 +0000 +++ lisp/progmodes/python.el 2013-02-19 03:29:28 +0000 @@ -708,10 +708,9 @@ ;; After backslash ((setq start (when (not (or (python-syntax-context 'string ppss) (python-syntax-context 'comment ppss))) - (let ((line-beg-pos (line-beginning-position))) - (when (python-info-line-ends-backslash-p - (1- line-beg-pos)) - (- line-beg-pos 2))))) + (let ((line-beg-pos (line-number-at-pos))) + (python-info-line-ends-backslash-p + (1- line-beg-pos))))) 'after-backslash) ;; After beginning of block ((setq start (save-excursion @@ -3115,7 +3114,7 @@ (save-restriction (widen) (when line-number - (goto-char line-number)) + (python-util-goto-line line-number)) (while (and (not (eobp)) (goto-char (line-end-position)) (python-syntax-context 'paren) @@ -3131,7 +3130,7 @@ (save-restriction (widen) (when line-number - (goto-char line-number)) + (python-util-goto-line line-number)) (when (python-info-line-ends-backslash-p) (while (save-excursion (goto-char (line-beginning-position)) @@ -3210,7 +3209,9 @@ (defun python-info-current-line-comment-p () "Check if current line is a comment line." - (char-equal (or (char-after (+ (point) (current-indentation))) ?_) ?#)) + (char-equal + (or (char-after (+ (line-beginning-position) (current-indentation))) ?_) + ?#)) (defun python-info-current-line-empty-p () "Check if current line is empty, ignoring whitespace." @@ -3225,12 +3226,10 @@ ;;; Utility functions -(defun python-util-position (item seq) - "Find the first occurrence of ITEM in SEQ. -Return the index of the matching item, or nil if not found." - (let ((member-result (member item seq))) - (when member-result - (- (length seq) (length member-result))))) +(defun python-util-goto-line (line-number) + "Move point to LINE-NUMBER." + (goto-char (point-min)) + (forward-line (1- line-number))) ;; Stolen from org-mode (defun python-util-clone-local-variables (from-buffer &optional regexp) === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-17 19:01:46 +0000 +++ src/ChangeLog 2013-02-19 03:29:28 +0000 @@ -1,3 +1,8 @@ +2013-02-19 Eli Zaretskii + + * w32proc.c (new_child): Avoid leaking handles if the subprocess + resources were not orderly released. + 2013-02-17 Eli Zaretskii * xdisp.c (x_draw_vertical_border): For a window that is neither === modified file 'src/w32proc.c' --- src/w32proc.c 2013-02-17 19:01:46 +0000 +++ src/w32proc.c 2013-02-19 03:29:28 +0000 @@ -849,6 +849,12 @@ cp = &child_procs[child_proc_count++]; Initialize: + /* Last opportunity to avoid leaking handles before we forget them + for good. */ + if (cp->procinfo.hProcess) + CloseHandle (cp->procinfo.hProcess); + if (cp->procinfo.hThread) + CloseHandle (cp->procinfo.hThread); memset (cp, 0, sizeof (*cp)); cp->fd = -1; cp->pid = -1; === modified file 'src/xdisp.c' --- src/xdisp.c 2013-02-17 19:01:46 +0000 +++ src/xdisp.c 2013-02-19 03:29:28 +0000 @@ -28244,7 +28244,7 @@ if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame))) return; - /* Note: It is necessary to redraw bot the left and the right + /* Note: It is necessary to redraw both the left and the right borders, for when only this single window W is being redisplayed. */ if (!WINDOW_RIGHTMOST_P (w) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.