]> git.eshelyaron.com Git - emacs.git/commitdiff
*** empty log message ***
authorChong Yidong <cyd@stupidchicken.com>
Tue, 6 Sep 2005 19:10:06 +0000 (19:10 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 6 Sep 2005 19:10:06 +0000 (19:10 +0000)
lisp/ChangeLog
lisp/buff-menu.el
lisp/mouse.el

index d1e102b52dafe565d567a92f91004fea0c8e5ee4..075bd7b3087418ce85903b71e054fa359e35fe48 100644 (file)
@@ -1,4 +1,11 @@
-2005-09-05  Chong Yidong  <cyd@stupidchicken.com>
+2005-09-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * buff-menu.el (Buffer-menu-make-sort-button): Allow mouse-1
+       clicks when using a header line.  Otherwise, use
+       mouse-1-click-follows-link.
+
+       * mouse.el (mouse-drag-header-line): Do nothing if the header-line
+       can't be moved; don't signal an error.
 
        * custom.el (custom-push-theme): Fix last change.
 
index 9418eebe98f6b221851ae74448f4aadaf9e576e8..41bc4bb3335101f69a02acb61a0990c738750a11 100644 (file)
@@ -638,29 +638,28 @@ For more information, see the function `buffer-menu'."
   (propertize name
              'help-echo (if column
                             (if Buffer-menu-use-header-line
-                                (concat "mouse-2: sort by " (downcase name))
+                                (concat "mouse-1, mouse-2: sort by "
+                                        (downcase name))
                               (concat "mouse-2, RET: sort by "
                                       (downcase name)))
                           (if Buffer-menu-use-header-line
-                              "mouse-2: sort by visited order"
+                              "mouse-1, mouse-2: sort by visited order"
                             "mouse-2, RET: sort by visited order"))
              'mouse-face 'highlight
-             'keymap (let ((map (make-sparse-keymap)))
-                       (if Buffer-menu-use-header-line
-                           (define-key map [header-line mouse-2]
-                             `(lambda (e)
-                                (interactive "e")
-                                (save-window-excursion
-                                  (if e (mouse-select-window e))
-                                  (Buffer-menu-sort ,column))))
-                         (define-key map [mouse-2]
-                           `(lambda (e)
-                              (interactive "e")
-                              (if e (mouse-select-window e))
-                              (Buffer-menu-sort ,column)))
-                         (define-key map "\C-m"
-                           `(lambda () (interactive)
-                              (Buffer-menu-sort ,column))))
+             'keymap (let ((map (make-sparse-keymap))
+                           (fun `(lambda (e)
+                                   (interactive "e")
+                                   (if e (mouse-select-window e))
+                                   (Buffer-menu-sort ,column))))
+                       ;; This keymap handles both nil and non-nil
+                       ;; values for Buffer-menu-use-header-line.
+                       (define-key map [header-line mouse-1] fun)
+                       (define-key map [header-line mouse-2] fun)
+                       (define-key map [mouse-2] fun)
+                       (define-key map [follow-link] 'mouse-face)
+                       (define-key map "\C-m"
+                         `(lambda () (interactive)
+                            (Buffer-menu-sort ,column)))
                        map)))
 
 (defun list-buffers-noselect (&optional files-only buffer-list)
index c928e04f8ed3b7585099664aa97e96765dffe034..1970fbf1eeb471f23927e9bee2020fe48b1fef00 100644 (file)
@@ -538,11 +538,10 @@ resized by dragging their header-line."
         (window (posn-window start))
         (frame (window-frame window))
         (first-window (frame-first-window frame)))
-    (when (or (eq window first-window)
-             (= (nth 1 (window-edges window))
-                (nth 1 (window-edges first-window))))
-      (error "Cannot move header-line at the top of the frame"))
-    (mouse-drag-mode-line-1 start-event nil)))
+    (unless (or (eq window first-window)
+               (= (nth 1 (window-edges window))
+                  (nth 1 (window-edges first-window))))
+      (mouse-drag-mode-line-1 start-event nil))))
 
 \f
 (defun mouse-drag-vertical-line (start-event)