From 502f9ebda07a494d37a9127bd396718f42c4c4d9 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 27 Sep 2011 11:58:13 -0400 Subject: [PATCH 01/13] * lisp/emacs-lisp/package.el (list-packages): Fix echo area message. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/package.el | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ec867fee08b..50dccb43b3b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-09-27 Chong Yidong + + * emacs-lisp/package.el (list-packages): Fix echo area message. + 2011-09-27 Leo Liu * ido.el (ido-read-internal): Accept cons cell HIST arg. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4cab8f43480..2e340a442a6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1658,10 +1658,11 @@ The list is displayed in a buffer named `*Packages*'." (switch-to-buffer buf)) (let ((upgrades (package-menu--find-upgrades))) (if upgrades - (message "%d package%s can be upgraded; type `%s' to mark them for upgrading." + (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading." (length upgrades) (if (= (length upgrades) 1) "" "s") - (substitute-command-keys "\\[package-menu-mark-upgrades]"))))) + (substitute-command-keys "\\[package-menu-mark-upgrades]") + (if (= (length upgrades) 1) "it" "them"))))) ;;;###autoload (defalias 'package-list-packages 'list-packages) From aa97fd08e3b8d6a218b977ffba668f9cc63e0c17 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 27 Sep 2011 19:46:17 +0300 Subject: [PATCH 02/13] Force left-to-right paragraphs in Org buffers. lisp/org/org.el (org-mode): Force left-to-right paragraphs in Org buffers. For a related discussions, see https://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00349.html. --- lisp/org/ChangeLog | 6 ++++++ lisp/org/org.el | 1 + 2 files changed, 7 insertions(+) diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 1c320f20e51..9fbeb9f1882 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,9 @@ +2011-09-27 Eli Zaretskii + + * org.el (org-mode): Force left-to-right paragraphs in Org + buffers. For a related discussions, see + https://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00349.html. + 2011-09-17 Juanma Barranquero * org.el (org-toggle-pretty-entities): Fix typo in message. diff --git a/lisp/org/org.el b/lisp/org/org.el index 32ca5288d6e..da39aa189ba 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -4748,6 +4748,7 @@ The following commands are available: (org-set-local 'line-move-ignore-invisible t)) (org-set-local 'outline-regexp org-outline-regexp) (org-set-local 'outline-level 'org-outline-level) + (setq bidi-paragraph-direction 'left-to-right) (when (and org-ellipsis (fboundp 'set-display-table-slot) (boundp 'buffer-display-table) (fboundp 'make-glyph-code)) From 88652fd58c34b494ef5e7139e317e0d8b0980200 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 27 Sep 2011 20:18:31 +0300 Subject: [PATCH 03/13] Fix bug #9610 with slow cursor motion in buffers with invisible text. src/xdisp.c (handle_invisible_prop): If invisible text ends on a newline, reseat the iterator instead of bidi-iterating there one character at a time. (Bug#9610) (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past TO_CHARPOS if the bidi iterator is at base embedding level. --- src/ChangeLog | 8 +++++ src/xdisp.c | 99 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 75 insertions(+), 32 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 59169bdcf9f..dd2e7256476 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2011-09-27 Eli Zaretskii + + * xdisp.c (handle_invisible_prop): If invisible text ends on a + newline, reseat the iterator instead of bidi-iterating there one + character at a time. (Bug#9610) + (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past + TO_CHARPOS if the bidi iterator is at base embedding level. + 2011-09-27 Andreas Schwab * lread.c (readevalloop): Use correct code for NBSP. diff --git a/src/xdisp.c b/src/xdisp.c index a556236835c..75f266ff739 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4056,40 +4056,67 @@ handle_invisible_prop (struct it *it) /* The position newpos is now either ZV or on visible text. */ if (it->bidi_p && newpos < ZV) { - /* With bidi iteration, the region of invisible text - could start and/or end in the middle of a non-base - embedding level. Therefore, we need to skip - invisible text using the bidi iterator, starting at - IT's current position, until we find ourselves - outside the invisible text. Skipping invisible text - _after_ bidi iteration avoids affecting the visual - order of the displayed text when invisible properties - are added or removed. */ - if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) + EMACS_INT bpos = CHAR_TO_BYTE (newpos); + + if (FETCH_BYTE (bpos) == '\n' + || (newpos > BEGV && FETCH_BYTE (bpos - 1) == '\n')) { - /* If we were `reseat'ed to a new paragraph, - determine the paragraph base direction. We need - to do it now because next_element_from_buffer may - not have a chance to do it, if we are going to - skip any text at the beginning, which resets the - FIRST_ELT flag. */ - bidi_paragraph_init (it->paragraph_embedding, - &it->bidi_it, 1); + /* If the invisible text ends on a newline or the + character after a newline, we can avoid the + costly, character by character, bidi iteration to + newpos, and instead simply reseat the iterator + there. That's because all bidi reordering + information is tossed at the newline. This is a + big win for modes that hide complete lines, like + Outline, Org, etc. (Implementation note: the + call to reseat_1 is necessary, because it signals + to the bidi iterator that it needs to reinit its + internal information when the next element for + display is requested. */ + struct text_pos tpos; + + SET_TEXT_POS (tpos, newpos, bpos); + reseat_1 (it, tpos, 0); } - do + else /* Must use the slow method. */ { - bidi_move_to_visually_next (&it->bidi_it); + /* With bidi iteration, the region of invisible text + could start and/or end in the middle of a + non-base embedding level. Therefore, we need to + skip invisible text using the bidi iterator, + starting at IT's current position, until we find + ourselves outside the invisible text. Skipping + invisible text _after_ bidi iteration avoids + affecting the visual order of the displayed text + when invisible properties are added or + removed. */ + if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) + { + /* If we were `reseat'ed to a new paragraph, + determine the paragraph base direction. We + need to do it now because + next_element_from_buffer may not have a + chance to do it, if we are going to skip any + text at the beginning, which resets the + FIRST_ELT flag. */ + bidi_paragraph_init (it->paragraph_embedding, + &it->bidi_it, 1); + } + do + { + bidi_move_to_visually_next (&it->bidi_it); + } + while (it->stop_charpos <= it->bidi_it.charpos + && it->bidi_it.charpos < newpos); + IT_CHARPOS (*it) = it->bidi_it.charpos; + IT_BYTEPOS (*it) = it->bidi_it.bytepos; + /* If we overstepped NEWPOS, record its position in + the iterator, so that we skip invisible text if + later the bidi iteration lands us in the + invisible region again. */ + if (IT_CHARPOS (*it) >= newpos) + it->prev_stop = newpos; } - while (it->stop_charpos <= it->bidi_it.charpos - && it->bidi_it.charpos < newpos); - IT_CHARPOS (*it) = it->bidi_it.charpos; - IT_BYTEPOS (*it) = it->bidi_it.bytepos; - /* If we overstepped NEWPOS, record its position in the - iterator, so that we skip invisible text if later the - bidi iteration lands us in the invisible region - again. */ - if (IT_CHARPOS (*it) >= newpos) - it->prev_stop = newpos; } else { @@ -7880,7 +7907,9 @@ move_it_in_display_line_to (struct it *it, ((op & MOVE_TO_POS) != 0 \ && BUFFERP (it->object) \ && (IT_CHARPOS (*it) == to_charpos \ - || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos) \ + || ((!it->bidi_p \ + || BIDI_AT_BASE_LEVEL (it->bidi_it)) \ + && IT_CHARPOS (*it) > to_charpos) \ || (it->what == IT_COMPOSITION \ && ((IT_CHARPOS (*it) > to_charpos \ && to_charpos >= it->cmp_it.charpos) \ @@ -7912,7 +7941,13 @@ move_it_in_display_line_to (struct it *it, if ((op & MOVE_TO_POS) != 0 && BUFFERP (it->object) && it->method == GET_FROM_BUFFER - && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos) + && (((!it->bidi_p + /* When the iterator is at base embedding level, we + are guaranteed that characters are delivered for + display in strictly increasing order of their + buffer positions. */ + || BIDI_AT_BASE_LEVEL (it->bidi_it)) + && IT_CHARPOS (*it) > to_charpos) || (it->bidi_p && (prev_method == GET_FROM_IMAGE || prev_method == GET_FROM_STRETCH From 85a162088f56ec197b7ccc6d2f9ad23a691a362d Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 27 Sep 2011 19:45:18 +0200 Subject: [PATCH 04/13] * mail/smtpmail.el (smtpmail-via-smtp): Fix STARTTLS detection. Fixes: debbugs:9615 --- lisp/ChangeLog | 5 +++++ lisp/mail/smtpmail.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 50dccb43b3b..8bbb7f5fcc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-27 Lars Magne Ingebrigtsen + + * mail/smtpmail.el (smtpmail-via-smtp): Fix STARTTLS detection + (bug#9615). + 2011-09-27 Chong Yidong * emacs-lisp/package.el (list-packages): Fix echo area message. diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 1c6f2c7b7ed..edcc82011af 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -658,7 +658,7 @@ The list is in preference order.") :always-query-capabilities t :starttls-function (lambda (capabilities) - (and (string-match "-STARTTLS" capabilities) + (and (string-match "[ -]STARTTLS" capabilities) "STARTTLS\r\n")) :client-certificate t :use-starttls-if-possible t))) From 8b457e28320da995d51714e40af65ab52d637eb8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 27 Sep 2011 14:09:43 -0400 Subject: [PATCH 05/13] pcmpl-cvs.el fix for bug#9606 * lisp/pcmpl-cvs.el (pcmpl-cvs-entries): Update for Emacs 22.1 changes to split-string. --- lisp/ChangeLog | 5 +++++ lisp/pcmpl-cvs.el | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bbb7f5fcc8..b258f1081b0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-27 Glenn Morris + + * pcmpl-cvs.el (pcmpl-cvs-entries): Update for Emacs 22.1 changes + to split-string. (Bug#9606) + 2011-09-27 Lars Magne Ingebrigtsen * mail/smtpmail.el (smtpmail-via-smtp): Fix STARTTLS detection diff --git a/lisp/pcmpl-cvs.el b/lisp/pcmpl-cvs.el index b6c5eb62b17..3ff07bca20e 100644 --- a/lisp/pcmpl-cvs.el +++ b/lisp/pcmpl-cvs.el @@ -169,13 +169,13 @@ operation character applies, as displayed by 'cvs -n update'." (insert-file-contents (concat dir "CVS/Entries")) (goto-char (point-min)) (while (not (eobp)) - (let* ((line (buffer-substring (line-beginning-position) - (line-end-position))) - (fields (split-string line "/")) - text) - (if (eq (aref line 0) ?/) - (setq fields (cons "" fields))) - (setq text (nth 1 fields)) + ;; Normal file: /NAME -> "" "NAME" + ;; Directory : D/NAME -> "D" "NAME" + (let* ((fields (split-string (buffer-substring + (line-beginning-position) + (line-end-position)) + "/")) + (text (nth 1 fields))) (when text (if (string= (nth 0 fields) "D") (setq text (file-name-as-directory text))) From 693fbdb629c8cd41253519cf6c68a9b7b7bde493 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 27 Sep 2011 21:51:05 +0300 Subject: [PATCH 06/13] Improve doc strings for completion styles. lisp/minibuffer.el (completion-styles) (completion-category-overrides): Cross reference each other in doc strings. --- lisp/ChangeLog | 6 ++++++ lisp/minibuffer.el | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b258f1081b0..bdf4522c4f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-27 Eli Zaretskii + + * minibuffer.el (completion-styles) + (completion-category-overrides): Cross reference each other in doc + strings. + 2011-09-27 Glenn Morris * pcmpl-cvs.el (pcmpl-cvs-entries): Update for Emacs 22.1 changes diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c6f28b14415..021e46d5053 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -482,7 +482,10 @@ and DOC describes the way this style of completion works.") ;; and simply add "bar" to the end of the result. emacs22) "List of completion styles to use. -The available styles are listed in `completion-styles-alist'." +The available styles are listed in `completion-styles-alist'. + +Note that `completion-category-overrides' may override these +styles for specific categories, such as files, buffers, etc." :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x))) completion-styles-alist))) :group 'minibuffer @@ -490,7 +493,7 @@ The available styles are listed in `completion-styles-alist'." (defcustom completion-category-overrides '((buffer (styles . (basic substring)))) - "List of overrides for specific categories. + "List of `completion-styles' overrides for specific categories. Each override has the shape (CATEGORY . ALIST) where ALIST is an association list that can specify properties such as: - `styles': the list of `completion-styles' to use for that category. From 81416b68d8a3f5759806ecdef7eb06779686bc5c Mon Sep 17 00:00:00 2001 From: Ulf Jasper Date: Tue, 27 Sep 2011 20:52:00 +0200 Subject: [PATCH 07/13] Move test/newsticker-testsuite.el to automated/newsticker-tests.el 2011-09-27 Ulf Jasper * automated/newsticker-tests.el: Move newsticker-testsuite.el to automated/newsticker-tests.el. Convert to ERT. --- test/ChangeLog | 5 + .../newsticker-tests.el} | 113 +++++++----------- 2 files changed, 46 insertions(+), 72 deletions(-) rename test/{newsticker-testsuite.el => automated/newsticker-tests.el} (59%) diff --git a/test/ChangeLog b/test/ChangeLog index 11b3d9b5e2d..6ab148358d9 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2011-09-27 Ulf Jasper + + * automated/newsticker-tests.el: Move newsticker-testsuite.el + to automated/newsticker-tests.el. Convert to ERT. + 2011-07-26 Ulf Jasper * automated/icalendar-tests.el (icalendar-tests--compare-strings): diff --git a/test/newsticker-testsuite.el b/test/automated/newsticker-tests.el similarity index 59% rename from test/newsticker-testsuite.el rename to test/automated/newsticker-tests.el index 99e40a7ef15..76f4345da55 100644 --- a/test/newsticker-testsuite.el +++ b/test/automated/newsticker-tests.el @@ -3,12 +3,7 @@ ;; Copyright (C) 2003-2011 Free Software Foundation, Inc. ;; Author: Ulf Jasper -;; Filename: newsticker-testsuite.el -;; URL: http://www.nongnu.org/newsticker ;; Keywords: News, RSS, Atom -;; Time-stamp: "14. Juni 2008, 12:09:39 (ulf)" - -;; ====================================================================== ;; This file is part of GNU Emacs. @@ -25,42 +20,26 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;; ====================================================================== - ;;; Commentary: ;;; Code: -(require 'cl) ; assert - -;; ====================================================================== -;; Entry point -;; ====================================================================== -(defun newsticker--testsuite () - "Unit test for newsticker. -Subtests signal errors if something goes wrong." - (interactive) - (newsticker--test--guid) - (newsticker--test--cache-contains) - (newsticker--test--decode-iso8601-date) - (newsticker--test--decode-rfc822-date) - (newsticker--test--group-manage-orphan-feeds) - (message "All tests passed successfully.")) +(require 'ert) +(require 'newsticker) ;; ====================================================================== ;; Tests for newsticker-backend ;; ====================================================================== -(defun newsticker--test--guid () - "Test `newsticker-guid-*'. +(ert-deftest newsticker--guid () + "Test for `newsticker--guid-*'. Signals an error if something goes wrong." - (assert (string= "blah" (newsticker--guid-to-string "blah"))) - (assert (string= "myguid" (newsticker--guid '("title1" "description1" "link1" + (should (string= "blah" (newsticker--guid-to-string "blah"))) + (should (string= "myguid" (newsticker--guid '("title1" "description1" "link1" nil 'new 42 nil nil ((guid () "myguid"))))))) -(defun newsticker--test--cache-contains () - "Test `newsticker--test--cache-contains'. -Signals an error if something goes wrong." +(ert-deftest newsticker--cache-contains () + "Test for `newsticker--cache-contains'." (let ((newsticker--cache '((feed1 ("title1" "description1" "link1" nil 'new 42 nil nil ((guid () "myguid"))))))) @@ -68,78 +47,68 @@ Signals an error if something goes wrong." (assoc 'guid (newsticker--extra '("title1" "description1" "link1" nil 'new 42 nil nil ((guid "myguid")))))) - (assert (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE" + (should (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE" "description1" "link1" 'new "myguid")) - (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" + (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" "description1" "link1" 'new "WRONG GUID"))) - (assert (newsticker--cache-contains newsticker--cache 'feed1 "title1" + (should (newsticker--cache-contains newsticker--cache 'feed1 "title1" "description1" "link1" 'new "myguid"))) (let ((newsticker--cache '((feed1 ("title1" "description1" "link1" nil 'new 42 nil nil ((guid () "myguid1"))) ("title1" "description1" "link1" nil 'new 42 nil nil ((guid () "myguid2"))))))) - (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" + (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" "description1" "link1" 'new "myguid"))) - (assert (string= "myguid1" + (should (string= "myguid1" (newsticker--guid (newsticker--cache-contains newsticker--cache 'feed1 "title1" "description1" "link1" 'new "myguid1")))) - (assert (string= "myguid2" + (should (string= "myguid2" (newsticker--guid (newsticker--cache-contains newsticker--cache 'feed1 "title1" "description1" "link1" 'new "myguid2")))))) -(defun newsticker--do-test--decode-iso8601-date (input expected) +(defun newsticker-tests--decode-iso8601-date (input expected) "Actually test `newsticker--decode-iso8601-date'. -Signals an error if iso8601-encoded INPUT does not match EXPECTED." +Apply to INPUT and compare with EXPECTED." (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" (newsticker--decode-iso8601-date input) t))) - (assert (string= result expected) - nil "Error decoding '%s': found '%s' but expected '%s'." - input result expected))) + (should (string= result expected)))) -(defun newsticker--test--decode-iso8601-date () +(ert-deftest newsticker--decode-iso8601-date () "Test `newsticker--decode-iso8601-date'." - (newsticker--decode-iso8601-date "2004-09-17T05:09:49+00:00") - (newsticker--decode-iso8601-date "2004-09-17T05:09+00:00") - (newsticker--decode-iso8601-date "2004-09-17T05:09:49") - (newsticker--decode-iso8601-date "2004-09-17T05:09") - (newsticker--decode-iso8601-date "2004-09-17") - (newsticker--decode-iso8601-date "2004-09") - (newsticker--do-test--decode-iso8601-date "2004" - "2004-01-01T00:00:00") - (newsticker--do-test--decode-iso8601-date "2004-09" - "2004-09-01T00:00:00") - (newsticker--do-test--decode-iso8601-date "2004-09-17" - "2004-09-17T00:00:00") - (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09" - "2004-09-17T05:09:00") - (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49" - "2004-09-17T05:09:49") - (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49.123" - "2004-09-17T05:09:49") - (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09+01:00" - "2004-09-17T04:09:00") - (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09-02:00" - "2004-09-17T07:09:00")) + (newsticker-tests--decode-iso8601-date "2004" + "2004-01-01T00:00:00") + (newsticker-tests--decode-iso8601-date "2004-09" + "2004-09-01T00:00:00") + (newsticker-tests--decode-iso8601-date "2004-09-17" + "2004-09-17T00:00:00") + (newsticker-tests--decode-iso8601-date "2004-09-17T05:09" + "2004-09-17T05:09:00") + (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49" + "2004-09-17T05:09:49") + (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49.123" + "2004-09-17T05:09:49") + (newsticker-tests--decode-iso8601-date "2004-09-17T05:09+01:00" + "2004-09-17T04:09:00") + (newsticker-tests--decode-iso8601-date "2004-09-17T05:09-02:00" + "2004-09-17T07:09:00")) (defun newsticker--do-test--decode-rfc822-date (input expected) "Actually test `newsticker--decode-rfc822-date'. -Signals an error if rfc822-encoded INPUT does not match EXPECTED." +Apply to INPUT and compare with EXPECTED." (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" (newsticker--decode-rfc822-date input) t))) - (assert (string= result expected) - nil "Error decoding '%s': found '%s' but expected '%s'." - input result expected))) + (should (string= result expected)))) -(defun newsticker--test--decode-rfc822-date () +(ert-deftest newsticker--decode-rfc822-date () "Test `newsticker--decode-rfc822-date'." (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100" "2008-03-10T18:27:52") @@ -164,16 +133,16 @@ Signals an error if rfc822-encoded INPUT does not match EXPECTED." ;; ====================================================================== ;; Tests for newsticker-treeview ;; ====================================================================== -(defun newsticker--test--group-manage-orphan-feeds () +(ert-deftest newsticker--group-manage-orphan-feeds () "Test `newsticker--group-manage-orphan-feeds'. Signals an error if something goes wrong." (let ((newsticker-groups '("Feeds")) (newsticker-url-list-defaults nil) (newsticker-url-list '(("feed1") ("feed2") ("feed3")))) (newsticker--group-manage-orphan-feeds) - (assert (equal '("Feeds" "feed3" "feed2" "feed1") + (should (equal '("Feeds" "feed3" "feed2" "feed1") newsticker-groups)))) -(provide 'newsticker-testsuite) +(provide 'newsticker-tests) -;;; newsticker-testsuite.el ends here +;;; newsticker-tests.el ends here From a239d4e9c0e6fe9fab01e24212fb1dbb158c0a53 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 28 Sep 2011 02:59:28 +0200 Subject: [PATCH 08/13] Fix typos. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/windows.texi | 6 +++--- lisp/ChangeLog | 6 ++++++ lisp/ChangeLog.13 | 2 +- lisp/net/quickurl.el | 4 ++-- lisp/subr.el | 2 +- src/ChangeLog | 4 ++++ src/ChangeLog.11 | 2 +- src/ChangeLog.9 | 2 +- src/lread.c | 2 +- 10 files changed, 24 insertions(+), 10 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 423e052068b..afd32ad4ebe 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2011-09-28 Juanma Barranquero + + * windows.texi (Splitting Windows): Fix typos. + 2011-09-25 Martin Rudalics * windows.texi (Windows and Frames, Display Action Functions) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 96d489d1203..6a7206f459d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1178,7 +1178,7 @@ equivalently, @code{(split-window W3 -8 'left)} should now produce the penultimate configuration from the previous scenario from where we can continue as described before. - Another strategy starts with splitting an inital window @code{W6} by + Another strategy starts with splitting an initial window @code{W6} by evaluating @code{(split-window W6 nil nil t)} with the following result: @smallexample @group @@ -1259,11 +1259,11 @@ configuration. @defopt window-splits If this variable is nil, the function @code{split-window} can split a window if and only if that window's screen estate is sufficiently large -to accomodate both--itself and the new window. +to accommodate both--itself and the new window. If this variable is non-@code{nil}, @code{split-window} tries to resize all windows that are part of the same combination as the old window to -accomodate the new window. Hence, the new window can be also created if +accommodate the new window. Hence, the new window can be also created if the old window is of fixed size or too small to split (@pxref{Window Sizes}). diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bdf4522c4f5..4d1f762dd26 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-28 Juanma Barranquero + + * subr.el (with-output-to-temp-buffer): + * net/quickurl.el (quickurl, quickurl-browse-url): + Fix typos in docstrings. + 2011-09-27 Eli Zaretskii * minibuffer.el (completion-styles) diff --git a/lisp/ChangeLog.13 b/lisp/ChangeLog.13 index 8cbe1ad5776..993c51163cb 100644 --- a/lisp/ChangeLog.13 +++ b/lisp/ChangeLog.13 @@ -1743,7 +1743,7 @@ auto-composition-function to it. (toggle-auto-composition): New function. - * international/characters.el: Make all chararacters in the + * international/characters.el: Make all characters in the charset tibetan to tibetan script. * international/mule-conf.el (tibetan): Fix :code-space property. diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index 712f0b0c924..3f1437f0799 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -307,7 +307,7 @@ Also display a `message' saying what the URL was unless SILENT is non-nil." "Insert a URL based on LOOKUP. If not supplied LOOKUP is taken to be the word at point in the current -buffer, this default action can be modifed via +buffer, this default action can be modified via `quickurl-grab-lookup-function'." (interactive) (when (or lookup @@ -402,7 +402,7 @@ is decided." "Browse the URL associated with LOOKUP. If not supplied LOOKUP is taken to be the word at point in the -current buffer, this default action can be modifed via +current buffer, this default action can be modified via `quickurl-grab-lookup-function'." (interactive) (when (or lookup diff --git a/lisp/subr.el b/lisp/subr.el index 1aa714fa883..4946f3eef7a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3002,7 +3002,7 @@ Instead it binds `standard-output' to that buffer, so that output generated with `prin1' and similar functions in BODY goes into the buffer. -At the end of BODY, this marks buffer BUFNAME unmodifed and displays +At the end of BODY, this marks buffer BUFNAME unmodified and displays it in a window, but does not select it. The normal way to do this is by calling `display-buffer', then running `temp-buffer-show-hook'. However, if `temp-buffer-show-function' is non-nil, it calls that diff --git a/src/ChangeLog b/src/ChangeLog index dd2e7256476..c6a321de2dd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-09-28 Juanma Barranquero + + * lread.c (Fread_from_string): Fix typo in docstring. + 2011-09-27 Eli Zaretskii * xdisp.c (handle_invisible_prop): If invisible text ends on a diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index b64736459c8..0a9df7d1aee 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -4547,7 +4547,7 @@ * composite.c (composition_compute_stop_pos): In forward search, pay attention to the possibility that some character after ENDPOS - will be composed with charactrs before ENDPOS. + will be composed with characters before ENDPOS. 2010-08-24 Chong Yidong diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index f25434087c1..ceec5da3296 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -10460,7 +10460,7 @@ (Fkey_description): Likewise. * lread.c (read1): On reading multibyte string, be sure to make - all 8-bit chararacters in valid multibyte form. + all 8-bit characters in valid multibyte form. (readchar): Use FETCH_STRING_CHAR_ADVANCE unconditionally. * print.c (print_object): Use FETCH_STRING_CHAR_ADVANCE diff --git a/src/lread.c b/src/lread.c index 241b1e41c94..af737d27070 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1966,7 +1966,7 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, doc: /* Read one Lisp expression which is represented as text by STRING. Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). FINAL-STRING-INDEX is an integer giving the position of the next - remaining chararacter in STRING. + remaining character in STRING. START and END optionally delimit a substring of STRING from which to read; they default to 0 and (length STRING) respectively. */) (Lisp_Object string, Lisp_Object start, Lisp_Object end) From a8406c20c43b156a6af9b51ebfa75ba085ba396d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 27 Sep 2011 21:20:41 -0400 Subject: [PATCH 09/13] * lisp/emacs-lisp/debug.el (debug-convert-byte-code): Don't assume the object has more than 4 slots. Fixes: debbugs:9613 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/debug.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d1f762dd26..eaea2b33204 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-28 Stefan Monnier + + * emacs-lisp/debug.el (debug-convert-byte-code): Don't assume the + object has more than 4 slots (bug#9613). + 2011-09-28 Juanma Barranquero * subr.el (with-output-to-temp-buffer): diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index d7021a46165..d05a518e590 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -869,8 +869,10 @@ To specify a nil argument interactively, exit with an empty minibuffer." ,defn ,@(remq '&rest (remq '&optional args)))))) (if (> (length defn) 5) + ;; The mere presence of field 5 is sufficient to make + ;; it interactive. (push `(interactive ,(aref defn 5)) body)) - (if (aref defn 4) + (if (and (> (length defn) 4) (aref defn 4)) ;; Use `documentation' here, to get the actual string, ;; in case the compiled function has a reference ;; to the .elc file. From a5daf810f38ce0d4f08ea6a38f55f7f50651305f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 27 Sep 2011 22:19:56 -0400 Subject: [PATCH 10/13] * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Don't confuse "y => 3" as the beginning of a `y' operation. --- lisp/ChangeLog | 3 +++ lisp/progmodes/perl-mode.el | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eaea2b33204..f83dbdd344a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-09-28 Stefan Monnier + * progmodes/perl-mode.el (perl-syntax-propertize-function): + Don't confuse "y => 3" as the beginning of a `y' operation. + * emacs-lisp/debug.el (debug-convert-byte-code): Don't assume the object has more than 4 slots (bug#9613). diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 8ca8c690f92..933f004bb5d 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -304,11 +304,12 @@ The expansion is entirely correct because it uses the C preprocessor." (put-text-property (match-beginning 2) (match-end 2) 'syntax-table (string-to-syntax "\"")) (perl-syntax-propertize-special-constructs end))))) - ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\([^])}> \n\t]\\)" + ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\(?:\\([^])}>= \n\t]\\)\\|\\(?3:=\\)[^>]\\)" ;; Nasty cases: ;; /foo/m $a->m $#m $m @m %m ;; \s (appears often in regexps). ;; -s file + ;; y => 3 ;; sub tr {...} (3 (ignore (if (save-excursion (goto-char (match-beginning 0)) From 0a40c0609bf7dc47b68f13178ff07334f7dde349 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 28 Sep 2011 09:03:55 +0000 Subject: [PATCH 11/13] gnus-uu.el (gnus-uu-grab-articles): Require gnus-async so that `gnus-asynchronous' isn't shadowed. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/gnus-uu.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c535f4a9549..a330d5c6be8 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -3,6 +3,11 @@ * plstore.el (plstore-select-keys, plstore-encrypt-to): Clarify documentation. +2011-09-27 Lars Magne Ingebrigtsen + + * gnus-uu.el (gnus-uu-grab-articles): Require gnus-async so that + `gnus-asynchronous' isn't shadowed. + 2011-09-26 Lars Magne Ingebrigtsen * nnimap.el (nnimap-wait-for-response): Message less (bug#9540). diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 05ba3595479..15c3d41bece 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -1290,6 +1290,7 @@ When called interactively, prompt for REGEXP." ;; the process-function has been successful and nil otherwise. (defun gnus-uu-grab-articles (articles process-function &optional sloppy limit no-errors) + (require 'gnus-async) (let ((state 'first) (gnus-asynchronous nil) (gnus-inhibit-treatment t) From fbcaa2f3880fc9fc3a84182a0061fbdcf32ba19e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 28 Sep 2011 17:37:27 +0300 Subject: [PATCH 12/13] Fix bug #9624 with crashes in Muse mode. src/xdisp.c (compute_display_string_end): If there's no display string at CHARPOS, return -1. src/bidi.c (bidi_fetch_char): When compute_display_string_end returns a negative value, treat the character as a normal character not covered by a display string. --- src/ChangeLog | 9 +++++++++ src/bidi.c | 10 ++++++++++ src/xdisp.c | 23 +++++++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6a321de2dd..f26754d1135 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-09-28 Eli Zaretskii + + * xdisp.c (compute_display_string_end): If there's no display + string at CHARPOS, return -1. + + * bidi.c (bidi_fetch_char): When compute_display_string_end + returns a negative value, treat the character as a normal + character not covered by a display string. (Bug#9624) + 2011-09-28 Juanma Barranquero * lread.c (Fread_from_string): Fix typo in docstring. diff --git a/src/bidi.c b/src/bidi.c index 599c00449b5..e3fc03f4a9b 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -974,6 +974,15 @@ bidi_fetch_char (EMACS_INT bytepos, EMACS_INT charpos, EMACS_INT *disp_pos, ch = 0xFFFC; } disp_end_pos = compute_display_string_end (*disp_pos, string); + if (disp_end_pos < 0) + { + /* Somebody removed the display string from the buffer + behind our back. Recover by processing this buffer + position as if no display property were present there to + begin with. */ + *disp_prop = 0; + goto normal_char; + } *nchars = disp_end_pos - *disp_pos; if (*nchars <= 0) abort (); @@ -988,6 +997,7 @@ bidi_fetch_char (EMACS_INT bytepos, EMACS_INT charpos, EMACS_INT *disp_pos, } else { + normal_char: if (string->s) { int len; diff --git a/src/xdisp.c b/src/xdisp.c index 75f266ff739..a072ff2c171 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3386,9 +3386,10 @@ compute_display_string_pos (struct text_pos *position, } /* Return the character position of the end of the display string that - started at CHARPOS. A display string is either an overlay with - `display' property whose value is a string or a `display' text - property whose value is a string. */ + started at CHARPOS. If there's no display string at CHARPOS, + return -1. A display string is either an overlay with `display' + property whose value is a string or a `display' text property whose + value is a string. */ EMACS_INT compute_display_string_end (EMACS_INT charpos, struct bidi_string_data *string) { @@ -3402,8 +3403,22 @@ compute_display_string_end (EMACS_INT charpos, struct bidi_string_data *string) if (charpos >= eob || (string->s && !STRINGP (object))) return eob; + /* It could happen that the display property or overlay was removed + since we found it in compute_display_string_pos above. One way + this can happen is if JIT font-lock was called (through + handle_fontified_prop), and jit-lock-functions remove text + properties or overlays from the portion of buffer that includes + CHARPOS. Muse mode is known to do that, for example. In this + case, we return -1 to the caller, to signal that no display + string is actually present at CHARPOS. See bidi_fetch_char for + how this is handled. + + An alternative would be to never look for display properties past + it->stop_charpos. But neither compute_display_string_pos nor + bidi_fetch_char that calls it know or care where the next + stop_charpos is. */ if (NILP (Fget_char_property (pos, Qdisplay, object))) - abort (); + return -1; /* Look forward for the first character where the `display' property changes. */ From e1504b9b0b2fdcf757c29dcc65ffe8b670cc7604 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 28 Sep 2011 20:49:09 +0300 Subject: [PATCH 13/13] INSTALL: Mention that m17n libraries and libotf are needed for Arabic shaping. --- ChangeLog | 5 +++++ INSTALL | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a80fa24c3c2..c1a80f2d92f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-28 Eli Zaretskii + + * INSTALL: Mention that m17n libraries and libotf are needed for + Arabic shaping. + 2011-09-26 Paul Eggert Merge from gnulib, improving some licensing wording. diff --git a/INSTALL b/INSTALL index 03682d19b10..3aed5a869cc 100644 --- a/INSTALL +++ b/INSTALL @@ -111,15 +111,16 @@ ADDITIONAL DISTRIBUTION FILES * Complex Text Layout support libraries -Emacs needs the optional libraries "m17n-db", "libm17n-flt", "libotf" -to correctly display such complex scripts as Indic and Khmer. -On some systems, particularly GNU/Linux, these libraries may be -already present or available as additional packages. Note that if -there is a separate `dev' or `devel' package, for use at compilation -time rather than run time, you will need that as well as the -corresponding run time package; typically the dev package will contain -header files and a library archive. Otherwise, you can download and -build libraries from sources. +On GNU and Unix systems, Emacs needs the optional libraries "m17n-db", +"libm17n-flt", "libotf" to correctly display such complex scripts as +Indic and Khmer, and also for scripts that require Arabic shaping +support (Arabic and Farsi). On some systems, particularly GNU/Linux, +these libraries may be already present or available as additional +packages. Note that if there is a separate `dev' or `devel' package, +for use at compilation time rather than run time, you will need that +as well as the corresponding run time package; typically the dev +package will contain header files and a library archive. Otherwise, +you can download and build libraries from sources. The sources of these libraries are available by anonymous CVS from cvs.m17n.org. @@ -133,6 +134,9 @@ For m17n-lib, if you have problems with making the whole package because you lack some other packages on which m17n-lib depends, try to configure it with the option "--without-gui". +Note that Emacs cannot support complex scripts on a TTY, unless the +terminal includes such a support. + * intlfonts-VERSION.tar.gz The intlfonts distribution contains X11 fonts in various encodings