Now on revision 109156. ------------------------------------------------------------ revno: 109156 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10190 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2012-07-19 02:24:04 -0400 message: * lisp/subr.el (eventp): Presume that if it looks vaguely like an event, it's an event. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-19 00:55:55 +0000 +++ lisp/ChangeLog 2012-07-19 06:24:04 +0000 @@ -1,3 +1,8 @@ +2012-07-19 Stefan Monnier + + * subr.el (eventp): Presume that if it looks vaguely like an event, + it's an event (bug#10190). + 2012-07-19 Fabián Ezequiel Gallina Enhancements to ppss related code (thanks Stefan). @@ -5,7 +10,7 @@ (python-indent-calculate-indentation, python-indent-dedent-line) (python-indent-electric-colon, python-nav-forward-block) (python-mode-abbrev-table) - (python-info-assignment-continuation-line-p): Simplified checks + (python-info-assignment-continuation-line-p): Simplify checks for ppss context. (python-info-continuation-line-p): Cleanup. (python-info-ppss-context): Do not catch 'quote. === modified file 'lisp/subr.el' --- lisp/subr.el 2012-07-18 14:48:25 +0000 +++ lisp/subr.el 2012-07-19 06:24:04 +0000 @@ -909,17 +909,9 @@ (defsubst eventp (obj) "True if the argument is an event object." - (or (and (integerp obj) - ;; FIXME: Why bother? - ;; Filter out integers too large to be events. - ;; M is the biggest modifier. - (zerop (logand obj (lognot (1- (lsh ?\M-\^@ 1))))) - (characterp (event-basic-type obj))) - (and (symbolp obj) - (get obj 'event-symbol-elements)) - (and (consp obj) - (symbolp (car obj)) - (get (car obj) 'event-symbol-elements)))) + (or (integerp obj) + (and (symbolp obj) obj (not (keywordp obj))) + (and (consp obj) (symbolp (car obj))))) (defun event-modifiers (event) "Return a list of symbols representing the modifier keys in event EVENT. ------------------------------------------------------------ revno: 109155 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-07-19 07:55:59 +0400 message: New macro to iterate over all buffers, miscellaneous cleanups. * lisp.h (all_buffers): Remove declaration. * buffer.h (all_buffers): Add declaration, with comment. (for_each_buffer): New macro. * alloc.c (Fgarbage_collect, mark_object): Use it. * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte) (init_buffer): Likewise. * data.c (Fset_default): Likewise. * coding.c (code_conversion_restore): Remove redundant check for dead buffer. * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 21:33:37 +0000 +++ src/ChangeLog 2012-07-19 03:55:59 +0000 @@ -1,3 +1,17 @@ +2012-07-19 Dmitry Antipov + + New macro to iterate over all buffers, miscellaneous cleanups. + * lisp.h (all_buffers): Remove declaration. + * buffer.h (all_buffers): Add declaration, with comment. + (for_each_buffer): New macro. + * alloc.c (Fgarbage_collect, mark_object): Use it. + * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte) + (init_buffer): Likewise. + * data.c (Fset_default): Likewise. + * coding.c (code_conversion_restore): Remove redundant check + for dead buffer. + * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment. + 2012-07-18 Andreas Schwab Fix bug that created negative-length intervals. @@ -110,7 +124,6 @@ * gnutls.c (emacs_gnutls_handshake): Only retry if GNUTLS_E_INTERRUPTED. -2012-07-17 Eli Zaretskii 2012-07-17 Dmitry Antipov Cleanup and convert miscellaneous checks to eassert. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-18 17:29:34 +0000 +++ src/alloc.c 2012-07-19 03:55:59 +0000 @@ -5392,6 +5392,7 @@ (void) { register struct specbinding *bind; + register struct buffer *nextb; char stack_top_variable; ptrdiff_t i; int message_p; @@ -5411,40 +5412,34 @@ /* Don't keep undo information around forever. Do this early on, so it is no problem if the user quits. */ - { - register struct buffer *nextb = all_buffers; - - while (nextb) - { - /* If a buffer's undo list is Qt, that means that undo is - turned off in that buffer. Calling truncate_undo_list on - Qt tends to return NULL, which effectively turns undo back on. - So don't call truncate_undo_list if undo_list is Qt. */ - if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) - && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) - truncate_undo_list (nextb); - - /* Shrink buffer gaps, but skip indirect and dead buffers. */ - if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name)) - && ! nextb->text->inhibit_shrinking) - { - /* If a buffer's gap size is more than 10% of the buffer - size, or larger than 2000 bytes, then shrink it - accordingly. Keep a minimum size of 20 bytes. */ - int size = min (2000, max (20, (nextb->text->z_byte / 10))); - - if (nextb->text->gap_size > size) - { - struct buffer *save_current = current_buffer; - current_buffer = nextb; - make_gap (-(nextb->text->gap_size - size)); - current_buffer = save_current; - } - } - - nextb = nextb->header.next.buffer; - } - } + for_each_buffer (nextb) + { + /* If a buffer's undo list is Qt, that means that undo is + turned off in that buffer. Calling truncate_undo_list on + Qt tends to return NULL, which effectively turns undo back on. + So don't call truncate_undo_list if undo_list is Qt. */ + if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) + && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) + truncate_undo_list (nextb); + + /* Shrink buffer gaps, but skip indirect and dead buffers. */ + if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name)) + && ! nextb->text->inhibit_shrinking) + { + /* If a buffer's gap size is more than 10% of the buffer + size, or larger than 2000 bytes, then shrink it + accordingly. Keep a minimum size of 20 bytes. */ + int size = min (2000, max (20, (nextb->text->z_byte / 10))); + + if (nextb->text->gap_size > size) + { + struct buffer *save_current = current_buffer; + current_buffer = nextb; + make_gap (-(nextb->text->gap_size - size)); + current_buffer = save_current; + } + } + } t1 = current_emacs_time (); @@ -5558,48 +5553,42 @@ Look thru every buffer's undo list for elements that update markers that were not marked, and delete them. */ - { - register struct buffer *nextb = all_buffers; - - while (nextb) - { - /* If a buffer's undo list is Qt, that means that undo is - turned off in that buffer. Calling truncate_undo_list on - Qt tends to return NULL, which effectively turns undo back on. - So don't call truncate_undo_list if undo_list is Qt. */ - if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) - { - Lisp_Object tail, prev; - tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); - prev = Qnil; - while (CONSP (tail)) - { - if (CONSP (XCAR (tail)) - && MARKERP (XCAR (XCAR (tail))) - && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) - { - if (NILP (prev)) - nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); - else - { - tail = XCDR (tail); - XSETCDR (prev, tail); - } - } - else - { - prev = tail; - tail = XCDR (tail); - } - } - } - /* Now that we have stripped the elements that need not be in the - undo_list any more, we can finally mark the list. */ - mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); - - nextb = nextb->header.next.buffer; - } - } + for_each_buffer (nextb) + { + /* If a buffer's undo list is Qt, that means that undo is + turned off in that buffer. Calling truncate_undo_list on + Qt tends to return NULL, which effectively turns undo back on. + So don't call truncate_undo_list if undo_list is Qt. */ + if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) + { + Lisp_Object tail, prev; + tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); + prev = Qnil; + while (CONSP (tail)) + { + if (CONSP (XCAR (tail)) + && MARKERP (XCAR (XCAR (tail))) + && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) + { + if (NILP (prev)) + nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); + else + { + tail = XCDR (tail); + XSETCDR (prev, tail); + } + } + else + { + prev = tail; + tail = XCDR (tail); + } + } + } + /* Now that we have stripped the elements that need not be in the + undo_list any more, we can finally mark the list. */ + mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); + } gc_sweep (); @@ -5987,9 +5976,10 @@ #ifdef GC_CHECK_MARKED_OBJECTS if (po != &buffer_defaults && po != &buffer_local_symbols) { - struct buffer *b = all_buffers; - for (; b && b != po; b = b->header.next.buffer) - ; + struct buffer *b; + for_each_buffer (b) + if (b == po) + break; if (b == NULL) abort (); } === modified file 'src/buffer.c' --- src/buffer.c 2012-07-17 11:52:00 +0000 +++ src/buffer.c 2012-07-19 03:55:59 +0000 @@ -1532,10 +1532,8 @@ GCPRO1 (buffer); - for (other = all_buffers; other; other = other->header.next.buffer) - /* all_buffers contains dead buffers too; - don't re-kill them. */ - if (other->base_buffer == b && !NILP (BVAR (other, name))) + for_each_buffer (other) + if (other->base_buffer == b) { Lisp_Object buf; XSETBUFFER (buf, other); @@ -2052,7 +2050,7 @@ { /* This is probably harder to make work. */ struct buffer *other; - for (other = all_buffers; other; other = other->header.next.buffer) + for_each_buffer (other) if (other->base_buffer == other_buffer || other->base_buffer == current_buffer) error ("One of the buffers to swap has indirect buffers"); @@ -2429,7 +2427,7 @@ /* Copy this buffer's new multibyte status into all of its indirect buffers. */ - for (other = all_buffers; other; other = other->header.next.buffer) + for_each_buffer (other) if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) { BVAR (other, enable_multibyte_characters) @@ -5035,7 +5033,7 @@ Map new memory. */ struct buffer *b; - for (b = all_buffers; b; b = b->header.next.buffer) + for_each_buffer (b) if (b->text->beg == NULL) enlarge_buffer_text (b, 0); } === modified file 'src/buffer.h' --- src/buffer.h 2012-07-17 04:29:50 +0000 +++ src/buffer.h 2012-07-19 03:55:59 +0000 @@ -857,6 +857,15 @@ }; +/* Chain of all buffers, including killed ones. */ + +extern struct buffer *all_buffers; + +/* Used to iterate over the chain above. */ + +#define for_each_buffer(b) \ + for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer) + /* This points to the current buffer. */ extern struct buffer *current_buffer; === modified file 'src/coding.c' --- src/coding.c 2012-07-11 07:19:44 +0000 +++ src/coding.c 2012-07-19 03:55:59 +0000 @@ -7588,7 +7588,7 @@ { if (EQ (workbuf, Vcode_conversion_reused_workbuf)) reused_workbuf_in_use = 0; - else if (! NILP (Fbuffer_live_p (workbuf))) + else Fkill_buffer (workbuf); } set_buffer_internal (XBUFFER (current)); === modified file 'src/data.c' --- src/data.c 2012-07-18 05:44:36 +0000 +++ src/data.c 2012-07-19 03:55:59 +0000 @@ -1401,7 +1401,7 @@ { struct buffer *b; - for (b = all_buffers; b; b = b->header.next.buffer) + for_each_buffer (b) if (!PER_BUFFER_VALUE_P (b, idx)) PER_BUFFER_VALUE (b, offset) = value; } === modified file 'src/lisp.h' --- src/lisp.h 2012-07-18 13:20:59 +0000 +++ src/lisp.h 2012-07-19 03:55:59 +0000 @@ -2858,7 +2858,6 @@ extern Lisp_Object other_buffer_safely (Lisp_Object); extern Lisp_Object Qpriority, Qwindow, Qbefore_string, Qafter_string; extern Lisp_Object get_truename_buffer (Lisp_Object); -extern struct buffer *all_buffers; extern void init_buffer_once (void); extern void init_buffer (void); extern void syms_of_buffer (void); ------------------------------------------------------------ revno: 109154 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Wed 2012-07-18 21:55:55 -0300 message: Enhancements to ppss related code (thanks Stefan). * progmodes/python.el (python-indent-context) (python-indent-calculate-indentation, python-indent-dedent-line) (python-indent-electric-colon, python-nav-forward-block) (python-mode-abbrev-table) (python-info-assignment-continuation-line-p): Simplified checks for ppss context. (python-info-continuation-line-p): Cleanup. (python-info-ppss-context): Do not catch 'quote. (python-info-ppss-context-type) (python-info-ppss-comment-or-string-p): Simplify. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 18:40:03 +0000 +++ lisp/ChangeLog 2012-07-19 00:55:55 +0000 @@ -1,3 +1,17 @@ +2012-07-19 Fabián Ezequiel Gallina + + Enhancements to ppss related code (thanks Stefan). + * progmodes/python.el (python-indent-context) + (python-indent-calculate-indentation, python-indent-dedent-line) + (python-indent-electric-colon, python-nav-forward-block) + (python-mode-abbrev-table) + (python-info-assignment-continuation-line-p): Simplified checks + for ppss context. + (python-info-continuation-line-p): Cleanup. + (python-info-ppss-context): Do not catch 'quote. + (python-info-ppss-context-type) + (python-info-ppss-comment-or-string-p): Simplify. + 2012-07-18 Fabián Ezequiel Gallina * progmodes/python.el: Enhancements to eldoc support. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-18 19:04:06 +0000 +++ lisp/progmodes/python.el 2012-07-19 00:55:55 +0000 @@ -656,9 +656,7 @@ (while (and (re-search-backward (python-rx block-start) nil t) (or - (python-info-ppss-context 'string) - (python-info-ppss-context 'comment) - (python-info-ppss-context 'paren) + (python-info-ppss-context-type) (python-info-continuation-line-p)))) (when (looking-at (python-rx block-start)) (point-marker))))) @@ -726,13 +724,9 @@ (goto-char (line-end-position)) (while (and (re-search-backward "\\." (line-beginning-position) t) - (or (python-info-ppss-context 'comment) - (python-info-ppss-context 'string) - (python-info-ppss-context 'paren)))) + (python-info-ppss-context-type))) (if (and (looking-at "\\.") - (not (or (python-info-ppss-context 'comment) - (python-info-ppss-context 'string) - (python-info-ppss-context 'paren)))) + (not (python-info-ppss-context-type))) ;; The indentation is the same column of the ;; first matching dot that's not inside a ;; comment, a string or a paren @@ -888,8 +882,7 @@ (defun python-indent-dedent-line () "De-indent current line." (interactive "*") - (when (and (not (or (python-info-ppss-context 'string) - (python-info-ppss-context 'comment))) + (when (and (not (python-info-ppss-comment-or-string-p)) (<= (point-marker) (save-excursion (back-to-indentation) (point-marker))) @@ -980,8 +973,7 @@ (when (and (not arg) (eolp) (not (equal ?: (char-after (- (point-marker) 2)))) - (not (or (python-info-ppss-context 'string) - (python-info-ppss-context 'comment)))) + (not (python-info-ppss-comment-or-string-p))) (let ((indentation (current-indentation)) (calculated-indentation (python-indent-calculate-indentation))) (python-info-closing-block-message) @@ -1209,17 +1201,13 @@ (python-nav-end-of-statement) (while (and (re-search-forward block-start-regexp nil t) - (or (python-info-ppss-context 'string) - (python-info-ppss-context 'comment) - (python-info-ppss-context 'paren)))) + (python-info-ppss-context-type))) (setq arg (1- arg))) (while (< arg 0) (python-nav-beginning-of-statement) (while (and (re-search-backward block-start-regexp nil t) - (or (python-info-ppss-context 'string) - (python-info-ppss-context 'comment) - (python-info-ppss-context 'paren)))) + (python-info-ppss-context-type))) (setq arg (1+ arg))) (python-nav-beginning-of-statement) (if (not (looking-at (python-rx block-start))) @@ -2249,8 +2237,7 @@ ;; Only expand in code. :enable-function (lambda () (and - (not (or (python-info-ppss-context 'string) - (python-info-ppss-context 'comment))) + (not (python-info-ppss-comment-or-string-p)) python-skeleton-autoinsert))) (defmacro python-skeleton-define (name doc &rest skel) @@ -2686,24 +2673,20 @@ (cond ((equal context-type 'paren) ;; Lines inside a paren are always a continuation line ;; (except the first one). - (when (equal (python-info-ppss-context-type) 'paren) - (python-util-forward-comment -1) - (python-util-forward-comment -1) - (point-marker))) - ((or (equal context-type 'comment) - (equal context-type 'string)) + (python-util-forward-comment -1) + (point-marker)) + ((member context-type '(string comment)) ;; move forward an roll again (goto-char context-start) (python-util-forward-comment) (python-info-continuation-line-p)) (t - ;; Not within a paren, string or comment, the only way we are - ;; dealing with a continuation line is that previous line - ;; contains a backslash, and this can only be the previous line - ;; from current + ;; Not within a paren, string or comment, the only way + ;; we are dealing with a continuation line is that + ;; previous line contains a backslash, and this can + ;; only be the previous line from current (back-to-indentation) (python-util-forward-comment -1) - (python-util-forward-comment -1) (when (and (equal (1- line-start) (line-number-at-pos)) (python-info-line-ends-backslash-p)) (point-marker)))))))) @@ -2731,45 +2714,37 @@ assignment-operator not-simple-operator) (line-end-position) t) - (not (or (python-info-ppss-context 'string) - (python-info-ppss-context 'paren) - (python-info-ppss-context 'comment))))) + (not (python-info-ppss-context-type)))) (skip-syntax-forward "\s") (point-marker))))) (defun python-info-ppss-context (type &optional syntax-ppss) "Return non-nil if point is on TYPE using SYNTAX-PPSS. -TYPE can be 'comment, 'string or 'paren. It returns the start +TYPE can be `comment', `string' or `paren'. It returns the start character address of the specified TYPE." (let ((ppss (or syntax-ppss (syntax-ppss)))) (case type - ('comment + (comment (and (nth 4 ppss) (nth 8 ppss))) - ('string + (string (and (not (nth 4 ppss)) (nth 8 ppss))) - ('paren + (paren (nth 1 ppss)) (t nil)))) (defun python-info-ppss-context-type (&optional syntax-ppss) "Return the context type using SYNTAX-PPSS. -The type returned can be 'comment, 'string or 'paren." +The type returned can be `comment', `string' or `paren'." (let ((ppss (or syntax-ppss (syntax-ppss)))) (cond - ((and (nth 4 ppss) - (nth 8 ppss)) - 'comment) - ((nth 8 ppss) - 'string) - ((nth 1 ppss) - 'paren) - (t nil)))) + ((nth 8 ppss) (if (nth 4 ppss) 'comment 'string)) + ((nth 1 ppss) 'paren)))) (defsubst python-info-ppss-comment-or-string-p () "Return non-nil if point is inside 'comment or 'string." - (car (member (python-info-ppss-context-type) '(string comment)))) + (nth 8 (syntax-ppss))) (defun python-info-looking-at-beginning-of-defun (&optional syntax-ppss) "Check if point is at `beginning-of-defun' using SYNTAX-PPSS." ------------------------------------------------------------ revno: 109153 author: Andreas Schwab committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-07-18 14:33:37 -0700 message: Fix bug that created negative-length intervals. * intervals.c (merge_interval_right, merge_interval_left): Do not zero out this interval if it is absorbed by its children, as this interval's total length doesn't change in that case. See . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 17:29:34 +0000 +++ src/ChangeLog 2012-07-18 21:33:37 +0000 @@ -1,3 +1,11 @@ +2012-07-18 Andreas Schwab + + Fix bug that created negative-length intervals. + * intervals.c (merge_interval_right, merge_interval_left): + Do not zero out this interval if it is absorbed by its children, + as this interval's total length doesn't change in that case. See + . + 2012-07-18 Paul Eggert * alloc.c (Fmake_bool_vector): Fix off-by-8 bug === modified file 'src/intervals.c' --- src/intervals.c 2012-07-17 09:12:24 +0000 +++ src/intervals.c 2012-07-18 21:33:37 +0000 @@ -1391,10 +1391,6 @@ register ptrdiff_t absorb = LENGTH (i); register INTERVAL successor; - /* Zero out this interval. */ - i->total_length -= absorb; - CHECK_TOTAL_LENGTH (i); - /* Find the succeeding interval. */ if (! NULL_RIGHT_CHILD (i)) /* It's below us. Add absorb as we descend. */ @@ -1413,6 +1409,10 @@ return successor; } + /* Zero out this interval. */ + i->total_length -= absorb; + CHECK_TOTAL_LENGTH (i); + successor = i; while (! NULL_PARENT (successor)) /* It's above us. Subtract as we ascend. */ @@ -1447,10 +1447,6 @@ register ptrdiff_t absorb = LENGTH (i); register INTERVAL predecessor; - /* Zero out this interval. */ - i->total_length -= absorb; - CHECK_TOTAL_LENGTH (i); - /* Find the preceding interval. */ if (! NULL_LEFT_CHILD (i)) /* It's below us. Go down, adding ABSORB as we go. */ @@ -1469,9 +1465,13 @@ return predecessor; } + /* Zero out this interval. */ + i->total_length -= absorb; + CHECK_TOTAL_LENGTH (i); + predecessor = i; while (! NULL_PARENT (predecessor)) /* It's above us. Go up, - subtracting ABSORB. */ + subtracting ABSORB. */ { if (AM_RIGHT_CHILD (predecessor)) { ------------------------------------------------------------ revno: 109152 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Wed 2012-07-18 16:04:06 -0300 message: progmodes/python.el: Set file local vars at end of file and clean tabs. diff: === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-18 18:40:03 +0000 +++ lisp/progmodes/python.el 2012-07-18 19:04:06 +0000 @@ -1,4 +1,4 @@ -;;; python.el --- Python's flying circus support for Emacs -*- coding: utf-8 -*- +;;; python.el --- Python's flying circus support for Emacs ;; Copyright (C) 2003-2012 Free Software Foundation, Inc. @@ -2262,7 +2262,7 @@ (function-name (intern (concat "python-skeleton-" name)))) `(progn (define-abbrev python-mode-abbrev-table ,name "" ',function-name - :system t) + :system t) (setq python-skeleton-available (cons ',function-name python-skeleton-available)) (define-skeleton ,function-name @@ -2911,4 +2911,10 @@ (provide 'python) + +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + ;;; python.el ends here ------------------------------------------------------------ revno: 109151 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Wed 2012-07-18 15:40:03 -0300 message: * progmodes/python.el: Enhancements to eldoc support. (python-info-current-symbol): New function. (python-eldoc-at-point): Use python-info-current-symbol. (python-info-current-defun): Fix cornercase on first defun scan. (python-eldoc--get-doc-at-point): Use python-info-current-symbol and signal error when no inferior python process is available. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 15:04:36 +0000 +++ lisp/ChangeLog 2012-07-18 18:40:03 +0000 @@ -1,3 +1,12 @@ +2012-07-18 Fabián Ezequiel Gallina + + * progmodes/python.el: Enhancements to eldoc support. + (python-info-current-symbol): New function. + (python-eldoc-at-point): Use python-info-current-symbol. + (python-info-current-defun): Fix cornercase on first defun scan. + (python-eldoc--get-doc-at-point): Use python-info-current-symbol + and signal error when no inferior python process is available. + 2012-07-18 Dmitry Gutov * vc/vc-git.el (vc-git-state): Don't call `vc-git-registered', === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-17 20:27:49 +0000 +++ lisp/progmodes/python.el 2012-07-18 18:40:03 +0000 @@ -2487,46 +2487,19 @@ (defun python-eldoc--get-doc-at-point (&optional force-input force-process) "Internal implementation to get documentation at point. -If not FORCE-INPUT is passed then what `current-word' returns -will be used. If not FORCE-PROCESS is passed what -`python-shell-get-process' returns is used." +If not FORCE-INPUT is passed then what +`python-info-current-symbol' returns will be used. If not +FORCE-PROCESS is passed what `python-shell-get-process' returns +is used." (let ((process (or force-process (python-shell-get-process)))) (if (not process) - "Eldoc needs an inferior Python process running." - (let* ((current-defun (python-info-current-defun)) - (input (or force-input - (with-syntax-table python-dotty-syntax-table - (if (not current-defun) - (current-word) - (concat current-defun "." (current-word)))))) - (ppss (syntax-ppss)) - (help (when (and - input - (not (string= input (concat current-defun "."))) - (not (or (python-info-ppss-context 'string ppss) - (python-info-ppss-context 'comment ppss)))) - (when (string-match - (concat - (regexp-quote (concat current-defun ".")) - "self\\.") input) - (with-temp-buffer - (insert input) - (goto-char (point-min)) - (forward-word) - (forward-char) - (delete-region - (point-marker) (search-forward "self.")) - (setq input (buffer-substring - (point-min) (point-max))))) - (python-shell-send-string-no-output - (format python-eldoc-string-code input) process)))) - (with-current-buffer (process-buffer process) - (when comint-last-prompt-overlay - (delete-region comint-last-input-end - (overlay-start comint-last-prompt-overlay)))) - (when (and help - (not (string= help "\n"))) - help))))) + (error "Eldoc needs an inferior Python process running") + (let ((input (or force-input + (python-info-current-symbol t)))) + (and input + (python-shell-send-string-no-output + (format python-eldoc-string-code input) + process)))))) (defun python-eldoc-function () "`eldoc-documentation-function' for Python. @@ -2539,17 +2512,16 @@ "Get help on SYMBOL using `help'. Interactively, prompt for symbol." (interactive - (let ((symbol (with-syntax-table python-dotty-syntax-table - (current-word))) + (let ((symbol (python-info-current-symbol t)) (enable-recursive-minibuffers t)) (list (read-string (if symbol (format "Describe symbol (default %s): " symbol) "Describe symbol: ") nil nil symbol)))) - (let ((process (python-shell-get-process))) - (if (not process) - (message "Eldoc needs an inferior Python process running.") - (message (python-eldoc--get-doc-at-point symbol process))))) + (message (python-eldoc--get-doc-at-point symbol))) + +(add-to-list 'debug-ignored-errors + "^Eldoc needs an inferior Python process running.") ;;; Misc helpers @@ -2561,18 +2533,27 @@ `add-log-current-defun-function' since it returns nil if point is not inside a defun." (let ((names '()) - (min-indent) + (starting-indentation) + (starting-point) (first-run t)) (save-restriction (widen) (save-excursion + (setq starting-point (point-marker)) + (setq starting-indentation (save-excursion + (python-nav-beginning-of-statement) + (current-indentation))) (end-of-line 1) - (setq min-indent (current-indentation)) (while (python-beginning-of-defun-function 1) - (when (or (< (current-indentation) min-indent) - first-run) + (when (or (< (current-indentation) starting-indentation) + (and first-run + (< + starting-point + (save-excursion + (python-end-of-defun-function) + (point-marker))))) (setq first-run nil) - (setq min-indent (current-indentation)) + (setq starting-indentation (current-indentation)) (looking-at python-nav-beginning-of-defun-regexp) (setq names (cons (if (not include-type) @@ -2584,6 +2565,30 @@ (when names (mapconcat (lambda (string) string) names ".")))) +(defun python-info-current-symbol (&optional replace-self) + "Return current symbol using dotty syntax. +With optional argument REPLACE-SELF convert \"self\" to current +parent defun name." + (let ((name + (and (not (python-info-ppss-comment-or-string-p)) + (with-syntax-table python-dotty-syntax-table + (let ((sym (symbol-at-point))) + (and sym + (substring-no-properties (symbol-name sym)))))))) + (when name + (if (not replace-self) + name + (let ((current-defun (python-info-current-defun))) + (if (not current-defun) + name + (replace-regexp-in-string + (python-rx line-start word-start "self" word-end ?.) + (concat + (mapconcat 'identity + (butlast (split-string current-defun "\\.")) + ".") ".") + name))))))) + (defsubst python-info-beginning-of-block-statement-p () "Return non-nil if current statement opens a block." (save-excursion ------------------------------------------------------------ revno: 109150 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-07-18 10:29:34 -0700 message: * alloc.c (Fmake_bool_vector): Fix off-by-8 bug when invoking (make-bool-vector N t) and N is a positive multiple of 8 -- the last 8 bits were mistakenly cleared. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 17:26:43 +0000 +++ src/ChangeLog 2012-07-18 17:29:34 +0000 @@ -1,5 +1,9 @@ 2012-07-18 Paul Eggert + * alloc.c (Fmake_bool_vector): Fix off-by-8 bug + when invoking (make-bool-vector N t) and N is a positive + multiple of 8 -- the last 8 bits were mistakenly cleared. + Remove some struct layout assumptions in bool vectors. * alloc.c (bool_header_size): New constant. (header_size, word_size): Move earlier, as they're now used earlier. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-18 17:26:43 +0000 +++ src/alloc.c 2012-07-18 17:29:34 +0000 @@ -2389,7 +2389,7 @@ /* Clear any extraneous bits in the last byte. */ p->data[length_in_chars - 1] - &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; + &= (1 << ((XFASTINT (length) - 1) % BOOL_VECTOR_BITS_PER_CHAR + 1)) - 1; } return val; ------------------------------------------------------------ revno: 109149 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-07-18 10:26:43 -0700 message: Remove some struct layout assumptions in bool vectors. * alloc.c (bool_header_size): New constant. (header_size, word_size): Move earlier, as they're now used earlier. Use 'word_size' in a few more places, where it's appropriate. (Fmake_bool_vector, sweep_vectors): Don't assume that there is no padding before the data member of a bool vector. (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather than doing the check by hand with an abort (). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 15:20:33 +0000 +++ src/ChangeLog 2012-07-18 17:26:43 +0000 @@ -1,3 +1,14 @@ +2012-07-18 Paul Eggert + + Remove some struct layout assumptions in bool vectors. + * alloc.c (bool_header_size): New constant. + (header_size, word_size): Move earlier, as they're now used earlier. + Use 'word_size' in a few more places, where it's appropriate. + (Fmake_bool_vector, sweep_vectors): Don't assume that there is no + padding before the data member of a bool vector. + (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather + than doing the check by hand with an abort (). + 2012-07-18 Stefan Monnier * eval.c (Fdefvar): Don't check constants since we only set the var if === modified file 'src/alloc.c' --- src/alloc.c 2012-07-18 09:46:07 +0000 +++ src/alloc.c 2012-07-18 17:26:43 +0000 @@ -281,6 +281,14 @@ static void free_misc (Lisp_Object); extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; +/* Handy constants for vectorlike objects. */ +enum + { + header_size = offsetof (struct Lisp_Vector, contents), + bool_header_size = offsetof (struct Lisp_Bool_Vector, data), + word_size = sizeof (Lisp_Object) + }; + /* When scanning the C stack for live Lisp objects, Emacs keeps track of what memory allocated via lisp_malloc is intended for what purpose. This enumeration specifies the type of memory. */ @@ -2356,6 +2364,8 @@ ptrdiff_t length_in_chars; EMACS_INT length_in_elts; int bits_per_value; + int extra_bool_elts = ((bool_header_size - header_size + word_size - 1) + / word_size); CHECK_NATNUM (length); @@ -2363,9 +2373,7 @@ length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; - /* We must allocate one more elements than LENGTH_IN_ELTS for the - slot `size' of the struct Lisp_Bool_Vector. */ - val = Fmake_vector (make_number (length_in_elts + 1), Qnil); + val = Fmake_vector (make_number (length_in_elts + extra_bool_elts), Qnil); /* No Lisp_Object to trace in there. */ XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0); @@ -2874,12 +2882,10 @@ #define VECTOR_BLOCK_SIZE 4096 -/* Handy constants for vectorlike objects. */ +/* Align allocation request sizes to be a multiple of ROUNDUP_SIZE. */ enum { - header_size = offsetof (struct Lisp_Vector, contents), - word_size = sizeof (Lisp_Object), - roundup_size = COMMON_MULTIPLE (sizeof (Lisp_Object), + roundup_size = COMMON_MULTIPLE (word_size, USE_LSB_TAG ? 1 << GCTYPEBITS : 1) }; @@ -2905,7 +2911,7 @@ /* Size of the largest vector allocated from block. */ #define VBLOCK_BYTES_MAX \ - vroundup ((VECTOR_BLOCK_BYTES / 2) - sizeof (Lisp_Object)) + vroundup ((VECTOR_BLOCK_BYTES / 2) - word_size) /* We maintain one free list for each possible block-allocated vector size, and this is the number of free lists we have. */ @@ -3154,25 +3160,21 @@ total_vectors++; if (vector->header.size & PSEUDOVECTOR_FLAG) { - if (((vector->header.size & PVEC_TYPE_MASK) - >> PSEUDOVECTOR_SIZE_BITS) == PVEC_BOOL_VECTOR) - { - struct Lisp_Bool_Vector *b - = (struct Lisp_Bool_Vector *) vector; - total_vector_bytes += header_size + sizeof (b->size) - + (b->size + BOOL_VECTOR_BITS_PER_CHAR - 1) - / BOOL_VECTOR_BITS_PER_CHAR; - } - else - /* All other pseudovectors are small enough to be - allocated from vector blocks. This code should - be redesigned if some pseudovector type grows - beyond VBLOCK_BYTES_MAX. */ - abort (); + struct Lisp_Bool_Vector *b = (struct Lisp_Bool_Vector *) vector; + + /* All non-bool pseudovectors are small enough to be allocated + from vector blocks. This code should be redesigned if some + pseudovector type grows beyond VBLOCK_BYTES_MAX. */ + eassert (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_BOOL_VECTOR)); + + total_vector_bytes + += (bool_header_size + + ((b->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR)); } else - total_vector_bytes - += header_size + vector->header.size * word_size; + total_vector_bytes += (header_size + + vector->header.size * word_size); vprev = &vector->header.next.vector; } else @@ -5261,8 +5263,7 @@ { Lisp_Object new; struct Lisp_Vector *p; - size_t size = (offsetof (struct Lisp_Vector, contents) - + len * sizeof (Lisp_Object)); + size_t size = header_size + len * word_size; p = (struct Lisp_Vector *) pure_alloc (size, Lisp_Vectorlike); XSETVECTOR (new, p); ------------------------------------------------------------ revno: 109148 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11904 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-07-18 11:20:33 -0400 message: * src/eval.c (Fdefvar): Don't check constants since we only set the var if it's not yet defined anyway. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 13:20:59 +0000 +++ src/ChangeLog 2012-07-18 15:20:33 +0000 @@ -1,5 +1,8 @@ 2012-07-18 Stefan Monnier + * eval.c (Fdefvar): Don't check constants since we only set the var if + it's not yet defined anyway (bug#11904). + * lisp.h (last_undo_boundary): Declare new var. * keyboard.c (command_loop_1): Set it. * cmds.c (Fself_insert_command): Use it to only remove boundaries that === modified file 'src/eval.c' --- src/eval.c 2012-07-10 16:53:26 +0000 +++ src/eval.c 2012-07-18 15:20:33 +0000 @@ -691,18 +691,6 @@ /* Do it before evaluating the initial value, for self-references. */ XSYMBOL (sym)->declared_special = 1; - if (SYMBOL_CONSTANT_P (sym)) - { - /* For upward compatibility, allow (defvar :foo (quote :foo)). */ - Lisp_Object tem1 = Fcar (tail); - if (! (CONSP (tem1) - && EQ (XCAR (tem1), Qquote) - && CONSP (XCDR (tem1)) - && EQ (XCAR (XCDR (tem1)), sym))) - error ("Constant symbol `%s' specified in defvar", - SDATA (SYMBOL_NAME (sym))); - } - if (NILP (tem)) Fset_default (sym, eval_sub (Fcar (tail))); else ------------------------------------------------------------ revno: 109147 author: Dmitry Gutov committer: Michael Albinus branch nick: trunk timestamp: Wed 2012-07-18 17:04:36 +0200 message: * vc/vc-git.el (vc-git-state): Don't call `vc-git-registered', assume it's always t. (vc-git-registered): Remove caching, the function is only called once. (vc-git-branches): Use `vc-git--call' instead of `call-process'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 14:46:32 +0000 +++ lisp/ChangeLog 2012-07-18 15:04:36 +0000 @@ -1,3 +1,11 @@ +2012-07-18 Dmitry Gutov + + * vc/vc-git.el (vc-git-state): Don't call `vc-git-registered', + assume it's always t. + (vc-git-registered): Remove caching, the function is only called + once. + (vc-git-branches): Use `vc-git--call' instead of `call-process'. + 2012-07-18 Chong Yidong * subr.el (last-input-char, last-command-char): Remove (Bug#9195). === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2012-07-11 23:13:41 +0000 +++ lisp/vc/vc-git.el 2012-07-18 15:04:36 +0000 @@ -173,31 +173,28 @@ (defun vc-git-registered (file) "Check whether FILE is registered with git." - (or (vc-file-getprop file 'git-registered) - (vc-file-setprop - file 'git-registered - (let ((dir (vc-git-root file))) - (when dir - (with-temp-buffer - (let* (process-file-side-effects - ;; Do not use the `file-name-directory' here: git-ls-files - ;; sometimes fails to return the correct status for relative - ;; path specs. - ;; See also: http://marc.info/?l=git&m=125787684318129&w=2 - (name (file-relative-name file dir)) - (str (ignore-errors - (cd dir) - (vc-git--out-ok "ls-files" "-c" "-z" "--" name) - ;; If result is empty, use ls-tree to check for deleted - ;; file. - (when (eq (point-min) (point-max)) - (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD" - "--" name)) - (buffer-string)))) - (and str - (> (length str) (length name)) - (string= (substring str 0 (1+ (length name))) - (concat name "\0")))))))))) + (let ((dir (vc-git-root file))) + (when dir + (with-temp-buffer + (let* (process-file-side-effects + ;; Do not use the `file-name-directory' here: git-ls-files + ;; sometimes fails to return the correct status for relative + ;; path specs. + ;; See also: http://marc.info/?l=git&m=125787684318129&w=2 + (name (file-relative-name file dir)) + (str (ignore-errors + (cd dir) + (vc-git--out-ok "ls-files" "-c" "-z" "--" name) + ;; If result is empty, use ls-tree to check for deleted + ;; file. + (when (eq (point-min) (point-max)) + (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD" + "--" name)) + (buffer-string)))) + (and str + (> (length str) (length name)) + (string= (substring str 0 (1+ (length name))) + (concat name "\0")))))))) (defun vc-git--state-code (code) "Convert from a string to a added/deleted/modified state." @@ -218,23 +215,24 @@ ;; is direct ancestor of corresponding upstream branch, and the file ;; was modified upstream. But we can't check that without a network ;; operation. - (if (not (vc-git-registered file)) - 'unregistered - (let ((diff (vc-git--run-command-string - file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) - (if (and diff - (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" - diff)) - (let ((diff-letter (match-string 1 diff))) - (if (not (match-beginning 2)) - ;; Empty diff: file contents is the same as the HEAD - ;; revision, but timestamps are different (eg, file - ;; was "touch"ed). Update timestamp in index: - (prog1 'up-to-date - (vc-git--call nil "add" "--refresh" "--" - (file-relative-name file))) - (vc-git--state-code diff-letter))) - (if (vc-git--empty-db-p) 'added 'up-to-date))))) + ;; This assumes that status is known to be not `unregistered' because + ;; we've been successfully dispatched here from `vc-state', that + ;; means `vc-git-registered' returned t earlier once. Bug#11757 + (let ((diff (vc-git--run-command-string + file "diff-index" "-p" "--raw" "-z" "HEAD" "--"))) + (if (and diff + (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.*\n.\\)?" + diff)) + (let ((diff-letter (match-string 1 diff))) + (if (not (match-beginning 2)) + ;; Empty diff: file contents is the same as the HEAD + ;; revision, but timestamps are different (eg, file + ;; was "touch"ed). Update timestamp in index: + (prog1 'up-to-date + (vc-git--call nil "add" "--refresh" "--" + (file-relative-name file))) + (vc-git--state-code diff-letter))) + (if (vc-git--empty-db-p) 'added 'up-to-date)))) (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." @@ -576,7 +574,7 @@ "Return the existing branches, as a list of strings. The car of the list is the current branch." (with-temp-buffer - (call-process vc-git-program nil t nil "branch") + (vc-git--call t "branch") (goto-char (point-min)) (let (current-branch branches) (while (not (eobp)) ------------------------------------------------------------ revno: 109146 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 22:48:25 +0800 message: Fix last commit. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-07-18 14:17:49 +0000 +++ etc/NEWS 2012-07-18 14:48:25 +0000 @@ -493,6 +493,7 @@ *** `facemenu-unlisted-faces' *** `rmail-decode-mime-charset' +*** `last-input-char' and `last-command-char' * Lisp changes in Emacs 24.2 === modified file 'lisp/subr.el' --- lisp/subr.el 2012-07-18 14:46:32 +0000 +++ lisp/subr.el 2012-07-18 14:48:25 +0000 @@ -1271,13 +1271,6 @@ (make-obsolete-variable 'translation-table-for-input nil "23.1") (defvaralias 'messages-buffer-max-lines 'message-log-max) - -;; These aliases exist in Emacs 19.34, and probably before, but were -;; only marked as obsolete in 23.1. -;; The lisp manual (since at least Emacs 21) describes them as -;; existing "for compatibility with Emacs version 18". -(define-obsolete-variable-alias 'last-input-char 'last-input-event - "at least 19.34") ;;;; Alternate names for functions - these are not being phased out. ------------------------------------------------------------ revno: 109145 fixes bug(s): http://debbugs.gnu.org/9195 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 22:46:32 +0800 message: * subr.el (last-input-char, last-command-char): Remove. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 14:29:34 +0000 +++ lisp/ChangeLog 2012-07-18 14:46:32 +0000 @@ -1,5 +1,7 @@ 2012-07-18 Chong Yidong + * subr.el (last-input-char, last-command-char): Remove (Bug#9195). + * simple.el (count-words): Report on narrowing (Bug#9959). * bindings.el: Bind M-= to count-words. === modified file 'lisp/subr.el' --- lisp/subr.el 2012-07-18 13:31:16 +0000 +++ lisp/subr.el 2012-07-18 14:46:32 +0000 @@ -1278,9 +1278,6 @@ ;; existing "for compatibility with Emacs version 18". (define-obsolete-variable-alias 'last-input-char 'last-input-event "at least 19.34") -(define-obsolete-variable-alias 'last-command-char 'last-command-event - "at least 19.34") - ;;;; Alternate names for functions - these are not being phased out. ------------------------------------------------------------ revno: 109144 fixes bug(s): http://debbugs.gnu.org/9959 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 22:29:34 +0800 message: * simple.el (count-words): Report on narrowing. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 14:17:49 +0000 +++ lisp/ChangeLog 2012-07-18 14:29:34 +0000 @@ -1,5 +1,7 @@ 2012-07-18 Chong Yidong + * simple.el (count-words): Report on narrowing (Bug#9959). + * bindings.el: Bind M-= to count-words. * faces.el (face-spec-reset-face): Handle reverse video (Bug#4238). === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-17 18:40:15 +0000 +++ lisp/simple.el 2012-07-18 14:29:34 +0000 @@ -986,7 +986,11 @@ ((use-region-p) (call-interactively 'count-words-region)) (t - (count-words--message "Buffer" (point-min) (point-max))))) + (count-words--message + (if (= (point-max) (1+ (buffer-size))) + "Buffer" + "Narrowed part of buffer") + (point-min) (point-max))))) (defun count-words--message (str start end) (let ((lines (count-lines start end)) ------------------------------------------------------------ revno: 109143 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 22:17:49 +0800 message: * lisp/bindings.el: Bind M-= to count-words. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-07-17 18:40:15 +0000 +++ etc/NEWS 2012-07-18 14:17:49 +0000 @@ -159,6 +159,8 @@ ** `mouse-avoidance-banish-position' can now be used to customize `mouse-avoidance-mode' further. +** `M-=' is now bound to `count-words', not `count-words-region'. + ** `C-M-f' and `C-M-b' will now move to the path name separator character when doing minibuffer filename prompts. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 14:00:09 +0000 +++ lisp/ChangeLog 2012-07-18 14:17:49 +0000 @@ -1,5 +1,7 @@ 2012-07-18 Chong Yidong + * bindings.el: Bind M-= to count-words. + * faces.el (face-spec-reset-face): Handle reverse video (Bug#4238). 2012-07-18 Masatake YAMATO === modified file 'lisp/bindings.el' --- lisp/bindings.el 2012-07-14 02:19:07 +0000 +++ lisp/bindings.el 2012-07-18 14:17:49 +0000 @@ -793,7 +793,7 @@ (define-key ctl-x-map "\C-o" 'delete-blank-lines) (define-key esc-map " " 'just-one-space) (define-key esc-map "z" 'zap-to-char) -(define-key esc-map "=" 'count-words-region) +(define-key esc-map "=" 'count-words) (define-key ctl-x-map "=" 'what-cursor-position) (define-key esc-map ":" 'eval-expression) ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. ------------------------------------------------------------ revno: 109142 fixes bug(s): http://debbugs.gnu.org/4238 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 22:00:09 +0800 message: * faces.el (face-spec-reset-face): Handle reverse video. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 13:40:57 +0000 +++ lisp/ChangeLog 2012-07-18 14:00:09 +0000 @@ -1,3 +1,7 @@ +2012-07-18 Chong Yidong + + * faces.el (face-spec-reset-face): Handle reverse video (Bug#4238). + 2012-07-18 Masatake YAMATO * progmodes/sh-script.el (sh-imenu-generic-expression): === modified file 'lisp/faces.el' --- lisp/faces.el 2012-06-22 21:24:54 +0000 +++ lisp/faces.el 2012-07-18 14:00:09 +0000 @@ -1549,8 +1549,12 @@ (display-graphic-p frame)) '(:family "default" :foundry "default" :width normal :height 1 :weight normal :slant normal - :foreground "unspecified-fg" - :background "unspecified-bg"))) + :foreground (if (frame-parameter nil 'reverse) + "unspecified-bg" + "unspecified-fg") + :background (if (frame-parameter nil 'reverse) + "unspecified-fg" + "unspecified-bg")))) ;; For all other faces, unspecify all attributes. (apply 'append (mapcar (lambda (x) (list (car x) 'unspecified)) ------------------------------------------------------------ revno: 109141 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11856 author: Masatake YAMATO committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-07-18 09:40:57 -0400 message: * lisp/progmodes/sh-script.el (sh-imenu-generic-expression): Capture a function with `function' keyword and without parentheses like "function FOO". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 13:31:16 +0000 +++ lisp/ChangeLog 2012-07-18 13:40:57 +0000 @@ -1,3 +1,9 @@ +2012-07-18 Masatake YAMATO + + * progmodes/sh-script.el (sh-imenu-generic-expression): + Capture a function with `function' keyword and without parentheses + like "function FOO" (bug#11856). + 2012-07-18 Tassilo Horn * window.el (split-window-sensibly): Make WINDOW argument @@ -51,9 +57,10 @@ * descr-text.el (describe-char): Fix format args. (Bug#10129) 2012-07-17 Fabián Ezequiel Gallina + Final renames and doc fixes for movement commands (bug#11899). - * progmodes/python.el (python-nav-beginning-of-statement): Rename - from python-nav-statement-start. + * progmodes/python.el (python-nav-beginning-of-statement): + Rename from python-nav-statement-start. (python-nav-end-of-statement): Rename from python-nav-statement-end. (python-nav-beginning-of-block): Rename from @@ -62,8 +69,8 @@ 2012-07-17 Fabián Ezequiel Gallina - * progmodes/python.el (python-shell-send-string-no-output): Allow - accept-process-output to quit, keeping shell process ready for + * progmodes/python.el (python-shell-send-string-no-output): + Allow accept-process-output to quit, keeping shell process ready for future interactions (Bug#11868). 2012-07-17 Stefan Monnier === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2012-07-17 11:52:00 +0000 +++ lisp/progmodes/sh-script.el 2012-07-18 13:40:57 +0000 @@ -327,8 +327,15 @@ (defcustom sh-imenu-generic-expression `((sh . ((nil - "^\\s-*\\(function\\s-+\\)?\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" - 2)))) + ;; function FOO + ;; function FOO() + "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?" + 1) + ;; FOO() + (nil + "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" + 1) + ))) "Alist of regular expressions for recognizing shell function definitions. See `sh-feature' and `imenu-generic-expression'." :type '(alist :key-type (symbol :tag "Shell") ------------------------------------------------------------ revno: 109140 fixes bug(s): http://debbugs.gnu.org/7261 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 21:31:16 +0800 message: * subr.el (keyboard-translate): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 10:02:54 +0000 +++ lisp/ChangeLog 2012-07-18 13:31:16 +0000 @@ -5,6 +5,8 @@ 2012-07-18 Chong Yidong + * subr.el (keyboard-translate): Doc fix (Bug#7261). + * isearch.el (isearch-mode-map): Handle C-x 8 key translations, and make C-x 8 RET exit isearch (Bug#11439). === modified file 'lisp/subr.el' --- lisp/subr.el 2012-06-22 21:24:54 +0000 +++ lisp/subr.el 2012-07-18 13:31:16 +0000 @@ -732,7 +732,7 @@ (put 'keyboard-translate-table 'char-table-extra-slots 0) (defun keyboard-translate (from to) - "Translate character FROM to TO at a low level. + "Translate character FROM to TO on the current terminal. This function creates a `keyboard-translate-table' if necessary and then modifies one entry in it." (or (char-table-p keyboard-translate-table) ------------------------------------------------------------ revno: 109139 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11774 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-07-18 09:20:59 -0400 message: * src/lisp.h (last_undo_boundary): Declare new var. * src/keyboard.c (command_loop_1): Set it. * src/cmds.c (Fself_insert_command): Use it to only remove boundaries that were auto-added by the command loop. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 10:12:43 +0000 +++ src/ChangeLog 2012-07-18 13:20:59 +0000 @@ -1,3 +1,10 @@ +2012-07-18 Stefan Monnier + + * lisp.h (last_undo_boundary): Declare new var. + * keyboard.c (command_loop_1): Set it. + * cmds.c (Fself_insert_command): Use it to only remove boundaries that + were auto-added by the command loop (bug#11774). + 2012-07-18 Andreas Schwab * w32font.c (Qsymbol): Remove local definition. === modified file 'src/cmds.c' --- src/cmds.c 2012-06-16 12:24:15 +0000 +++ src/cmds.c 2012-07-18 13:20:59 +0000 @@ -296,7 +296,10 @@ if (remove_boundary && CONSP (BVAR (current_buffer, undo_list)) - && NILP (XCAR (BVAR (current_buffer, undo_list)))) + && NILP (XCAR (BVAR (current_buffer, undo_list))) + /* Only remove auto-added boundaries, not boundaries + added be explicit calls to undo-boundary. */ + && EQ (BVAR (current_buffer, undo_list), last_undo_boundary)) /* Remove the undo_boundary that was just pushed. */ BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list)); === modified file 'src/keyboard.c' --- src/keyboard.c 2012-07-12 03:45:46 +0000 +++ src/keyboard.c 2012-07-18 13:20:59 +0000 @@ -1318,6 +1318,9 @@ } #endif +/* The last boundary auto-added to buffer-undo-list. */ +Lisp_Object last_undo_boundary; + /* FIXME: This is wrong rather than test window-system, we should call a new set-selection, which will then dispatch to x-set-selection, or tty-set-selection, or w32-set-selection, ... */ @@ -1565,7 +1568,13 @@ #endif if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */ - Fundo_boundary (); + { + Lisp_Object undo = BVAR (current_buffer, undo_list); + Fundo_boundary (); + last_undo_boundary + = (EQ (undo, BVAR (current_buffer, undo_list)) + ? Qnil : BVAR (current_buffer, undo_list)); + } Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); #ifdef HAVE_WINDOW_SYSTEM === modified file 'src/lisp.h' --- src/lisp.h 2012-07-18 05:44:36 +0000 +++ src/lisp.h 2012-07-18 13:20:59 +0000 @@ -2921,7 +2921,7 @@ extern void syms_of_search (void); extern void clear_regexp_cache (void); -/* Defined in minibuf.c */ +/* Defined in minibuf.c. */ extern Lisp_Object Qcompletion_ignore_case; extern Lisp_Object Vminibuffer_list; @@ -2930,25 +2930,25 @@ extern void init_minibuf_once (void); extern void syms_of_minibuf (void); -/* Defined in callint.c */ +/* Defined in callint.c. */ extern Lisp_Object Qminus, Qplus; extern Lisp_Object Qwhen; extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; extern void syms_of_callint (void); -/* Defined in casefiddle.c */ +/* Defined in casefiddle.c. */ extern Lisp_Object Qidentity; extern void syms_of_casefiddle (void); extern void keys_of_casefiddle (void); -/* Defined in casetab.c */ +/* Defined in casetab.c. */ extern void init_casetab_once (void); extern void syms_of_casetab (void); -/* Defined in keyboard.c */ +/* Defined in keyboard.c. */ extern Lisp_Object echo_message_buffer; extern struct kboard *echo_kboard; @@ -2956,6 +2956,7 @@ extern Lisp_Object Qdisabled, QCfilter; extern Lisp_Object Qup, Qdown, Qbottom; extern Lisp_Object Qtop; +extern Lisp_Object last_undo_boundary; extern int input_pending; extern Lisp_Object menu_bar_items (Lisp_Object); extern Lisp_Object tool_bar_items (Lisp_Object, int *); @@ -2976,13 +2977,13 @@ extern void syms_of_keyboard (void); extern void keys_of_keyboard (void); -/* Defined in indent.c */ +/* Defined in indent.c. */ extern ptrdiff_t current_column (void); extern void invalidate_current_column (void); extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT); extern void syms_of_indent (void); -/* Defined in frame.c */ +/* Defined in frame.c. */ extern Lisp_Object Qonly; extern Lisp_Object Qvisible; extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); @@ -2995,7 +2996,7 @@ extern void frames_discard_buffer (Lisp_Object); extern void syms_of_frame (void); -/* Defined in emacs.c */ +/* Defined in emacs.c. */ extern char **initial_argv; extern int initial_argc; #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) ------------------------------------------------------------ revno: 109138 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2012-07-18 10:38:37 +0000 message: gnus/{sieve-mode,sieve}.el: Close buffers by default diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-17 11:52:00 +0000 +++ lisp/gnus/ChangeLog 2012-07-18 10:38:37 +0000 @@ -1,3 +1,12 @@ +2012-07-18 Julien Danjou + + * sieve-mode.el (sieve-mode-map): Bind C-c C-c to + `sieve-upload-and-kill'. + + * sieve.el (sieve-bury-buffer): Remove function. + (sieve-manage-mode-map): Map "q" to `kill-buffer'. + (sieve-upload-and-kill): New function, mapped to C-c C-c. + 2012-07-17 Andreas Schwab * shr.el (shr-expand-url): Handle URL starting with `//'. === modified file 'lisp/gnus/sieve-mode.el' --- lisp/gnus/sieve-mode.el 2012-01-19 07:21:25 +0000 +++ lisp/gnus/sieve-mode.el 2012-07-18 10:38:37 +0000 @@ -173,7 +173,7 @@ (defvar sieve-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-l" 'sieve-upload) - (define-key map "\C-c\C-c" 'sieve-upload-and-bury) + (define-key map "\C-c\C-c" 'sieve-upload-and-kill) (define-key map "\C-c\C-m" 'sieve-manage) map) "Key map used in sieve mode.") === modified file 'lisp/gnus/sieve.el' --- lisp/gnus/sieve.el 2012-01-19 07:21:25 +0000 +++ lisp/gnus/sieve.el 2012-07-18 10:38:37 +0000 @@ -109,7 +109,7 @@ ;; various (define-key map "?" 'sieve-help) (define-key map "h" 'sieve-help) - (define-key map "q" 'sieve-bury-buffer) + (define-key map "q" 'kill-buffer) ;; activating (define-key map "m" 'sieve-activate) (define-key map "u" 'sieve-deactivate) @@ -250,29 +250,6 @@ (message "%s" (substitute-command-keys "`\\[sieve-edit-script]':edit `\\[sieve-activate]':activate `\\[sieve-deactivate]':deactivate `\\[sieve-remove]':remove")))) -(defun sieve-bury-buffer (buf &optional mainbuf) - "Hide the buffer BUF that was temporarily popped up. -BUF is assumed to be a temporary buffer used from the buffer MAINBUF." - (interactive (list (current-buffer))) - (save-current-buffer - (let ((win (if (eq buf (window-buffer (selected-window))) (selected-window) - (get-buffer-window buf t)))) - (when win - (if (window-dedicated-p win) - (condition-case () - (delete-window win) - (error (iconify-frame (window-frame win)))) - (if (and mainbuf (get-buffer-window mainbuf)) - (delete-window win))))) - (with-current-buffer buf - (bury-buffer (unless (and (eq buf (window-buffer (selected-window))) - (not (window-dedicated-p (selected-window)))) - buf))) - (when mainbuf - (let ((mainwin (or (get-buffer-window mainbuf) - (get-buffer-window mainbuf 'visible)))) - (when mainwin (select-window mainwin)))))) - ;; Create buffer: (defun sieve-setup-buffer (server port) @@ -389,6 +366,12 @@ (sieve-upload name) (bury-buffer)) +;;;###autoload +(defun sieve-upload-and-kill (&optional name) + (interactive) + (sieve-upload name) + (kill-buffer)) + (provide 'sieve) ;; sieve.el ends here ------------------------------------------------------------ revno: 109137 committer: Andreas Schwab branch nick: emacs timestamp: Wed 2012-07-18 12:12:43 +0200 message: * w32font.c (Qsymbol): Remove local definition. (syms_of_w32font): Don't DEFSYM it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 09:46:07 +0000 +++ src/ChangeLog 2012-07-18 10:12:43 +0000 @@ -1,3 +1,8 @@ +2012-07-18 Andreas Schwab + + * w32font.c (Qsymbol): Remove local definition. + (syms_of_w32font): Don't DEFSYM it. + 2012-07-18 Dmitry Antipov Fix sweep_vectors to handle large bool vectors correctly. === modified file 'src/w32font.c' --- src/w32font.c 2012-07-11 07:37:39 +0000 +++ src/w32font.c 2012-07-18 10:12:43 +0000 @@ -75,7 +75,7 @@ static Lisp_Object Qkannada, Qmalayalam, Qsinhala, Qthai, Qlao; static Lisp_Object Qtibetan, Qmyanmar, Qgeorgian, Qhangul, Qethiopic; static Lisp_Object Qcherokee, Qcanadian_aboriginal, Qogham, Qrunic; -static Lisp_Object Qkhmer, Qmongolian, Qsymbol, Qbraille, Qhan; +static Lisp_Object Qkhmer, Qmongolian, Qbraille, Qhan; static Lisp_Object Qideographic_description, Qcjk_misc, Qkana, Qbopomofo; static Lisp_Object Qkanbun, Qyi, Qbyzantine_musical_symbol; static Lisp_Object Qmusical_symbol, Qmathematical, Qcham, Qphonetic; @@ -2634,7 +2634,6 @@ DEFSYM (Qrunic, "runic"); DEFSYM (Qkhmer, "khmer"); DEFSYM (Qmongolian, "mongolian"); - DEFSYM (Qsymbol, "symbol"); DEFSYM (Qbraille, "braille"); DEFSYM (Qhan, "han"); DEFSYM (Qideographic_description, "ideographic-description"); ------------------------------------------------------------ revno: 109136 committer: Tassilo Horn branch nick: trunk timestamp: Wed 2012-07-18 12:02:54 +0200 message: * window.el (split-window-sensibly): Make WINDOW argument optional. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 09:27:23 +0000 +++ lisp/ChangeLog 2012-07-18 10:02:54 +0000 @@ -1,3 +1,8 @@ +2012-07-18 Tassilo Horn + + * window.el (split-window-sensibly): Make WINDOW argument + optional. + 2012-07-18 Chong Yidong * isearch.el (isearch-mode-map): Handle C-x 8 key translations, === modified file 'lisp/window.el' --- lisp/window.el 2012-07-06 06:22:56 +0000 +++ lisp/window.el 2012-07-18 10:02:54 +0000 @@ -4475,8 +4475,9 @@ (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) -(defun split-window-sensibly (window) +(defun split-window-sensibly (&optional window) "Split WINDOW in a way suitable for `display-buffer'. +WINDOW defaults to the currently selected window. If `split-height-threshold' specifies an integer, WINDOW is at least `split-height-threshold' lines tall and can be split vertically, split WINDOW into two windows one above the other and @@ -4506,23 +4507,24 @@ Have a look at the function `window-splittable-p' if you want to know how `split-window-sensibly' determines whether WINDOW can be split." - (or (and (window-splittable-p window) - ;; Split window vertically. - (with-selected-window window - (split-window-below))) - (and (window-splittable-p window t) - ;; Split window horizontally. - (with-selected-window window - (split-window-right))) - (and (eq window (frame-root-window (window-frame window))) - (not (window-minibuffer-p window)) - ;; If WINDOW is the only window on its frame and is not the - ;; minibuffer window, try to split it vertically disregarding - ;; the value of `split-height-threshold'. - (let ((split-height-threshold 0)) - (when (window-splittable-p window) - (with-selected-window window - (split-window-below))))))) + (let ((window (or window (selected-window)))) + (or (and (window-splittable-p window) + ;; Split window vertically. + (with-selected-window window + (split-window-below))) + (and (window-splittable-p window t) + ;; Split window horizontally. + (with-selected-window window + (split-window-right))) + (and (eq window (frame-root-window (window-frame window))) + (not (window-minibuffer-p window)) + ;; If WINDOW is the only window on its frame and is not the + ;; minibuffer window, try to split it vertically disregarding + ;; the value of `split-height-threshold'. + (let ((split-height-threshold 0)) + (when (window-splittable-p window) + (with-selected-window window + (split-window-below)))))))) (defun window--try-to-split-window (window) "Try to split WINDOW. ------------------------------------------------------------ revno: 109135 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-07-18 13:46:07 +0400 message: Fix sweep_vectors to handle large bool vectors correctly. * alloc.c (sweep_vectors): Account total_vector_bytes for bool vectors larger than VBLOCK_BYTES_MAX. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 08:11:08 +0000 +++ src/ChangeLog 2012-07-18 09:46:07 +0000 @@ -1,3 +1,9 @@ +2012-07-18 Dmitry Antipov + + Fix sweep_vectors to handle large bool vectors correctly. + * alloc.c (sweep_vectors): Account total_vector_bytes for + bool vectors larger than VBLOCK_BYTES_MAX. + 2012-07-18 Chong Yidong * frame.c (x_set_frame_parameters): Revert bogus change introduced === modified file 'src/alloc.c' --- src/alloc.c 2012-07-18 05:44:36 +0000 +++ src/alloc.c 2012-07-18 09:46:07 +0000 @@ -3152,11 +3152,27 @@ { VECTOR_UNMARK (vector); total_vectors++; - /* All pseudovectors are small enough to be allocated from - vector blocks. This code should be redesigned if some - pseudovector type grows beyond VBLOCK_BYTES_MAX. */ - eassert (!(vector->header.size & PSEUDOVECTOR_FLAG)); - total_vector_bytes += header_size + vector->header.size * word_size; + if (vector->header.size & PSEUDOVECTOR_FLAG) + { + if (((vector->header.size & PVEC_TYPE_MASK) + >> PSEUDOVECTOR_SIZE_BITS) == PVEC_BOOL_VECTOR) + { + struct Lisp_Bool_Vector *b + = (struct Lisp_Bool_Vector *) vector; + total_vector_bytes += header_size + sizeof (b->size) + + (b->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR; + } + else + /* All other pseudovectors are small enough to be + allocated from vector blocks. This code should + be redesigned if some pseudovector type grows + beyond VBLOCK_BYTES_MAX. */ + abort (); + } + else + total_vector_bytes + += header_size + vector->header.size * word_size; vprev = &vector->header.next.vector; } else ------------------------------------------------------------ revno: 109134 fixes bug(s): http://debbugs.gnu.org/11439 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 17:27:23 +0800 message: Fix usage of C-x 8 key translations in Isearch. * lisp/isearch.el (isearch-mode-map): Handle C-x 8 key translations, and make C-x 8 RET exit isearch. * lisp/international/iso-transl.el: Move isearch-mode-map key definitions to isearch.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 07:20:04 +0000 +++ lisp/ChangeLog 2012-07-18 09:27:23 +0000 @@ -1,3 +1,11 @@ +2012-07-18 Chong Yidong + + * isearch.el (isearch-mode-map): Handle C-x 8 key translations, + and make C-x 8 RET exit isearch (Bug#11439). + + * international/iso-transl.el: Move isearch-mode-map key + definitions to isearch.el. + 2012-07-18 Stefan Monnier * emacs-lisp/eieio.el: Adapt further to gv.el (bug#11970). === modified file 'lisp/dired.el' --- lisp/dired.el 2012-07-13 07:06:09 +0000 +++ lisp/dired.el 2012-07-18 09:27:23 +0000 @@ -3736,7 +3736,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "91d39bd8f7e9ce93dc752fe74bea78c2") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "9499f79f5853da0aa93d26465c7bf3a1") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ @@ -3829,15 +3829,24 @@ (autoload 'dired-do-async-shell-command "dired-aux" "\ Run a shell command COMMAND on the marked files asynchronously. -Like `dired-do-shell-command' but if COMMAND doesn't end in ampersand, -adds `* &' surrounded by whitespace and executes the command asynchronously. +Like `dired-do-shell-command', but adds `&' at the end of COMMAND +to execute it asynchronously. + +When operating on multiple files, asynchronous commands +are executed in the background on each file in parallel. +In shell syntax this means separating the individual commands +with `&'. However, when COMMAND ends in `;' or `;&' then commands +are executed in the background on each file sequentially waiting +for each command to terminate before running the next command. +In shell syntax this means separating the individual commands with `;'. + The output appears in the buffer `*Async Shell Command*'. \(fn COMMAND &optional ARG FILE-LIST)" t nil) (autoload 'dired-do-shell-command "dired-aux" "\ Run a shell command COMMAND on the marked files. -If no files are marked or a specific numeric prefix arg is given, +If no files are marked or a numeric prefix arg is given, the next ARG files are used. Just \\[universal-argument] means the current file. The prompt mentions the file(s) or the marker, as appropriate. @@ -3859,7 +3868,17 @@ it, write `*\"\"' in place of just `*'. This is equivalent to just `*' in the shell, but avoids Dired's special handling. -If COMMAND produces output, it goes to a separate buffer. +If COMMAND ends in `&', `;', or `;&', it is executed in the +background asynchronously, and the output appears in the buffer +`*Async Shell Command*'. When operating on multiple files and COMMAND +ends in `&', the shell command is executed on each file in parallel. +However, when COMMAND ends in `;' or `;&' then commands are executed +in the background on each file sequentially waiting for each command +to terminate before running the next command. You can also use +`dired-do-async-shell-command' that automatically adds `&'. + +Otherwise, COMMAND is executed synchronously, and the output +appears in the buffer `*Shell Command Output*'. This feature does not try to redisplay Dired buffers afterward, as there's no telling what files COMMAND may have changed. === modified file 'lisp/international/iso-transl.el' --- lisp/international/iso-transl.el 2012-01-19 07:21:25 +0000 +++ lisp/international/iso-transl.el 2012-07-18 09:27:23 +0000 @@ -38,7 +38,6 @@ ;;; Code: ;;; Provide some binding for startup: -;;;###autoload (or key-translation-map (setq key-translation-map (make-sparse-keymap))) ;;;###autoload (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map) ;;;###autoload (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 'keymap) @@ -283,11 +282,6 @@ ;; with a language-specific mapping by using `M-x iso-transl-set-language'. (iso-transl-define-keys iso-transl-char-map) -(define-key isearch-mode-map "\C-x" nil) -(define-key isearch-mode-map [?\C-x t] 'isearch-other-control-char) -(define-key isearch-mode-map "\C-x8" nil) - - (provide 'iso-transl) ;;; iso-transl.el ends here === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-06-17 08:53:31 +0000 +++ lisp/isearch.el 2012-07-18 09:27:23 +0000 @@ -511,6 +511,13 @@ (define-key map "\M-so" 'isearch-occur) (define-key map "\M-shr" 'isearch-highlight-regexp) + ;; The key translations defined in the C-x 8 prefix should insert + ;; characters into the search string. See iso-transl.el. + (define-key map "\C-x" nil) + (define-key map [?\C-x t] 'isearch-other-control-char) + (define-key map "\C-x8" nil) + (define-key map "\C-x8\r" 'isearch-other-control-char) + map) "Keymap for `isearch-mode'.") ------------------------------------------------------------ revno: 109133 fixes bug(s): http://debbugs.gnu.org/11738 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-07-18 16:11:08 +0800 message: Revert bogus change in revno 108370. * src/frame.c (x_set_frame_parameters): Revert bogus change introduced in 2012-05-25 commit by Paul Eggert. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-18 05:44:36 +0000 +++ src/ChangeLog 2012-07-18 08:11:08 +0000 @@ -1,3 +1,8 @@ +2012-07-18 Chong Yidong + + * frame.c (x_set_frame_parameters): Revert bogus change introduced + in 2012-05-25 commit by Paul Eggert (Bug#11738). + 2012-07-18 Dmitry Antipov Return more descriptive data from Fgarbage_collect. === modified file 'src/frame.c' --- src/frame.c 2012-07-11 04:31:53 +0000 +++ src/frame.c 2012-07-18 08:11:08 +0000 @@ -2868,7 +2868,7 @@ } /* Don't die if just one of these was set. */ - if (! TYPE_RANGED_INTEGERP (int, left)) + if (EQ (left, Qunbound)) { left_no_change = 1; if (f->left_pos < 0) @@ -2876,7 +2876,7 @@ else XSETINT (left, f->left_pos); } - if (! TYPE_RANGED_INTEGERP (int, top)) + if (EQ (top, Qunbound)) { top_no_change = 1; if (f->top_pos < 0) ------------------------------------------------------------ revno: 109132 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11970 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-07-18 03:20:04 -0400 message: * lisp/emacs-lisp/eieio.el: Adapt further to gv.el. (eieio-defclass): Use gv-define-setter when possible. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 05:44:36 +0000 +++ lisp/ChangeLog 2012-07-18 07:20:04 +0000 @@ -1,3 +1,8 @@ +2012-07-18 Stefan Monnier + + * emacs-lisp/eieio.el: Adapt further to gv.el (bug#11970). + (eieio-defclass): Use gv-define-setter when possible. + 2012-07-18 Dmitry Antipov Reflect recent changes in Fgarbage_collect. === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2012-07-13 07:06:09 +0000 +++ lisp/emacs-lisp/eieio.el 2012-07-18 07:20:04 +0000 @@ -44,8 +44,7 @@ ;;; Code: -(eval-when-compile - (require 'cl)) +(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib! (defvar eieio-version "1.3" "Current version of EIEIO.") @@ -431,10 +430,10 @@ (run-hooks 'eieio-hook) (setq eieio-hook nil) - (if (not (symbolp cname)) (signal 'wrong-type-argument '(symbolp cname))) - (if (not (listp superclasses)) (signal 'wrong-type-argument '(listp superclasses))) + (if (not (listp superclasses)) + (signal 'wrong-type-argument '(listp superclasses))) - (let* ((pname (if superclasses superclasses nil)) + (let* ((pname superclasses) (newc (make-vector class-num-slots nil)) (oldc (when (class-p cname) (class-v cname))) (groups nil) ;; list of groups id'd from slots @@ -553,8 +552,8 @@ (put cname 'cl-deftype-handler (list 'lambda () `(list 'satisfies (quote ,csym))))) - ;; before adding new slots, let's add all the methods and classes - ;; in from the parent class + ;; Before adding new slots, let's add all the methods and classes + ;; in from the parent class. (eieio-copy-parents-into-subclass newc superclasses) ;; Store the new class vector definition into the symbol. We need to @@ -652,9 +651,9 @@ ;; We need to id the group, and store them in a group list attribute. (mapc (lambda (cg) (add-to-list 'groups cg)) customg) - ;; anyone can have an accessor function. This creates a function + ;; Anyone can have an accessor function. This creates a function ;; of the specified name, and also performs a `defsetf' if applicable - ;; so that users can `setf' the space returned by this function + ;; so that users can `setf' the space returned by this function. (if acces (progn (eieio--defmethod @@ -668,18 +667,26 @@ ;; Else - Some error? nil? nil))) - ;; Provide a setf method. It would be cleaner to use - ;; defsetf, but that would require CL at runtime. - (put acces 'setf-method - `(lambda (widget) - (let* ((--widget-sym-- (make-symbol "--widget--")) - (--store-sym-- (make-symbol "--store--"))) - (list - (list --widget-sym--) - (list widget) - (list --store-sym--) - (list 'eieio-oset --widget-sym-- '',name --store-sym--) - (list 'getfoo --widget-sym--))))))) + (if (fboundp 'gv-define-setter) + ;; FIXME: We should move more of eieio-defclass into the + ;; defclass macro so we don't have to use `eval' and require + ;; `gv' at run-time. + (eval `(gv-define-setter ,acces (eieio--store eieio--object) + (list 'eieio-oset eieio--object '',name + eieio--store))) + ;; Provide a setf method. It would be cleaner to use + ;; defsetf, but that would require CL at runtime. + (put acces 'setf-method + `(lambda (widget) + (let* ((--widget-sym-- (make-symbol "--widget--")) + (--store-sym-- (make-symbol "--store--"))) + (list + (list --widget-sym--) + (list widget) + (list --store-sym--) + (list 'eieio-oset --widget-sym-- '',name + --store-sym--) + (list 'getfoo --widget-sym--)))))))) ;; If a writer is defined, then create a generic method of that ;; name whose purpose is to set the value of the slot. @@ -702,7 +709,8 @@ ) (setq slots (cdr slots))) - ;; Now that everything has been loaded up, all our lists are backwards! Fix that up now. + ;; Now that everything has been loaded up, all our lists are backwards! + ;; Fix that up now. (aset newc class-public-a (nreverse (aref newc class-public-a))) (aset newc class-public-d (nreverse (aref newc class-public-d))) (aset newc class-public-doc (nreverse (aref newc class-public-doc))) @@ -2544,11 +2552,14 @@ ;; (defsetf eieio-oref eieio-oset) -;; FIXME: Not needed for Emacs>=24.2 since setf follows function aliases. + +(if (eval-when-compile (fboundp 'gv-define-expander)) + ;; Not needed for Emacs>=24.2 since gv.el's setf expands macros and + ;; follows aliases. + nil (defsetf slot-value eieio-oset) ;; The below setf method was written by Arnd Kohrs -;; FIXME: Not needed for Emacs>=24.2 since setf expands macros. (define-setf-method oref (obj slot) (with-no-warnings (require 'cl) @@ -2560,7 +2571,7 @@ (list store-temp) (list 'set-slot-value obj-temp slot-temp store-temp) - (list 'slot-value obj-temp slot-temp))))) + (list 'slot-value obj-temp slot-temp)))))) ;;; ------------------------------------------------------------ revno: 109131 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-07-18 09:44:36 +0400 message: Return more descriptive data from Fgarbage_collect. Suggested by Stefan Monnier in http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html. * src/alloc.c (bounded_number): New function. (total_buffers, total_vectors): New variable. (total_string_size): Rename to total_string_bytes, adjust users. (total_vector_size): Rename to total_vector_bytes, adjust users. (sweep_vectors): Account total_vectors and total_vector_bytes. (Fgarbage_collect): New return value. Adjust documentation. (gc_sweep): Account total_buffers. (Fmemory_free, Fmemory_use_counts): Use bounded_number. (VECTOR_SIZE): Remove. * src/data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global. (Qinterval, Qmisc): New symbols. (syms_of_data): Initialize them. * src/lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat) (Qcons, Qbuffer): New declarations. * lisp/emacs-lisp/chart.el (chart-emacs-storage): Change to reflect new format of data returned by Fgarbage_collect. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-17 20:27:49 +0000 +++ lisp/ChangeLog 2012-07-18 05:44:36 +0000 @@ -1,3 +1,9 @@ +2012-07-18 Dmitry Antipov + + Reflect recent changes in Fgarbage_collect. + * emacs-lisp/chart.el (chart-emacs-storage): Change to + reflect new format of data returned by Fgarbage_collect. + 2012-07-17 Fabián Ezequiel Gallina New utility functions + python-info-ppss-context fix (Bug#11910). === modified file 'lisp/emacs-lisp/chart.el' --- lisp/emacs-lisp/chart.el 2012-05-13 03:05:06 +0000 +++ lisp/emacs-lisp/chart.el 2012-07-18 05:44:36 +0000 @@ -676,23 +676,25 @@ "Chart the current storage requirements of Emacs." (interactive) (let* ((data (garbage-collect)) - (names '("strings/2" "vectors" - "conses" "free cons" - "syms" "free syms" - "markers" "free mark" - ;; "floats" "free flt" - )) - (nums (list (/ (nth 3 data) 2) - (nth 4 data) - (car (car data)) ; conses - (cdr (car data)) - (car (nth 1 data)) ; syms - (cdr (nth 1 data)) - (car (nth 2 data)) ; markers - (cdr (nth 2 data)) - ;(car (nth 5 data)) ; floats are Emacs only - ;(cdr (nth 5 data)) - ))) + (cons-info (nth 0 data)) + (symbol-info (nth 1 data)) + (misc-info (nth 2 data)) + (string-info (nth 3 data)) + (vector-info (nth 4 data)) + (float-info (nth 5 data)) + (interval-info (nth 6 data)) + (buffer-info (nth 7 data)) + (names '("conses" "symbols" "miscs" "strings" + "vectors" "floats" "intervals" "buffers")) + (nums (list (* (nth 1 cons-info) (nth 2 cons-info)) + (* (nth 1 symbol-info) (nth 2 symbol-info)) + (* (nth 1 misc-info) (nth 2 misc-info)) + (+ (* (nth 1 string-info) (nth 2 string-info)) + (nth 3 string-info)) + (nth 3 vector-info) + (* (nth 1 float-info) (nth 2 float-info)) + (* (nth 1 interval-info) (nth 2 interval-info)) + (* (nth 1 buffer-info) (nth 2 buffer-info))))) ;; Let's create the chart! (chart-bar-quickie 'vertical "Emacs Runtime Storage Usage" names "Storage Items" === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-17 16:24:57 +0000 +++ src/ChangeLog 2012-07-18 05:44:36 +0000 @@ -1,3 +1,23 @@ +2012-07-18 Dmitry Antipov + + Return more descriptive data from Fgarbage_collect. + Suggested by Stefan Monnier in + http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html. + * alloc.c (bounded_number): New function. + (total_buffers, total_vectors): New variable. + (total_string_size): Rename to total_string_bytes, adjust users. + (total_vector_size): Rename to total_vector_bytes, adjust users. + (sweep_vectors): Account total_vectors and total_vector_bytes. + (Fgarbage_collect): New return value. Adjust documentation. + (gc_sweep): Account total_buffers. + (Fmemory_free, Fmemory_use_counts): Use bounded_number. + (VECTOR_SIZE): Remove. + * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global. + (Qinterval, Qmisc): New symbols. + (syms_of_data): Initialize them. + * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat) + (Qcons, Qbuffer): New declarations. + 2012-07-17 Paul Eggert * alloc.c (Fmemory_free): Account for memory-free's own storage. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-17 16:24:57 +0000 +++ src/alloc.c 2012-07-18 05:44:36 +0000 @@ -189,9 +189,9 @@ /* Number of live and free conses etc. */ -static EMACS_INT total_conses, total_markers, total_symbols, total_vector_size; +static EMACS_INT total_conses, total_markers, total_symbols, total_buffers; static EMACS_INT total_free_conses, total_free_markers, total_free_symbols; -static EMACS_INT total_free_floats, total_floats, total_free_vector_bytes; +static EMACS_INT total_free_floats, total_floats; /* Points to memory space allocated as "spare", to be freed if we run out of memory. We keep one large block, four cons-blocks, and @@ -1708,7 +1708,7 @@ /* Number of bytes used by live strings. */ -static EMACS_INT total_string_size; +static EMACS_INT total_string_bytes; /* Given a pointer to a Lisp_String S which is on the free-list string_free_list, return a pointer to its successor in the @@ -2081,7 +2081,7 @@ string_free_list = NULL; total_strings = total_free_strings = 0; - total_string_size = 0; + total_string_bytes = 0; /* Scan strings_blocks, free Lisp_Strings that aren't marked. */ for (b = string_blocks; b; b = next) @@ -2107,7 +2107,7 @@ UNMARK_BALANCE_INTERVALS (s->intervals); ++total_strings; - total_string_size += STRING_BYTES (s); + total_string_bytes += STRING_BYTES (s); } else { @@ -2957,6 +2957,14 @@ Lisp_Object zero_vector; +/* Number of live vectors. */ + +static EMACS_INT total_vectors; + +/* Number of bytes used by live and free vectors. */ + +static EMACS_INT total_vector_bytes, total_free_vector_bytes; + /* Get a new vector block. */ static struct vector_block * @@ -3047,12 +3055,6 @@ return vector; } -/* Return how many Lisp_Objects can be stored in V. */ - -#define VECTOR_SIZE(v) ((v)->header.size & PSEUDOVECTOR_FLAG ? \ - (PSEUDOVECTOR_SIZE_MASK & (v)->header.size) : \ - (v)->header.size) - /* Nonzero if VECTOR pointer is valid pointer inside BLOCK. */ #define VECTOR_IN_BLOCK(vector, block) \ @@ -3077,7 +3079,7 @@ struct vector_block *block = vector_blocks, **bprev = &vector_blocks; struct Lisp_Vector *vector, *next, **vprev = &large_vectors; - total_free_vector_bytes = total_vector_size = 0; + total_vectors = total_vector_bytes = total_free_vector_bytes = 0; memset (vector_free_lists, 0, sizeof (vector_free_lists)); /* Looking through vector blocks. */ @@ -3092,7 +3094,8 @@ if (VECTOR_MARKED_P (vector)) { VECTOR_UNMARK (vector); - total_vector_size += VECTOR_SIZE (vector); + total_vectors++; + total_vector_bytes += vector->header.next.nbytes; next = ADVANCE (vector, vector->header.next.nbytes); } else @@ -3148,7 +3151,12 @@ if (VECTOR_MARKED_P (vector)) { VECTOR_UNMARK (vector); - total_vector_size += VECTOR_SIZE (vector); + total_vectors++; + /* All pseudovectors are small enough to be allocated from + vector blocks. This code should be redesigned if some + pseudovector type grows beyond VBLOCK_BYTES_MAX. */ + eassert (!(vector->header.size & PSEUDOVECTOR_FLAG)); + total_vector_bytes += header_size + vector->header.size * word_size; vprev = &vector->header.next.vector; } else @@ -5339,16 +5347,28 @@ return count; } +/* Used to avoid possible overflows when + converting from C to Lisp integers. */ + +static inline Lisp_Object +bounded_number (EMACS_INT number) +{ + return make_number (min (MOST_POSITIVE_FIXNUM, number)); +} DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", doc: /* Reclaim storage for Lisp objects no longer needed. Garbage collection happens automatically if you cons more than `gc-cons-threshold' bytes of Lisp data since previous garbage collection. `garbage-collect' normally returns a list with info on amount of space in use: - ((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS) - (USED-MISCS . FREE-MISCS) USED-STRING-CHARS USED-VECTOR-SLOTS - (USED-FLOATS . FREE-FLOATS) (USED-INTERVALS . FREE-INTERVALS) - (USED-STRINGS . FREE-STRINGS)) + ((CONS INTERNAL-SIZE USED-CONSES FREE-CONSES) + (SYMBOL INTERNAL-SIZE USED-SYMBOLS FREE-SYMBOLS) + (MISC INTERNAL-SIZE USED-MISCS FREE-MISCS) + (STRING INTERNAL-SIZE USED-STRINGS USED-STRING-BYTES FREE-STRING) + (VECTOR INTERNAL-SIZE USED-VECTORS USED-VECTOR-BYTES FREE-VECTOR-BYTES) + (FLOAT INTERNAL-SIZE USED-FLOATS FREE-FLOATS) + (INTERVAL INTERNAL-SIZE USED-INTERVALS FREE-INTERVALS) + (BUFFER INTERNAL-SIZE USED-BUFFERS)) However, if there was overflow in pure space, `garbage-collect' returns nil, because real GC can't be done. See Info node `(elisp)Garbage Collection'. */) @@ -5595,8 +5615,8 @@ tot += total_conses * sizeof (struct Lisp_Cons); tot += total_symbols * sizeof (struct Lisp_Symbol); tot += total_markers * sizeof (union Lisp_Misc); - tot += total_string_size; - tot += total_vector_size * sizeof (Lisp_Object); + tot += total_string_bytes; + tot += total_vector_bytes; tot += total_floats * sizeof (struct Lisp_Float); tot += total_intervals * sizeof (struct interval); tot += total_strings * sizeof (struct Lisp_String); @@ -5621,20 +5641,38 @@ unbind_to (count, Qnil); - total[0] = Fcons (make_number (total_conses), - make_number (total_free_conses)); - total[1] = Fcons (make_number (total_symbols), - make_number (total_free_symbols)); - total[2] = Fcons (make_number (total_markers), - make_number (total_free_markers)); - total[3] = make_number (total_string_size); - total[4] = make_number (total_vector_size); - total[5] = Fcons (make_number (total_floats), - make_number (total_free_floats)); - total[6] = Fcons (make_number (total_intervals), - make_number (total_free_intervals)); - total[7] = Fcons (make_number (total_strings), - make_number (total_free_strings)); + total[0] = list4 (Qcons, make_number (sizeof (struct Lisp_Cons)), + bounded_number (total_conses), + bounded_number (total_free_conses)); + + total[1] = list4 (Qsymbol, make_number (sizeof (struct Lisp_Symbol)), + bounded_number (total_symbols), + bounded_number (total_free_symbols)); + + total[2] = list4 (Qmisc, make_number (sizeof (union Lisp_Misc)), + bounded_number (total_markers), + bounded_number (total_free_markers)); + + total[3] = list5 (Qstring, make_number (sizeof (struct Lisp_String)), + bounded_number (total_strings), + bounded_number (total_string_bytes), + bounded_number (total_free_strings)); + + total[4] = list5 (Qvector, make_number (sizeof (struct Lisp_Vector)), + bounded_number (total_vectors), + bounded_number (total_vector_bytes), + bounded_number (total_free_vector_bytes)); + + total[5] = list4 (Qfloat, make_number (sizeof (struct Lisp_Float)), + bounded_number (total_floats), + bounded_number (total_free_floats)); + + total[6] = list4 (Qinterval, make_number (sizeof (struct interval)), + bounded_number (total_intervals), + bounded_number (total_free_intervals)); + + total[7] = list3 (Qbuffer, make_number (sizeof (struct buffer)), + bounded_number (total_buffers)); #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { @@ -6535,6 +6573,7 @@ { register struct buffer *buffer = all_buffers, *prev = 0, *next; + total_buffers = 0; while (buffer) if (!VECTOR_MARKED_P (buffer)) { @@ -6550,6 +6589,7 @@ { VECTOR_UNMARK (buffer); UNMARK_BALANCE_INTERVALS (BUF_INTERVALS (buffer)); + total_buffers++; prev = buffer, buffer = buffer->header.next.buffer; } } @@ -6592,22 +6632,17 @@ Lisp_Object val = Fmake_list (make_number (2), make_number (0)); XSETCAR (val, - (make_number - (min (MOST_POSITIVE_FIXNUM, - ((total_free_conses * sizeof (struct Lisp_Cons) - + total_free_markers * sizeof (union Lisp_Misc) - + total_free_symbols * sizeof (struct Lisp_Symbol) - + total_free_floats * sizeof (struct Lisp_Float) - + total_free_intervals * sizeof (struct interval) - + total_free_strings * sizeof (struct Lisp_String) - + total_free_vector_bytes - + 1023) - >> 10))))); - + bounded_number + ((total_free_conses * sizeof (struct Lisp_Cons) + + total_free_markers * sizeof (union Lisp_Misc) + + total_free_symbols * sizeof (struct Lisp_Symbol) + + total_free_floats * sizeof (struct Lisp_Float) + + total_free_intervals * sizeof (struct interval) + + total_free_strings * sizeof (struct Lisp_String) + + total_free_vector_bytes + + 1023) >> 10)); #ifdef DOUG_LEA_MALLOC - XSETCAR (XCDR (val), - make_number (min (MOST_POSITIVE_FIXNUM, - (mallinfo ().fordblks + 1023) >> 10))); + XSETCAR (XCDR (val), bounded_number ((mallinfo ().fordblks + 1023) >> 10)); #endif return val; } @@ -6629,14 +6664,14 @@ { Lisp_Object consed[8]; - consed[0] = make_number (min (MOST_POSITIVE_FIXNUM, cons_cells_consed)); - consed[1] = make_number (min (MOST_POSITIVE_FIXNUM, floats_consed)); - consed[2] = make_number (min (MOST_POSITIVE_FIXNUM, vector_cells_consed)); - consed[3] = make_number (min (MOST_POSITIVE_FIXNUM, symbols_consed)); - consed[4] = make_number (min (MOST_POSITIVE_FIXNUM, string_chars_consed)); - consed[5] = make_number (min (MOST_POSITIVE_FIXNUM, misc_objects_consed)); - consed[6] = make_number (min (MOST_POSITIVE_FIXNUM, intervals_consed)); - consed[7] = make_number (min (MOST_POSITIVE_FIXNUM, strings_consed)); + consed[0] = bounded_number (cons_cells_consed); + consed[1] = bounded_number (floats_consed); + consed[2] = bounded_number (vector_cells_consed); + consed[3] = bounded_number (symbols_consed); + consed[4] = bounded_number (string_chars_consed); + consed[5] = bounded_number (misc_objects_consed); + consed[6] = bounded_number (intervals_consed); + consed[7] = bounded_number (strings_consed); return Flist (8, consed); } === modified file 'src/data.c' --- src/data.c 2012-07-10 08:43:46 +0000 +++ src/data.c 2012-07-18 05:44:36 +0000 @@ -83,12 +83,12 @@ Lisp_Object Qfloatp; Lisp_Object Qnumberp, Qnumber_or_marker_p; -Lisp_Object Qinteger; -static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay; +Lisp_Object Qinteger, Qinterval, Qfloat, Qvector; +Lisp_Object Qsymbol, Qstring, Qcons, Qmisc; Lisp_Object Qwindow; -static Lisp_Object Qfloat, Qwindow_configuration; -static Lisp_Object Qprocess; -static Lisp_Object Qcompiled_function, Qframe, Qvector; +static Lisp_Object Qoverlay, Qwindow_configuration; +static Lisp_Object Qprocess, Qmarker; +static Lisp_Object Qcompiled_function, Qframe; Lisp_Object Qbuffer; static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; static Lisp_Object Qsubrp, Qmany, Qunevalled; @@ -3083,7 +3083,6 @@ DEFSYM (Qwindow_configuration, "window-configuration"); DEFSYM (Qprocess, "process"); DEFSYM (Qwindow, "window"); - /* DEFSYM (Qsubr, "subr"); */ DEFSYM (Qcompiled_function, "compiled-function"); DEFSYM (Qbuffer, "buffer"); DEFSYM (Qframe, "frame"); @@ -3091,6 +3090,9 @@ DEFSYM (Qchar_table, "char-table"); DEFSYM (Qbool_vector, "bool-vector"); DEFSYM (Qhash_table, "hash-table"); + /* Used by Fgarbage_collect. */ + DEFSYM (Qinterval, "interval"); + DEFSYM (Qmisc, "misc"); DEFSYM (Qdefun, "defun"); === modified file 'src/lisp.h' --- src/lisp.h 2012-07-16 04:47:31 +0000 +++ src/lisp.h 2012-07-18 05:44:36 +0000 @@ -2332,7 +2332,8 @@ extern Lisp_Object Qfloatp; extern Lisp_Object Qnumberp, Qnumber_or_marker_p; -extern Lisp_Object Qinteger; +extern Lisp_Object Qinteger, Qinterval, Qsymbol, Qstring; +extern Lisp_Object Qmisc, Qvector, Qfloat, Qcons, Qbuffer; extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;