------------------------------------------------------------ revno: 117033 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2014-04-30 04:21:08 +0000 message: lisp/gnus/gnus-art.el (gnus-mm-display-part): Fix previous commit diff: === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-04-30 04:05:27 +0000 +++ lisp/gnus/gnus-art.el 2014-04-30 04:21:08 +0000 @@ -5679,7 +5679,11 @@ (delete-region (previous-single-property-change end 'gnus-data) end)) (gnus-insert-mime-button handle id (list (mm-handle-displayed-p handle))) - (delete-char -1) + (let ((pt (point))) + (if (search-backward "\n\n" nil t) + (goto-char pt) + ;; We're in the article header. + (delete-char -1))) (goto-char point)) retval)) ------------------------------------------------------------ revno: 117032 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2014-04-30 04:05:27 +0000 message: lisp/gnus/gnus-art.el (gnus-mm-display-part): Bugfix for the 2014-03-23 change diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-04-27 22:08:43 +0000 +++ lisp/gnus/ChangeLog 2014-04-30 04:05:27 +0000 @@ -1,3 +1,8 @@ +2014-04-30 Katsumi Yamaoka + + * gnus-art.el (gnus-mm-display-part): Don't move point while toggling + a part; redisplay a button (enbugged in 2014-02-05). + 2014-04-27 Teodor Zlatanov * auth-source.el (auth-source-search, auth-source-search-backends): === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-04-28 06:30:39 +0000 +++ lisp/gnus/gnus-art.el 2014-04-30 04:05:27 +0000 @@ -5635,43 +5635,53 @@ "Display HANDLE and fix MIME button." (let ((id (get-text-property (point) 'gnus-part)) (point (point)) - (inhibit-read-only t)) - (forward-line 1) - (prog1 - (let ((window (selected-window)) - (mail-parse-charset gnus-newsgroup-charset) - (mail-parse-ignored-charsets - (if (gnus-buffer-live-p gnus-summary-buffer) - (with-current-buffer gnus-summary-buffer - gnus-newsgroup-ignored-charsets) - nil))) - (save-excursion - (unwind-protect - (let ((win (gnus-get-buffer-window (current-buffer) t)) - (beg (point))) - (when win - (select-window win)) - (goto-char point) - (forward-line) - (if (mm-handle-displayed-p handle) - ;; This will remove the part. - (mm-display-part handle) - (save-window-excursion - (save-restriction - (narrow-to-region (point) - (if (eobp) (point) (1+ (point)))) - (gnus-bind-safe-url-regexp (mm-display-part handle)) - ;; We narrow to the part itself and - ;; then call the treatment functions. - (goto-char (point-min)) - (forward-line 1) - (narrow-to-region (point) (point-max)) - (gnus-treat-article - nil id - (gnus-article-mime-total-parts) - (mm-handle-media-type handle)))))) - (if (window-live-p window) - (select-window window)))))))) + (inhibit-read-only t) + (window (selected-window)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (if (gnus-buffer-live-p gnus-summary-buffer) + (with-current-buffer gnus-summary-buffer + gnus-newsgroup-ignored-charsets) + nil)) + retval) + (unwind-protect + (progn + (let ((win (gnus-get-buffer-window (current-buffer) t))) + (when win + (select-window win) + (goto-char point))) + (forward-line) + (if (mm-handle-displayed-p handle) + ;; This will remove the part. + (setq retval (mm-display-part handle)) + (save-window-excursion + (save-restriction + ;; FIXME: nothing is displayed in the article buffer + ;; while prompting a user for a file name. + (narrow-to-region (point) + (if (eobp) (point) (1+ (point)))) + (gnus-bind-safe-url-regexp + (setq retval (mm-display-part handle))) + ;; We narrow to the part itself and + ;; then call the treatment functions. + (goto-char (point-min)) + (forward-line 1) + (narrow-to-region (point) (point-max)) + (gnus-treat-article + nil id + (gnus-article-mime-total-parts) + (mm-handle-media-type handle)))))) + (if (window-live-p window) + (select-window window)) + (goto-char point) + ;; Toggle the button appearance between `[button]...' and `[button]'. + (let ((end (next-single-property-change point 'gnus-data))) + (delete-region (previous-single-property-change end 'gnus-data) end)) + (gnus-insert-mime-button + handle id (list (mm-handle-displayed-p handle))) + (delete-char -1) + (goto-char point)) + retval)) (defun gnus-article-goto-part (n) "Go to MIME part N." ------------------------------------------------------------ revno: 117031 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-04-29 11:16:07 -0400 message: * src/window.c (struct saved_window): Remove mark. (Fset_window_configuration, save_window_save) (compare_window_configurations): Don't touch marks any more. * doc/lispref/windows.texi (Window Configurations, Window Configurations): Window configs don't store marks any more. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-04-25 16:11:07 +0000 +++ doc/lispref/ChangeLog 2014-04-29 15:16:07 +0000 @@ -1,8 +1,12 @@ +2014-04-29 Stefan Monnier + + * windows.texi (Window Configurations, Window Configurations): + Window configs don't store marks any more. + 2014-04-25 Eli Zaretskii - * strings.texi (Text Comparison): Mention - equal-including-properties for when text properties of the strings - matter for comparison. + * strings.texi (Text Comparison): Mention equal-including-properties + for when text properties of the strings matter for comparison. 2014-04-22 Eli Zaretskii === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2014-03-21 09:23:22 +0000 +++ doc/lispref/windows.texi 2014-04-29 15:16:07 +0000 @@ -3655,7 +3655,7 @@ A @dfn{window configuration} records the entire layout of one frame---all windows, their sizes, which buffers they contain, how those -buffers are scrolled, and their values of point and the mark; also their +buffers are scrolled, and their value of point; also their fringes, margins, and scroll bar settings. It also includes the value of @code{minibuffer-scroll-window}. As a special exception, the window configuration does not record the value of point in the selected window @@ -3731,13 +3731,13 @@ @defun compare-window-configurations config1 config2 This function compares two window configurations as regards the -structure of windows, but ignores the values of point and mark and the +structure of windows, but ignores the values of point and the saved scrolling positions---it can return @code{t} even if those aspects differ. The function @code{equal} can also compare two window configurations; it regards configurations as unequal if they differ in any respect, even a -saved point or mark. +saved point. @end defun @defun window-configuration-frame config === modified file 'etc/NEWS' --- etc/NEWS 2014-04-22 21:32:51 +0000 +++ etc/NEWS 2014-04-29 15:16:07 +0000 @@ -85,6 +85,8 @@ * Incompatible Lisp Changes in Emacs 24.5 +** window-configurations do not record the buffers's marks any more. + ** inhibit-modification-hooks now also inhibits lock-file checks as well as active region handling. === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-28 16:59:41 +0000 +++ src/ChangeLog 2014-04-29 15:16:07 +0000 @@ -1,3 +1,9 @@ +2014-04-29 Stefan Monnier + + * window.c (struct saved_window): Remove mark. + (Fset_window_configuration, save_window_save) + (compare_window_configurations): Don't touch marks any more. + 2014-04-28 Paul Eggert Use bits_word for gcmarkbits. @@ -19,8 +25,7 @@ 2014-04-25 Eli Zaretskii * search.c (Fnewline_cache_check): Don't try to count newlines - outside the buffer's restriction, as find_newline doesn't support - that. + outside the buffer's restriction, as find_newline doesn't support that. 2014-04-24 Stefan Monnier === modified file 'src/window.c' --- src/window.c 2014-04-24 03:59:19 +0000 +++ src/window.c 2014-04-29 15:16:07 +0000 @@ -5953,12 +5953,12 @@ int frame_menu_bar_height, frame_tool_bar_height; }; -/* This is saved as a Lisp_Vector */ +/* This is saved as a Lisp_Vector. */ struct saved_window { struct vectorlike_header header; - Lisp_Object window, buffer, start, pointm, mark; + Lisp_Object window, buffer, start, pointm; Lisp_Object pixel_left, pixel_top, pixel_height, pixel_width; Lisp_Object left_col, top_line, total_cols, total_lines; Lisp_Object normal_cols, normal_lines; @@ -6260,17 +6260,6 @@ set_marker_restricted (w->start, p->start, w->contents); set_marker_restricted (w->pointm, p->pointm, w->contents); - if (MARKERP (p->mark) && !XMARKER (p->mark)->buffer - && !NILP (BVAR (XBUFFER (w->contents), mark_active))) - { - struct buffer *old = current_buffer; - extern Lisp_Object Qdeactivate_mark; - set_buffer_internal (XBUFFER (w->contents)); - call0 (Qdeactivate_mark); - set_buffer_internal (old); - } - Fset_marker (BVAR (XBUFFER (w->contents), mark), - p->mark, w->contents); /* As documented in Fcurrent_window_configuration, don't restore the location of point in the buffer which was @@ -6626,27 +6615,16 @@ p->start = Fcopy_marker (w->start, Qnil); p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; - - tem = BVAR (XBUFFER (w->contents), mark); - p->mark = Fcopy_marker (tem, Qnil); } else { p->pointm = Qnil; p->start = Qnil; - p->mark = Qnil; p->start_at_line_beg = Qnil; } - if (NILP (w->parent)) - p->parent = Qnil; - else - p->parent = XWINDOW (w->parent)->temslot; - - if (NILP (w->prev)) - p->prev = Qnil; - else - p->prev = XWINDOW (w->prev)->temslot; + p->parent = NILP (w->parent) ? Qnil : XWINDOW (w->parent)->temslot; + p->prev = NILP (w->prev) ? Qnil : XWINDOW (w->prev)->temslot; if (WINDOWP (w->contents)) i = save_window_save (w->contents, vector, i); @@ -6660,8 +6638,8 @@ doc: /* Return an object representing the current window configuration of FRAME. If FRAME is nil or omitted, use the selected frame. This describes the number of windows, their sizes and current buffers, -and for each displayed buffer, where display starts, and the positions of -point and mark. An exception is made for point in the current buffer: +and for each displayed buffer, where display starts, and the position of +point. An exception is made for point in the current buffer: its value is -not- saved. This also records the currently selected frame, and FRAME's focus redirection (see `redirect-frame-focus'). The variable @@ -7105,8 +7083,7 @@ || !EQ (sw1->min_hscroll, sw2->min_hscroll) || !EQ (sw1->start_at_line_beg, sw2->start_at_line_beg) || NILP (Fequal (sw1->start, sw2->start)) - || NILP (Fequal (sw1->pointm, sw2->pointm)) - || NILP (Fequal (sw1->mark, sw2->mark)))) + || NILP (Fequal (sw1->pointm, sw2->pointm)))) || !EQ (sw1->left_margin_cols, sw2->left_margin_cols) || !EQ (sw1->right_margin_cols, sw2->right_margin_cols) || !EQ (sw1->left_fringe_width, sw2->left_fringe_width) @@ -7123,7 +7100,7 @@ DEFUN ("compare-window-configurations", Fcompare_window_configurations, Scompare_window_configurations, 2, 2, 0, doc: /* Compare two window configurations as regards the structure of windows. -This function ignores details such as the values of point and mark +This function ignores details such as the values of point and scrolling positions. */) (Lisp_Object x, Lisp_Object y) { ------------------------------------------------------------ revno: 117030 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-04-28 09:59:41 -0700 message: Use bits_word for gcmarkbits. * alloc.c (struct cons_block, struct float_block): On 64-bit hosts, bits_word is typically a tad more efficient for mark bits than unsigned is, so use bits_word. All uses changed. * lisp.h (BITS_PER_INT): Remove; no longer used. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-28 01:29:44 +0000 +++ src/ChangeLog 2014-04-28 16:59:41 +0000 @@ -1,5 +1,11 @@ 2014-04-28 Paul Eggert + Use bits_word for gcmarkbits. + * alloc.c (struct cons_block, struct float_block): On 64-bit hosts, + bits_word is typically a tad more efficient for mark bits than + unsigned is, so use bits_word. All uses changed. + * lisp.h (BITS_PER_INT): Remove; no longer used. + Avoid undefined behavior in signed left shift. This ports to GCC 4.9.0 with -fsanitize=undefined. * alloc.c (bool_vector_fill, SETMARKBIT, UNSETMARKBIT): === modified file 'src/alloc.c' --- src/alloc.c 2014-04-28 01:29:44 +0000 +++ src/alloc.c 2014-04-28 16:59:41 +0000 @@ -2332,21 +2332,21 @@ #define FLOAT_BLOCK_SIZE \ (((BLOCK_BYTES - sizeof (struct float_block *) \ /* The compiler might add padding at the end. */ \ - - (sizeof (struct Lisp_Float) - sizeof (int))) * CHAR_BIT) \ + - (sizeof (struct Lisp_Float) - sizeof (bits_word))) * CHAR_BIT) \ / (sizeof (struct Lisp_Float) * CHAR_BIT + 1)) #define GETMARKBIT(block,n) \ - (((block)->gcmarkbits[(n) / (sizeof (unsigned) * CHAR_BIT)] \ - >> ((n) % (sizeof (unsigned) * CHAR_BIT))) \ + (((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD] \ + >> ((n) % BITS_PER_BITS_WORD)) \ & 1) #define SETMARKBIT(block,n) \ - ((block)->gcmarkbits[(n) / (sizeof (unsigned) * CHAR_BIT)] \ - |= 1u << ((n) % (sizeof (unsigned) * CHAR_BIT))) + ((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD] \ + |= (bits_word) 1 << ((n) % BITS_PER_BITS_WORD)) #define UNSETMARKBIT(block,n) \ - ((block)->gcmarkbits[(n) / (sizeof (unsigned) * CHAR_BIT)] \ - &= ~(1u << ((n) % (sizeof (unsigned) * CHAR_BIT)))) + ((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD] \ + &= ~((bits_word) 1 << ((n) % BITS_PER_BITS_WORD))) #define FLOAT_BLOCK(fptr) \ ((struct float_block *) (((uintptr_t) (fptr)) & ~(BLOCK_ALIGN - 1))) @@ -2358,7 +2358,7 @@ { /* Place `floats' at the beginning, to ease up FLOAT_INDEX's job. */ struct Lisp_Float floats[FLOAT_BLOCK_SIZE]; - unsigned gcmarkbits[1 + FLOAT_BLOCK_SIZE / (sizeof (unsigned) * CHAR_BIT)]; + bits_word gcmarkbits[1 + FLOAT_BLOCK_SIZE / BITS_PER_BITS_WORD]; struct float_block *next; }; @@ -2439,7 +2439,7 @@ #define CONS_BLOCK_SIZE \ (((BLOCK_BYTES - sizeof (struct cons_block *) \ /* The compiler might add padding at the end. */ \ - - (sizeof (struct Lisp_Cons) - sizeof (int))) * CHAR_BIT) \ + - (sizeof (struct Lisp_Cons) - sizeof (bits_word))) * CHAR_BIT) \ / (sizeof (struct Lisp_Cons) * CHAR_BIT + 1)) #define CONS_BLOCK(fptr) \ @@ -2452,7 +2452,7 @@ { /* Place `conses' at the beginning, to ease up CONS_INDEX's job. */ struct Lisp_Cons conses[CONS_BLOCK_SIZE]; - unsigned gcmarkbits[1 + CONS_BLOCK_SIZE / (sizeof (unsigned) * CHAR_BIT)]; + bits_word gcmarkbits[1 + CONS_BLOCK_SIZE / BITS_PER_BITS_WORD]; struct cons_block *next; }; @@ -6436,27 +6436,27 @@ static void sweep_conses (void) { - register struct cons_block *cblk; + struct cons_block *cblk; struct cons_block **cprev = &cons_block; - register int lim = cons_block_index; + int lim = cons_block_index; EMACS_INT num_free = 0, num_used = 0; cons_free_list = 0; for (cblk = cons_block; cblk; cblk = *cprev) { - register int i = 0; + int i = 0; int this_free = 0; - int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT; + int ilim = (lim + BITS_PER_BITS_WORD - 1) / BITS_PER_BITS_WORD; /* Scan the mark bits an int at a time. */ for (i = 0; i < ilim; i++) { - if (cblk->gcmarkbits[i] == -1) + if (cblk->gcmarkbits[i] == BITS_WORD_MAX) { /* Fast path - all cons cells for this int are marked. */ cblk->gcmarkbits[i] = 0; - num_used += BITS_PER_INT; + num_used += BITS_PER_BITS_WORD; } else { @@ -6464,10 +6464,10 @@ Find which ones, and free them. */ int start, pos, stop; - start = i * BITS_PER_INT; + start = i * BITS_PER_BITS_WORD; stop = lim - start; - if (stop > BITS_PER_INT) - stop = BITS_PER_INT; + if (stop > BITS_PER_BITS_WORD) + stop = BITS_PER_BITS_WORD; stop += start; for (pos = start; pos < stop; pos++) === modified file 'src/lisp.h' --- src/lisp.h 2014-04-28 01:29:44 +0000 +++ src/lisp.h 2014-04-28 16:59:41 +0000 @@ -115,7 +115,7 @@ }; /* An unsigned integer type representing a fixed-length bit sequence, - suitable for words in a Lisp bool vector. Normally it is size_t + suitable for bool vector words, GC mark bits, etc. Normally it is size_t for speed, but it is unsigned char on weird platforms. */ #if BOOL_VECTOR_BITS_PER_CHAR == CHAR_BIT typedef size_t bits_word; @@ -133,7 +133,6 @@ { BITS_PER_CHAR = CHAR_BIT, BITS_PER_SHORT = CHAR_BIT * sizeof (short), - BITS_PER_INT = CHAR_BIT * sizeof (int), BITS_PER_LONG = CHAR_BIT * sizeof (long int), BITS_PER_EMACS_INT = CHAR_BIT * sizeof (EMACS_INT) };