Subject: rev 29 - trunk trunk/lisp

From: [email-masked]
Date: Sun, 6 Oct 2002 18:40:51 -0500

Author: kfogel
Date: 2002-10-06 18:40:44 -0500 (Sun, 06 Oct 2002)
New Revision: 29

Modified:
   trunk/BUGS
   trunk/dist.sh
   trunk/lisp/gene-seq-mode.el
Log:
* lisp/gene-seq-mode.el 
  (gene-do-window-sync): Do nothing if there is no sequence buffer
  window.  This fixes the bug reported by Loredana Lo Conte
  <[email-masked]>, whereby running the command
  'ale demo-data/demo.gb demo-data/demo.phylo' would generate a
  "wrong type argument: window-live-p, nil" error.

* BUGS: Record the phylogenetic browsing bug Loredana reported in the
  same email.

* dist.sh: Add a comment giving Loredana a formula for printing the
  "tree revision".

Modified: trunk/BUGS
==============================================================================
--- trunk/BUGS	(original)
+++ trunk/BUGS	Sun Oct  6 18:40:49 2002
@@ -1,5 +1,11 @@
   Oh Most Grandiose and Majestic Emacs, please be in -*- outline -*- mode!
 
+* [BUG] Phylogenetic browsing appears to be broken.
+
+   Do 'ale demo-data/demo.gb demo-data/demo.phylo', then try to browse
+   the tree.  See how nothing works.  For example, Mouse-1 on any
+   organism gets: "wrong number of args to `select-range' request".
+
 * [BUG] Can't insert a sequence at the end of the alignment.
 
   As Jim points out, in an alignment of N sequences, there are N+1

Modified: trunk/lisp/gene-seq-mode.el
==============================================================================
--- trunk/lisp/gene-seq-mode.el	(original)
+++ trunk/lisp/gene-seq-mode.el	Sun Oct  6 18:40:49 2002
@@ -501,34 +501,37 @@
 window-start to happen.  This doesn't always work, sad to say, so
 don't pass NO-RECENTER unless you absolutely must."
 
-  (save-excursion
-    (if (not (eq (selected-frame)
-                 (window-frame (gene-seq-buffer-window t))))
-        (select-frame (window-frame (gene-seq-buffer-window t))))
-    (let* ((o-win (selected-window))
-           this-win
-           (line (save-excursion
-                   (if no-recenter
-                       ;; Keep current line where it has been put
-                       ;; relative to the window.  Pray that the
-                       ;; sit-for forced recalculation of window-start
-                       ;; to happen.
-                       (progn
-                         (sit-for 0)
-                         (goto-char (window-start))
-                         (gene-current-line))
-                     ;; Else just manually place current line in the
-                     ;; center of the window:
-                     (beginning-of-line)
-                     (vertical-motion
-                      (- (/ (frame-height) 2)))
-                     (set-window-start o-win (point))
-                     (gene-current-line)))))
-      
-      (while (not (eq (setq this-win (next-window this-win)) o-win))
-        (set-buffer (window-buffer this-win))
-        (gene-goto-line line)
-        (set-window-start this-win (point))))))
+  (let ((seq-win (gene-seq-buffer-window t)))
+    ;; Only synchronize if the windows are visible.
+    (if seq-win
+        (save-excursion
+          (if (not (eq (selected-frame)
+                       (window-frame (gene-seq-buffer-window t))))
+              (select-frame (window-frame (gene-seq-buffer-window t))))
+          (let* ((o-win (selected-window))
+                 this-win
+                 (line (save-excursion
+                         (if no-recenter
+                             ;; Keep current line where it has been put
+                             ;; relative to the window.  Pray that the
+                             ;; sit-for forced recalculation of window-start
+                             ;; to happen.
+                             (progn
+                               (sit-for 0)
+                               (goto-char (window-start))
+                               (gene-current-line))
+                           ;; Else just manually place current line in the
+                           ;; center of the window:
+                           (beginning-of-line)
+                           (vertical-motion
+                            (- (/ (frame-height) 2)))
+                           (set-window-start o-win (point))
+                           (gene-current-line)))))
+            
+            (while (not (eq (setq this-win (next-window this-win)) o-win))
+              (set-buffer (window-buffer this-win))
+              (gene-goto-line line)
+              (set-window-start this-win (point))))))))

 (defun gene-seq-recenter-vertically ()

Modified: trunk/dist.sh
==============================================================================
--- trunk/dist.sh	(original)
+++ trunk/dist.sh	Sun Oct  6 18:40:50 2002
@@ -9,3 +9,8 @@
 mv ale-*.tar.gz www/
 cp docs/ale*.html www/
 cp docs/ale*.ps www/
+
+# This formula prints the revision of the tree, assuming the whole
+# tree is at one revision:
+#
+# svn st -vN . | head -1 | awk '{print $2}'