From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: carlosjosepita@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#18268: 24.3.92; Make imenu sort submenus also (fix included) Date: Thu, 14 Aug 2014 20:18:33 -0300 Message-ID: <87vbpu7j92.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408058365 13161 80.91.229.3 (14 Aug 2014 23:19:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 23:19:25 +0000 (UTC) To: 18268@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 15 01:19:19 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XI4Ig-0004U7-GS for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Aug 2014 01:19:18 +0200 Original-Received: from localhost ([::1]:56800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4If-0002bd-Ov for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Aug 2014 19:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4IX-0002Zl-4L for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:19:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XI4IR-0001Qa-1v for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:19:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4IQ-0001QU-UM for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XI4IQ-0003Gu-BY for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: carlosjosepita@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Aug 2014 23:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18268 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140805833012542 (code B ref -1); Thu, 14 Aug 2014 23:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Aug 2014 23:18:50 +0000 Original-Received: from localhost ([127.0.0.1]:43694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XI4ID-0003GB-Ka for submit@debbugs.gnu.org; Thu, 14 Aug 2014 19:18:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58163) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XI4I9-0003Fo-8k for submit@debbugs.gnu.org; Thu, 14 Aug 2014 19:18:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XI4Hx-0001NX-Vl for submit@debbugs.gnu.org; Thu, 14 Aug 2014 19:18:39 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4Hx-0001NN-SV for submit@debbugs.gnu.org; Thu, 14 Aug 2014 19:18:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4Hr-0002YX-QF for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:18:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XI4Hl-0001MF-OU for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:18:27 -0400 Original-Received: from mail-yk0-x22e.google.com ([2607:f8b0:4002:c07::22e]:45578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI4Hl-0001MB-IO for bug-gnu-emacs@gnu.org; Thu, 14 Aug 2014 19:18:21 -0400 Original-Received: by mail-yk0-f174.google.com with SMTP id q9so1565289ykb.19 for ; Thu, 14 Aug 2014 16:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=GZe4KZbncnlaVg+E5088CKFZ5//nOzOTLfmWqwFczEw=; b=C6UQTisUbElRidNUiebC8kHahZ3B1xv29RGfWkSGb/U+x/DSfHcWUItxtFEQFN0YF3 qg8Mu66vcYFyl5n1XCNDlTjEsQDc2Rq9SlXhLUaOiRccSILGPLMHRq6iy/OuTp0nPUh4 i6MCELYghHuKUOV95FNGBcR+axLt2v5qC7UF8/qaQBnQIpdWpipGfwxFRyMaEeb5u/5t DKvdk3amCOPd3kHgllqk1uaAd9Yq2L9hifj4MyhcPHI+5luwANOIaml5DKvOe478sK5v YWHBBSD1XRwtCE2LeryhhA6j4k1v5sxlTAgcSjUU3G8OkXy+qmm60DDH1zcZsRHdUOZH HYzQ== X-Received: by 10.236.148.209 with SMTP id v57mr21500334yhj.140.1408058300981; Thu, 14 Aug 2014 16:18:20 -0700 (PDT) Original-Received: from memeplex ([190.18.155.203]) by mx.google.com with ESMTPSA id x48sm13679185yha.5.2014.08.14.16.18.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 16:18:19 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92475 Archived-At: When the current major mode provides submenus (say, python-mode, with methods nested inside classes, classes being top-level), imenu always shows them at the top of the menu and unsorted. Only sibling leaves of the menu tree are sorted. To fix this, just sort the output of imenu--split submenus when a custom imenu-sort-function was required by the user: (defun imenu--split-submenus (alist) "Split up each long alist that are nested within ALIST into nested alists. Return a split and sorted copy of ALIST. The returned alist DOES NOT share structure with ALIST." (let ((menulist (mapcar (lambda (elt) (if (imenu--subalist-p elt) (imenu--split-menu (cdr elt) (car elt)) elt)) alist))) (if imenu-sort-function (sort menulist imenu-sort-function) menulist))) Regards -- Carlos In GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-08-07 on memeplex Windowing system distributor `The X.Org Foundation', version 11.0.11600000 Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: shell-dirtrack-mode: t show-paren-mode: t winner-mode: t yas-global-mode: t yas-minor-mode: t ido-everywhere: t global-auto-complete-mode: t auto-complete-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t prettify-symbols-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-SPC C-w C-x C-s C-x d C-e ( r e q u i r e SPC ' i m e n u - a n y w h e e r r e ) C-x C-e C-e C-x C-e d x y e s C-x C-s C-x b s c ( r e q u i r e SPC ' f i x e s ) C-x C-e C-g C-x C-s M-x r e p o r t Recent messages: End of buffer [3 times] imenu-anywhere imenu--sort-by-name Deleting...done (No changes need to be saved) progn: Required feature `fixes' was not provided Quit Saving file /home/carlos/.emacs... Wrote /home/carlos/.emacs Making completion list... Load-path shadows: ~/.emacs.d/lisp/python hides /usr/share/emacs/24.3.92/lisp/progmodes/python ~/.emacs.d/lisp/rmail hides /usr/share/emacs/24.3.92/lisp/mail/rmail Features: (shadow sort mail-extr emacsbug message idna rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils debug mule-util tramp-cache tramp tramp-compat tramp-loaddefs trampver shell image-file org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view image-mode dired org-bibtex bibtex org-bbdb org-w3m org-capture org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec cal-menu calendar cal-loaddefs edebug misearch multi-isearch jka-compr eieio-opt speedbar sb-image ezimage dframe network-stream auth-source eieio byte-opt bytecomp byte-compile cconv eieio-core gnus-util mm-util mail-prsvr password-cache starttls tls warnings vc-git jedi python-environment epc ctable concurrent deferred python skeleton derived pcase rx json imenu-anywhere cl-macs imenu thingatpt find-func flymake compile comint ansi-color paren winner ring windmove advice help-fns yasnippet help-mode cl gv ido auto-complete-config auto-complete popup edmacro kmacro cl-loaddefs cl-lib info easymenu package wombat-theme time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 361814 22370) (symbols 48 36390 0) (miscs 40 1153 1328) (strings 32 103033 9931) (string-bytes 1 2189271) (vectors 16 35814) (vector-slots 8 1446654 27798) (floats 8 665 911) (intervals 56 9261 0) (buffers 960 26) (heap 1024 67756 2517))