GNU bug report logs - #47073
28.0.50; speedbar: sorting in sublists is in reverse

Previous Next

Package: emacs;

Reported by: haj <at> posteo.de (Harald Jörg)

Date: Thu, 11 Mar 2021 16:28:01 UTC

Severity: normal

Tags: fixed

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47073 in the body.
You can then email your comments to 47073 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47073; Package emacs. (Thu, 11 Mar 2021 16:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to haj <at> posteo.de (Harald Jörg):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Mar 2021 16:28:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: haj <at> posteo.de (Harald Jörg)
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; speedbar: sorting in sublists is in reverse
Date: Thu, 11 Mar 2021 17:26:56 +0100
This isn't specific for "current" Emacs, it happens in Emacs 26.1, too.

How to reproduce:

 - emacs -Q
 - open a Perl file with lots of subroutines
   (e.g. https://github.com/foswiki/distro/blob/master/core/lib/Foswiki.pm)
   or a Elisp file with lots of defuns
   (e.g. lisp/progmodes/cperl-mode.el)
 - M-x speedbar

Following the default configuration, speedbar clusters the display of
subroutines into alphabetically sorted batches of 20 entries each.

While the batches are sorted alphabetically (e.g. "ge to i" comes before
"l to re" in Foswiki.pm), the entries in each of the batches are sorted
in reverse: The batch "ge to i" has a first entry of "isValidWikiWord"
and a last entry of "getApproxRevTime".

This happens in both perl-mode _and_ cperl-mode, and only in speedbar
but not in the completion list after M-x imenu, nor in the imenu index
which I added with M-x imenu-add-menubar-index.  So, either the bug is
in speedbar - or both Perl modes share the same bug.

...And, as I just found out, it isn't specific for Perl files so, I've
modified the recipe above and can add:

The situation with large elisp files (e.g. lisp/progmodes/cperl-mode.el)
might give a clue what's happening to someone who is familiar with
speedbar:

 - batches with a single word headline (e.g. "cperl-e") are sorted
   according to the positions of the entries.

 - batches with a range in the headline (e.g. "cperl-auto to cperl-d")
   have their sub-entries sorted in reverse alphabetical order.

Cheers,
haj

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2021-03-02 built on hajtower
Repository revision: 9ef8a3bfca192777e7cf8b4748d188249a517582
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured features:
GIF GMP GNUTLS JPEG LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SOUND
THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
  shell-dirtrack-mode: t
  global-hl-line-mode: t
  recentf-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/haj/devel/emacs-lisp/cperl-mode/cperl-mode hides /home/haj/devel/emacs/emacs/lisp/progmodes/cperl-mode

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
vc-svn semantic/db-mode apropos semantic/bovine/c hideif cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs
cc-bytecomp cc-vars cc-defs semantic/bovine/c-by semantic/lex-spp
semantic/analyze/refs semantic/bovine/el semantic/db-el
semantic/bovine/gcc semantic/bovine/make semantic/bovine/make-by
make-mode semantic/bovine/scm semantic/bovine/scm-by semantic/bovine
semantic/complete semantic/decorate/mode semantic/edit semantic/html
sgml-mode dom semantic/imenu advice semantic/db-file data-debug
cedet-files semantic/mru-bookmark semantic/texi texinfo semantic/db-find
semantic/db-ref semantic/wisent/java-tags semantic/wisent/javat-wy
semantic/wisent/javascript-jv semantic/wisent/js-wy
semantic/wisent/python compile semantic/dep semantic/wisent/python-wy
python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete parse-time iso8601 ls-lisp format-spec
comint semantic/bovine/debug semantic/debug semantic/decorate pulse
semantic/grammar semantic/idle semantic/grammar-wy semantic/java
semantic/doc srecode/srt-mode semantic/analyze semantic/scope
semantic/analyze/fcn semantic/db srecode/template srecode/srt-wy
semantic/wisent semantic/wisent/wisent semantic/ctxt srecode/ctxt
srecode/compile srecode/dictionary srecode/fields srecode/table srecode
eieio-base semantic/sb semantic/sort semantic/format semantic/tag-ls
semantic/find semantic/util-modes semantic/util semantic semantic/tag
semantic/lex semantic/fw cedet rmail rmail-loaddefs auth-source
password-cache json map rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils cus-edit pp mule-util mode-local eieio-opt shortdoc
text-property-search cl-extra speedbar ezimage dframe thingatpt
cus-start cus-load misearch multi-isearch face-remap
cperl-object-pad-mode help-fns radix-tree cl-print debug backtrace
help-mode find-func time-date subr-x perl-mode bug-reference which-func
regex-tool cl font-lock-studio vc-git diff-mode easy-mmode vc-dispatcher
linum hl-line recentf tree-widget wid-edit autorevert filenotify paren
cperl-mode derived rx info man ansi-color etags fileloop generator xref
cl-seq project seq eieio byte-opt bytecomp byte-compile cconv eieio-core
cl-macs gv eieio-loaddefs ring imenu cl-loaddefs cl-lib iso-transl
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core term/tty-colors frame minibuffer cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads inotify
dynamic-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 439059 19058)
 (symbols 48 24683 3)
 (strings 32 85250 3038)
 (string-bytes 1 2766058)
 (vectors 16 44771)
 (vector-slots 8 638785 52530)
 (floats 8 175 110)
 (intervals 56 24822 0)
 (buffers 992 32))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47073; Package emacs. (Fri, 12 Mar 2021 00:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 47073 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: haj <at> posteo.de (Harald Jörg)
Cc: 47073 <at> debbugs.gnu.org
Subject: Re: bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
Date: Fri, 12 Mar 2021 01:47:38 +0100
haj <at> posteo.de (Harald Jörg) writes:

> This isn't specific for "current" Emacs, it happens in Emacs 26.1, too.
>
> How to reproduce:
>
>  - emacs -Q
>  - open a Perl file with lots of subroutines
>    (e.g. https://github.com/foswiki/distro/blob/master/core/lib/Foswiki.pm)
>    or a Elisp file with lots of defuns
>    (e.g. lisp/progmodes/cperl-mode.el)
>  - M-x speedbar
>
> Following the default configuration, speedbar clusters the display of
> subroutines into alphabetically sorted batches of 20 entries each.

I've barely used speedbar before, but where does speedbar display these
clusters?  The window that pops up with "emacs -Q" and `M-x speedbar' in
cperl-mode.el is unclustered, as far as I can tell.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47073; Package emacs. (Fri, 12 Mar 2021 07:54:02 GMT) Full text and rfc822 format available.

Message #11 received at 47073 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47073 <at> debbugs.gnu.org, haj <at> posteo.de
Subject: Re: bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
Date: Fri, 12 Mar 2021 09:53:20 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 12 Mar 2021 01:47:38 +0100
> Cc: 47073 <at> debbugs.gnu.org
> 
> haj <at> posteo.de (Harald Jörg) writes:
> 
> > This isn't specific for "current" Emacs, it happens in Emacs 26.1, too.
> >
> > How to reproduce:
> >
> >  - emacs -Q
> >  - open a Perl file with lots of subroutines
> >    (e.g. https://github.com/foswiki/distro/blob/master/core/lib/Foswiki.pm)
> >    or a Elisp file with lots of defuns
> >    (e.g. lisp/progmodes/cperl-mode.el)
> >  - M-x speedbar
> >
> > Following the default configuration, speedbar clusters the display of
> > subroutines into alphabetically sorted batches of 20 entries each.
> 
> I've barely used speedbar before, but where does speedbar display these
> clusters?  The window that pops up with "emacs -Q" and `M-x speedbar' in
> cperl-mode.el is unclustered, as far as I can tell.

The recipe is incomplete.  Try this:

  . emacs -Q
  . C-x C-f Foswiki.pm
  . M-x speedbar
  . in the speedbar frame go to Foswiki.pm, and click the "+" icon.
  . you should now see the content of cperl.el in batches, sorted
    alphabetically, with each batch having its own "+" icon
  . click on some of the "+" icons of some of the batches and look at
    the order of the entries within

After doing this, I think this observation of the OP:

> While the batches are sorted alphabetically (e.g. "ge to i" comes before
> "l to re" in Foswiki.pm), the entries in each of the batches are sorted
> in reverse: The batch "ge to i" has a first entry of "isValidWikiWord"
> and a last entry of "getApproxRevTime".

is incorrect: the entries are simply unsorted, I guess they appear in
the order they are found in the file or something.  For example, the
entries below "ge to i" in Foswiki.pm are displayed thusly here:

 > isValidWikiWord
 > isValidTopicName
 > isValidWebName
 > isValidEmailAddress
 > i18n
 > inlineAlert
 > isTrue
 > innerExpandMacros
 > inContext
 > generateHTTPHeaders
 > getCGISession
 > getLoginManager
 > getSkin
 > getScriptUrl
 > getPubURL
 > generateRandomChars
 > getWorkArea
 > getApproxRevTime

And you can see that the first 4 are not in any alphabetically-sorted
order.  Likewise, these entries near the end:

 > getCGISession
 > getLoginManager
 > getSkin
 > getScriptUrl
 > getPubURL

aren't sorted, neither in ascending nor in descending order.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47073; Package emacs. (Thu, 18 Mar 2021 07:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 47073 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47073 <at> debbugs.gnu.org, haj <at> posteo.de
Subject: Re: bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
Date: Thu, 18 Mar 2021 08:24:36 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> While the batches are sorted alphabetically (e.g. "ge to i" comes before
>> "l to re" in Foswiki.pm), the entries in each of the batches are sorted
>> in reverse: The batch "ge to i" has a first entry of "isValidWikiWord"
>> and a last entry of "getApproxRevTime".
>
> is incorrect: the entries are simply unsorted, I guess they appear in
> the order they are found in the file or something.

But the groupings are sorted...  so it doesn't make much sense to leave
the elements in each group unsorted.  So I've changed this now in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 18 Mar 2021 07:26:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 47073 <at> debbugs.gnu.org and haj <at> posteo.de (Harald Jörg) Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 18 Mar 2021 07:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 Apr 2021 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.