unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
@ 2021-03-11 16:26 Harald Jörg
  2021-03-12  0:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Jörg @ 2021-03-11 16:26 UTC (permalink / raw)
  To: 47073

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))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
  2021-03-11 16:26 bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse Harald Jörg
@ 2021-03-12  0:47 ` Lars Ingebrigtsen
  2021-03-12  7:53   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-12  0:47 UTC (permalink / raw)
  To: Harald Jörg; +Cc: 47073

haj@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
  2021-03-12  0:47 ` Lars Ingebrigtsen
@ 2021-03-12  7:53   ` Eli Zaretskii
  2021-03-18  7:24     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-03-12  7:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 47073, haj

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Fri, 12 Mar 2021 01:47:38 +0100
> Cc: 47073@debbugs.gnu.org
> 
> haj@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse
  2021-03-12  7:53   ` Eli Zaretskii
@ 2021-03-18  7:24     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-18  7:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47073, haj

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-18  7:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-11 16:26 bug#47073: 28.0.50; speedbar: sorting in sublists is in reverse Harald Jörg
2021-03-12  0:47 ` Lars Ingebrigtsen
2021-03-12  7:53   ` Eli Zaretskii
2021-03-18  7:24     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).