bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-buffer-menu signals wrong-type-argument


From: Eli Zaretskii
Subject: Re: mouse-buffer-menu signals wrong-type-argument
Date: Tue, 28 Aug 2001 09:26:42 +0300 (IDT)

On 10 Aug 2001, Kalle Olavi Niemitalo wrote:

> 6. Start `mouse-buffer-menu'.
>    C-down-mouse-1
> 
> 7. Emacs gives an error:
>    Wrong type argument: consp, nil
> 
> I originally got the error with a much larger set of buffers;
> I hope this smaller set is easier for you to reproduce.

Please try the changes below.  I'm not sure they solve your original 
problem, since the only mode I could reproduce this is the Fundamental 
mode, and killing *Messages* sounds a bit extreme, to say the least...

2001-08-27  Eli Zaretskii  <address@hidden>

        * mouse.el (mouse-buffer-menu): If the buffer menu is split by
        major modes, don't create panes for modes for which
        mouse-buffer-menu-alist returns an empty alist.

*** lisp/mouse.e~2      Thu Aug  9 19:04:18 2001
--- lisp/mouse.el       Mon Aug 27 00:05:22 2001
***************
*** 1571,1596 ****
          (while (and split-by-major-mode
                      (and (> (length (car split-by-major-mode)) 3)
                           (> (* buffers-left 10) (length buffers))))
!           (setq subdivided-menus
!                 (cons (cons
!                        (nth 1 (car split-by-major-mode))
!                        (mouse-buffer-menu-alist
!                         (cdr (cdr (car split-by-major-mode)))))
!                       subdivided-menus))
            (setq buffers-left
                  (- buffers-left (length (cdr (car split-by-major-mode)))))
            (setq split-by-major-mode (cdr split-by-major-mode)))
          ;; If any major modes are left over,
          ;; make a single submenu for them.
          (if split-by-major-mode
!             (setq subdivided-menus
!                   (cons (cons
!                          "Others"
!                          (mouse-buffer-menu-alist
!                           ;; we don't need split-by-major-mode any
!                           ;; more, so we can ditch it with nconc.
!                           (apply 'nconc (mapcar 'cddr split-by-major-mode))))
!                         subdivided-menus)))
          (setq menu (cons "Buffer Menu" (nreverse subdivided-menus))))
        (progn
        (setq alist (mouse-buffer-menu-alist buffers))
--- 1571,1599 ----
          (while (and split-by-major-mode
                      (and (> (length (car split-by-major-mode)) 3)
                           (> (* buffers-left 10) (length buffers))))
!           (let ((this-mode-list (mouse-buffer-menu-alist
!                                  (cdr (cdr (car split-by-major-mode))))))
!             (and this-mode-list
!                  (setq subdivided-menus
!                        (cons (cons
!                               (nth 1 (car split-by-major-mode))
!                               this-mode-list)
!                              subdivided-menus))))
            (setq buffers-left
                  (- buffers-left (length (cdr (car split-by-major-mode)))))
            (setq split-by-major-mode (cdr split-by-major-mode)))
          ;; If any major modes are left over,
          ;; make a single submenu for them.
          (if split-by-major-mode
!             (let ((others-list
!                    (mouse-buffer-menu-alist
!                     ;; we don't need split-by-major-mode any more,
!                     ;; so we can ditch it with nconc.
!                     (apply 'nconc (mapcar 'cddr split-by-major-mode)))))
!               (and others-list
!                    (setq subdivided-menus
!                          (cons (cons "Others" others-list)
!                                subdivided-menus)))))
          (setq menu (cons "Buffer Menu" (nreverse subdivided-menus))))
        (progn
        (setq alist (mouse-buffer-menu-alist buffers))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]