diff options
| author | Sam Steingold | 2007-08-06 17:19:26 +0000 |
|---|---|---|
| committer | Sam Steingold | 2007-08-06 17:19:26 +0000 |
| commit | cc2ee8ec1eb66987e56a21fefd2217325208fa5f (patch) | |
| tree | d72d011eab164e90ec4b1d53315e5eb4775373f0 | |
| parent | 465d8f275afb360dcc4b8231c9658e299d47a551 (diff) | |
| download | emacs-cc2ee8ec1eb66987e56a21fefd2217325208fa5f.tar.gz emacs-cc2ee8ec1eb66987e56a21fefd2217325208fa5f.zip | |
(mouse-buffer-menu): Pass mode-name through format-mode-line because it
may be a list, e.g., (sgml-xml-mode "XML" "SGML"), and not a string.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mouse.el | 38 |
2 files changed, 23 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 92b0673c1c6..f2bde13f0be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-08-06 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * mouse.el (mouse-buffer-menu): Pass mode-name through | ||
| 4 | format-mode-line because it may be a list, | ||
| 5 | e.g., (sgml-xml-mode "XML" "SGML"), and not a string. | ||
| 6 | |||
| 1 | 2007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br> | 7 | 2007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br> |
| 2 | 8 | ||
| 3 | * printing.el (pr-update-menus): Docstring fix. | 9 | * printing.el (pr-update-menus): Docstring fix. |
diff --git a/lisp/mouse.el b/lisp/mouse.el index cbbaf73fcbb..27c5dd901f7 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1814,27 +1814,23 @@ and selects that window." | |||
| 1814 | (mouse-minibuffer-check event) | 1814 | (mouse-minibuffer-check event) |
| 1815 | (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) | 1815 | (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) |
| 1816 | ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). | 1816 | ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). |
| 1817 | (let ((tail buffers)) | 1817 | (dolist (buf buffers) |
| 1818 | (while tail | 1818 | ;; Divide all buffers into buckets for various major modes. |
| 1819 | ;; Divide all buffers into buckets for various major modes. | 1819 | ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). |
| 1820 | ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). | 1820 | (with-current-buffer buf |
| 1821 | (with-current-buffer (car tail) | 1821 | (let* ((adjusted-major-mode major-mode) elt) |
| 1822 | (let* ((adjusted-major-mode major-mode) elt) | 1822 | (dolist (group mouse-buffer-menu-mode-groups) |
| 1823 | (let ((tail mouse-buffer-menu-mode-groups)) | 1823 | (when (string-match (car group) (format-mode-line mode-name)) |
| 1824 | (while tail | 1824 | (setq adjusted-major-mode (cdr group)))) |
| 1825 | (if (string-match (car (car tail)) mode-name) | 1825 | (setq elt (assoc adjusted-major-mode split-by-major-mode)) |
| 1826 | (setq adjusted-major-mode (cdr (car tail)))) | 1826 | (unless elt |
| 1827 | (setq tail (cdr tail)))) | 1827 | (setq elt (list adjusted-major-mode |
| 1828 | (setq elt (assoc adjusted-major-mode split-by-major-mode)) | 1828 | (if (stringp adjusted-major-mode) |
| 1829 | (if (null elt) | 1829 | adjusted-major-mode |
| 1830 | (setq elt (list adjusted-major-mode | 1830 | mode-name)) |
| 1831 | (if (stringp adjusted-major-mode) | 1831 | split-by-major-mode (cons elt split-by-major-mode))) |
| 1832 | adjusted-major-mode | 1832 | (or (memq buf (cdr (cdr elt))) |
| 1833 | mode-name)) | 1833 | (setcdr (cdr elt) (cons buf (cdr (cdr elt)))))))) |
| 1834 | split-by-major-mode (cons elt split-by-major-mode))) | ||
| 1835 | (or (memq (car tail) (cdr (cdr elt))) | ||
| 1836 | (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt))))))) | ||
| 1837 | (setq tail (cdr tail)))) | ||
| 1838 | ;; Compute the sum of squares of sizes of the major-mode buckets. | 1834 | ;; Compute the sum of squares of sizes of the major-mode buckets. |
| 1839 | (let ((tail split-by-major-mode)) | 1835 | (let ((tail split-by-major-mode)) |
| 1840 | (setq sum-of-squares 0) | 1836 | (setq sum-of-squares 0) |