(gnus-article-set-window-start): Do nothing when the article buffer does not have...
authorKevin Greiner <kevin.greiner@compsol.cc>
Sun, 25 Mar 2007 18:08:30 +0000 (18:08 +0000)
committerKevin Greiner <kevin.greiner@compsol.cc>
Sun, 25 Mar 2007 18:08:30 +0000 (18:08 +0000)
lisp/gnus-art.el

index c94f2b2..38f2842 100644 (file)
@@ -4221,17 +4221,19 @@ Internal variable.")
 ;; Set article window start at LINE, where LINE is the number of lines
 ;; from the head of the article.
 (defun gnus-article-set-window-start (&optional line)
-  (set-window-start
-   (gnus-get-buffer-window gnus-article-buffer t)
-   (save-excursion
-     (set-buffer gnus-article-buffer)
-     (goto-char (point-min))
-     (if (not line)
-        (point-min)
-       (gnus-message 6 "Moved to bookmark")
-       (search-forward "\n\n" nil t)
-       (forward-line line)
-       (point)))))
+  (let ((article-window (gnus-get-buffer-window gnus-article-buffer t)))
+    (when article-window
+      (set-window-start
+       article-window
+       (save-excursion
+        (set-buffer gnus-article-buffer)
+        (goto-char (point-min))
+        (if (not line)
+            (point-min)
+          (gnus-message 6 "Moved to bookmark")
+          (search-forward "\n\n" nil t)
+          (forward-line line)
+          (point)))))))
 
 (defun gnus-article-prepare (article &optional all-headers header)
   "Prepare ARTICLE in article mode buffer.