Now on revision 109597. ------------------------------------------------------------ revno: 109597 fixes bug: http://debbugs.gnu.org/12168 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-14 14:52:59 +0800 message: Fix highlight-regexp's use of Font Lock mode. * hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock. (hi-lock-set-pattern): When deciding whether to use font lock or overlays, look at font-lock-mode instead of font-lock-fontified. (hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer) (hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 04:37:00 +0000 +++ lisp/ChangeLog 2012-08-14 06:52:59 +0000 @@ -1,3 +1,12 @@ +2012-08-14 Chong Yidong + + * hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock. + (hi-lock-set-pattern): When deciding whether to use font lock or + overlays, look at font-lock-mode instead of font-lock-fontified + (Bug#12168). + (hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer) + (hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix. + 2012-08-14 Daiki Ueno * subr.el (internal--after-with-selected-window): Fix typo === modified file 'lisp/hi-lock.el' --- lisp/hi-lock.el 2012-05-21 04:33:54 +0000 +++ lisp/hi-lock.el 2012-08-14 06:52:59 +0000 @@ -287,12 +287,19 @@ positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Issuing one the highlighting commands listed below will -automatically enable Hi Lock mode. To enable Hi Lock mode in all -buffers, use `global-hi-lock-mode' or add (global-hi-lock-mode 1) -to your init file. When Hi Lock mode is enabled, a \"Regexp -Highlighting\" submenu is added to the \"Edit\" menu. The -commands in the submenu, which can be called interactively, are: +Hi Lock mode is automatically enabled when you invoke any of the +highlighting commands listed below, such as \\[highlight-regexp]. +To enable Hi Lock mode in all buffers, use `global-hi-lock-mode' +or add (global-hi-lock-mode 1) to your init file. + +In buffers where Font Lock mode is enabled, patterns are +highlighted using font lock. In buffers where Font Lock mode is +disabled, patterns are applied using overlays; in this case, the +highlighting will not be updated as you type. + +When Hi Lock mode is enabled, a \"Regexp Highlighting\" submenu +is added to the \"Edit\" menu. The commands in the submenu, +which can be called interactively, are: \\[highlight-regexp] REGEXP FACE Highlight matches of pattern REGEXP in current buffer with FACE. @@ -326,12 +333,12 @@ rejected, the beginning of the buffer is searched for lines of the form: Hi-lock: FOO -where FOO is a list of patterns. These are added to the font lock -keywords already present. The patterns must start before position -\(number of characters into buffer) `hi-lock-file-patterns-range'. -Patterns will be read until - Hi-lock: end -is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'." + +where FOO is a list of patterns. The patterns must start before +position \(number of characters into buffer) +`hi-lock-file-patterns-range'. Patterns will be read until +Hi-lock: end is found. A mode is excluded if it's in the list +`hi-lock-exclude-modes'." :group 'hi-lock :lighter (:eval (if (or hi-lock-interactive-patterns hi-lock-file-patterns) @@ -358,7 +365,6 @@ (if hi-lock-mode ;; Turned on. (progn - (unless font-lock-mode (font-lock-mode 1)) (define-key-after menu-bar-edit-menu [hi-lock] (cons "Regexp Highlighting" hi-lock-menu)) (hi-lock-find-patterns) @@ -392,12 +398,13 @@ ;;;###autoload (defun hi-lock-line-face-buffer (regexp &optional face) "Set face of all lines containing a match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.)" +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -416,12 +423,13 @@ ;;;###autoload (defun hi-lock-face-buffer (regexp &optional face) "Set face of each match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.)" +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -436,9 +444,13 @@ ;;;###autoload (defun hi-lock-face-phrase-buffer (regexp &optional face) "Set face of each match of phrase REGEXP to FACE. - Whitespace in REGEXP converted to arbitrary whitespace and initial -lower-case letters made case insensitive." +lower-case letters made case insensitive. + +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -456,12 +468,8 @@ ;;;###autoload (defun hi-lock-unface-buffer (regexp) "Remove highlighting of each match to REGEXP set by hi-lock. - -Interactively, prompt for REGEXP. Buffer-local history of inserted -regexp's maintained. Will accept only regexps inserted by hi-lock -interactive functions. \(See `hi-lock-interactive-patterns'.\) -\\Use \\[minibuffer-complete] to complete a partially typed regexp. -\(See info node `Minibuffer History'.\)" +Interactively, prompt for REGEXP, accepting only regexps +previously inserted by hi-lock interactive functions." (interactive (if (and (display-popup-menus-p) (listp last-nonmenu-event) @@ -573,7 +581,7 @@ (let ((pattern (list regexp (list 0 (list 'quote face) t)))) (unless (member pattern hi-lock-interactive-patterns) (push pattern hi-lock-interactive-patterns) - (if font-lock-fontified + (if font-lock-mode (progn (font-lock-add-keywords nil (list pattern) t) (font-lock-fontify-buffer)) ------------------------------------------------------------ revno: 109596 fixes bug: http://debbugs.gnu.org/11802 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-14 13:34:20 +0800 message: * gnus-art.el (article-display-face): Handle failure in gnus-create-image. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-08-10 21:20:24 +0000 +++ lisp/gnus/ChangeLog 2012-08-14 05:34:20 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Chong Yidong + + * gnus-art.el (article-display-face): Handle failure in + gnus-create-image (Bug#11802). + 2012-08-10 Stefan Monnier * gnus-agent.el (gnus-agent-cat-defaccessor, gnus-agent-cat-groups): === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2012-07-25 22:10:37 +0000 +++ lisp/gnus/gnus-art.el 2012-08-14 05:34:20 +0000 @@ -2437,9 +2437,10 @@ (apply 'gnus-create-image png 'png t (cdr (assq 'png gnus-face-properties-alist)))) (goto-char from) - (gnus-add-wash-type 'face) - (gnus-add-image 'face image) - (gnus-put-image image nil 'face)))))))))) + (when image + (gnus-add-wash-type 'face) + (gnus-add-image 'face image) + (gnus-put-image image nil 'face))))))))))) (defun article-display-x-face (&optional force) "Look for an X-Face header and display it if present." ------------------------------------------------------------ revno: 109595 fixes bug: http://debbugs.gnu.org/11773 author: Gergely Risko committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-14 13:09:35 +0800 message: Fix for undo recording in decode_coding. * coding.c (decode_coding): Record buffer modification before disabling undo_list. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 04:49:18 +0000 +++ src/ChangeLog 2012-08-14 05:09:35 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Gergely Risko + + * coding.c (decode_coding): Record buffer modification before + disabling undo_list (Bug#11773). + 2012-08-14 Dmitry Antipov Revert and cleanup some recent overlay changes. === modified file 'src/coding.c' --- src/coding.c 2012-08-13 03:39:07 +0000 +++ src/coding.c 2012-08-14 05:09:35 +0000 @@ -7102,6 +7102,15 @@ set_buffer_internal (XBUFFER (coding->dst_object)); if (GPT != PT) move_gap_both (PT, PT_BYTE); + + /* We must disable undo_list in order to record the whole insert + transaction via record_insert at the end. But doing so also + disables the recording of the first change to the undo_list. + Therefore we check for first change here and record it via + record_first_change if needed. */ + if (MODIFF <= SAVE_MODIFF) + record_first_change (); + undo_list = BVAR (current_buffer, undo_list); BSET (current_buffer, undo_list, Qt); } ------------------------------------------------------------ revno: 109594 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-14 08:49:18 +0400 message: Revert and cleanup some recent overlay changes. * buffer.h (enum overlay_type): Remove. (buffer_get_overlays, buffer_set_overlays): Likewise. (buffer_set_overlays_before, buffer_set_overlays_after): New function. Adjust users. (unchain_both): Add eassert. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 04:47:05 +0000 +++ src/ChangeLog 2012-08-14 04:49:18 +0000 @@ -1,5 +1,14 @@ 2012-08-14 Dmitry Antipov + Revert and cleanup some recent overlay changes. + * buffer.h (enum overlay_type): Remove. + (buffer_get_overlays, buffer_set_overlays): Likewise. + (buffer_set_overlays_before, buffer_set_overlays_after): + New function. Adjust users. + (unchain_both): Add eassert. + +2012-08-14 Dmitry Antipov + * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate. 2012-08-14 Paul Eggert === modified file 'src/alloc.c' --- src/alloc.c 2012-08-08 14:47:11 +0000 +++ src/alloc.c 2012-08-14 04:49:18 +0000 @@ -5831,8 +5831,8 @@ a special way just before the sweep phase, and after stripping some of its elements that are not needed any more. */ - mark_overlay (buffer_get_overlays (buffer, OV_BEFORE)); - mark_overlay (buffer_get_overlays (buffer, OV_AFTER)); + mark_overlay (buffer->overlays_before); + mark_overlay (buffer->overlays_after); /* If this is an indirect buffer, mark its base buffer. */ if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) === modified file 'src/buffer.c' --- src/buffer.c 2012-08-13 03:39:07 +0000 +++ src/buffer.c 2012-08-14 04:49:18 +0000 @@ -474,10 +474,8 @@ memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); - buffer_set_overlays - (to, copy_overlays (to, buffer_get_overlays (from, OV_BEFORE)), OV_BEFORE); - buffer_set_overlays - (to, copy_overlays (to, buffer_get_overlays (from, OV_AFTER)), OV_AFTER); + buffer_set_overlays_before (to, copy_overlays (to, from->overlays_before)); + buffer_set_overlays_after (to, copy_overlays (to, from->overlays_after)); /* Get (a copy of) the alist of Lisp-level local variables of FROM and install that in TO. */ @@ -676,22 +674,22 @@ { struct Lisp_Overlay *ov, *next; - for (ov = buffer_get_overlays (b, OV_BEFORE); ov; ov = next) - { - drop_overlay (b, ov); - next = ov->next; - ov->next = NULL; - } - - for (ov = buffer_get_overlays (b, OV_AFTER); ov; ov = next) - { - drop_overlay (b, ov); - next = ov->next; - ov->next = NULL; - } - - buffer_set_overlays (b, NULL, OV_BEFORE); - buffer_set_overlays (b, NULL, OV_AFTER); + for (ov = b->overlays_before; ov; ov = next) + { + drop_overlay (b, ov); + next = ov->next; + ov->next = NULL; + } + + for (ov = b->overlays_after; ov; ov = next) + { + drop_overlay (b, ov); + next = ov->next; + ov->next = NULL; + } + + buffer_set_overlays_before (b, NULL); + buffer_set_overlays_after (b, NULL); } /* Reinitialize everything about a buffer except its name and contents @@ -720,8 +718,8 @@ b->auto_save_failure_time = 0; BSET (b, auto_save_file_name, Qnil); BSET (b, read_only, Qnil); - buffer_set_overlays (b, NULL, OV_BEFORE); - buffer_set_overlays (b, NULL, OV_AFTER); + buffer_set_overlays_before (b, NULL); + buffer_set_overlays_after (b, NULL); b->overlay_center = BEG; BSET (b, mark_active, Qnil); BSET (b, point_before_scroll, Qnil); @@ -2608,7 +2606,7 @@ ptrdiff_t prev = BEGV; int inhibit_storing = 0; - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2656,7 +2654,7 @@ next = startpos; } - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2743,7 +2741,7 @@ int inhibit_storing = 0; int end_is_Z = end == Z; - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2790,7 +2788,7 @@ next = startpos; } - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2880,7 +2878,7 @@ Lisp_Object overlay; struct Lisp_Overlay *tail; - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { ptrdiff_t endpos; @@ -2894,7 +2892,7 @@ return 1; } - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { ptrdiff_t startpos; @@ -3095,7 +3093,7 @@ overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; - for (ov = buffer_get_overlays (NULL, OV_BEFORE); ov; ov = ov->next) + for (ov = current_buffer->overlays_before; ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -3123,7 +3121,7 @@ Foverlay_get (overlay, Qpriority), endpos - startpos); } - for (ov = buffer_get_overlays (NULL, OV_AFTER); ov; ov = ov->next) + for (ov = current_buffer->overlays_after; ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -3221,7 +3219,7 @@ But we use it for symmetry and in case that should cease to be true with some future change. */ prev = NULL; - for (tail = buffer_get_overlays (buf, OV_BEFORE); tail; prev = tail, tail = next) + for (tail = buf->overlays_before; tail; prev = tail, tail = next) { next = tail->next; XSETMISC (overlay, tail); @@ -3240,11 +3238,11 @@ if (prev) prev->next = next; else - buffer_set_overlays (buf, next, OV_BEFORE); + buffer_set_overlays_before (buf, next); /* Search thru overlays_after for where to put it. */ other_prev = NULL; - for (other = buffer_get_overlays (buf, OV_AFTER); other; + for (other = buf->overlays_after; other; other_prev = other, other = other->next) { Lisp_Object otherbeg, otheroverlay; @@ -3262,7 +3260,7 @@ if (other_prev) other_prev->next = tail; else - buffer_set_overlays (buf, tail, OV_AFTER); + buffer_set_overlays_after (buf, tail); tail = prev; } else @@ -3274,7 +3272,7 @@ /* See if anything in overlays_after should be in overlays_before. */ prev = NULL; - for (tail = buffer_get_overlays (buf, OV_AFTER); tail; prev = tail, tail = next) + for (tail = buf->overlays_after; tail; prev = tail, tail = next) { next = tail->next; XSETMISC (overlay, tail); @@ -3298,11 +3296,11 @@ if (prev) prev->next = next; else - buffer_set_overlays (buf, next, OV_AFTER); + buffer_set_overlays_after (buf, next); /* Search thru overlays_before for where to put it. */ other_prev = NULL; - for (other = buffer_get_overlays (buf, OV_BEFORE); other; + for (other = buf->overlays_before; other; other_prev = other, other = other->next) { Lisp_Object otherend, otheroverlay; @@ -3320,7 +3318,7 @@ if (other_prev) other_prev->next = tail; else - buffer_set_overlays (buf, tail, OV_BEFORE); + buffer_set_overlays_before (buf, tail); tail = prev; } } @@ -3373,7 +3371,7 @@ assigned. */ struct Lisp_Overlay *beforep = NULL, *afterp = NULL; /* 'Parent', likewise, indicates a cons cell or - before or after overlays list, depending + current_buffer->overlays_before or overlays_after, depending which loop we're in. */ struct Lisp_Overlay *tail, *parent; ptrdiff_t startpos, endpos; @@ -3385,7 +3383,7 @@ (after_list) if it is, is still uninitialized. So it's not a bug that before_list isn't initialized, although it may look strange. */ - for (parent = NULL, tail = buffer_get_overlays (NULL, OV_BEFORE); tail;) + for (parent = NULL, tail = current_buffer->overlays_before; tail;) { XSETMISC (overlay, tail); @@ -3425,7 +3423,7 @@ beforep = tail; } if (!parent) - buffer_set_overlays (NULL, tail->next, OV_BEFORE); + buffer_set_overlays_before (current_buffer, tail->next); else parent->next = tail->next; tail = tail->next; @@ -3433,7 +3431,7 @@ else parent = tail, tail = parent->next; } - for (parent = NULL, tail = buffer_get_overlays (NULL, OV_AFTER); tail;) + for (parent = NULL, tail = current_buffer->overlays_after; tail;) { XSETMISC (overlay, tail); @@ -3471,7 +3469,7 @@ beforep = tail; } if (!parent) - buffer_set_overlays (NULL, tail->next, OV_AFTER); + buffer_set_overlays_after (current_buffer, tail->next); else parent->next = tail->next; tail = tail->next; @@ -3484,15 +3482,15 @@ and let the recenter function make it sane again. */ if (beforep) { - beforep->next = buffer_get_overlays (NULL, OV_BEFORE); - buffer_set_overlays (NULL, before_list, OV_BEFORE); + beforep->next = current_buffer->overlays_before; + buffer_set_overlays_before (current_buffer, before_list); } recenter_overlay_lists (current_buffer, current_buffer->overlay_center); if (afterp) { - afterp->next = buffer_get_overlays (NULL, OV_AFTER); - buffer_set_overlays (NULL, after_list, OV_AFTER); + afterp->next = current_buffer->overlays_after; + buffer_set_overlays_after (current_buffer, after_list); } recenter_overlay_lists (current_buffer, current_buffer->overlay_center); } @@ -3513,8 +3511,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) { /* If parent is nil, replace overlays_before; otherwise, parent->next. */ - struct Lisp_Overlay *tail = buffer_get_overlays (bp, OV_BEFORE); - struct Lisp_Overlay *parent = NULL, *right_pair; + struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; Lisp_Object tem; ptrdiff_t end IF_LINT (= 0); @@ -3569,8 +3566,8 @@ and link it into the right place. */ if (!right_pair) { - found->next = buffer_get_overlays (bp, OV_BEFORE); - buffer_set_overlays (bp, found, OV_BEFORE); + found->next = bp->overlays_before; + buffer_set_overlays_before (bp, found); } else { @@ -3646,15 +3643,15 @@ end = OVERLAY_END (overlay); if (OVERLAY_POSITION (end) < b->overlay_center) { - if (buffer_get_overlays (b, OV_AFTER)) - XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER); - buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER); + if (b->overlays_after) + XOVERLAY (overlay)->next = b->overlays_after; + buffer_set_overlays_after (b, XOVERLAY (overlay)); } else { - if (buffer_get_overlays (b, OV_BEFORE)) - XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE); - buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE); + if (b->overlays_before) + XOVERLAY (overlay)->next = b->overlays_before; + buffer_set_overlays_before (b, XOVERLAY (overlay)); } /* This puts it in the right list, and in the right order. */ @@ -3719,10 +3716,9 @@ { struct Lisp_Overlay *ov = XOVERLAY (overlay); - buffer_set_overlays - (b, unchain_overlay (buffer_get_overlays (b, OV_BEFORE), ov), OV_BEFORE); - buffer_set_overlays - (b, unchain_overlay (buffer_get_overlays (b, OV_AFTER), ov), OV_AFTER); + buffer_set_overlays_before (b, unchain_overlay (b->overlays_before, ov)); + buffer_set_overlays_after (b, unchain_overlay (b->overlays_after, ov)); + eassert (XOVERLAY (overlay)->next == NULL); } DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, @@ -3776,7 +3772,6 @@ o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); unchain_both (ob, overlay); - eassert (XOVERLAY (overlay)->next == NULL); } /* Set the overlay boundaries, which may clip them. */ @@ -3816,13 +3811,13 @@ wrong list. */ if (n_end < b->overlay_center) { - XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER); - buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER); + XOVERLAY (overlay)->next = b->overlays_after; + buffer_set_overlays_after (b, XOVERLAY (overlay)); } else { - XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE); - buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE); + XOVERLAY (overlay)->next = b->overlays_before; + buffer_set_overlays_before (b, XOVERLAY (overlay)); } /* This puts it in the right list, and in the right order. */ @@ -3849,8 +3844,6 @@ specbind (Qinhibit_quit, Qt); unchain_both (b, overlay); - eassert (XOVERLAY (overlay)->next == NULL); - drop_overlay (b, XOVERLAY (overlay)); /* When deleting an overlay with before or after strings, turn off @@ -4048,13 +4041,12 @@ struct Lisp_Overlay *ol; Lisp_Object before = Qnil, after = Qnil, tmp; - for (ol = buffer_get_overlays (NULL, OV_BEFORE); ol; ol = ol->next) + for (ol = current_buffer->overlays_before; ol; ol = ol->next) { XSETMISC (tmp, ol); before = Fcons (tmp, before); } - - for (ol = buffer_get_overlays (NULL, OV_AFTER); ol; ol = ol->next) + for (ol = current_buffer->overlays_after; ol; ol = ol->next) { XSETMISC (tmp, ol); after = Fcons (tmp, after); @@ -4199,7 +4191,7 @@ /* We are being called before a change. Scan the overlays to find the functions to call. */ last_overlay_modification_hooks_used = 0; - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { ptrdiff_t startpos, endpos; Lisp_Object ostart, oend; @@ -4236,7 +4228,7 @@ } } - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { ptrdiff_t startpos, endpos; Lisp_Object ostart, oend; @@ -4328,7 +4320,7 @@ hit_list = Qnil; if (pos <= current_buffer->overlay_center) - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { ptrdiff_t endpos; XSETMISC (overlay, tail); @@ -4340,7 +4332,7 @@ hit_list = Fcons (overlay, hit_list); } else - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { ptrdiff_t startpos; XSETMISC (overlay, tail); @@ -4946,8 +4938,8 @@ BSET (&buffer_defaults, mark_active, Qnil); BSET (&buffer_defaults, file_format, Qnil); BSET (&buffer_defaults, auto_save_file_format, Qt); - buffer_defaults.overlays_before = NULL; - buffer_defaults.overlays_after = NULL; + buffer_set_overlays_before (&buffer_defaults, NULL); + buffer_set_overlays_after (&buffer_defaults, NULL); buffer_defaults.overlay_center = BEG; XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8); === modified file 'src/buffer.h' --- src/buffer.h 2012-08-13 03:39:07 +0000 +++ src/buffer.h 2012-08-14 04:49:18 +0000 @@ -946,52 +946,6 @@ } \ } while (0) -enum overlay_type -{ - OV_BEFORE, - OV_AFTER -}; - -/* Get overlay list of type T and belonging to B. */ - -BUFFER_INLINE struct Lisp_Overlay * -buffer_get_overlays (struct buffer *b, enum overlay_type t) -{ - if (!b) - b = current_buffer; - if (t == OV_BEFORE) - return b->overlays_before; - else if (t == OV_AFTER) - return b->overlays_after; - else - abort (); -} - -/* Set overlay list of type T as belonging to B. */ - -BUFFER_INLINE void -buffer_set_overlays (struct buffer *b, struct Lisp_Overlay *o, - enum overlay_type t) -{ - if (!b) - b = current_buffer; - if (t == OV_BEFORE) - b->overlays_before = o; - else if (t == OV_AFTER) - b->overlays_after = o; - else - abort (); -} - -/* Non-zero if current buffer has overlays. */ - -BUFFER_INLINE int -buffer_has_overlays (void) -{ - return buffer_get_overlays (current_buffer, OV_BEFORE) - || buffer_get_overlays (current_buffer, OV_AFTER); -} - extern Lisp_Object Qbefore_change_functions; extern Lisp_Object Qafter_change_functions; extern Lisp_Object Qfirst_change_hook; @@ -1014,6 +968,28 @@ b->text->intervals = i; } +/* Set an appropriate overlay of B. */ + +BUFFER_INLINE void +buffer_set_overlays_before (struct buffer *b, struct Lisp_Overlay *o) +{ + b->overlays_before = o; +} + +BUFFER_INLINE void +buffer_set_overlays_after (struct buffer *b, struct Lisp_Overlay *o) +{ + b->overlays_after = o; +} + +/* Non-zero if current buffer has overlays. */ + +BUFFER_INLINE int +buffer_has_overlays (void) +{ + return current_buffer->overlays_before || current_buffer->overlays_after; +} + /* Return character code of multi-byte form at byte position POS. If POS doesn't point the head of valid multi-byte form, only the byte at POS is returned. No range checking. === modified file 'src/editfns.c' --- src/editfns.c 2012-08-13 03:39:07 +0000 +++ src/editfns.c 2012-08-14 04:49:18 +0000 @@ -310,7 +310,7 @@ ptrdiff_t startpos, endpos; ptrdiff_t idx = 0; - for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) + for (tail = current_buffer->overlays_before; tail; tail = tail->next) { XSETMISC (overlay, tail); @@ -329,7 +329,7 @@ } } - for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { XSETMISC (overlay, tail); === modified file 'src/fileio.c' --- src/fileio.c 2012-08-13 03:39:07 +0000 +++ src/fileio.c 2012-08-14 04:49:18 +0000 @@ -3490,8 +3490,8 @@ BSET (buf, read_only, Qnil); BSET (buf, filename, Qnil); BSET (buf, undo_list, Qt); - eassert (buffer_get_overlays (buf, OV_BEFORE) == NULL); - eassert (buffer_get_overlays (buf, OV_AFTER) == NULL); + eassert (buf->overlays_before == NULL); + eassert (buf->overlays_after == NULL); set_buffer_internal (buf); Ferase_buffer (); === modified file 'src/print.c' --- src/print.c 2012-08-13 03:39:07 +0000 +++ src/print.c 2012-08-14 04:49:18 +0000 @@ -498,10 +498,10 @@ BSET (current_buffer, read_only, Qnil); BSET (current_buffer, filename, Qnil); BSET (current_buffer, undo_list, Qt); - eassert (buffer_get_overlays (NULL, OV_BEFORE) == NULL); - eassert (buffer_get_overlays (NULL, OV_AFTER) == NULL); + eassert (current_buffer->overlays_before == NULL); + eassert (current_buffer->overlays_after == NULL); BSET (current_buffer, enable_multibyte_characters, - BVAR (&buffer_defaults, enable_multibyte_characters)); + BVAR (&buffer_defaults, enable_multibyte_characters)); specbind (Qinhibit_read_only, Qt); specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-13 03:39:07 +0000 +++ src/xdisp.c 2012-08-14 04:49:18 +0000 @@ -5445,7 +5445,7 @@ while (0) /* Process overlay before the overlay center. */ - for (ov = buffer_get_overlays (NULL, OV_BEFORE); ov; ov = ov->next) + for (ov = current_buffer->overlays_before; ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -5485,7 +5485,7 @@ } /* Process overlays after the overlay center. */ - for (ov = buffer_get_overlays (NULL, OV_AFTER); ov; ov = ov->next) + for (ov = current_buffer->overlays_after; ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); ------------------------------------------------------------ revno: 109593 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-14 08:47:05 +0400 message: * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 02:39:59 +0000 +++ src/ChangeLog 2012-08-14 04:47:05 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Dmitry Antipov + + * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate. + 2012-08-14 Paul Eggert * gtkutil.c (xg_mark_data): Don't assume C99. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-08-14 02:39:59 +0000 +++ src/gtkutil.c 2012-08-14 04:47:05 +0000 @@ -4583,8 +4583,8 @@ && tbinfo->n_last_items == f->n_tool_bar_items && tbinfo->hmargin == hmargin && tbinfo->vmargin == vmargin && tbinfo->dir == dir - && Fequal (tbinfo->style, style) == Qt - && Fequal (tbinfo->last_tool_bar, f->tool_bar_items) == Qt) + && EQ (Fequal (tbinfo->style, style), Qt) + && EQ (Fequal (tbinfo->last_tool_bar, f->tool_bar_items), Qt)) { UNBLOCK_INPUT; return; ------------------------------------------------------------ revno: 109592 fixes bug: http://debbugs.gnu.org/12193 author: Daiki Ueno committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-14 12:37:00 +0800 message: * subr.el (internal--after-with-selected-window): Fix typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 04:18:41 +0000 +++ lisp/ChangeLog 2012-08-14 04:37:00 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Daiki Ueno + + * subr.el (internal--after-with-selected-window): Fix typo + (Bug#12193). + 2012-08-14 Fabián Ezequiel Gallina Use `completion-table-dynamic' for completion functions. === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-13 21:23:09 +0000 +++ lisp/subr.el 2012-08-14 04:37:00 +0000 @@ -3048,8 +3048,8 @@ (not (eq (tty-top-frame) (nth 3 state))) (select-frame (nth 3 state) 'norecord))) ;; Then reset the actual selected-window. - (when (window-live-p (nth 2 state)) - (select-window (nth 2 state) 'norecord))) + (when (window-live-p (nth 1 state)) + (select-window (nth 1 state) 'norecord))) (defmacro with-selected-window (window &rest body) "Execute the forms in BODY with WINDOW as the selected window. ------------------------------------------------------------ revno: 109591 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Tue 2012-08-14 01:18:41 -0300 message: Use `completion-table-dynamic' for completion functions. * progmodes/python.el (python-shell-completion--do-completion-at-point) (python-shell-completion--get-completions): Remove functions. (python-shell-completion-complete-at-point): New function. (python-completion-complete-at-point): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 21:31:56 +0000 +++ lisp/ChangeLog 2012-08-14 04:18:41 +0000 @@ -1,3 +1,13 @@ +2012-08-14 Fabián Ezequiel Gallina + + Use `completion-table-dynamic' for completion functions. + * progmodes/python.el + (python-shell-completion--do-completion-at-point) + (python-shell-completion--get-completions): Remove + functions. + (python-shell-completion-complete-at-point): New function. + (python-completion-complete-at-point): Use it. + 2012-08-13 Jambunathan K * vc/vc-dir.el (vc-dir-hide-state): New command (bug#12159). === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-10 16:46:07 +0000 +++ lisp/progmodes/python.el 2012-08-14 04:18:41 +0000 @@ -2018,27 +2018,71 @@ :type 'string :group 'python) -(defun python-shell-completion--get-completions (input process completion-code) - "Retrieve available completions for INPUT using PROCESS. -Argument COMPLETION-CODE is the python code used to get -completions on the current context." - (with-current-buffer (process-buffer process) - (let ((completions (python-shell-send-string-no-output - (format completion-code input) process))) - (when (> (length completions) 2) - (split-string completions "^'\\|^\"\\|;\\|'$\\|\"$" t))))) +(defun python-shell-completion-get-completions (process line input) + "Do completion at point for PROCESS. +LINE is used to detect the context on how to complete given +INPUT." + (let* ((prompt + ;; Get the last prompt for the inferior process + ;; buffer. This is used for the completion code selection + ;; heuristic. + (with-current-buffer (process-buffer process) + (buffer-substring-no-properties + (overlay-start comint-last-prompt-overlay) + (overlay-end comint-last-prompt-overlay)))) + (completion-context + ;; Check whether a prompt matches a pdb string, an import + ;; statement or just the standard prompt and use the + ;; correct python-shell-completion-*-code string + (cond ((and (> (length python-shell-completion-pdb-string-code) 0) + (string-match + (concat "^" python-shell-prompt-pdb-regexp) prompt)) + 'pdb) + ((and (> + (length python-shell-completion-module-string-code) 0) + (string-match + (concat "^" python-shell-prompt-regexp) prompt) + (string-match "^[ \t]*\\(from\\|import\\)[ \t]" line)) + 'import) + ((string-match + (concat "^" python-shell-prompt-regexp) prompt) + 'default) + (t nil))) + (completion-code + (case completion-context + (pdb python-shell-completion-pdb-string-code) + (import python-shell-completion-module-string-code) + (default python-shell-completion-string-code) + (t nil))) + (input + (if (eq completion-context 'import) + (replace-regexp-in-string "^[ \t]+" "" line) + input))) + (and completion-code + (> (length input) 0) + (with-current-buffer (process-buffer process) + (let ((completions (python-shell-send-string-no-output + (format completion-code input) process))) + (and (> (length completions) 2) + (split-string completions + "^'\\|^\"\\|;\\|'$\\|\"$" t))))))) -(defun python-shell-completion--do-completion-at-point (process) - "Do completion at point for PROCESS." - (with-syntax-table python-dotty-syntax-table - (let* ((beg - (save-excursion +(defun python-shell-completion-complete-at-point (&optional process) + "Perform completion at point in inferior Python. +Optional argument PROCESS forces completions to be retrieved +using that one instead of current buffer's process." + (setq process (or process (get-buffer-process (current-buffer)))) + (let* ((start + (save-excursion + (with-syntax-table python-dotty-syntax-table (let* ((paren-depth (car (syntax-ppss))) (syntax-string "w_") (syntax-list (string-to-syntax syntax-string))) - ;; Stop scanning for the beginning of the completion subject - ;; after the char before point matches a delimiter - (while (member (car (syntax-after (1- (point)))) syntax-list) + ;; Stop scanning for the beginning of the completion + ;; subject after the char before point matches a + ;; delimiter + (while (member + (car (syntax-after (1- (point)))) syntax-list) (skip-syntax-backward syntax-string) (when (or (equal (char-before) ?\)) (equal (char-before) ?\")) @@ -2047,58 +2091,15 @@ ;; honor initial paren depth (> (car (syntax-ppss)) paren-depth) (python-syntax-context 'string)) - (forward-char -1)))) - (point))) - (end (point)) - (line (buffer-substring-no-properties (point-at-bol) end)) - (input (buffer-substring-no-properties beg end)) - ;; Get the last prompt for the inferior process buffer. This is - ;; used for the completion code selection heuristic. - (prompt - (with-current-buffer (process-buffer process) - (buffer-substring-no-properties - (overlay-start comint-last-prompt-overlay) - (overlay-end comint-last-prompt-overlay)))) - (completion-context - ;; Check whether a prompt matches a pdb string, an import statement - ;; or just the standard prompt and use the correct - ;; python-shell-completion-*-code string - (cond ((and (> (length python-shell-completion-pdb-string-code) 0) - (string-match - (concat "^" python-shell-prompt-pdb-regexp) prompt)) - 'pdb) - ((and (> - (length python-shell-completion-module-string-code) 0) - (string-match - (concat "^" python-shell-prompt-regexp) prompt) - (string-match "^[ \t]*\\(from\\|import\\)[ \t]" line)) - 'import) - ((string-match - (concat "^" python-shell-prompt-regexp) prompt) - 'default) - (t nil))) - (completion-code - (case completion-context - ('pdb python-shell-completion-pdb-string-code) - ('import python-shell-completion-module-string-code) - ('default python-shell-completion-string-code) - (t nil))) - (input - (if (eq completion-context 'import) - (replace-regexp-in-string "^[ \t]+" "" line) - input)) - (completions - (and completion-code (> (length input) 0) - (python-shell-completion--get-completions - input process completion-code)))) - (list beg end completions)))) - -(defun python-shell-completion-complete-at-point () - "Perform completion at point in inferior Python process." - (and comint-last-prompt-overlay - (> (point-marker) (overlay-end comint-last-prompt-overlay)) - (python-shell-completion--do-completion-at-point - (get-buffer-process (current-buffer))))) + (forward-char -1))) + (point))))) + (end (point))) + (list start end + (completion-table-dynamic + (apply-partially + #'python-shell-completion-get-completions + process (buffer-substring-no-properties + (line-beginning-position) end)))))) (defun python-shell-completion-complete-or-indent () "Complete or indent depending on the context. @@ -2210,7 +2211,7 @@ (let ((process (python-shell-get-process))) (if (not process) (error "Completion needs an inferior Python process running") - (python-shell-completion--do-completion-at-point process)))) + (python-shell-completion-complete-at-point process)))) (add-to-list 'debug-ignored-errors "^Completion needs an inferior Python process running.") ------------------------------------------------------------ revno: 109590 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-08-13 20:15:52 -0700 message: Merge from gnulib. This incorporates: 2012-08-05 extern-inline: also ignore -Wmissing-declarations diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-10 21:29:38 +0000 +++ ChangeLog 2012-08-14 03:15:52 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-05 extern-inline: also ignore -Wmissing-declarations + 2012-08-10 Juanma Barranquero * lib/makefile.w32-in (STAT_TIME_H): New macro. === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2012-07-30 06:07:22 +0000 +++ doc/misc/texinfo.tex 2012-08-14 03:15:52 +0000 @@ -3146,12 +3146,17 @@ % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% - \ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize \else - % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi \fi \thisecfont } === modified file 'm4/extern-inline.m4' --- m4/extern-inline.m4 2012-08-02 04:46:10 +0000 +++ m4/extern-inline.m4 2012-08-14 03:15:52 +0000 @@ -24,7 +24,8 @@ # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") # endif ------------------------------------------------------------ revno: 109589 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-08-13 19:39:59 -0700 message: * gtkutil.c (xg_mark_data): Don't assume C99. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-13 19:12:26 +0000 +++ src/ChangeLog 2012-08-14 02:39:59 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Paul Eggert + + * gtkutil.c (xg_mark_data): Don't assume C99. + 2012-08-13 Jan Djärv * gtkutil.c (xg_frame_tb_info): New struct. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-08-13 19:12:26 +0000 +++ src/gtkutil.c 2012-08-14 02:39:59 +0000 @@ -2150,6 +2150,7 @@ xg_mark_data (void) { xg_list_node *iter; + Lisp_Object rest, frame; for (iter = xg_menu_cb_list.next; iter; iter = iter->next) mark_object (((xg_menu_cb_data *) iter)->menu_bar_vector); @@ -2162,7 +2163,6 @@ mark_object (cb_data->help); } - Lisp_Object rest, frame; FOR_EACH_FRAME (rest, frame) { FRAME_PTR f = XFRAME (frame); ------------------------------------------------------------ revno: 109588 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12159 author: Jambunathan K committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-13 17:31:56 -0400 message: * lisp/vc/vc-dir.el (vc-dir-hide-state): New command. (vc-dir-hide-up-to-date): Route it to `vc-dir-hide-state'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 21:23:09 +0000 +++ lisp/ChangeLog 2012-08-13 21:31:56 +0000 @@ -1,3 +1,8 @@ +2012-08-13 Jambunathan K + + * vc/vc-dir.el (vc-dir-hide-state): New command (bug#12159). + (vc-dir-hide-up-to-date): Route it to `vc-dir-hide-state'. + 2012-08-13 Stefan Monnier * subr.el (function-get): Refine `autoload' arg so it can also === modified file 'lisp/vc/vc-dir.el' --- lisp/vc/vc-dir.el 2012-07-11 23:13:41 +0000 +++ lisp/vc/vc-dir.el 2012-08-13 21:31:56 +0000 @@ -1106,9 +1106,22 @@ (interactive "fShow file: ") (vc-dir-update (list (list (file-relative-name file) (vc-state file))) (current-buffer))) -(defun vc-dir-hide-up-to-date () - "Hide up-to-date items from display." - (interactive) +(defun vc-dir-hide-state (&optional state) + "Hide items that are in STATE from display. +See `vc-state' for valid values of STATE. + +If STATE is nil, default it to up-to-date. + +Interactively, if `current-prefix-arg' is non-nil, set STATE to +state of item at point. Otherwise, set STATE to up-to-date." + (interactive (list + (and current-prefix-arg + ;; Command is prefixed. Infer STATE from point. + (let ((node (ewoc-locate vc-ewoc))) + (and node (vc-dir-fileinfo->state (ewoc-data node))))))) + ;; If STATE is un-specified, use up-to-date. + (setq state (or state 'up-to-date)) + (message "Hiding items in state \"%s\"" state) (let ((crt (ewoc-nth vc-ewoc -1)) (first (ewoc-nth vc-ewoc 0))) ;; Go over from the last item to the first and remove the @@ -1120,18 +1133,21 @@ (prev (ewoc-prev vc-ewoc crt)) ;; ewoc-delete does not work without this... (inhibit-read-only t)) - (when (or - ;; Remove directories with no child files. - (and dir - (or - ;; Nothing follows this directory. - (not next) - ;; Next item is a directory. - (vc-dir-fileinfo->directory (ewoc-data next)))) - ;; Remove files in the up-to-date state. - (eq (vc-dir-fileinfo->state data) 'up-to-date)) - (ewoc-delete vc-ewoc crt)) - (setq crt prev))))) + (when (or + ;; Remove directories with no child files. + (and dir + (or + ;; Nothing follows this directory. + (not next) + ;; Next item is a directory. + (vc-dir-fileinfo->directory (ewoc-data next)))) + ;; Remove files in specified STATE. STATE can be a + ;; symbol or a user-name. + (equal (vc-dir-fileinfo->state data) state)) + (ewoc-delete vc-ewoc crt)) + (setq crt prev))))) + +(defalias 'vc-dir-hide-up-to-date 'vc-dir-hide-state) (defun vc-dir-kill-line () "Remove the current line from display." ------------------------------------------------------------ revno: 109587 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12191 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-13 17:23:09 -0400 message: * lisp/subr.el (function-get): Refine `autoload' arg so it can also autoload functions for gv.el. * lisp/emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only autoloads macros. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 19:10:35 +0000 +++ lisp/ChangeLog 2012-08-13 21:23:09 +0000 @@ -1,5 +1,10 @@ 2012-08-13 Stefan Monnier + * subr.el (function-get): Refine `autoload' arg so it can also + autoload functions for gv.el (bug#12191). + * emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only + autoloads macros. + * color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000): Prefer pcase-let over destructuring-bind. * vc/diff-mode.el (diff-remove-trailing-whitespace): Same. === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/edebug.el 2012-08-13 21:23:09 +0000 @@ -248,7 +248,7 @@ (progn (and (symbolp indirect) (setq indirect - (function-get indirect 'edebug-form-spec 'autoload)))) + (function-get indirect 'edebug-form-spec 'macro)))) ;; (edebug-trace "indirection: %s" edebug-form-spec) (setq edebug-form-spec indirect)) edebug-form-spec === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-13 14:12:47 +0000 +++ lisp/subr.el 2012-08-13 21:23:09 +0000 @@ -2785,15 +2785,19 @@ (defun function-get (f prop &optional autoload) "Return the value of property PROP of function F. -If AUTOLOAD is non-nil and F is an autoloaded macro, try to autoload -the macro in the hope that it will set PROP." +If AUTOLOAD is non-nil and F is autoloaded, try to autoload it +in the hope that it will set PROP. If AUTOLOAD is `macro', only do it +if it's an autoloaded macro." (let ((val nil)) (while (and (symbolp f) (null (setq val (get f prop))) (fboundp f)) (let ((fundef (symbol-function f))) (if (and autoload (autoloadp fundef) - (not (equal fundef (autoload-do-load fundef f 'macro)))) + (not (equal fundef + (autoload-do-load fundef f + (if (eq autoload 'macro) + 'macro))))) nil ;Re-try `get' on the same `f'. (setq f fundef)))) val)) ------------------------------------------------------------ revno: 109586 committer: Jan D. branch nick: trunk timestamp: Mon 2012-08-13 21:12:26 +0200 message: Don't redraw tool bar for Gtk+ unless out of date. * gtkutil.c (xg_frame_tb_info): New struct. (TB_INFO_KEY): New define. (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present. (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info. (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info if not present. (update_frame_tool_bar): Return early if data in xg_frame_tb_info is up to date. Otherwise store new data. (free_frame_tool_bar): Free xg_frame_tb_info if present. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-13 03:44:27 +0000 +++ src/ChangeLog 2012-08-13 19:12:26 +0000 @@ -1,3 +1,15 @@ +2012-08-13 Jan Djärv + + * gtkutil.c (xg_frame_tb_info): New struct. + (TB_INFO_KEY): New define. + (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present. + (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info. + (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info + if not present. + (update_frame_tool_bar): Return early if data in xg_frame_tb_info + is up to date. Otherwise store new data. + (free_frame_tool_bar): Free xg_frame_tb_info if present. + 2012-08-13 Dmitry Antipov Use KSET for write access to Lisp_Object members of struct kboard. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-08-11 08:54:35 +0000 +++ src/gtkutil.c 2012-08-13 19:12:26 +0000 @@ -110,6 +110,16 @@ static void update_theme_scrollbar_width (void); +#define TB_INFO_KEY "xg_frame_tb_info" +struct xg_frame_tb_info +{ + Lisp_Object last_tool_bar; + Lisp_Object style; + int n_last_items; + int hmargin, vmargin; + GtkTextDirection dir; +}; + /*********************************************************************** Display handling functions @@ -1277,6 +1287,12 @@ #ifdef USE_GTK_TOOLTIP struct x_output *x = f->output_data.x; #endif + struct xg_frame_tb_info *tbinfo + = g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY); + if (tbinfo) + xfree (tbinfo); + gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f)); FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */ FRAME_GTK_OUTER_WIDGET (f) = 0; @@ -2145,6 +2161,24 @@ if (! NILP (cb_data->help)) mark_object (cb_data->help); } + + Lisp_Object rest, frame; + FOR_EACH_FRAME (rest, frame) + { + FRAME_PTR f = XFRAME (frame); + + if (FRAME_X_OUTPUT (f) && FRAME_GTK_OUTER_WIDGET (f)) + { + struct xg_frame_tb_info *tbinfo + = g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY); + if (tbinfo) + { + mark_object (tbinfo->last_tool_bar); + mark_object (tbinfo->style); + } + } + } } @@ -4220,6 +4254,21 @@ #if GTK_CHECK_VERSION (3, 3, 6) GtkStyleContext *gsty; #endif + struct xg_frame_tb_info *tbinfo + = g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY); + if (! tbinfo) + { + tbinfo = xmalloc (sizeof (*tbinfo)); + tbinfo->last_tool_bar = Qnil; + tbinfo->style = Qnil; + tbinfo->hmargin = tbinfo->vmargin = 0; + tbinfo->dir = GTK_TEXT_DIR_NONE; + tbinfo->n_last_items = 0; + g_object_set_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY, + tbinfo); + } x->toolbar_widget = gtk_toolbar_new (); x->toolbar_detached = 0; @@ -4490,6 +4539,7 @@ int pack_tool_bar = x->handlebox_widget == NULL; Lisp_Object style; int text_image, horiz; + struct xg_frame_tb_info *tbinfo; if (! FRAME_GTK_WIDGET (f)) return; @@ -4524,6 +4574,29 @@ dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar)); style = Ftool_bar_get_system_style (); + + /* Are we up to date? */ + tbinfo = g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY); + + if (! NILP (tbinfo->last_tool_bar) && ! NILP (f->tool_bar_items) + && tbinfo->n_last_items == f->n_tool_bar_items + && tbinfo->hmargin == hmargin && tbinfo->vmargin == vmargin + && tbinfo->dir == dir + && Fequal (tbinfo->style, style) == Qt + && Fequal (tbinfo->last_tool_bar, f->tool_bar_items) == Qt) + { + UNBLOCK_INPUT; + return; + } + + tbinfo->last_tool_bar = f->tool_bar_items; + tbinfo->n_last_items = f->n_tool_bar_items; + tbinfo->style = style; + tbinfo->hmargin = hmargin; + tbinfo->vmargin = vmargin; + tbinfo->dir = dir; + text_image = EQ (style, Qtext_image_horiz); horiz = EQ (style, Qboth_horiz) || text_image; @@ -4737,6 +4810,7 @@ if (x->toolbar_widget) { + struct xg_frame_tb_info *tbinfo; int is_packed = x->handlebox_widget != 0; BLOCK_INPUT; /* We may have created the toolbar_widget in xg_create_tool_bar, but @@ -4758,6 +4832,16 @@ FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0; FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0; + tbinfo = g_object_get_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY); + if (tbinfo) + { + xfree (tbinfo); + g_object_set_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), + TB_INFO_KEY, + NULL); + } + xg_height_or_width_changed (f); UNBLOCK_INPUT; ------------------------------------------------------------ revno: 109585 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-13 15:10:35 -0400 message: * lisp/color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000): Prefer pcase-let over destructuring-bind. * lisp/vc/diff-mode.el (diff-remove-trailing-whitespace): Same. Also, remove whitespace as we go, rather than after accumulating the various places. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 14:12:47 +0000 +++ lisp/ChangeLog 2012-08-13 19:10:35 +0000 @@ -1,5 +1,11 @@ 2012-08-13 Stefan Monnier + * color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000): + Prefer pcase-let over destructuring-bind. + * vc/diff-mode.el (diff-remove-trailing-whitespace): Same. + Also, remove whitespace as we go, rather than after accumulating the + various places. + * subr.el (internal--before-with-selected-window) (internal--after-with-selected-window): Fix typo seleted->selected. (with-selected-window): Adjust callers. === modified file 'lisp/color.el' --- lisp/color.el 2012-04-05 07:29:19 +0000 +++ lisp/color.el 2012-08-13 19:10:35 +0000 @@ -1,4 +1,4 @@ -;;; color.el --- Color manipulation library -*- coding: utf-8; -*- +;;; color.el --- Color manipulation library -*- coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2010-2012 Free Software Foundation, Inc. @@ -85,7 +85,7 @@ (g-step (/ (- (nth 1 stop) g) (1+ step-number))) (b-step (/ (- (nth 2 stop) b) (1+ step-number))) result) - (dotimes (n step-number) + (dotimes (_ step-number) (push (list (setq r (+ r r-step)) (setq g (+ g g-step)) (setq b (+ b b-step))) @@ -226,44 +226,44 @@ "Convert CIE XYZ to CIE L*a*b*. WHITE-POINT specifies the (X Y Z) white point for the conversion. If omitted or nil, use `color-d65-xyz'." - (destructuring-bind (Xr Yr Zr) (or white-point color-d65-xyz) - (let* ((xr (/ X Xr)) - (yr (/ Y Yr)) - (zr (/ Z Zr)) - (fx (if (> xr color-cie-ε) - (expt xr (/ 1 3.0)) - (/ (+ (* color-cie-κ xr) 16) 116.0))) - (fy (if (> yr color-cie-ε) - (expt yr (/ 1 3.0)) - (/ (+ (* color-cie-κ yr) 16) 116.0))) - (fz (if (> zr color-cie-ε) - (expt zr (/ 1 3.0)) - (/ (+ (* color-cie-κ zr) 16) 116.0)))) - (list - (- (* 116 fy) 16) ; L - (* 500 (- fx fy)) ; a - (* 200 (- fy fz)))))) ; b + (pcase-let* ((`(,Xr ,Yr ,Zr) (or white-point color-d65-xyz)) + (xr (/ X Xr)) + (yr (/ Y Yr)) + (zr (/ Z Zr)) + (fx (if (> xr color-cie-ε) + (expt xr (/ 1 3.0)) + (/ (+ (* color-cie-κ xr) 16) 116.0))) + (fy (if (> yr color-cie-ε) + (expt yr (/ 1 3.0)) + (/ (+ (* color-cie-κ yr) 16) 116.0))) + (fz (if (> zr color-cie-ε) + (expt zr (/ 1 3.0)) + (/ (+ (* color-cie-κ zr) 16) 116.0)))) + (list + (- (* 116 fy) 16) ; L + (* 500 (- fx fy)) ; a + (* 200 (- fy fz))))) ; b (defun color-lab-to-xyz (L a b &optional white-point) "Convert CIE L*a*b* to CIE XYZ. WHITE-POINT specifies the (X Y Z) white point for the conversion. If omitted or nil, use `color-d65-xyz'." - (destructuring-bind (Xr Yr Zr) (or white-point color-d65-xyz) - (let* ((fy (/ (+ L 16) 116.0)) - (fz (- fy (/ b 200.0))) - (fx (+ (/ a 500.0) fy)) - (xr (if (> (expt fx 3.0) color-cie-ε) - (expt fx 3.0) - (/ (- (* fx 116) 16) color-cie-κ))) - (yr (if (> L (* color-cie-κ color-cie-ε)) - (expt (/ (+ L 16) 116.0) 3.0) - (/ L color-cie-κ))) - (zr (if (> (expt fz 3) color-cie-ε) - (expt fz 3.0) - (/ (- (* 116 fz) 16) color-cie-κ)))) - (list (* xr Xr) ; X - (* yr Yr) ; Y - (* zr Zr))))) ; Z + (pcase-let* ((`(,Xr ,Yr ,Zr) (or white-point color-d65-xyz)) + (fy (/ (+ L 16) 116.0)) + (fz (- fy (/ b 200.0))) + (fx (+ (/ a 500.0) fy)) + (xr (if (> (expt fx 3.0) color-cie-ε) + (expt fx 3.0) + (/ (- (* fx 116) 16) color-cie-κ))) + (yr (if (> L (* color-cie-κ color-cie-ε)) + (expt (/ (+ L 16) 116.0) 3.0) + (/ L color-cie-κ))) + (zr (if (> (expt fz 3) color-cie-ε) + (expt fz 3.0) + (/ (- (* 116 fz) 16) color-cie-κ)))) + (list (* xr Xr) ; X + (* yr Yr) ; Y + (* zr Zr)))) ; Z (defun color-srgb-to-lab (red green blue) "Convert RGB to CIE L*a*b*." @@ -277,67 +277,72 @@ "Return the CIEDE2000 color distance between COLOR1 and COLOR2. Both COLOR1 and COLOR2 should be in CIE L*a*b* format, as returned by `color-srgb-to-lab' or `color-xyz-to-lab'." - (destructuring-bind (L₁ a₁ b₁) color1 - (destructuring-bind (L₂ a₂ b₂) color2 - (let* ((kL (or kL 1)) - (kC (or kC 1)) - (kH (or kH 1)) - (C₁ (sqrt (+ (expt a₁ 2.0) (expt b₁ 2.0)))) - (C₂ (sqrt (+ (expt a₂ 2.0) (expt b₂ 2.0)))) - (C̄ (/ (+ C₁ C₂) 2.0)) - (G (* 0.5 (- 1 (sqrt (/ (expt C̄ 7.0) (+ (expt C̄ 7.0) (expt 25 7.0))))))) - (a′₁ (* (+ 1 G) a₁)) - (a′₂ (* (+ 1 G) a₂)) - (C′₁ (sqrt (+ (expt a′₁ 2.0) (expt b₁ 2.0)))) - (C′₂ (sqrt (+ (expt a′₂ 2.0) (expt b₂ 2.0)))) - (h′₁ (if (and (= b₁ 0) (= a′₁ 0)) - 0 - (let ((v (atan b₁ a′₁))) - (if (< v 0) - (+ v (* 2 float-pi)) - v)))) - (h′₂ (if (and (= b₂ 0) (= a′₂ 0)) - 0 - (let ((v (atan b₂ a′₂))) - (if (< v 0) - (+ v (* 2 float-pi)) - v)))) - (ΔL′ (- L₂ L₁)) - (ΔC′ (- C′₂ C′₁)) - (Δh′ (cond ((= (* C′₁ C′₂) 0) - 0) - ((<= (abs (- h′₂ h′₁)) float-pi) - (- h′₂ h′₁)) - ((> (- h′₂ h′₁) float-pi) - (- (- h′₂ h′₁) (* 2 float-pi))) - ((< (- h′₂ h′₁) (- float-pi)) - (+ (- h′₂ h′₁) (* 2 float-pi))))) - (ΔH′ (* 2 (sqrt (* C′₁ C′₂)) (sin (/ Δh′ 2.0)))) - (L̄′ (/ (+ L₁ L₂) 2.0)) - (C̄′ (/ (+ C′₁ C′₂) 2.0)) - (h̄′ (cond ((= (* C′₁ C′₂) 0) - (+ h′₁ h′₂)) - ((<= (abs (- h′₁ h′₂)) float-pi) - (/ (+ h′₁ h′₂) 2.0)) - ((< (+ h′₁ h′₂) (* 2 float-pi)) - (/ (+ h′₁ h′₂ (* 2 float-pi)) 2.0)) - ((>= (+ h′₁ h′₂) (* 2 float-pi)) - (/ (+ h′₁ h′₂ (* -2 float-pi)) 2.0)))) - (T (+ 1 - (- (* 0.17 (cos (- h̄′ (degrees-to-radians 30))))) - (* 0.24 (cos (* h̄′ 2))) - (* 0.32 (cos (+ (* h̄′ 3) (degrees-to-radians 6)))) - (- (* 0.20 (cos (- (* h̄′ 4) (degrees-to-radians 63))))))) - (Δθ (* (degrees-to-radians 30) (exp (- (expt (/ (- h̄′ (degrees-to-radians 275)) (degrees-to-radians 25)) 2.0))))) - (Rc (* 2 (sqrt (/ (expt C̄′ 7.0) (+ (expt C̄′ 7.0) (expt 25.0 7.0)))))) - (Sl (+ 1 (/ (* 0.015 (expt (- L̄′ 50) 2.0)) (sqrt (+ 20 (expt (- L̄′ 50) 2.0)))))) - (Sc (+ 1 (* C̄′ 0.045))) - (Sh (+ 1 (* 0.015 C̄′ T))) - (Rt (- (* (sin (* Δθ 2)) Rc)))) + (pcase-let* + ((`(,L₁ ,a₁ ,b₁) color1) + (`(,L₂ ,a₂ ,b₂) color2) + (kL (or kL 1)) + (kC (or kC 1)) + (kH (or kH 1)) + (C₁ (sqrt (+ (expt a₁ 2.0) (expt b₁ 2.0)))) + (C₂ (sqrt (+ (expt a₂ 2.0) (expt b₂ 2.0)))) + (C̄ (/ (+ C₁ C₂) 2.0)) + (G (* 0.5 (- 1 (sqrt (/ (expt C̄ 7.0) + (+ (expt C̄ 7.0) (expt 25 7.0))))))) + (a′₁ (* (+ 1 G) a₁)) + (a′₂ (* (+ 1 G) a₂)) + (C′₁ (sqrt (+ (expt a′₁ 2.0) (expt b₁ 2.0)))) + (C′₂ (sqrt (+ (expt a′₂ 2.0) (expt b₂ 2.0)))) + (h′₁ (if (and (= b₁ 0) (= a′₁ 0)) + 0 + (let ((v (atan b₁ a′₁))) + (if (< v 0) + (+ v (* 2 float-pi)) + v)))) + (h′₂ (if (and (= b₂ 0) (= a′₂ 0)) + 0 + (let ((v (atan b₂ a′₂))) + (if (< v 0) + (+ v (* 2 float-pi)) + v)))) + (ΔL′ (- L₂ L₁)) + (ΔC′ (- C′₂ C′₁)) + (Δh′ (cond ((= (* C′₁ C′₂) 0) + 0) + ((<= (abs (- h′₂ h′₁)) float-pi) + (- h′₂ h′₁)) + ((> (- h′₂ h′₁) float-pi) + (- (- h′₂ h′₁) (* 2 float-pi))) + ((< (- h′₂ h′₁) (- float-pi)) + (+ (- h′₂ h′₁) (* 2 float-pi))))) + (ΔH′ (* 2 (sqrt (* C′₁ C′₂)) (sin (/ Δh′ 2.0)))) + (L̄′ (/ (+ L₁ L₂) 2.0)) + (C̄′ (/ (+ C′₁ C′₂) 2.0)) + (h̄′ (cond ((= (* C′₁ C′₂) 0) + (+ h′₁ h′₂)) + ((<= (abs (- h′₁ h′₂)) float-pi) + (/ (+ h′₁ h′₂) 2.0)) + ((< (+ h′₁ h′₂) (* 2 float-pi)) + (/ (+ h′₁ h′₂ (* 2 float-pi)) 2.0)) + ((>= (+ h′₁ h′₂) (* 2 float-pi)) + (/ (+ h′₁ h′₂ (* -2 float-pi)) 2.0)))) + (T (+ 1 + (- (* 0.17 (cos (- h̄′ (degrees-to-radians 30))))) + (* 0.24 (cos (* h̄′ 2))) + (* 0.32 (cos (+ (* h̄′ 3) (degrees-to-radians 6)))) + (- (* 0.20 (cos (- (* h̄′ 4) (degrees-to-radians 63))))))) + (Δθ (* (degrees-to-radians 30) + (exp (- (expt (/ (- h̄′ (degrees-to-radians 275)) + (degrees-to-radians 25)) 2.0))))) + (Rc (* 2 (sqrt (/ (expt C̄′ 7.0) (+ (expt C̄′ 7.0) (expt 25.0 7.0)))))) + (Sl (+ 1 (/ (* 0.015 (expt (- L̄′ 50) 2.0)) + (sqrt (+ 20 (expt (- L̄′ 50) 2.0)))))) + (Sc (+ 1 (* C̄′ 0.045))) + (Sh (+ 1 (* 0.015 C̄′ T))) + (Rt (- (* (sin (* Δθ 2)) Rc)))) (sqrt (+ (expt (/ ΔL′ (* Sl kL)) 2.0) (expt (/ ΔC′ (* Sc kC)) 2.0) (expt (/ ΔH′ (* Sh kH)) 2.0) - (* Rt (/ ΔC′ (* Sc kC)) (/ ΔH′ (* Sh kH))))))))) + (* Rt (/ ΔC′ (* Sc kC)) (/ ΔH′ (* Sh kH))))))) (defun color-clamp (value) "Make sure VALUE is a number between 0.0 and 1.0 inclusive." === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-08-08 04:41:35 +0000 +++ lisp/vc/diff-mode.el 2012-08-13 19:10:35 +0000 @@ -2024,37 +2024,26 @@ file referenced on the diff has no buffer and needs to be fixed, a buffer visiting that file is created." (interactive) - (goto-char (point-min)) - (let - ;; We assume that the diff header has no trailing whitespace. - ((modified-buffers nil) - (white-positions nil)) - (while (re-search-forward "^[+!>].*[ \t]+$" (point-max) t) - (save-excursion - (cl-destructuring-bind (buf line-offset pos src _dst &optional _switched) - (diff-find-source-location t t) - (when line-offset - (set-buffer buf) - (save-excursion - (goto-char (+ (car pos) (cdr src))) - (beginning-of-line) - (when (re-search-forward "\\([ \t]+\\)$" (line-end-position) t) - (when (not (member buf modified-buffers)) - (push buf modified-buffers)) - (goto-char (match-end 0)) - (push (point-marker) white-positions) - (goto-char (match-beginning 0)) - (push (point-marker) white-positions) - (push buf white-positions))))))) - (while white-positions - (save-excursion - (set-buffer (pop white-positions)) - (delete-region (pop white-positions) (pop white-positions)))) + ;; We assume that the diff header has no trailing whitespace. + (let ((modified-buffers nil)) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "^[+!>].*[ \t]+$" (point-max) t) + (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,_switched) + (diff-find-source-location t t))) + (when line-offset + (with-current-buffer buf + (save-excursion + (goto-char (+ (car pos) (cdr src))) + (beginning-of-line) + (when (re-search-forward "\\([ \t]+\\)$" (line-end-position) t) + (unless (memq buf modified-buffers) + (push buf modified-buffers)) + (replace-match "")))))))) (if modified-buffers - (let ((msg "Deleted new trailing whitespace from:")) - (dolist (f modified-buffers) - (setq msg (concat msg " `" (buffer-name f) "'"))) - (message "%s" msg)) + (message "Deleted new trailing whitespace from: %s" + (mapconcat (lambda (buf) (concat "`" (buffer-name buf) "'")) + modified-buffers " ")) (message "No trailing whitespace fixes needed.")))) ;; provide the package ------------------------------------------------------------ revno: 109584 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-13 10:12:47 -0400 message: * lisp/subr.el (internal--before-with-selected-window) (internal--after-with-selected-window): Fix typo seleted->selected. (with-selected-window): Adjust callers. Reported by Dmitry Gutov . diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-10 16:02:48 +0000 +++ etc/NEWS 2012-08-13 14:12:47 +0000 @@ -200,18 +200,32 @@ `term-color-', `term-color-underline' and `term-color-bold' faces. -** CL's main entry is now (require 'cl-lib). +** CL +*** CL's main entry is now (require 'cl-lib). `cl-lib' is like the old `cl' except that it uses the namespace cleanly, -i.e. all its definitions have the "cl-" prefix. +i.e. all its definitions have the "cl-" prefix (and internal definitions use +the "cl--" prefix). If `cl' provided a feature under the name `foo', then `cl-lib' provides it under the name `cl-foo' instead, with the exceptions of the few definitions that had to use `foo*' to avoid conflicts with pre-existing Elisp entities, which have not been renamed to `cl-foo*' but just `cl-foo'. -The old `cl' is now deprecated and is nothing more than a bunch of aliases that +The old `cl' is now deprecated and is just a bunch of aliases that provide the old non-prefixed names. +*** `cl-flet' is not like `flet' (which is deprecated). +Instead it obeys the behavior of Common-Lisp's `flet'. + +*** `cl-labels' is slightly different from `labels'. +The difference is that it relies on the `lexical-binding' machinery (as opposed +to the `lexical-let' machinery used previously) to capture definitions in +closures, so such closures will only work if `lexical-binding' is in use. + +*** `progv' was rewritten to use the `let' machinery. +A side effect is that vars without corresponding value are bound to nil +rather than making them unbound. + ** Desktop *** `desktop-path' no longer includes the "." directory. Desktop === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 14:05:24 +0000 +++ lisp/ChangeLog 2012-08-13 14:12:47 +0000 @@ -1,3 +1,10 @@ +2012-08-13 Stefan Monnier + + * subr.el (internal--before-with-selected-window) + (internal--after-with-selected-window): Fix typo seleted->selected. + (with-selected-window): Adjust callers. + Reported by Dmitry Gutov . + 2012-08-13 Bastien Guerry * window.el (special-display-popup-frame): Small docstring === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-13 07:25:30 +0000 +++ lisp/subr.el 2012-08-13 14:12:47 +0000 @@ -3023,7 +3023,7 @@ (set-buffer ,buffer-or-name) ,@body)) -(defun internal--before-with-seleted-window (window) +(defun internal--before-with-selected-window (window) (let ((other-frame (window-frame window))) (list window (selected-window) ;; Selecting a window on another frame also changes that @@ -3034,7 +3034,7 @@ (unless (eq (selected-frame) other-frame) (tty-top-frame other-frame))))) -(defun internal--after-with-seleted-window (state) +(defun internal--after-with-selected-window (state) ;; First reset frame-selected-window. (when (window-live-p (nth 2 state)) ;; We don't use set-frame-selected-window because it does not @@ -3065,12 +3065,12 @@ the buffer list ordering." (declare (indent 1) (debug t)) `(let ((save-selected-window--state - (internal--before-with-seleted-window ,window))) + (internal--before-with-selected-window ,window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) ,@body) - (internal--after-with-seleted-window save-selected-window--state))))) + (internal--after-with-selected-window save-selected-window--state))))) (defmacro with-selected-frame (frame &rest body) "Execute the forms in BODY with FRAME as the selected frame. ------------------------------------------------------------ revno: 109583 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2012-08-13 16:05:24 +0200 message: window.el: Minor dosctring enhancement (Bug#12172). * window.el (special-display-popup-frame): Minor docstring enhancement. (Bug#12172) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 10:34:25 +0000 +++ lisp/ChangeLog 2012-08-13 14:05:24 +0000 @@ -1,3 +1,8 @@ +2012-08-13 Bastien Guerry + + * window.el (special-display-popup-frame): Small docstring + enhancement. (Bug#12172) + 2012-08-13 Andreas Schwab * tar-mode.el (tar-header-data-end): Only ignore size for files of === modified file 'lisp/window.el' --- lisp/window.el 2012-08-06 05:33:39 +0000 +++ lisp/window.el 2012-08-13 14:05:24 +0000 @@ -4238,7 +4238,7 @@ :group 'frames) (defun special-display-popup-frame (buffer &optional args) - "Display BUFFER and return the window chosen. + "Pop up a frame displaying BUFFER and return its window. If BUFFER is already displayed in a visible or iconified frame, raise that frame. Otherwise, display BUFFER in a new frame. ------------------------------------------------------------ revno: 109582 committer: Andreas Schwab branch nick: emacs timestamp: Mon 2012-08-13 12:34:25 +0200 message: * tar-mode.el (tar-header-data-end): Only ignore size for files of type 1-6. (tar-header-block-summarize, tar-get-descriptor): Handle pax extended headers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 07:37:05 +0000 +++ lisp/ChangeLog 2012-08-13 10:34:25 +0000 @@ -1,5 +1,10 @@ 2012-08-13 Andreas Schwab + * tar-mode.el (tar-header-data-end): Only ignore size for files of + type 1-6. + (tar-header-block-summarize, tar-get-descriptor): Handle pax + extended headers. + * files.el (hack-local-variables-filter): Remove useless eval. 2012-08-13 Martin Rudalics === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2012-07-11 23:13:41 +0000 +++ lisp/tar-mode.el 2012-08-13 10:34:25 +0000 @@ -325,13 +325,10 @@ (defun tar-header-data-end (descriptor) (let* ((data-start (tar-header-data-start descriptor)) (link-type (tar-header-link-type descriptor)) - (size (tar-header-size descriptor)) - (fudge (cond - ;; Foo. There's an extra empty block after these. - ((memq link-type '(20 55)) 512) - (t 0)))) - (+ data-start fudge - (if (and (null link-type) (> size 0)) + (size (tar-header-size descriptor))) + (+ data-start + ;; Ignore size for files of type 1-6 + (if (and (not (memq link-type '(1 2 3 4 5 6))) (> size 0)) (tar-roundup-512 size) 0)))) @@ -445,7 +442,8 @@ ((eq type 29) ?M) ; multivolume continuation ((eq type 35) ?S) ; sparse ((eq type 38) ?V) ; volume header - ((eq type 55) ?H) ; extended pax header + ((eq type 55) ?H) ; pax global extended header + ((eq type 72) ?X) ; pax extended header (t ?\s) ) (tar-grind-file-mode mode) @@ -751,7 +749,8 @@ ((eq link-p 29) "a multivolume-continuation") ((eq link-p 35) "a sparse entry") ((eq link-p 38) "a volume header") - ((eq link-p 55) "an extended pax header") + ((eq link-p 55) "a pax global extended header") + ((eq link-p 72) "a pax extended header") (t "a link")))) (if (zerop size) (message "This is a zero-length file")) descriptor)) ------------------------------------------------------------ revno: 109581 committer: Andreas Schwab branch nick: emacs timestamp: Mon 2012-08-13 09:37:05 +0200 message: * files.el (hack-local-variables-filter): Remove useless eval. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-13 07:25:30 +0000 +++ lisp/ChangeLog 2012-08-13 07:37:05 +0000 @@ -1,3 +1,7 @@ +2012-08-13 Andreas Schwab + + * files.el (hack-local-variables-filter): Remove useless eval. + 2012-08-13 Martin Rudalics * subr.el (with-selected-window): Fix last change. @@ -6,7 +10,8 @@ * subr.el (internal--before-with-seleted-window) (internal--after-with-seleted-window): New functions. - (with-selected-window): Use them, to replace dependency on tty-top-frame. + (with-selected-window): Use them, to replace dependency on + tty-top-frame. 2012-08-12 Nobuyoshi Nakada === modified file 'lisp/files.el' --- lisp/files.el 2012-08-11 02:12:12 +0000 +++ lisp/files.el 2012-08-13 07:37:05 +0000 @@ -3102,8 +3102,7 @@ ;; Obey `enable-local-eval'. ((eq var 'eval) (when enable-local-eval - (let ((safe (or (hack-one-local-variable-eval-safep - (eval (quote val))) + (let ((safe (or (hack-one-local-variable-eval-safep val) ;; In case previously marked safe (bug#5636). (safe-local-variable-p var val)))) ;; If not safe and e-l-v = :safe, ignore totally. ------------------------------------------------------------ revno: 109580 committer: martin rudalics branch nick: trunk timestamp: Mon 2012-08-13 09:25:30 +0200 message: Fix last change to with-selected-window. * subr.el (with-selected-window): Fix last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-12 22:52:33 +0000 +++ lisp/ChangeLog 2012-08-13 07:25:30 +0000 @@ -1,3 +1,7 @@ +2012-08-13 Martin Rudalics + + * subr.el (with-selected-window): Fix last change. + 2012-08-12 Stefan Monnier * subr.el (internal--before-with-seleted-window) === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-12 22:52:33 +0000 +++ lisp/subr.el 2012-08-13 07:25:30 +0000 @@ -3070,7 +3070,7 @@ (unwind-protect (progn (select-window (car save-selected-window--state) 'norecord) ,@body) - (internal--before-with-seleted-window save-selected-window--state))))) + (internal--after-with-seleted-window save-selected-window--state))))) (defmacro with-selected-frame (frame &rest body) "Execute the forms in BODY with FRAME as the selected frame. ------------------------------------------------------------ revno: 109579 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-13 07:44:27 +0400 message: Use KSET for write access to Lisp_Object members of struct kboard. * keyboard.h (KSET): New macro. * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c: * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c: * xterm.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-13 03:39:07 +0000 +++ src/ChangeLog 2012-08-13 03:44:27 +0000 @@ -1,5 +1,13 @@ 2012-08-13 Dmitry Antipov + Use KSET for write access to Lisp_Object members of struct kboard. + * keyboard.h (KSET): New macro. + * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c: + * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c: + * xterm.c: Adjust users. + +2012-08-13 Dmitry Antipov + Use BSET for write access to Lisp_Object members of struct buffer. * buffer.h (BSET): New macro. * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c: === modified file 'src/callint.c' --- src/callint.c 2012-08-05 15:47:28 +0000 +++ src/callint.c 2012-08-13 03:44:27 +0000 @@ -372,7 +372,7 @@ Vthis_command = save_this_command; Vthis_original_command = save_this_original_command; Vreal_this_command = save_real_this_command; - KVAR (current_kboard, Vlast_command) = save_last_command; + KSET (current_kboard, Vlast_command, save_last_command); temporarily_switch_to_single_kboard (NULL); return unbind_to (speccount, apply1 (function, specs)); @@ -843,7 +843,7 @@ Vthis_command = save_this_command; Vthis_original_command = save_this_original_command; Vreal_this_command = save_real_this_command; - KVAR (current_kboard, Vlast_command) = save_last_command; + KSET (current_kboard, Vlast_command, save_last_command); { Lisp_Object val; === modified file 'src/category.c' --- src/category.c 2012-08-02 07:31:34 +0000 +++ src/category.c 2012-08-13 03:44:27 +0000 @@ -285,7 +285,7 @@ { int idx; table = check_category_table (table); - BVAR (current_buffer, category_table) = table; + BSET (current_buffer, category_table, table); /* Indicate that this buffer now has a specified category table. */ idx = PER_BUFFER_VAR_IDX (category_table); SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); === modified file 'src/frame.c' --- src/frame.c 2012-08-13 03:39:07 +0000 +++ src/frame.c 2012-08-13 03:44:27 +0000 @@ -393,8 +393,8 @@ XSETFRAME (frame_dummy, f); GCPRO1 (frame_dummy); /* If there's no minibuffer frame to use, create one. */ - KVAR (kb, Vdefault_minibuffer_frame) = - call1 (intern ("make-initial-minibuffer-frame"), display); + KSET (kb, Vdefault_minibuffer_frame, + call1 (intern ("make-initial-minibuffer-frame"), display)); UNGCPRO; } @@ -843,7 +843,7 @@ (Lisp_Object event) { /* Preserve prefix arg that the command loop just cleared. */ - KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg; + KSET (current_kboard, Vprefix_arg, Vcurrent_prefix_arg); Frun_hooks (1, &Qmouse_leave_buffer_hook); return do_switch_frame (event, 0, 0, Qnil); } @@ -1435,11 +1435,11 @@ if (NILP (frame_with_minibuf)) abort (); - KVAR (kb, Vdefault_minibuffer_frame) = frame_with_minibuf; + KSET (kb, Vdefault_minibuffer_frame, frame_with_minibuf); } else /* No frames left on this kboard--say no minibuffer either. */ - KVAR (kb, Vdefault_minibuffer_frame) = Qnil; + KSET (kb, Vdefault_minibuffer_frame, Qnil); } /* Cause frame titles to update--necessary if we now have just one frame. */ === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-08 15:53:52 +0000 +++ src/keyboard.c 2012-08-13 03:44:27 +0000 @@ -551,8 +551,8 @@ else if (STRINGP (echo_string)) echo_string = concat2 (echo_string, build_string (" ")); - KVAR (current_kboard, echo_string) - = concat2 (echo_string, make_string (buffer, ptr - buffer)); + KSET (current_kboard, echo_string, + concat2 (echo_string, make_string (buffer, ptr - buffer))); echo_now (); } @@ -597,8 +597,8 @@ /* Put a dash at the end of the buffer temporarily, but make it go away when the next character is added. */ - KVAR (current_kboard, echo_string) = concat2 (KVAR (current_kboard, echo_string), - build_string ("-")); + KSET (current_kboard, echo_string, + concat2 (KVAR (current_kboard, echo_string), build_string ("-"))); echo_now (); } @@ -660,7 +660,7 @@ { current_kboard->immediate_echo = 0; current_kboard->echo_after_prompt = -1; - KVAR (current_kboard, echo_string) = Qnil; + KSET (current_kboard, echo_string, Qnil); ok_to_echo_at_next_pause = NULL; echo_kboard = NULL; echo_message_buffer = Qnil; @@ -684,9 +684,9 @@ echo_truncate (ptrdiff_t nchars) { if (STRINGP (KVAR (current_kboard, echo_string))) - KVAR (current_kboard, echo_string) - = Fsubstring (KVAR (current_kboard, echo_string), - make_number (0), make_number (nchars)); + KSET (current_kboard, echo_string, + Fsubstring (KVAR (current_kboard, echo_string), + make_number (0), make_number (nchars))); truncate_echo_area (nchars); } @@ -1016,8 +1016,8 @@ Vstandard_input = Qt; Vexecuting_kbd_macro = Qnil; executing_kbd_macro = Qnil; - KVAR (current_kboard, Vprefix_arg) = Qnil; - KVAR (current_kboard, Vlast_prefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); + KSET (current_kboard, Vlast_prefix_arg, Qnil); cancel_echoing (); /* Avoid unquittable loop if data contains a circular list. */ @@ -1338,8 +1338,8 @@ #endif int already_adjusted = 0; - KVAR (current_kboard, Vprefix_arg) = Qnil; - KVAR (current_kboard, Vlast_prefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); + KSET (current_kboard, Vlast_prefix_arg, Qnil); Vdeactivate_mark = Qnil; waiting_for_input = 0; cancel_echoing (); @@ -1371,10 +1371,10 @@ } /* Do this after running Vpost_command_hook, for consistency. */ - KVAR (current_kboard, Vlast_command) = Vthis_command; - KVAR (current_kboard, Vreal_last_command) = Vreal_this_command; + KSET (current_kboard, Vlast_command, Vthis_command); + KSET (current_kboard, Vreal_last_command, Vreal_this_command); if (!CONSP (last_command_event)) - KVAR (current_kboard, Vlast_repeatable_command) = Vreal_this_command; + KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command); while (1) { @@ -1537,7 +1537,7 @@ keys = Fkey_description (keys, Qnil); bitch_at_user (); message_with_string ("%s is undefined", keys, 0); - KVAR (current_kboard, defining_kbd_macro) = Qnil; + KSET (current_kboard, defining_kbd_macro, Qnil); update_mode_lines = 1; /* If this is a down-mouse event, don't reset prefix-arg; pass it to the command run by the up event. */ @@ -1547,10 +1547,10 @@ = parse_modifiers (EVENT_HEAD (last_command_event)); int modifiers = XINT (XCAR (XCDR (breakdown))); if (!(modifiers & down_modifier)) - KVAR (current_kboard, Vprefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); } else - KVAR (current_kboard, Vprefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); } else { @@ -1587,7 +1587,7 @@ unbind_to (scount, Qnil); #endif } - KVAR (current_kboard, Vlast_prefix_arg) = Vcurrent_prefix_arg; + KSET (current_kboard, Vlast_prefix_arg, Vcurrent_prefix_arg); safe_run_hooks (Qpost_command_hook); @@ -1618,11 +1618,10 @@ if (NILP (KVAR (current_kboard, Vprefix_arg)) || CONSP (last_command_event)) { - KVAR (current_kboard, Vlast_command) = Vthis_command; - KVAR (current_kboard, Vreal_last_command) = Vreal_this_command; + KSET (current_kboard, Vlast_command, Vthis_command); + KSET (current_kboard, Vreal_last_command, Vreal_this_command); if (!CONSP (last_command_event)) - KVAR (current_kboard, Vlast_repeatable_command) - = Vreal_this_command; + KSET (current_kboard, Vlast_repeatable_command, Vreal_this_command); cancel_echoing (); this_command_key_count = 0; this_command_key_count_reset = 0; @@ -2565,7 +2564,7 @@ abort (); } if (!CONSP (last)) - KVAR (kb, kbd_queue) = Fcons (c, Qnil); + KSET (kb, kbd_queue, Fcons (c, Qnil)); else XSETCDR (last, Fcons (c, Qnil)); kb->kbd_queue_has_data = 1; @@ -2737,8 +2736,8 @@ if (!CONSP (KVAR (current_kboard, kbd_queue))) abort (); c = XCAR (KVAR (current_kboard, kbd_queue)); - KVAR (current_kboard, kbd_queue) - = XCDR (KVAR (current_kboard, kbd_queue)); + KSET (current_kboard, kbd_queue, + XCDR (KVAR (current_kboard, kbd_queue))); if (NILP (KVAR (current_kboard, kbd_queue))) current_kboard->kbd_queue_has_data = 0; input_pending = readable_events (0); @@ -2805,7 +2804,7 @@ abort (); } if (!CONSP (last)) - KVAR (kb, kbd_queue) = Fcons (c, Qnil); + KSET (kb, kbd_queue, Fcons (c, Qnil)); else XSETCDR (last, Fcons (c, Qnil)); kb->kbd_queue_has_data = 1; @@ -3063,7 +3062,7 @@ cancel_echoing (); ok_to_echo_at_next_pause = saved_ok_to_echo; - KVAR (current_kboard, echo_string) = saved_echo_string; + KSET (current_kboard, echo_string, saved_echo_string); current_kboard->echo_after_prompt = saved_echo_after_prompt; if (saved_immediate_echo) echo_now (); @@ -3534,9 +3533,9 @@ if (single_kboard && kb != current_kboard) { - KVAR (kb, kbd_queue) - = Fcons (make_lispy_switch_frame (event->frame_or_window), - Fcons (make_number (c), Qnil)); + KSET (kb, kbd_queue, + Fcons (make_lispy_switch_frame (event->frame_or_window), + Fcons (make_number (c), Qnil))); kb->kbd_queue_has_data = 1; for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) { @@ -5408,7 +5407,7 @@ /* We need to use an alist rather than a vector as the cache since we can't make a vector long enough. */ if (NILP (KVAR (current_kboard, system_key_syms))) - KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil); + KSET (current_kboard, system_key_syms, Fcons (Qnil, Qnil)); return modify_event_symbol (event->code, event->modifiers, Qfunction_key, @@ -8729,11 +8728,11 @@ is not used on replay. */ orig_defn_macro = KVAR (current_kboard, defining_kbd_macro); - KVAR (current_kboard, defining_kbd_macro) = Qnil; + KSET (current_kboard, defining_kbd_macro, Qnil); do obj = read_char (commandflag, 0, 0, Qt, 0, NULL); while (BUFFERP (obj)); - KVAR (current_kboard, defining_kbd_macro) = orig_defn_macro; + KSET (current_kboard, defining_kbd_macro, orig_defn_macro); if (!INTEGERP (obj)) return obj; @@ -9089,7 +9088,7 @@ /* Install the string STR as the beginning of the string of echoing, so that it serves as a prompt for the next character. */ - KVAR (current_kboard, echo_string) = prompt; + KSET (current_kboard, echo_string, prompt); current_kboard->echo_after_prompt = SCHARS (prompt); echo_now (); } @@ -9335,15 +9334,15 @@ if (!NILP (delayed_switch_frame)) { - KVAR (interrupted_kboard, kbd_queue) - = Fcons (delayed_switch_frame, - KVAR (interrupted_kboard, kbd_queue)); + KSET (interrupted_kboard, kbd_queue, + Fcons (delayed_switch_frame, + KVAR (interrupted_kboard, kbd_queue))); delayed_switch_frame = Qnil; } while (t > 0) - KVAR (interrupted_kboard, kbd_queue) - = Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue)); + KSET (interrupted_kboard, kbd_queue, + Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue))); /* If the side queue is non-empty, ensure it begins with a switch-frame, so we'll replay it in the right context. */ @@ -9355,9 +9354,9 @@ { Lisp_Object frame; XSETFRAME (frame, interrupted_frame); - KVAR (interrupted_kboard, kbd_queue) - = Fcons (make_lispy_switch_frame (frame), - KVAR (interrupted_kboard, kbd_queue)); + KSET (interrupted_kboard, kbd_queue, + Fcons (make_lispy_switch_frame (frame), + KVAR (interrupted_kboard, kbd_queue))); } mock_input = 0; orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); @@ -10251,7 +10250,7 @@ { prefixarg = KVAR (current_kboard, Vprefix_arg); Vcurrent_prefix_arg = prefixarg; - KVAR (current_kboard, Vprefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); } else prefixarg = Qnil; @@ -11249,30 +11248,30 @@ void init_kboard (KBOARD *kb) { - KVAR (kb, Voverriding_terminal_local_map) = Qnil; - KVAR (kb, Vlast_command) = Qnil; - KVAR (kb, Vreal_last_command) = Qnil; - KVAR (kb, Vkeyboard_translate_table) = Qnil; - KVAR (kb, Vlast_repeatable_command) = Qnil; - KVAR (kb, Vprefix_arg) = Qnil; - KVAR (kb, Vlast_prefix_arg) = Qnil; - KVAR (kb, kbd_queue) = Qnil; + KSET (kb, Voverriding_terminal_local_map, Qnil); + KSET (kb, Vlast_command, Qnil); + KSET (kb, Vreal_last_command, Qnil); + KSET (kb, Vkeyboard_translate_table, Qnil); + KSET (kb, Vlast_repeatable_command, Qnil); + KSET (kb, Vprefix_arg, Qnil); + KSET (kb, Vlast_prefix_arg, Qnil); + KSET (kb, kbd_queue, Qnil); kb->kbd_queue_has_data = 0; kb->immediate_echo = 0; - KVAR (kb, echo_string) = Qnil; + KSET (kb, echo_string, Qnil); kb->echo_after_prompt = -1; kb->kbd_macro_buffer = 0; kb->kbd_macro_bufsize = 0; - KVAR (kb, defining_kbd_macro) = Qnil; - KVAR (kb, Vlast_kbd_macro) = Qnil; + KSET (kb, defining_kbd_macro, Qnil); + KSET (kb, Vlast_kbd_macro, Qnil); kb->reference_count = 0; - KVAR (kb, Vsystem_key_alist) = Qnil; - KVAR (kb, system_key_syms) = Qnil; - KVAR (kb, Vwindow_system) = Qt; /* Unset. */ - KVAR (kb, Vinput_decode_map) = Fmake_sparse_keymap (Qnil); - KVAR (kb, Vlocal_function_key_map) = Fmake_sparse_keymap (Qnil); + KSET (kb, Vsystem_key_alist, Qnil); + KSET (kb, system_key_syms, Qnil); + KSET (kb, Vwindow_system, Qt); /* Unset. */ + KSET (kb, Vinput_decode_map, Fmake_sparse_keymap (Qnil)); + KSET (kb, Vlocal_function_key_map, Fmake_sparse_keymap (Qnil)); Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map); - KVAR (kb, Vdefault_minibuffer_frame) = Qnil; + KSET (kb, Vdefault_minibuffer_frame, Qnil); } /* @@ -11348,7 +11347,7 @@ init_kboard (current_kboard); /* A value of nil for Vwindow_system normally means a tty, but we also use it for the initial terminal since there is no window system there. */ - KVAR (current_kboard, Vwindow_system) = Qnil; + KSET (current_kboard, Vwindow_system, Qnil); if (!noninteractive) { === modified file 'src/keyboard.h' --- src/keyboard.h 2012-07-31 12:36:19 +0000 +++ src/keyboard.h 2012-08-13 03:44:27 +0000 @@ -22,6 +22,7 @@ /* Most code should use this macro to access Lisp fields in struct kboard. */ #define KVAR(kboard, field) ((kboard)->INTERNAL_FIELD (field)) +#define KSET(kboard, field, value) ((kboard)->INTERNAL_FIELD (field) = (value)) /* Each KBOARD represents one logical input stream from which Emacs gets input. If we are using ordinary terminals, it has one KBOARD === modified file 'src/macros.c' --- src/macros.c 2012-08-05 15:47:28 +0000 +++ src/macros.c 2012-08-13 03:44:27 +0000 @@ -127,7 +127,7 @@ message ("Appending to kbd macro..."); } - KVAR (current_kboard, defining_kbd_macro) = Qt; + KSET (current_kboard, defining_kbd_macro, Qt); return Qnil; } @@ -137,12 +137,12 @@ void end_kbd_macro (void) { - KVAR (current_kboard, defining_kbd_macro) = Qnil; + KSET (current_kboard, defining_kbd_macro, Qnil); update_mode_lines++; - KVAR (current_kboard, Vlast_kbd_macro) - = make_event_array ((current_kboard->kbd_macro_end - - current_kboard->kbd_macro_buffer), - current_kboard->kbd_macro_buffer); + KSET (current_kboard, Vlast_kbd_macro, + make_event_array ((current_kboard->kbd_macro_end + - current_kboard->kbd_macro_buffer), + current_kboard->kbd_macro_buffer)); } DEFUN ("end-kbd-macro", Fend_kbd_macro, Send_kbd_macro, 0, 2, "p", @@ -330,7 +330,7 @@ executing_kbd_macro = final; executing_kbd_macro_index = 0; - KVAR (current_kboard, Vprefix_arg) = Qnil; + KSET (current_kboard, Vprefix_arg, Qnil); if (!NILP (loopfunc)) { === modified file 'src/msdos.c' --- src/msdos.c 2012-08-07 07:33:18 +0000 +++ src/msdos.c 2012-08-13 03:44:27 +0000 @@ -1801,7 +1801,7 @@ } tty = FRAME_TTY (sf); - KVAR (current_kboard, Vwindow_system) = Qpc; + KSET (current_kboard, Vwindow_system, Qpc); sf->output_method = output_msdos_raw; if (init_needed) { === modified file 'src/nsfns.m' --- src/nsfns.m 2012-08-10 09:24:03 +0000 +++ src/nsfns.m 2012-08-13 03:44:27 +0000 @@ -1391,7 +1391,7 @@ if (FRAME_HAS_MINIBUF_P (f) && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) - KVAR (kb, Vdefault_minibuffer_frame) = frame; + KSET (kb, Vdefault_minibuffer_frame, frame); /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-11 09:10:08 +0000 +++ src/nsterm.m 2012-08-13 03:44:27 +0000 @@ -4051,7 +4051,7 @@ terminal->kboard = xmalloc (sizeof *terminal->kboard); init_kboard (terminal->kboard); - KVAR (terminal->kboard, Vwindow_system) = Qns; + KSET (terminal->kboard, Vwindow_system, Qns); terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; /* Don't let the initial kboard remain current longer than necessary. === modified file 'src/term.c' --- src/term.c 2012-08-07 05:29:25 +0000 +++ src/term.c 2012-08-13 03:44:27 +0000 @@ -1333,7 +1333,7 @@ /* This can happen if CANNOT_DUMP or with strange options. */ if (!KEYMAPP (KVAR (kboard, Vinput_decode_map))) - KVAR (kboard, Vinput_decode_map) = Fmake_sparse_keymap (Qnil); + KSET (kboard, Vinput_decode_map, Fmake_sparse_keymap (Qnil)); for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) { @@ -3281,7 +3281,7 @@ terminal->kboard = xmalloc (sizeof *terminal->kboard); init_kboard (terminal->kboard); - KVAR (terminal->kboard, Vwindow_system) = Qnil; + KSET (terminal->kboard, Vwindow_system, Qnil); terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; terminal->kboard->reference_count++; === modified file 'src/w32fns.c' --- src/w32fns.c 2012-08-13 03:39:07 +0000 +++ src/w32fns.c 2012-08-13 03:44:27 +0000 @@ -4381,7 +4381,7 @@ if (FRAME_HAS_MINIBUF_P (f) && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) - KVAR (kb, Vdefault_minibuffer_frame) = frame; + KSET (kb, Vdefault_minibuffer_frame, frame); /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ === modified file 'src/w32term.c' --- src/w32term.c 2012-08-08 19:53:44 +0000 +++ src/w32term.c 2012-08-13 03:44:27 +0000 @@ -6232,7 +6232,7 @@ terminal like X does. */ terminal->kboard = xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); - KVAR (terminal->kboard, Vwindow_system) = intern ("w32"); + KSET (terminal->kboard, Vwindow_system, intern ("w32")); terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; /* Don't let the initial kboard remain current longer than necessary. === modified file 'src/xfns.c' --- src/xfns.c 2012-08-13 03:39:07 +0000 +++ src/xfns.c 2012-08-13 03:44:27 +0000 @@ -3461,7 +3461,7 @@ if (FRAME_HAS_MINIBUF_P (f) && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame)) || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))) - KVAR (kb, Vdefault_minibuffer_frame) = frame; + KSET (kb, Vdefault_minibuffer_frame, frame); /* All remaining specified parameters, which have not been "used" by x_get_arg and friends, now go in the misc. alist of the frame. */ === modified file 'src/xterm.c' --- src/xterm.c 2012-08-07 13:37:21 +0000 +++ src/xterm.c 2012-08-13 03:44:27 +0000 @@ -7835,7 +7835,7 @@ { /* Set this to t so that delete_frame won't get confused trying to find a replacement. */ - KVAR (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame) = Qt; + KSET (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame, Qt); delete_frame (frame, Qnoelisp); } @@ -10115,7 +10115,7 @@ { terminal->kboard = xmalloc (sizeof *terminal->kboard); init_kboard (terminal->kboard); - KVAR (terminal->kboard, Vwindow_system) = Qx; + KSET (terminal->kboard, Vwindow_system, Qx); /* Add the keyboard to the list before running Lisp code (via Qvendor_specific_keysyms below), since these are not traced @@ -10137,9 +10137,9 @@ /* Temporarily hide the partially initialized terminal. */ terminal_list = terminal->next_terminal; UNBLOCK_INPUT; - KVAR (terminal->kboard, Vsystem_key_alist) - = call1 (Qvendor_specific_keysyms, - vendor ? build_string (vendor) : empty_unibyte_string); + KSET (terminal->kboard, Vsystem_key_alist, + call1 (Qvendor_specific_keysyms, + vendor ? build_string (vendor) : empty_unibyte_string)); BLOCK_INPUT; terminal->next_terminal = terminal_list; terminal_list = terminal;