From unknown Sun Sep 07 16:50:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37174: 26.2; Stabilize tabulated-list reversed sort Resent-From: Johan Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2019 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 37174@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156665684217741 (code B ref -1); Sat, 24 Aug 2019 14:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Aug 2019 14:27:22 +0000 Received: from localhost ([127.0.0.1]:43189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1X0j-0004c5-Gi for submit@debbugs.gnu.org; Sat, 24 Aug 2019 10:27:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:53226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i1X0g-0004bv-2K for submit@debbugs.gnu.org; Sat, 24 Aug 2019 10:27:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51629) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1X0d-0002yK-9A for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 10:27:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1X0b-0003dj-1F for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 10:27:15 -0400 Received: from mail227c50.megamailservers.eu ([91.136.10.237]:43780 helo=mail36c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i1X0a-0003cX-Dz for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2019 10:27:12 -0400 X-Authenticated-User: johanclaesson@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1566656826; bh=XO+BF4+84gzSnnTWFNXp0kP1fFk7mA8EC2KIZ/Y/y+4=; h=From:To:Subject:Date:From; b=Qquoqw/MfvJYvMcy4YpP6Sz3A4zdV43b3Sd5KHpoBJpl/t2lOuvsQrD6VCkFNCoaD VMo6ak9HThjJTe2mrRSZjecSLBOqCO8Lxpud9l49ZJeWujmabTz+tWMDEJeFKIw2kH DvvfnnaNeTazbNfEIMGzlvolCPaFlWXfY9jYHoc4= Feedback-ID: johanclaesson@b Received: from goblin (c-969c72d5.04-99-73746f3.bbcust.telenor.se [213.114.156.150]) (authenticated bits=0) by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x7OER47q007163 for ; Sat, 24 Aug 2019 14:27:06 +0000 From: Johan Claesson Date: Sat, 24 Aug 2019 16:27:04 +0200 Message-ID: <871rxaiqpz.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CTCH-RefID: str=0001.0A0B0210.5D61493A.001C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=eNI9ckh1 c=1 sm=1 tr=0 a=es36QED1PvwHim/y0rXxVA==:117 a=es36QED1PvwHim/y0rXxVA==:17 a=aR16PxjQAAAA:8 a=ItsVpp5qLpZY4o5yknIA:9 a=tZU5ZPk-nnhugxBM:21 a=4gbsS6JOxBB3QuUm:21 a=zbFvvTOBjyH4ze5LlUjX:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.237 X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi, Sorting with S multiple times in a tabulated-list buffer should be stable but will sometimes reorder entries with the same value. When the sort order is reversed the function tabulated-list--get-sorter will transform the sort function to sort the other way around by negating. I think this is what cause the needless reordering and that it should be changed something like the following: diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 63ae1f8c07..f30e2c0ec8 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -373,7 +373,7 @@ tabulated-list--get-sorter (if (stringp b) b (car b))))))) ;; Reversed order. (if (cdr tabulated-list-sort-key) - (lambda (a b) (not (funcall sorter a b))) + (lambda (a b) (funcall sorter b a)) sorter)))) (defsubst tabulated-list--col-local-max-widths (col) Recipe for 26.2 or 27.0 (42f8fa8070): emacs -Q a.el b.el C-x C-b (pop buffer list buffer) Goto buffer list buffer and put point in "Mode" column. Press S to sort on Mode. b.el is now before a.el in the list. Press S twice more. a.el is now before b.el. Regards, /Johan In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of 2019-04-22 built on goblin Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Ubuntu 19.04 Recent messages: ((1 . b) (1 . a) (2 . b) (2 . a)) 0.001_013s ((1 . b) (1 . a) (2 . b) (2 . a)) Saving file /ssd/home/jcl/share/elisp/picpocket.el... Wrote /ssd/home/jcl/share/elisp/picpocket.el Saving file /ssd/home/jcl/share/elisp/jcl-bugfix.el... Wrote /ssd/home/jcl/share/elisp/jcl-bugfix.el Quit Saving file /ssd/home/jcl/build/emacs/lisp/emacs-lisp/tabulated-list.el... Wrote /ssd/home/jcl/build/emacs/lisp/emacs-lisp/tabulated-list.el C-2 C-g is undefined Configured using: 'configure --prefix=/ssd/home/jcl/usr --with-x-toolkit=gtk3 --with-xwidgets --without-compress-install --with-modules PKG_CONFIG_PATH=/home/jcl/usr/lib/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2 Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode) S))) bug-reference-prog-mode: t global-magit-file-mode: t magit-file-mode: t magit-auto-revert-mode: t display-time-mode: t minibuffer-depth-indicate-mode: t save-place-mode: t minibuffer-electric-default-mode: t icomplete-mode: t diff-auto-refine-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t auto-revert-mode: t whitespace-mode: t winner-mode: t ido-everywhere: t num3-mode: t which-function-mode: t global-eldoc-mode: t eldoc-mode: t electric-layout-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: /home/jcl/elpa/soap-client-3.1.5/soap-inspect hides /ssd/home/jcl/build/emacs-26.2/lisp/net/soap-inspect /home/jcl/elpa/soap-client-3.1.5/soap-client hides /ssd/home/jcl/build/emacs-26.2/lisp/net/soap-client /home/jcl/elpa/let-alist-1.0.6/let-alist hides /ssd/home/jcl/build/emacs-26.2/lisp/emacs-lisp/let-alist Features: (shadow emacsbug reposition cl-format-def rect benchmark tree-widget inferior-slime slime-cl-indent elp gud apropos company-dabbrev company-template company pcase edmacro hydra lv autoload tar-mode two-column iso-transl srecode/srt-mode semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db semantic/format srecode/template srecode/srt-wy semantic/wisent semantic/wisent/wisent semantic/ctxt srecode/ctxt semantic/tag-ls semantic/find srecode/compile srecode/dictionary srecode/table srecode eieio-base semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet find-dired w3m-cookie cl-print macrostep-c cmacexp tabify hippie-exp eieio-opt speedbar sb-image ezimage dframe help-fns radix-tree bug-reference w3m-form w3m-symbol pulse check-declare gnus-dired flow-fill url-cache mailalias dabbrev cl-indent char-fold misearch multi-isearch org-duration cal-move time-stamp gnus-cite mm-archive mail-extr gnus-async smiley jcl-replace jcl-games-init jcl-muse-init htmlize-hack htmlize muse-latex muse-html muse-xml-common muse-colors cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode jcl-w3m-init w3m-search w3m-bookmark w3m-antenna w3m-rss jcl-yaoddmuse-init yaoddmuse-extension yaoddmuse skeleton sgml-mode org-rmail org-mhe org-irc org-info org-gnus nnir org-docview org-bibtex bibtex org-bbdb org-w3m jcl-renegade-goblin jcl-home-boot elec-pair network-stream erlang-test jcl-load jcl-magit-init magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode transient jcl-billboard-init jcl-dir-local-init jcl-rfc-init rfcview goto-addr jcl-file-cache-test jcl-file-cache-init jcl-package-lint-init package-lint finder lisp-mnt typing-practice jcl-elisp-init lib-requires profiler jcl-grep-init jcl-abbrev-init jcl-ediff-init jcl-term-init jcl-erlang-init erldoc jcl-sbg jcl-erlang-log bookmark jcl-erlang-man man jcl-midnite-init jcl-sbg-compile-test sbg jcl-midnite jcl-mailme midnight jcl-picpocket-init picpocket-test jcl-erc-init jcl-ido-init jcl-dired-init image-file ls-lisp wdired jcl-register-init jcl-command-subset-init jcl-generic-init generic-x jcl-eww-init eww url-queue shr svg dom jcl-org-init poporg ob-latex ox-beamer org-feed org-capture jcl-shell-init jcl-google-init jcl-c-init cwarn jcl-modes-init hexl checkdoc vc-dir vc vc-dispatcher vc-git gitconfig-mode conf-mode calc calc-loaddefs calc-macs proced nroff-mode picture markdown-mode rx color make-mode python tramp-sh jcl-ruby inf-ruby ruby-mode fpl grep jcl-elpa-init ffap view jcl-global-init time printing ps-print ps-print-loaddefs ps-def lpr mb-depth saveplace face-remap minibuf-eldef icomplete jcl-keys-init kmacro diff-mode jcl-sbg-ssit wiki-summary jcl-file-cache filecache jcl-google google-translate google-translate-default-ui google-translate-core-ui google-translate-core google-translate-tk google-translate-backend jcl-imenu jcl-wesnoth wesnoth-mode wesnoth-wml-data wesnoth-update jcl-erlang jcl-sbg-compile jcl-picpocket jcl-goblin jcl-dired fuzzy-match jcl-ediff jcl-elisp jcl-grep edebug jcl-stumpwm jcl-org jcl-erc erc-goodies erc erc-backend erc-compat jcl-vbox jcl-lxc jcl-keys tramp tramp-compat tramp-loaddefs trampver ucs-normalize windmove jcl-debbugs-init debbugs-org debbugs-gnu debbugs soap-client url-http url-auth url-gw nsm warnings rng-xsd xsd-regexp jcl-epresent-init jcl-epresent org-indent epresent ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox jcl-isearch jcl-bugfix loadhist git-commit with-editor async-bytecomp async shell magit-git magit-section magit-utils crm log-edit pcvs-util add-log dash jcl-bugfix-complete-at-eob jcl-bugfix-xref jcl-merge jcl-wip jcl-work-buffer ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff jcl-sty jcl-template jcl-copyright jcl-template-lib cperl-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs erlang tempo align wc-mode jcl-register jcl-term ange-ftp jcl-advice jcl-command-subset jcl-duff clearcase reporter jcl-motion jcl-safe-init jcl-site-start jpt-mode erlang-start cal-iso qp cl-extra gnus-ml cursor-sensor nndraft nnmh nnfolder nnml jcl-master jcl-calendar-init jcl-emms-init emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-streams emms-show-all emms-tag-editor emms-mark emms-cache emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mpv emms-player-mplayer emms-librefm-stream emms-librefm-scrobbler emms-playing-time emms-info later-do xml jcl-gnus-init jcl-gnus jcl-org-import-icalendar jcl-status jcl-emms emms-playlist-mode emms-source-playlist emms-mode-line emms-setup emms-lyrics emms-url emms-source-file locate emms-player-simple emms emms-compat jcl-buffer-init org-element avl-tree generator org-location-google-maps org-agenda google-maps google-maps-static google-maps-geocode google-maps-base json map org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities 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 autorevert filenotify appt jcl-calendar jcl-swedish-postfix quail help-mode holidays hol-loaddefs icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs dired-aux dired-x mm-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util gnus-topic w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-favicon w3m-image w3m-proc w3m-util gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win mailcap starttls smtpmail sendmail message rmc puny format-spec rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr wid-edit jcl-boot jcl-slime-init slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse jcl-misc jcl-ert picpocket jcl-windows jcl-buffer jcl-compile ldap whitespace winner ido num3-mode ispell find-lisp ert find-func ewoc debug slime compile etags xref project arc-mode archive-mode noutline outline easy-mmode pp hyperspec thingatpt browse-url jcl-face hi-lock dired dired-loaddefs mic-paren which-func imenu hl-line jcl-times-init fortune jcl-early-init jcl-compat-init advice jcl-util subr-x jcl-times server term disp-table comint ansi-color ehelp ring sh-script smie executable jcl-load-path finder-inf tex-site eimp-autoloads ipython-autoloads cl memory-usage-autoloads slime-autoloads info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util 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 menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer cl-preloaded 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 threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 2980948 292521) (symbols 48 104444 115) (miscs 40 9688 3466) (strings 32 532596 46887) (string-bytes 1 17835329) (vectors 16 163799) (vector-slots 8 3724944 353612) (floats 8 1586 1374) (intervals 56 259762 0) (buffers 992 206)) From unknown Sun Sep 07 16:50:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37174: 26.2; Stabilize tabulated-list reversed sort Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2019 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Johan Claesson Cc: 37174@debbugs.gnu.org Received: via spool by 37174-submit@debbugs.gnu.org id=B37174.156901737516224 (code B ref 37174); Fri, 20 Sep 2019 22:10:02 +0000 Received: (at 37174) by debbugs.gnu.org; 20 Sep 2019 22:09:35 +0000 Received: from localhost ([127.0.0.1]:58697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBR5q-0004Dc-T9 for submit@debbugs.gnu.org; Fri, 20 Sep 2019 18:09:35 -0400 Received: from quimby.gnus.org ([80.91.231.51]:37552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBR5o-0004DP-Q0 for 37174@debbugs.gnu.org; Fri, 20 Sep 2019 18:09:33 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iBR5k-00075i-0j; Sat, 21 Sep 2019 00:09:30 +0200 From: Lars Ingebrigtsen References: <871rxaiqpz.fsf@bredband.net> Date: Sat, 21 Sep 2019 00:09:27 +0200 In-Reply-To: <871rxaiqpz.fsf@bredband.net> (Johan Claesson's message of "Sat, 24 Aug 2019 16:27:04 +0200") Message-ID: <87pnju62nc.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Johan Claesson writes: > Sorting with S multiple times in a tabulated-list buffer should be > stable but will sometimes reorder entries with the same value. When the > sort order is reversed the function tabulated-list--get [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Johan Claesson writes: > Sorting with S multiple times in a tabulated-list buffer should be > stable but will sometimes reorder entries with the same value. When the > sort order is reversed the function tabulated-list--get-sorter will > transform the sort function to sort the other way around by negating. I > think this is what cause the needless reordering and that it should be > changed something like the following: [...] > (if (cdr tabulated-list-sort-key) > - (lambda (a b) (not (funcall sorter a b))) > + (lambda (a b) (funcall sorter b a)) That looks like the correct solution, so I've applied it to the trunk. If I read the logs correctly, I think that cumulatively you've now had the number of lines committed to Emacs that's allowed without signing copyright assignment papers. For future patches, would you be willing to sign such paperwork? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 18:09:39 2019 Received: (at control) by debbugs.gnu.org; 20 Sep 2019 22:09:39 +0000 Received: from localhost ([127.0.0.1]:58700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBR5v-0004Du-4h for submit@debbugs.gnu.org; Fri, 20 Sep 2019 18:09:39 -0400 Received: from quimby.gnus.org ([80.91.231.51]:37566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBR5t-0004Dl-0f for control@debbugs.gnu.org; Fri, 20 Sep 2019 18:09:37 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iBR5q-00075t-C2 for control@debbugs.gnu.org; Sat, 21 Sep 2019 00:09:36 +0200 Date: Sat, 21 Sep 2019 00:09:33 +0200 Message-Id: <87o8ze62n6.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #37174 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 37174 fixed close 37174 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 37174 fixed close 37174 27.1 quit From unknown Sun Sep 07 16:50:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37174: 26.2; Stabilize tabulated-list reversed sort In-Reply-To: <871rxaiqpz.fsf@bredband.net> Resent-From: Johan Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Sep 2019 09:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: 37174@debbugs.gnu.org Received: via spool by 37174-submit@debbugs.gnu.org id=B37174.156914440616840 (code B ref 37174); Sun, 22 Sep 2019 09:27:02 +0000 Received: (at 37174) by debbugs.gnu.org; 22 Sep 2019 09:26:46 +0000 Received: from localhost ([127.0.0.1]:33405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBy8j-0004NY-Mk for submit@debbugs.gnu.org; Sun, 22 Sep 2019 05:26:45 -0400 Received: from mail230c50.megamailservers.eu ([91.136.10.240]:43662 helo=mail37c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBy8h-0004NN-2A for 37174@debbugs.gnu.org; Sun, 22 Sep 2019 05:26:44 -0400 X-Authenticated-User: johanclaesson@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1569144401; bh=0IA6AXoMlI76Cg9brmi1CmM4FMMI8/eB37AwaL5MSXI=; h=From:To:Cc:Subject:References:Date:From; b=GpdRK+/0nQOSmdpna5a5/FSmEqinnccMo19XMrjephG2rr7TD0rTTb16osvSho+F4 MfdtLCFpHx8+hpi8rGaJIoLSust9hSlY06yD62e29u5ieGD/olsRGwCvkgBiJ9Zlfa FvWRTjEYUk/il9G3UY7sZQRi0eylxgc6LnO8sdSw= Feedback-ID: johanclaesson@b Received: from goblin (dhcp-5-254-159-9.vpnsvc.com [5.254.159.9] (may be forged)) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x8M9Qd8X014435; Sun, 22 Sep 2019 09:26:41 +0000 From: Johan Claesson References: <871rxaiqpz.fsf@bredband.net> <87pnju62nc.fsf@gnus.org> Date: Sun, 22 Sep 2019 11:26:37 +0200 Message-ID: <87zhiwy94i.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CTCH-RefID: str=0001.0A0B0212.5D873E51.001C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=bdoVr9HB c=1 sm=1 tr=0 a=gkqH4BfY9u+Ued9JcynvVQ==:117 a=gkqH4BfY9u+Ued9JcynvVQ==:17 a=DPSeMV08AAAA:8 a=8fxfRyiksReWv9jLZ0wA:9 a=bFKhLQa2sdSHufCki0ND:22 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Lars, I am willing to sign myself but the company i work for also need to sign and the last time i asked they refused. If this will become a problem in the future i might ask them again. Regards, /Johan On Sat, Sep 21 2019, Lars Ingebrigtsen wrote: > Johan Claesson writes: > >> Sorting with S multiple times in a tabulated-list buffer should be >> stable but will sometimes reorder entries with the same value. When the >> sort order is reversed the function tabulated-list--get-sorter will >> transform the sort function to sort the other way around by negating. I >> think this is what cause the needless reordering and that it should be >> changed something like the following: > > [...] > >> (if (cdr tabulated-list-sort-key) >> - (lambda (a b) (not (funcall sorter a b))) >> + (lambda (a b) (funcall sorter b a)) > > That looks like the correct solution, so I've applied it to the trunk. > > If I read the logs correctly, I think that cumulatively you've now had > the number of lines committed to Emacs that's allowed without signing > copyright assignment papers. For future patches, would you be willing > to sign such paperwork?