aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-09-28 13:07:17 -0700
committerPaul Eggert2011-09-28 13:07:17 -0700
commitb13f71e2dda86836dc7dea90b385b3791f8ebd01 (patch)
treed15fcbcfb6b94693c2db439828e7daa4e07fe0fc
parent7b09a37a895ab2d428d1ab0786aa262ef82efba2 (diff)
parente1504b9b0b2fdcf757c29dcc65ffe8b670cc7604 (diff)
downloademacs-b13f71e2dda86836dc7dea90b385b3791f8ebd01.tar.gz
emacs-b13f71e2dda86836dc7dea90b385b3791f8ebd01.zip
Merge from trunk.
-rw-r--r--ChangeLog5
-rw-r--r--INSTALL22
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/windows.texi6
-rw-r--r--lisp/ChangeLog34
-rw-r--r--lisp/ChangeLog.132
-rw-r--r--lisp/emacs-lisp/debug.el4
-rw-r--r--lisp/emacs-lisp/package.el5
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-uu.el1
-rw-r--r--lisp/mail/smtpmail.el2
-rw-r--r--lisp/minibuffer.el7
-rw-r--r--lisp/net/quickurl.el4
-rw-r--r--lisp/org/ChangeLog6
-rw-r--r--lisp/org/org.el1
-rw-r--r--lisp/pcmpl-cvs.el14
-rw-r--r--lisp/progmodes/perl-mode.el3
-rw-r--r--lisp/subr.el2
-rw-r--r--src/ChangeLog23
-rw-r--r--src/ChangeLog.112
-rw-r--r--src/ChangeLog.92
-rw-r--r--src/bidi.c10
-rw-r--r--src/lread.c2
-rw-r--r--src/xdisp.c122
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/newsticker-tests.el (renamed from test/newsticker-testsuite.el)113
26 files changed, 264 insertions, 142 deletions
diff --git a/ChangeLog b/ChangeLog
index a80fa24c3c2..c1a80f2d92f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12011-09-28 Eli Zaretskii <eliz@gnu.org>
2
3 * INSTALL: Mention that m17n libraries and libotf are needed for
4 Arabic shaping.
5
12011-09-26 Paul Eggert <eggert@cs.ucla.edu> 62011-09-26 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Merge from gnulib, improving some licensing wording. 8 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
111 111
112* Complex Text Layout support libraries 112* Complex Text Layout support libraries
113 113
114Emacs needs the optional libraries "m17n-db", "libm17n-flt", "libotf" 114On GNU and Unix systems, Emacs needs the optional libraries "m17n-db",
115to correctly display such complex scripts as Indic and Khmer. 115"libm17n-flt", "libotf" to correctly display such complex scripts as
116On some systems, particularly GNU/Linux, these libraries may be 116Indic and Khmer, and also for scripts that require Arabic shaping
117already present or available as additional packages. Note that if 117support (Arabic and Farsi). On some systems, particularly GNU/Linux,
118there is a separate `dev' or `devel' package, for use at compilation 118these libraries may be already present or available as additional
119time rather than run time, you will need that as well as the 119packages. Note that if there is a separate `dev' or `devel' package,
120corresponding run time package; typically the dev package will contain 120for use at compilation time rather than run time, you will need that
121header files and a library archive. Otherwise, you can download and 121as well as the corresponding run time package; typically the dev
122build libraries from sources. 122package will contain header files and a library archive. Otherwise,
123you can download and build libraries from sources.
123 124
124The sources of these libraries are available by anonymous CVS from 125The sources of these libraries are available by anonymous CVS from
125cvs.m17n.org. 126cvs.m17n.org.
@@ -133,6 +134,9 @@ For m17n-lib, if you have problems with making the whole package
133because you lack some other packages on which m17n-lib depends, try to 134because you lack some other packages on which m17n-lib depends, try to
134configure it with the option "--without-gui". 135configure it with the option "--without-gui".
135 136
137Note that Emacs cannot support complex scripts on a TTY, unless the
138terminal includes such a support.
139
136* intlfonts-VERSION.tar.gz 140* intlfonts-VERSION.tar.gz
137 141
138The intlfonts distribution contains X11 fonts in various encodings 142The intlfonts distribution contains X11 fonts in various encodings
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 @@
12011-09-28 Juanma Barranquero <lekktu@gmail.com>
2
3 * windows.texi (Splitting Windows): Fix typos.
4
12011-09-25 Martin Rudalics <rudalics@gmx.at> 52011-09-25 Martin Rudalics <rudalics@gmx.at>
2 6
3 * windows.texi (Windows and Frames, Display Action Functions) 7 * 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
1178penultimate configuration from the previous scenario from where we can 1178penultimate configuration from the previous scenario from where we can
1179continue as described before. 1179continue as described before.
1180 1180
1181 Another strategy starts with splitting an inital window @code{W6} by 1181 Another strategy starts with splitting an initial window @code{W6} by
1182evaluating @code{(split-window W6 nil nil t)} with the following result: 1182evaluating @code{(split-window W6 nil nil t)} with the following result:
1183@smallexample 1183@smallexample
1184@group 1184@group
@@ -1259,11 +1259,11 @@ configuration.
1259@defopt window-splits 1259@defopt window-splits
1260If this variable is nil, the function @code{split-window} can split a 1260If this variable is nil, the function @code{split-window} can split a
1261window if and only if that window's screen estate is sufficiently large 1261window if and only if that window's screen estate is sufficiently large
1262to accomodate both--itself and the new window. 1262to accommodate both--itself and the new window.
1263 1263
1264If this variable is non-@code{nil}, @code{split-window} tries to resize 1264If this variable is non-@code{nil}, @code{split-window} tries to resize
1265all windows that are part of the same combination as the old window to 1265all windows that are part of the same combination as the old window to
1266accomodate the new window. Hence, the new window can be also created if 1266accommodate the new window. Hence, the new window can be also created if
1267the old window is of fixed size or too small to split (@pxref{Window 1267the old window is of fixed size or too small to split (@pxref{Window
1268Sizes}). 1268Sizes}).
1269 1269
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ec867fee08b..f83dbdd344a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,37 @@
12011-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/perl-mode.el (perl-syntax-propertize-function):
4 Don't confuse "y => 3" as the beginning of a `y' operation.
5
6 * emacs-lisp/debug.el (debug-convert-byte-code): Don't assume the
7 object has more than 4 slots (bug#9613).
8
92011-09-28 Juanma Barranquero <lekktu@gmail.com>
10
11 * subr.el (with-output-to-temp-buffer):
12 * net/quickurl.el (quickurl, quickurl-browse-url):
13 Fix typos in docstrings.
14
152011-09-27 Eli Zaretskii <eliz@gnu.org>
16
17 * minibuffer.el (completion-styles)
18 (completion-category-overrides): Cross reference each other in doc
19 strings.
20
212011-09-27 Glenn Morris <rgm@gnu.org>
22
23 * pcmpl-cvs.el (pcmpl-cvs-entries): Update for Emacs 22.1 changes
24 to split-string. (Bug#9606)
25
262011-09-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
27
28 * mail/smtpmail.el (smtpmail-via-smtp): Fix STARTTLS detection
29 (bug#9615).
30
312011-09-27 Chong Yidong <cyd@stupidchicken.com>
32
33 * emacs-lisp/package.el (list-packages): Fix echo area message.
34
12011-09-27 Leo Liu <sdl.web@gmail.com> 352011-09-27 Leo Liu <sdl.web@gmail.com>
2 36
3 * ido.el (ido-read-internal): Accept cons cell HIST arg. 37 * ido.el (ido-read-internal): Accept cons cell HIST arg.
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 @@
1743 auto-composition-function to it. 1743 auto-composition-function to it.
1744 (toggle-auto-composition): New function. 1744 (toggle-auto-composition): New function.
1745 1745
1746 * international/characters.el: Make all chararacters in the 1746 * international/characters.el: Make all characters in the
1747 charset tibetan to tibetan script. 1747 charset tibetan to tibetan script.
1748 1748
1749 * international/mule-conf.el (tibetan): Fix :code-space property. 1749 * international/mule-conf.el (tibetan): Fix :code-space property.
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."
869 ,defn 869 ,defn
870 ,@(remq '&rest (remq '&optional args)))))) 870 ,@(remq '&rest (remq '&optional args))))))
871 (if (> (length defn) 5) 871 (if (> (length defn) 5)
872 ;; The mere presence of field 5 is sufficient to make
873 ;; it interactive.
872 (push `(interactive ,(aref defn 5)) body)) 874 (push `(interactive ,(aref defn 5)) body))
873 (if (aref defn 4) 875 (if (and (> (length defn) 4) (aref defn 4))
874 ;; Use `documentation' here, to get the actual string, 876 ;; Use `documentation' here, to get the actual string,
875 ;; in case the compiled function has a reference 877 ;; in case the compiled function has a reference
876 ;; to the .elc file. 878 ;; to the .elc file.
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*'."
1658 (switch-to-buffer buf)) 1658 (switch-to-buffer buf))
1659 (let ((upgrades (package-menu--find-upgrades))) 1659 (let ((upgrades (package-menu--find-upgrades)))
1660 (if upgrades 1660 (if upgrades
1661 (message "%d package%s can be upgraded; type `%s' to mark them for upgrading." 1661 (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading."
1662 (length upgrades) 1662 (length upgrades)
1663 (if (= (length upgrades) 1) "" "s") 1663 (if (= (length upgrades) 1) "" "s")
1664 (substitute-command-keys "\\[package-menu-mark-upgrades]"))))) 1664 (substitute-command-keys "\\[package-menu-mark-upgrades]")
1665 (if (= (length upgrades) 1) "it" "them")))))
1665 1666
1666;;;###autoload 1667;;;###autoload
1667(defalias 'package-list-packages 'list-packages) 1668(defalias 'package-list-packages 'list-packages)
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 @@
3 * plstore.el (plstore-select-keys, plstore-encrypt-to): Clarify 3 * plstore.el (plstore-select-keys, plstore-encrypt-to): Clarify
4 documentation. 4 documentation.
5 5
62011-09-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7
8 * gnus-uu.el (gnus-uu-grab-articles): Require gnus-async so that
9 `gnus-asynchronous' isn't shadowed.
10
62011-09-26 Lars Magne Ingebrigtsen <larsi@gnus.org> 112011-09-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
7 12
8 * nnimap.el (nnimap-wait-for-response): Message less (bug#9540). 13 * 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."
1290;; the process-function has been successful and nil otherwise. 1290;; the process-function has been successful and nil otherwise.
1291(defun gnus-uu-grab-articles (articles process-function 1291(defun gnus-uu-grab-articles (articles process-function
1292 &optional sloppy limit no-errors) 1292 &optional sloppy limit no-errors)
1293 (require 'gnus-async)
1293 (let ((state 'first) 1294 (let ((state 'first)
1294 (gnus-asynchronous nil) 1295 (gnus-asynchronous nil)
1295 (gnus-inhibit-treatment t) 1296 (gnus-inhibit-treatment t)
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.")
658 :always-query-capabilities t 658 :always-query-capabilities t
659 :starttls-function 659 :starttls-function
660 (lambda (capabilities) 660 (lambda (capabilities)
661 (and (string-match "-STARTTLS" capabilities) 661 (and (string-match "[ -]STARTTLS" capabilities)
662 "STARTTLS\r\n")) 662 "STARTTLS\r\n"))
663 :client-certificate t 663 :client-certificate t
664 :use-starttls-if-possible t))) 664 :use-starttls-if-possible t)))
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.")
482 ;; and simply add "bar" to the end of the result. 482 ;; and simply add "bar" to the end of the result.
483 emacs22) 483 emacs22)
484 "List of completion styles to use. 484 "List of completion styles to use.
485The available styles are listed in `completion-styles-alist'." 485The available styles are listed in `completion-styles-alist'.
486
487Note that `completion-category-overrides' may override these
488styles for specific categories, such as files, buffers, etc."
486 :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x))) 489 :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x)))
487 completion-styles-alist))) 490 completion-styles-alist)))
488 :group 'minibuffer 491 :group 'minibuffer
@@ -490,7 +493,7 @@ The available styles are listed in `completion-styles-alist'."
490 493
491(defcustom completion-category-overrides 494(defcustom completion-category-overrides
492 '((buffer (styles . (basic substring)))) 495 '((buffer (styles . (basic substring))))
493 "List of overrides for specific categories. 496 "List of `completion-styles' overrides for specific categories.
494Each override has the shape (CATEGORY . ALIST) where ALIST is 497Each override has the shape (CATEGORY . ALIST) where ALIST is
495an association list that can specify properties such as: 498an association list that can specify properties such as:
496- `styles': the list of `completion-styles' to use for that category. 499- `styles': the list of `completion-styles' to use for that category.
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."
307 "Insert a URL based on LOOKUP. 307 "Insert a URL based on LOOKUP.
308 308
309If not supplied LOOKUP is taken to be the word at point in the current 309If not supplied LOOKUP is taken to be the word at point in the current
310buffer, this default action can be modifed via 310buffer, this default action can be modified via
311`quickurl-grab-lookup-function'." 311`quickurl-grab-lookup-function'."
312 (interactive) 312 (interactive)
313 (when (or lookup 313 (when (or lookup
@@ -402,7 +402,7 @@ is decided."
402 "Browse the URL associated with LOOKUP. 402 "Browse the URL associated with LOOKUP.
403 403
404If not supplied LOOKUP is taken to be the word at point in the 404If not supplied LOOKUP is taken to be the word at point in the
405current buffer, this default action can be modifed via 405current buffer, this default action can be modified via
406`quickurl-grab-lookup-function'." 406`quickurl-grab-lookup-function'."
407 (interactive) 407 (interactive)
408 (when (or lookup 408 (when (or lookup
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 @@
12011-09-27 Eli Zaretskii <eliz@gnu.org>
2
3 * org.el (org-mode): Force left-to-right paragraphs in Org
4 buffers. For a related discussions, see
5 https://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00349.html.
6
12011-09-17 Juanma Barranquero <lekktu@gmail.com> 72011-09-17 Juanma Barranquero <lekktu@gmail.com>
2 8
3 * org.el (org-toggle-pretty-entities): Fix typo in message. 9 * 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:
4748 (org-set-local 'line-move-ignore-invisible t)) 4748 (org-set-local 'line-move-ignore-invisible t))
4749 (org-set-local 'outline-regexp org-outline-regexp) 4749 (org-set-local 'outline-regexp org-outline-regexp)
4750 (org-set-local 'outline-level 'org-outline-level) 4750 (org-set-local 'outline-level 'org-outline-level)
4751 (setq bidi-paragraph-direction 'left-to-right)
4751 (when (and org-ellipsis 4752 (when (and org-ellipsis
4752 (fboundp 'set-display-table-slot) (boundp 'buffer-display-table) 4753 (fboundp 'set-display-table-slot) (boundp 'buffer-display-table)
4753 (fboundp 'make-glyph-code)) 4754 (fboundp 'make-glyph-code))
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'."
169 (insert-file-contents (concat dir "CVS/Entries")) 169 (insert-file-contents (concat dir "CVS/Entries"))
170 (goto-char (point-min)) 170 (goto-char (point-min))
171 (while (not (eobp)) 171 (while (not (eobp))
172 (let* ((line (buffer-substring (line-beginning-position) 172 ;; Normal file: /NAME -> "" "NAME"
173 (line-end-position))) 173 ;; Directory : D/NAME -> "D" "NAME"
174 (fields (split-string line "/")) 174 (let* ((fields (split-string (buffer-substring
175 text) 175 (line-beginning-position)
176 (if (eq (aref line 0) ?/) 176 (line-end-position))
177 (setq fields (cons "" fields))) 177 "/"))
178 (setq text (nth 1 fields)) 178 (text (nth 1 fields)))
179 (when text 179 (when text
180 (if (string= (nth 0 fields) "D") 180 (if (string= (nth 0 fields) "D")
181 (setq text (file-name-as-directory text))) 181 (setq text (file-name-as-directory text)))
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."
304 (put-text-property (match-beginning 2) (match-end 2) 304 (put-text-property (match-beginning 2) (match-end 2)
305 'syntax-table (string-to-syntax "\"")) 305 'syntax-table (string-to-syntax "\""))
306 (perl-syntax-propertize-special-constructs end))))) 306 (perl-syntax-propertize-special-constructs end)))))
307 ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\([^])}> \n\t]\\)" 307 ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\(?:\\([^])}>= \n\t]\\)\\|\\(?3:=\\)[^>]\\)"
308 ;; Nasty cases: 308 ;; Nasty cases:
309 ;; /foo/m $a->m $#m $m @m %m 309 ;; /foo/m $a->m $#m $m @m %m
310 ;; \s (appears often in regexps). 310 ;; \s (appears often in regexps).
311 ;; -s file 311 ;; -s file
312 ;; y => 3
312 ;; sub tr {...} 313 ;; sub tr {...}
313 (3 (ignore 314 (3 (ignore
314 (if (save-excursion (goto-char (match-beginning 0)) 315 (if (save-excursion (goto-char (match-beginning 0))
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
3002generated with `prin1' and similar functions in BODY goes into 3002generated with `prin1' and similar functions in BODY goes into
3003the buffer. 3003the buffer.
3004 3004
3005At the end of BODY, this marks buffer BUFNAME unmodifed and displays 3005At the end of BODY, this marks buffer BUFNAME unmodified and displays
3006it in a window, but does not select it. The normal way to do this is 3006it in a window, but does not select it. The normal way to do this is
3007by calling `display-buffer', then running `temp-buffer-show-hook'. 3007by calling `display-buffer', then running `temp-buffer-show-hook'.
3008However, if `temp-buffer-show-function' is non-nil, it calls that 3008However, if `temp-buffer-show-function' is non-nil, it calls that
diff --git a/src/ChangeLog b/src/ChangeLog
index 4f1edc95668..4f0a0b9ab74 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12011-09-27 Paul Eggert <eggert@cs.ucla.edu> 12011-09-28 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 3 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) 4 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
@@ -775,6 +775,27 @@
775 rather than rolling our own approximation. 775 rather than rolling our own approximation.
776 (SCROLL_BAR_VEC_SIZE): Remove; not used. 776 (SCROLL_BAR_VEC_SIZE): Remove; not used.
777 777
7782011-09-28 Eli Zaretskii <eliz@gnu.org>
779
780 * xdisp.c (compute_display_string_end): If there's no display
781 string at CHARPOS, return -1.
782
783 * bidi.c (bidi_fetch_char): When compute_display_string_end
784 returns a negative value, treat the character as a normal
785 character not covered by a display string. (Bug#9624)
786
7872011-09-28 Juanma Barranquero <lekktu@gmail.com>
788
789 * lread.c (Fread_from_string): Fix typo in docstring.
790
7912011-09-27 Eli Zaretskii <eliz@gnu.org>
792
793 * xdisp.c (handle_invisible_prop): If invisible text ends on a
794 newline, reseat the iterator instead of bidi-iterating there one
795 character at a time. (Bug#9610)
796 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
797 TO_CHARPOS if the bidi iterator is at base embedding level.
798
7782011-09-27 Andreas Schwab <schwab@linux-m68k.org> 7992011-09-27 Andreas Schwab <schwab@linux-m68k.org>
779 800
780 * lread.c (readevalloop): Use correct code for NBSP. 801 * lread.c (readevalloop): Use correct code for NBSP.
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 @@
4547 4547
4548 * composite.c (composition_compute_stop_pos): In forward search, 4548 * composite.c (composition_compute_stop_pos): In forward search,
4549 pay attention to the possibility that some character after ENDPOS 4549 pay attention to the possibility that some character after ENDPOS
4550 will be composed with charactrs before ENDPOS. 4550 will be composed with characters before ENDPOS.
4551 4551
45522010-08-24 Chong Yidong <cyd@stupidchicken.com> 45522010-08-24 Chong Yidong <cyd@stupidchicken.com>
4553 4553
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 @@
10460 (Fkey_description): Likewise. 10460 (Fkey_description): Likewise.
10461 10461
10462 * lread.c (read1): On reading multibyte string, be sure to make 10462 * lread.c (read1): On reading multibyte string, be sure to make
10463 all 8-bit chararacters in valid multibyte form. 10463 all 8-bit characters in valid multibyte form.
10464 (readchar): Use FETCH_STRING_CHAR_ADVANCE unconditionally. 10464 (readchar): Use FETCH_STRING_CHAR_ADVANCE unconditionally.
10465 10465
10466 * print.c (print_object): Use FETCH_STRING_CHAR_ADVANCE 10466 * print.c (print_object): Use FETCH_STRING_CHAR_ADVANCE
diff --git a/src/bidi.c b/src/bidi.c
index c7b3a770597..a43490f4110 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -974,6 +974,15 @@ bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos,
974 ch = 0xFFFC; 974 ch = 0xFFFC;
975 } 975 }
976 disp_end_pos = compute_display_string_end (*disp_pos, string); 976 disp_end_pos = compute_display_string_end (*disp_pos, string);
977 if (disp_end_pos < 0)
978 {
979 /* Somebody removed the display string from the buffer
980 behind our back. Recover by processing this buffer
981 position as if no display property were present there to
982 begin with. */
983 *disp_prop = 0;
984 goto normal_char;
985 }
977 *nchars = disp_end_pos - *disp_pos; 986 *nchars = disp_end_pos - *disp_pos;
978 if (*nchars <= 0) 987 if (*nchars <= 0)
979 abort (); 988 abort ();
@@ -988,6 +997,7 @@ bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos,
988 } 997 }
989 else 998 else
990 { 999 {
1000 normal_char:
991 if (string->s) 1001 if (string->s)
992 { 1002 {
993 int len; 1003 int len;
diff --git a/src/lread.c b/src/lread.c
index 1179d63436f..91195a88e63 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1971,7 +1971,7 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
1971 doc: /* Read one Lisp expression which is represented as text by STRING. 1971 doc: /* Read one Lisp expression which is represented as text by STRING.
1972Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). 1972Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
1973FINAL-STRING-INDEX is an integer giving the position of the next 1973FINAL-STRING-INDEX is an integer giving the position of the next
1974 remaining chararacter in STRING. 1974 remaining character in STRING.
1975START and END optionally delimit a substring of STRING from which to read; 1975START and END optionally delimit a substring of STRING from which to read;
1976 they default to 0 and (length STRING) respectively. */) 1976 they default to 0 and (length STRING) respectively. */)
1977 (Lisp_Object string, Lisp_Object start, Lisp_Object end) 1977 (Lisp_Object string, Lisp_Object start, Lisp_Object end)
diff --git a/src/xdisp.c b/src/xdisp.c
index e6a38f76dc5..ce240922010 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3389,9 +3389,10 @@ compute_display_string_pos (struct text_pos *position,
3389} 3389}
3390 3390
3391/* Return the character position of the end of the display string that 3391/* Return the character position of the end of the display string that
3392 started at CHARPOS. A display string is either an overlay with 3392 started at CHARPOS. If there's no display string at CHARPOS,
3393 `display' property whose value is a string or a `display' text 3393 return -1. A display string is either an overlay with `display'
3394 property whose value is a string. */ 3394 property whose value is a string or a `display' text property whose
3395 value is a string. */
3395ptrdiff_t 3396ptrdiff_t
3396compute_display_string_end (ptrdiff_t charpos, struct bidi_string_data *string) 3397compute_display_string_end (ptrdiff_t charpos, struct bidi_string_data *string)
3397{ 3398{
@@ -3405,8 +3406,22 @@ compute_display_string_end (ptrdiff_t charpos, struct bidi_string_data *string)
3405 if (charpos >= eob || (string->s && !STRINGP (object))) 3406 if (charpos >= eob || (string->s && !STRINGP (object)))
3406 return eob; 3407 return eob;
3407 3408
3409 /* It could happen that the display property or overlay was removed
3410 since we found it in compute_display_string_pos above. One way
3411 this can happen is if JIT font-lock was called (through
3412 handle_fontified_prop), and jit-lock-functions remove text
3413 properties or overlays from the portion of buffer that includes
3414 CHARPOS. Muse mode is known to do that, for example. In this
3415 case, we return -1 to the caller, to signal that no display
3416 string is actually present at CHARPOS. See bidi_fetch_char for
3417 how this is handled.
3418
3419 An alternative would be to never look for display properties past
3420 it->stop_charpos. But neither compute_display_string_pos nor
3421 bidi_fetch_char that calls it know or care where the next
3422 stop_charpos is. */
3408 if (NILP (Fget_char_property (pos, Qdisplay, object))) 3423 if (NILP (Fget_char_property (pos, Qdisplay, object)))
3409 abort (); 3424 return -1;
3410 3425
3411 /* Look forward for the first character where the `display' property 3426 /* Look forward for the first character where the `display' property
3412 changes. */ 3427 changes. */
@@ -4059,40 +4074,67 @@ handle_invisible_prop (struct it *it)
4059 /* The position newpos is now either ZV or on visible text. */ 4074 /* The position newpos is now either ZV or on visible text. */
4060 if (it->bidi_p && newpos < ZV) 4075 if (it->bidi_p && newpos < ZV)
4061 { 4076 {
4062 /* With bidi iteration, the region of invisible text 4077 ptrdiff_t bpos = CHAR_TO_BYTE (newpos);
4063 could start and/or end in the middle of a non-base 4078
4064 embedding level. Therefore, we need to skip 4079 if (FETCH_BYTE (bpos) == '\n'
4065 invisible text using the bidi iterator, starting at 4080 || (newpos > BEGV && FETCH_BYTE (bpos - 1) == '\n'))
4066 IT's current position, until we find ourselves
4067 outside the invisible text. Skipping invisible text
4068 _after_ bidi iteration avoids affecting the visual
4069 order of the displayed text when invisible properties
4070 are added or removed. */
4071 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
4072 { 4081 {
4073 /* If we were `reseat'ed to a new paragraph, 4082 /* If the invisible text ends on a newline or the
4074 determine the paragraph base direction. We need 4083 character after a newline, we can avoid the
4075 to do it now because next_element_from_buffer may 4084 costly, character by character, bidi iteration to
4076 not have a chance to do it, if we are going to 4085 newpos, and instead simply reseat the iterator
4077 skip any text at the beginning, which resets the 4086 there. That's because all bidi reordering
4078 FIRST_ELT flag. */ 4087 information is tossed at the newline. This is a
4079 bidi_paragraph_init (it->paragraph_embedding, 4088 big win for modes that hide complete lines, like
4080 &it->bidi_it, 1); 4089 Outline, Org, etc. (Implementation note: the
4090 call to reseat_1 is necessary, because it signals
4091 to the bidi iterator that it needs to reinit its
4092 internal information when the next element for
4093 display is requested. */
4094 struct text_pos tpos;
4095
4096 SET_TEXT_POS (tpos, newpos, bpos);
4097 reseat_1 (it, tpos, 0);
4081 } 4098 }
4082 do 4099 else /* Must use the slow method. */
4083 { 4100 {
4084 bidi_move_to_visually_next (&it->bidi_it); 4101 /* With bidi iteration, the region of invisible text
4102 could start and/or end in the middle of a
4103 non-base embedding level. Therefore, we need to
4104 skip invisible text using the bidi iterator,
4105 starting at IT's current position, until we find
4106 ourselves outside the invisible text. Skipping
4107 invisible text _after_ bidi iteration avoids
4108 affecting the visual order of the displayed text
4109 when invisible properties are added or
4110 removed. */
4111 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
4112 {
4113 /* If we were `reseat'ed to a new paragraph,
4114 determine the paragraph base direction. We
4115 need to do it now because
4116 next_element_from_buffer may not have a
4117 chance to do it, if we are going to skip any
4118 text at the beginning, which resets the
4119 FIRST_ELT flag. */
4120 bidi_paragraph_init (it->paragraph_embedding,
4121 &it->bidi_it, 1);
4122 }
4123 do
4124 {
4125 bidi_move_to_visually_next (&it->bidi_it);
4126 }
4127 while (it->stop_charpos <= it->bidi_it.charpos
4128 && it->bidi_it.charpos < newpos);
4129 IT_CHARPOS (*it) = it->bidi_it.charpos;
4130 IT_BYTEPOS (*it) = it->bidi_it.bytepos;
4131 /* If we overstepped NEWPOS, record its position in
4132 the iterator, so that we skip invisible text if
4133 later the bidi iteration lands us in the
4134 invisible region again. */
4135 if (IT_CHARPOS (*it) >= newpos)
4136 it->prev_stop = newpos;
4085 } 4137 }
4086 while (it->stop_charpos <= it->bidi_it.charpos
4087 && it->bidi_it.charpos < newpos);
4088 IT_CHARPOS (*it) = it->bidi_it.charpos;
4089 IT_BYTEPOS (*it) = it->bidi_it.bytepos;
4090 /* If we overstepped NEWPOS, record its position in the
4091 iterator, so that we skip invisible text if later the
4092 bidi iteration lands us in the invisible region
4093 again. */
4094 if (IT_CHARPOS (*it) >= newpos)
4095 it->prev_stop = newpos;
4096 } 4138 }
4097 else 4139 else
4098 { 4140 {
@@ -7886,7 +7928,9 @@ move_it_in_display_line_to (struct it *it,
7886 ((op & MOVE_TO_POS) != 0 \ 7928 ((op & MOVE_TO_POS) != 0 \
7887 && BUFFERP (it->object) \ 7929 && BUFFERP (it->object) \
7888 && (IT_CHARPOS (*it) == to_charpos \ 7930 && (IT_CHARPOS (*it) == to_charpos \
7889 || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos) \ 7931 || ((!it->bidi_p \
7932 || BIDI_AT_BASE_LEVEL (it->bidi_it)) \
7933 && IT_CHARPOS (*it) > to_charpos) \
7890 || (it->what == IT_COMPOSITION \ 7934 || (it->what == IT_COMPOSITION \
7891 && ((IT_CHARPOS (*it) > to_charpos \ 7935 && ((IT_CHARPOS (*it) > to_charpos \
7892 && to_charpos >= it->cmp_it.charpos) \ 7936 && to_charpos >= it->cmp_it.charpos) \
@@ -7918,7 +7962,13 @@ move_it_in_display_line_to (struct it *it,
7918 if ((op & MOVE_TO_POS) != 0 7962 if ((op & MOVE_TO_POS) != 0
7919 && BUFFERP (it->object) 7963 && BUFFERP (it->object)
7920 && it->method == GET_FROM_BUFFER 7964 && it->method == GET_FROM_BUFFER
7921 && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos) 7965 && (((!it->bidi_p
7966 /* When the iterator is at base embedding level, we
7967 are guaranteed that characters are delivered for
7968 display in strictly increasing order of their
7969 buffer positions. */
7970 || BIDI_AT_BASE_LEVEL (it->bidi_it))
7971 && IT_CHARPOS (*it) > to_charpos)
7922 || (it->bidi_p 7972 || (it->bidi_p
7923 && (prev_method == GET_FROM_IMAGE 7973 && (prev_method == GET_FROM_IMAGE
7924 || prev_method == GET_FROM_STRETCH 7974 || prev_method == GET_FROM_STRETCH
diff --git a/test/ChangeLog b/test/ChangeLog
index 11b3d9b5e2d..6ab148358d9 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
12011-09-27 Ulf Jasper <ulf.jasper@web.de>
2
3 * automated/newsticker-tests.el: Move newsticker-testsuite.el
4 to automated/newsticker-tests.el. Convert to ERT.
5
12011-07-26 Ulf Jasper <ulf.jasper@web.de> 62011-07-26 Ulf Jasper <ulf.jasper@web.de>
2 7
3 * automated/icalendar-tests.el (icalendar-tests--compare-strings): 8 * automated/icalendar-tests.el (icalendar-tests--compare-strings):
diff --git a/test/newsticker-testsuite.el b/test/automated/newsticker-tests.el
index 99e40a7ef15..76f4345da55 100644
--- a/test/newsticker-testsuite.el
+++ b/test/automated/newsticker-tests.el
@@ -3,12 +3,7 @@
3;; Copyright (C) 2003-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2011 Free Software Foundation, Inc.
4 4
5;; Author: Ulf Jasper <ulf.jasper@web.de> 5;; Author: Ulf Jasper <ulf.jasper@web.de>
6;; Filename: newsticker-testsuite.el
7;; URL: http://www.nongnu.org/newsticker
8;; Keywords: News, RSS, Atom 6;; Keywords: News, RSS, Atom
9;; Time-stamp: "14. Juni 2008, 12:09:39 (ulf)"
10
11;; ======================================================================
12 7
13;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
14 9
@@ -25,42 +20,26 @@
25;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
26;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27 22
28;; ======================================================================
29
30;;; Commentary: 23;;; Commentary:
31 24
32;;; Code: 25;;; Code:
33 26
34(require 'cl) ; assert 27(require 'ert)
35 28(require 'newsticker)
36;; ======================================================================
37;; Entry point
38;; ======================================================================
39(defun newsticker--testsuite ()
40 "Unit test for newsticker.
41Subtests signal errors if something goes wrong."
42 (interactive)
43 (newsticker--test--guid)
44 (newsticker--test--cache-contains)
45 (newsticker--test--decode-iso8601-date)
46 (newsticker--test--decode-rfc822-date)
47 (newsticker--test--group-manage-orphan-feeds)
48 (message "All tests passed successfully."))
49 29
50;; ====================================================================== 30;; ======================================================================
51;; Tests for newsticker-backend 31;; Tests for newsticker-backend
52;; ====================================================================== 32;; ======================================================================
53(defun newsticker--test--guid () 33(ert-deftest newsticker--guid ()
54 "Test `newsticker-guid-*'. 34 "Test for `newsticker--guid-*'.
55Signals an error if something goes wrong." 35Signals an error if something goes wrong."
56 (assert (string= "blah" (newsticker--guid-to-string "blah"))) 36 (should (string= "blah" (newsticker--guid-to-string "blah")))
57 (assert (string= "myguid" (newsticker--guid '("title1" "description1" "link1" 37 (should (string= "myguid" (newsticker--guid '("title1" "description1" "link1"
58 nil 'new 42 nil nil 38 nil 'new 42 nil nil
59 ((guid () "myguid"))))))) 39 ((guid () "myguid")))))))
60 40
61(defun newsticker--test--cache-contains () 41(ert-deftest newsticker--cache-contains ()
62 "Test `newsticker--test--cache-contains'. 42 "Test for `newsticker--cache-contains'."
63Signals an error if something goes wrong."
64 (let ((newsticker--cache '((feed1 43 (let ((newsticker--cache '((feed1
65 ("title1" "description1" "link1" nil 'new 42 44 ("title1" "description1" "link1" nil 'new 42
66 nil nil ((guid () "myguid"))))))) 45 nil nil ((guid () "myguid")))))))
@@ -68,78 +47,68 @@ Signals an error if something goes wrong."
68 (assoc 'guid (newsticker--extra '("title1" "description1" 47 (assoc 'guid (newsticker--extra '("title1" "description1"
69 "link1" nil 'new 42 nil nil 48 "link1" nil 'new 42 nil nil
70 ((guid "myguid")))))) 49 ((guid "myguid"))))))
71 (assert (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE" 50 (should (newsticker--cache-contains newsticker--cache 'feed1 "WRONGTITLE"
72 "description1" "link1" 'new "myguid")) 51 "description1" "link1" 'new "myguid"))
73 (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" 52 (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1"
74 "description1" "link1" 'new 53 "description1" "link1" 'new
75 "WRONG GUID"))) 54 "WRONG GUID")))
76 (assert (newsticker--cache-contains newsticker--cache 'feed1 "title1" 55 (should (newsticker--cache-contains newsticker--cache 'feed1 "title1"
77 "description1" "link1" 'new "myguid"))) 56 "description1" "link1" 'new "myguid")))
78 (let ((newsticker--cache '((feed1 57 (let ((newsticker--cache '((feed1
79 ("title1" "description1" "link1" nil 'new 42 58 ("title1" "description1" "link1" nil 'new 42
80 nil nil ((guid () "myguid1"))) 59 nil nil ((guid () "myguid1")))
81 ("title1" "description1" "link1" nil 'new 42 60 ("title1" "description1" "link1" nil 'new 42
82 nil nil ((guid () "myguid2"))))))) 61 nil nil ((guid () "myguid2")))))))
83 (assert (not (newsticker--cache-contains newsticker--cache 'feed1 "title1" 62 (should (not (newsticker--cache-contains newsticker--cache 'feed1 "title1"
84 "description1" "link1" 'new 63 "description1" "link1" 'new
85 "myguid"))) 64 "myguid")))
86 (assert (string= "myguid1" 65 (should (string= "myguid1"
87 (newsticker--guid (newsticker--cache-contains 66 (newsticker--guid (newsticker--cache-contains
88 newsticker--cache 'feed1 "title1" 67 newsticker--cache 'feed1 "title1"
89 "description1" "link1" 'new 68 "description1" "link1" 'new
90 "myguid1")))) 69 "myguid1"))))
91 (assert (string= "myguid2" 70 (should (string= "myguid2"
92 (newsticker--guid (newsticker--cache-contains 71 (newsticker--guid (newsticker--cache-contains
93 newsticker--cache 'feed1 "title1" 72 newsticker--cache 'feed1 "title1"
94 "description1" "link1" 'new 73 "description1" "link1" 'new
95 "myguid2")))))) 74 "myguid2"))))))
96 75
97(defun newsticker--do-test--decode-iso8601-date (input expected) 76(defun newsticker-tests--decode-iso8601-date (input expected)
98 "Actually test `newsticker--decode-iso8601-date'. 77 "Actually test `newsticker--decode-iso8601-date'.
99Signals an error if iso8601-encoded INPUT does not match EXPECTED." 78Apply to INPUT and compare with EXPECTED."
100 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" 79 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S"
101 (newsticker--decode-iso8601-date input) 80 (newsticker--decode-iso8601-date input)
102 t))) 81 t)))
103 (assert (string= result expected) 82 (should (string= result expected))))
104 nil "Error decoding '%s': found '%s' but expected '%s'."
105 input result expected)))
106 83
107(defun newsticker--test--decode-iso8601-date () 84(ert-deftest newsticker--decode-iso8601-date ()
108 "Test `newsticker--decode-iso8601-date'." 85 "Test `newsticker--decode-iso8601-date'."
109 (newsticker--decode-iso8601-date "2004-09-17T05:09:49+00:00") 86 (newsticker-tests--decode-iso8601-date "2004"
110 (newsticker--decode-iso8601-date "2004-09-17T05:09+00:00") 87 "2004-01-01T00:00:00")
111 (newsticker--decode-iso8601-date "2004-09-17T05:09:49") 88 (newsticker-tests--decode-iso8601-date "2004-09"
112 (newsticker--decode-iso8601-date "2004-09-17T05:09") 89 "2004-09-01T00:00:00")
113 (newsticker--decode-iso8601-date "2004-09-17") 90 (newsticker-tests--decode-iso8601-date "2004-09-17"
114 (newsticker--decode-iso8601-date "2004-09") 91 "2004-09-17T00:00:00")
115 (newsticker--do-test--decode-iso8601-date "2004" 92 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09"
116 "2004-01-01T00:00:00") 93 "2004-09-17T05:09:00")
117 (newsticker--do-test--decode-iso8601-date "2004-09" 94 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49"
118 "2004-09-01T00:00:00") 95 "2004-09-17T05:09:49")
119 (newsticker--do-test--decode-iso8601-date "2004-09-17" 96 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09:49.123"
120 "2004-09-17T00:00:00") 97 "2004-09-17T05:09:49")
121 (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09" 98 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09+01:00"
122 "2004-09-17T05:09:00") 99 "2004-09-17T04:09:00")
123 (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49" 100 (newsticker-tests--decode-iso8601-date "2004-09-17T05:09-02:00"
124 "2004-09-17T05:09:49") 101 "2004-09-17T07:09:00"))
125 (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09:49.123"
126 "2004-09-17T05:09:49")
127 (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09+01:00"
128 "2004-09-17T04:09:00")
129 (newsticker--do-test--decode-iso8601-date "2004-09-17T05:09-02:00"
130 "2004-09-17T07:09:00"))
131 102
132(defun newsticker--do-test--decode-rfc822-date (input expected) 103(defun newsticker--do-test--decode-rfc822-date (input expected)
133 "Actually test `newsticker--decode-rfc822-date'. 104 "Actually test `newsticker--decode-rfc822-date'.
134Signals an error if rfc822-encoded INPUT does not match EXPECTED." 105Apply to INPUT and compare with EXPECTED."
135 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S" 106 (let ((result (format-time-string "%Y-%m-%dT%H:%M:%S"
136 (newsticker--decode-rfc822-date input) 107 (newsticker--decode-rfc822-date input)
137 t))) 108 t)))
138 (assert (string= result expected) 109 (should (string= result expected))))
139 nil "Error decoding '%s': found '%s' but expected '%s'."
140 input result expected)))
141 110
142(defun newsticker--test--decode-rfc822-date () 111(ert-deftest newsticker--decode-rfc822-date ()
143 "Test `newsticker--decode-rfc822-date'." 112 "Test `newsticker--decode-rfc822-date'."
144 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100" 113 (newsticker--do-test--decode-rfc822-date "Mon, 10 Mar 2008 19:27:52 +0100"
145 "2008-03-10T18:27:52") 114 "2008-03-10T18:27:52")
@@ -164,16 +133,16 @@ Signals an error if rfc822-encoded INPUT does not match EXPECTED."
164;; ====================================================================== 133;; ======================================================================
165;; Tests for newsticker-treeview 134;; Tests for newsticker-treeview
166;; ====================================================================== 135;; ======================================================================
167(defun newsticker--test--group-manage-orphan-feeds () 136(ert-deftest newsticker--group-manage-orphan-feeds ()
168 "Test `newsticker--group-manage-orphan-feeds'. 137 "Test `newsticker--group-manage-orphan-feeds'.
169Signals an error if something goes wrong." 138Signals an error if something goes wrong."
170 (let ((newsticker-groups '("Feeds")) 139 (let ((newsticker-groups '("Feeds"))
171 (newsticker-url-list-defaults nil) 140 (newsticker-url-list-defaults nil)
172 (newsticker-url-list '(("feed1") ("feed2") ("feed3")))) 141 (newsticker-url-list '(("feed1") ("feed2") ("feed3"))))
173 (newsticker--group-manage-orphan-feeds) 142 (newsticker--group-manage-orphan-feeds)
174 (assert (equal '("Feeds" "feed3" "feed2" "feed1") 143 (should (equal '("Feeds" "feed3" "feed2" "feed1")
175 newsticker-groups)))) 144 newsticker-groups))))
176 145
177(provide 'newsticker-testsuite) 146(provide 'newsticker-tests)
178 147
179;;; newsticker-testsuite.el ends here 148;;; newsticker-tests.el ends here