Make `news-select-buffer' select in other window by default.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 30 Aug 2013 15:30:20 +0000 (15:30 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 30 Aug 2013 15:30:22 +0000 (15:30 +0000)
From Rich Loveland.

src/edwin/snr.scm

index 14fce5874f5abc6683fc1cb01970590d5c128df1..51cab4a81d2772e603580dbb7b535997881d9cd1 100644 (file)
@@ -2128,22 +2128,26 @@ This unmarks the article indicated by point and any other articles in
                (update-buffer-news-thread-status buffer thread)))))))
 \f
 (define-command news-select-article
-  "Select a buffer containing the News article indicated by point."
-  ()
-  (lambda ()
-    (select-buffer
-     (let ((buffer (selected-buffer)))
-       (cond ((news-article-buffer? buffer)
-             buffer)
-            ((news-group-buffer? buffer)
-             (call-with-values
-                 (lambda ()
-                   (get-article-buffer buffer (current-news-header) #t))
-               (lambda (buffer new?)
-                 new?
-                 buffer)))
-            (else
-             (editor-error "No article selected.")))))))
+  "Select a buffer in the other window containing the News article at point.
+With prefix arg, select the buffer in the same window."
+  "P"
+  (lambda (same-window?)
+    (let ((proc (if same-window?
+                    select-buffer
+                    select-buffer-other-window)))
+      (proc
+       (let ((buffer (selected-buffer)))
+         (cond ((news-article-buffer? buffer)
+                buffer)
+               ((news-group-buffer? buffer)
+                (call-with-values
+                    (lambda ()
+                      (get-article-buffer buffer (current-news-header) #t))
+                  (lambda (buffer new?)
+                    new?
+                    buffer)))
+               (else
+                (editor-error "No article selected."))))))))
 
 (define-command news-toggle-thread
   "Expand or collapse the current thread."