From xemacs-m  Sat Jan 11 14:59:28 1997
Received: from dorsey.corp.teradyne.com (dorsey.corp.teradyne.com [131.101.17.251])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id OAA28164 for <xemacs-beta@xemacs.org>; Sat, 11 Jan 1997 14:59:28 -0600 (CST)
Received: from kiki.icd.teradyne.com (kiki.icd.teradyne.com [131.101.1.30]) by dorsey.corp.teradyne.com (8.7.1/8.7.1) with ESMTP id PAA03615 for <xemacs-beta@xemacs.org>; Sat, 11 Jan 1997 15:58:56 -0500 (EST)
Received: from spacely.icd.teradyne.com (spacely.icd.teradyne.com [131.101.10.9]) by kiki.icd.teradyne.com (8.7.1/8.7.1) with SMTP id PAA15155 for <xemacs-beta@xemacs.org>; Sat, 11 Jan 1997 15:53:29 -0500 (EST)
Received: from spacely by spacely.icd.teradyne.com (SMI-8.6/SMI-SVR4)
	id PAA05312; Sat, 11 Jan 1997 15:55:44 -0500
Message-Id: <199701112055.PAA05312@spacely.icd.teradyne.com>
X-Mailer: exmh version 2.0beta (patched 1/7/97)
To: xemacs-beta@xemacs.org
reply-to: acs@acm.org
Subject: Button2 on modeline
Mime-Version: 1.0
Content-Type: multipart/mixed ;
	boundary="==_Exmh_-345255420"
Date: Sat, 11 Jan 1997 15:55:44 -0500
From: Vinnie Shelton  <shelton@icd.teradyne.com>

This is a multipart MIME message.

--==_Exmh_-345255420
Content-Type: text/plain; charset=us-ascii

If you've ever used button2 on the modeline to click through the buffers, 
you've probably noticed that it works fine until you get to certain types 
of buffers.  The following patch (against v20) fixes the breakage in dired, 
info and hyper-apropos.

However, the real problem hasn't been addressed: an elisp writer is 
free to modify modeline-buffer-identification *and not use the -left and 
-right extents*.  As anyone who uses button2 to cycle through the buffers 
can tell you, one bad buffer/mode is all it takes to make the feature
unusable.

We should be able to come up with a better encapsulation for this, but 
until we do, this patch fixes info, dired and hyper-apropos.

--vin

--==_Exmh_-345255420
Content-Type: application/x-patch ; name="cycle2.patch"
Content-Description: cycle2.patch
Content-Disposition: attachment; filename="cycle2.patch"

--- lisp/packages/info.el.orig	Wed Dec 18 17:42:49 1996
+++ lisp/packages/info.el	Sat Jan 11 15:20:56 1997
@@ -834,17 +834,19 @@
 
 (defun Info-set-mode-line ()
   (setq modeline-buffer-identification
-	(concat
-	 "Info:  ("
-	 (if Info-current-file
-	     (let ((name (file-name-nondirectory Info-current-file)))
-	       (if (string-match "\\.info$" name)
-		   (substring name 0 -5)
-		 name))
-	   "")
-	 ")"
-	 (or Info-current-node ""))))
-
+	(list (cons modeline-buffer-id-left-extent "Info: ")
+	      (cons modeline-buffer-id-right-extent
+		    (concat
+		     "("
+		     (if Info-current-file
+			 (let ((name (file-name-nondirectory Info-current-file)))
+			   (if (string-match "\\.info$" name)
+			       (substring name 0 -5)
+			     name))
+		       "")
+		     ")"
+		     (or Info-current-node ""))))))
+	
 ;; Go to an info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.
 
--- lisp/packages/hyper-apropos.el.orig	Wed Dec 18 17:42:53 1996
+++ lisp/packages/hyper-apropos.el	Sat Jan 11 15:10:48 1997
@@ -336,8 +336,9 @@
 	buffer-read-only t
 	truncate-lines t
 	hypropos-last-regexp regexp
-	modeline-buffer-identification (concat "Hyper Apropos: "
-					       "\"" regexp "\""))
+	modeline-buffer-identification
+	(list (cons modeline-buffer-id-left-extent "Hyper Apropos: ")
+	      (cons modeline-buffer-id-right-extent (concat "\"" regexp "\""))))
   (setq mode-motion-hook 'mode-motion-highlight-line)
   (use-local-map hypropos-map)
   (run-hooks 'hyper-apropos-mode-hook))
--- lisp/dired/dired.el.orig	Wed Dec 18 17:42:37 1996
+++ lisp/dired/dired.el	Sat Jan 11 15:11:18 1997
@@ -852,7 +852,9 @@
 	case-fold-search nil
 	buffer-read-only t
 	selective-display t		; for subdirectory hiding
-	modeline-buffer-identification '("Dired: %17b"))
+	modeline-buffer-identification
+	(list (cons modeline-buffer-id-left-extent "Dired: ")
+	      (cons modeline-buffer-id-right-extent "%17b")))
   (set (make-local-variable 'revert-buffer-function)
        (function dired-revert))
   (set (make-local-variable 'page-delimiter)

--==_Exmh_-345255420--


