Commit 4b4ea1dc authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(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.
parent 35cd9438
2001-08-27 Thien-Thi Nguyen <ttn@gnu.org>
2001-08-28 Eli Zaretskii <eliz@is.elta.co.il>
* 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.
2001-08-28 Thien-Thi Nguyen <ttn@gnu.org>
 
* progmodes/hideshow.el: Update first-line description.
Sync comments w/ maintainer version 5.31.
......
......@@ -1571,26 +1571,29 @@ and selects that window."
(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))
(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
(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)))
(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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment