From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 05:54:41 2023 Received: (at submit) by debbugs.gnu.org; 6 Jan 2023 10:54:41 +0000 Received: from localhost ([127.0.0.1]:53856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDkMx-0002a7-0s for submit@debbugs.gnu.org; Fri, 06 Jan 2023 05:54:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:59446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDjQQ-000161-Ef for submit@debbugs.gnu.org; Fri, 06 Jan 2023 04:54:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDjQQ-0006ib-25 for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 04:54:10 -0500 Received: from mail-ve1eur01on0607.outbound.protection.outlook.com ([2a01:111:f400:fe1f::607] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDjQL-0003fz-QK; Fri, 06 Jan 2023 04:54:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MXDGnDBhf1sGznXE60TVsd8Wrp2P2GkehyiRp5TOzQYZqAC79PYc8Z0G6FpQCKr2pq4TElqMGa1iBjdmypI93sNPirPyxSF0ANLj0PGlR1LOal7a/lfL5pRacLzHTOxsFeX0GkieJEDGvuIp6vi7StxXXi2WzCbIyd90qHXbbWyFCz3V1JsO4H/rP2z+jogWw4VvlJf1X8LHJDDaR73vdVw/0pB10nM3au4xTWzjM82IxLjXCUdsKsB93JtgbxVuTAWlUdGh7VybMV2gRC02Nd4TbwMY1WxPFDW1wJEOiJ6FYvF7CvsOYD+3UCMplQ+JbjvVu2E0UcjZ1X1ytUyiFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r1QfdRkV7qM1W06MJxm2YX7mJ44AnR9biDRzuaMgrqU=; b=CPV4NcFyjji6TvYsC8zeSsDAYInRYTaRkkTNAbUWFXxIrj151AZ7h5Cp5nBsMamJoltdlaw0kYXcMPG2mE1G7+hVOAbcvQW8Q7W86jCbU5FjncN+kNLMQtyfBxS42rXDSrEoCLBZ+yCEHjc1I3K+wOPhSlue/OY0AxNqWDM/frSYAc86N8xiMoApY4CyV64moHOwpbg6aevrjP2vdxQaCw4g/IRztsB+BGBKPpYNV8LXGE4aLy+MsOO9ZHdHmYXF5RCH+r1f7eHvGvuGUZ9sMdwlo4pkoZmP8hTA7sp+uvLoB6fdm3u3twNhz/22KzWLN3uwYzuRfMLfAirmKSOFrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=superoffice.com; dmarc=pass action=none header.from=superoffice.com; dkim=pass header.d=superoffice.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=superoffice.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r1QfdRkV7qM1W06MJxm2YX7mJ44AnR9biDRzuaMgrqU=; b=pQMhlZiUTIq8HFnLGhkyv74sLSfizJoz6AiEFmHqB1erMyhZuSMp26MeXl5LN67AuRKK41v40WQaB3W5/t83cXesmLQb9Khl8D65iYYk+/uu/Dxhq8hSdrwm/oi1VTcYZwajvYEz526srQj7Jgb+v5tkUBVV+xe7bRzn1WDOVw8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=superoffice.com; Received: from AM6PR06MB5432.eurprd06.prod.outlook.com (2603:10a6:20b:80::33) by DB9PR06MB8011.eurprd06.prod.outlook.com (2603:10a6:10:29f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 09:48:57 +0000 Received: from AM6PR06MB5432.eurprd06.prod.outlook.com ([fe80::e9d9:95a6:d569:1bd]) by AM6PR06MB5432.eurprd06.prod.outlook.com ([fe80::e9d9:95a6:d569:1bd%4]) with mapi id 15.20.5944.019; Fri, 6 Jan 2023 09:48:57 +0000 Content-Type: multipart/mixed; boundary="------------NG3DNkUmXMEygoG0Qkhtq06w" Message-ID: Date: Fri, 6 Jan 2023 10:48:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: "bug-gnu-emacs@gnu.org" From: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= Subject: 29.0.60; project-find-files reports files in seemingly random order X-ClientProxiedBy: OS6P279CA0106.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:3c::8) To AM6PR06MB5432.eurprd06.prod.outlook.com (2603:10a6:20b:80::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR06MB5432:EE_|DB9PR06MB8011:EE_ X-MS-Office365-Filtering-Correlation-Id: 0be0adc6-f957-4deb-c8ab-08daefcb3af7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iTQLyBlGXkmbTP3cxhSwKcQ45AHHU3rn9HOZCI1l7qA9zyfuHZhGClPwI9oGk4G9thSC6eKeZOSZ5i74BKi46QMwAgF64gFXZNpEBSFi3wl8OOr39+c8yRKwz5Hf+hxbEKE2JpGEIATqVFJX73FoAG+tzLoGlap8rimviDjfLYKa1DzBmaRXGw5C/AbDSnEBSUddFSSgJUBeD78BOe/P799cVe8M3Peoy3pPjaoiuKcL89E+FCoRDpsjGz7HLN+T9yrVkbu/rahKOxjeLMlw0W+h58Ld6bGHiEMY+PPlmx/gJz1DWXfu57/WAB7eAvUrbURAq+EgxrA+qN7Kf8Vc26x/EuIXH2ljCOjuofm3GODGjdp5F7rAuHqidaCUVY+XOPi2srja+0dfpnHEr15f57An1VlBSoAk5yT/9QSQyvEUhXmSXhNqOXoTK5xdpHbM3uPcFRWN/Yp2t6BpJeq3HCfKKL3rKcMQvcflSG+EPek3pFuw+teaNHyS5WYEKozvX9+ctT4Uf49xWZCGiAuP9gIwqZgz3grY8/9U6Ktv05lq6S118aE5Vx+zQgy0i+P/tD7x+17sQ2geTPqrVEU0LPXujz+QQLjIaqQStqEo2IU9c+oIaj/DlsU6LQ458wSFpRSnqBAgQlo0aWKQ81CA2//zOlmgOhrvvmlEemXILw5BQikUQ2cJy4R1+7dl6IHLMM73UggmRq7k1GYbiWWby/ASDPGu/YgFSyWMtflTQBuLKqte5jNiDk1UOZYZm6egKVxH+XvR/2QRPx0G0G0fQg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR06MB5432.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(39850400004)(136003)(396003)(366004)(451199015)(30864003)(83380400001)(66899015)(41300700001)(8936002)(31686004)(8676002)(4326008)(66556008)(66946007)(66574015)(66476007)(38100700002)(2906002)(31696002)(478600001)(26005)(6512007)(6486002)(15974865002)(186003)(316002)(2616005)(166002)(54906003)(5660300002)(36756003)(6916009)(33964004)(235185007)(6506007)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEd6N3UvQVY2NU14WG1NdG1YaDQxK2p5bEVmcS82Y1ZFNURzdS9YVm1pZDBz?= =?utf-8?B?NjUvazN5SXNGQmpWbjByMTI0L2VMSGxGVmk4WWdUS3FxMDgwbGhCTUt4YTFQ?= =?utf-8?B?bjAvRGtVeW1UYkd4eGM4U0MvTTVqSEhjZlVpbURRK2p0UXpoV3BZclNHVktJ?= =?utf-8?B?SDNrL1EralFuUWNuNDUvU0lEUGlocm5qdUthVnRNMWNYYjl1UFQ3RlZ2eFVT?= =?utf-8?B?WGNlYWdlT1hLeW5GMjk2K0V5UXlhVnFGOVlSVkpiSDJCR05ydEJZQ2dyNXd3?= =?utf-8?B?bDBOK2FwWU1IUnV4c1Z2eTMwMWFuaGg3V0FUMUxhUVEwYkFGRVhONEk0QWl3?= =?utf-8?B?L2EweXhUd1B0ZTFPL1M1bU8zeGlqYUY1QXgycFdQRmMrZzhkcEdxSzdUSlFG?= =?utf-8?B?aWFmYjFTcHlJT2pweUtOQ3doK2R5TWlGMzFmZkVKYWRieWNmaXhkWWtTTExs?= =?utf-8?B?U2FFVGpyeVNzS3NmZ3JTenNUUi9sOUtyOHNLNE9pUzQzUFN5eTl6V2R1dEdB?= =?utf-8?B?WTcxaFYwQmNsS20rQTYrNUFXWTdxRHY4S2FDQWh5bmVGTzAwUVovb3dsZUd3?= =?utf-8?B?VlJPZGtJYWFVeUpybHB1TTVWR01yaDhLZU1tZXdEdG5JUkVpL3dqTDBmbW5Y?= =?utf-8?B?L2MzT0dTZVRlTnN3Y29wczBwd293QjFZS3FMNGE4RlNGbmZiVktxaTBRUXE3?= =?utf-8?B?UTd0eGFBdm15MVRvK09yWFhIUXViZElTSmhyWmMvM3Q3VEJlS01TSkpZbDNl?= =?utf-8?B?ajRVbXVpN3p1WHBIa1JPVE1EeXdzQmZWeGM4V1BaeWhpSE1zRGJqYTduNkh3?= =?utf-8?B?WTdzN3BDUm1UZFROOXBOaXV3NVNuRFl1bFVjNFp2dTBHK0tiYW0wRjRsT09O?= =?utf-8?B?THd5NHZyTk9xbDBCaElHbkRpNzJnbjJnQWkxN2tiL0FTQ08vdngvemJLeXhM?= =?utf-8?B?Mys0YWFpUVo4RllvRm1EWXBWYlpaQkc0a1g4SHlaemsrZzFrNVh2Z2FUa0xZ?= =?utf-8?B?YXl1TGlqaGpQcWxjME51QmJOdG1KNmhIcUtrM3NTaDM3OU1pNVp3dDRIdWVw?= =?utf-8?B?QTNwQndOdTBCRTAwaGw2dkNraTA3aU5xU0IzZE9SMk9vc0UxUWtyRnVXLzN2?= =?utf-8?B?L0hTb2xVdlR3blcyZjI3aHBwUkFlMmNVclNqSm9BQjFaMHh5YW8yNWFsR1V5?= =?utf-8?B?N2R3ZVlNcGRjQ0w3bXFIR1dQSitSQzdoZURiaWtra0hML3dCRnc3cGhFVGdv?= =?utf-8?B?WnVRdlhMNDhXRE1sS2JQM3dUWktlNzJYZDNIZXM0aUdVK1A2eUFnemVvNC9w?= =?utf-8?B?bDZvbE9wOWFZRWkyTDNZTXhTVDB1dm5lQStVMVd3T1dFRU5sdW9XVTNHTGwy?= =?utf-8?B?bjN1MFFPNVI3c1JUeW16dzRzRmRxa1FLMmpONDVJYkNpM1F0OUZBZE54b2Uy?= =?utf-8?B?bm5Zb0xLKzM4VnRHc1UvOURwZ3d1eFRqQmljbFJzUDdJRFZVZUNGa2xwS3o0?= =?utf-8?B?djhVV2o5US9yL3ZaNXFXSWVNWDBKTnlWcGUyL3piSVdMemljSkE0bUNiYnoz?= =?utf-8?B?TmJ1bm8zQjJxNGNYeEQ1NDZkcU0xK0pEcWZjZnNjZ21ud2R0SkZwK2ZtTjlv?= =?utf-8?B?NUpxNzUydWREcm12OUh4UDVQOTRScXdDSmJnRERmVGoyVDhoblNwU241aWVi?= =?utf-8?B?Y1ZHU0dzanIzY3lxS1U3ZTBndlZkKzluYkU2cWJybU4wZ2FvY1dFK2dIZGgw?= =?utf-8?B?MU5YLzBGVERPVVBxTDUxM0pjL2lJVHdhc2NmL28waVdWWmhWdGNxVmMyS25k?= =?utf-8?B?aytJclRpVHFqUXVuZFo3dTkvVGh5ZFdYZnNtT00wTVpnQUdPeW1SSHFQTWFB?= =?utf-8?B?UnBHWmVLeGcxL2FJa21XZFFsSENXdFNUR0NjdG1WZ2x2TGpPM1F4eDlIMDlx?= =?utf-8?B?M1A0S3dEMTlmcHdHYXJZWmJVWGxwa3BudUlPK1Fyb2hsSllWVEkrYlU1Mkxz?= =?utf-8?B?SzFXdGNGVTA2empIYTBKRVp6WFVpUGVpRHlpeGttUkNyUmx5ZFg5Smc2ajRP?= =?utf-8?B?ZVdsNkp4RnZObkNNYk9HYnhlK3E1aHFEMFJDTDdpVjdYTkNHZStyeTdxZ3J0?= =?utf-8?B?aDR0eFFIYVhnaVJZR0F0Nk42QmVaV0NRbEFlbXAwdzFEVFAvb0N1eHkveW1M?= =?utf-8?B?RGc9PQ==?= X-OriginatorOrg: superoffice.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0be0adc6-f957-4deb-c8ab-08daefcb3af7 X-MS-Exchange-CrossTenant-AuthSource: AM6PR06MB5432.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 09:48:57.5563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: caef7785-c073-4453-8b47-6432b6b5b10f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yazG6koWFjGpXyn1xtWmKkqUguS4AW7YKfpztk3MCmjVqjlAJMvpMII7mox4NVb40NxgkQTWi/eAlqF5qcZIiR8cCizWG0BgXjbbE6HXx8g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR06MB8011 Received-SPF: pass client-ip=2a01:111:f400:fe1f::607; envelope-from=Jostein.Kjonigsen@superoffice.com; helo=EUR01-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 06 Jan 2023 05:54:37 -0500 Cc: Eli Zaretskii , Dmitry Gutov 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.4 (--) --------------NG3DNkUmXMEygoG0Qkhtq06w Content-Type: multipart/alternative; boundary="------------Jb14n0vz5cQQOJSfh0lOfyjZ" --------------Jb14n0vz5cQQOJSfh0lOfyjZ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit When working in large projects, and using completion engines like Helm, one often navigates within an Emacs-project by first typing some preliminary filtering-criteria, observing the result, and then further limiting the results until one eventually finds the one file you want to work with. For this flow to work well, one needs to have related files show up close to one another, and not being listed in "random" order. However, in some projects I've observed that generated files (not part of VC) are shown on top, and VC-files comes later. When the generated files are supposed to be alongside the checked in files, this makes navigation using project-find-file hard, because of the low data-locality in the presented results. Example: - src/someFile.d.ts   # compiled files - src/someFile.js - tests/someTest.d.ts - tests/someTest.js - src/someFile.ts     # vc-files - tests/someTest.ts If the results are sorted, the proper files are much easier to find quickly: - src/someFile.d.ts - src/someFile.js - src/someFile.ts - tests/someTest.d.ts - tests/someTest.js - tests/someTest.ts Are there any reason we're currently not doing that? If we can agree sorting the result is a proper thing to do, attached is a patch which implements this change. -- Jostein In GNU Emacs 29.0.60 (build 13, x86_64-pc-linux-gnu, GTK+ Version  3.24.33, cairo version 1.16.0) of 2023-01-06 built on dev-jostein Repository revision: 699711786ac7aa6d6524467076a45568e283e061 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12201001 System Description: Ubuntu 22.04.1 LTS Configured using:  'configure --with-json --with-tree-sitter  PKG_CONFIG_PATH=/home/jostein/.opam/default/lib/pkgconfig:' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings:   value of $LC_MONETARY: nb_NO.UTF-8   value of $LC_NUMERIC: nb_NO.UTF-8   value of $LC_TIME: nb_NO.UTF-8   value of $LANG: en_US.UTF-8   locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect:   global-git-commit-mode: t   magit-auto-revert-mode: t   bug-reference-prog-mode: t   elisp-slime-nav-mode: t   paredit-mode: t   highlight-symbol-mode: t   flycheck-mode: t   editorconfig-mode: t   company-mode: t   which-function-mode: t   helm-mode: t   helm-minibuffer-history-mode: t   shell-dirtrack-mode: t   helm--remap-mouse-mode: t   async-bytecomp-package-mode: t   delete-selection-mode: t   global-auto-revert-mode: t   yas-global-mode: t   yas-minor-mode: t   global-nlinum-mode: t   nlinum-mode: t   ido-yes-or-no-mode: t   override-global-mode: t   server-mode: t   global-hl-line-mode: t   pixel-scroll-precision-mode: t   doom-modeline-mode: t   tooltip-mode: t   global-eldoc-mode: t   eldoc-mode: t   show-paren-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   column-number-mode: t   line-number-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t   hs-minor-mode: t Load-path shadows: /home/jostein/.emacs.d/elpa/transient-20221202.1727/transient hides /home/jostein/build/emacs/lisp/transient Features: (shadow sort emacsbug flyspell ispell mail-extr pulse cl-print dired-aux misearch multi-isearch tabify cus-start help-fns radix-tree mule-util apropos helm-command helm-elisp helm-eval edebug helm-info executable markdown-mode color elec-pair typescript-ts-mode js c-ts-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs treesit goto-addr magit-extras face-remap 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 diff git-commit log-edit message sendmail yank-media rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader pcvs-util magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode transient magit-git magit-base magit-section crm compat-27 compat-26 disp-table bug-reference vc-git diff-mode vc-dispatcher vc-svn winner ffap tramp-archive tramp-gvfs tramp-cache time-stamp zeroconf dbus add-log ido-completing-read+ memoize minibuf-eldef elisp-slime-nav paredit highlight-symbol flycheck editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch company-oddmuse company-keywords company-etags etags fileloop generator company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-cmake company-semantic company-template company-bbdb company eglot external-completion array jsonrpc ert ewoc debug backtrace flymake-proc flymake warnings which-func hideshow eww url-queue thingatpt shr pixel-fill kinsoku url-file svg xml dom puny mm-url gnus nnheader gnus-util mail-utils range mm-util mail-prsvr helm-imenu pcase imenu ob-plantuml org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs helm-mode helm-misc helm-files image-dired image-dired-tags image-dired-external image-dired-util xdg image-mode dired dired-loaddefs exif tramp tramp-loaddefs trampver tramp-integration cus-edit pp cus-load icons wid-edit files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp format-spec helm-utils helm-help helm-types helm helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source helm-multi-match helm-lib async helm-config delsel autorevert filenotify yasnippet nlinum linum ido-yes-or-no advice ido edmacro kmacro use-package-bind-key bind-key easy-mmode xref project server hl-line pixel-scroll cua-base compile-eslint compile comint ansi-osc ansi-color ring doom-modeline doom-modeline-segments doom-modeline-env doom-modeline-core all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons shrink-path rx f f-shortdoc shortdoc text-property-search s dash compat compat-macs dracula-theme cl-extra help-mode use-package-ensure use-package-core finder-inf expand-region-autoloads ido-yes-or-no-autoloads doom-modeline-autoloads elisp-slime-nav-autoloads multiple-cursors-autoloads dracula-theme-autoloads crontab-mode-autoloads highlight-symbol-autoloads ssh-config-mode-autoloads dap-mode-autoloads lsp-treemacs-autoloads treemacs-autoloads cfrs-autoloads posframe-autoloads powershell-autoloads company-web-autoloads shrink-path-autoloads paredit-autoloads bui-autoloads all-the-icons-autoloads rust-mode-autoloads yaml-mode-autoloads helm-autoloads popup-autoloads helm-core-autoloads async-autoloads lsp-docker-autoloads yaml-autoloads lsp-mode-autoloads spinner-autoloads f-autoloads hydra-autoloads nlinum-autoloads ht-autoloads undo-tree-autoloads queue-autoloads ace-window-autoloads avy-autoloads cmake-mode-autoloads bmx-mode-autoloads s-autoloads company-autoloads ido-completing-read+-autoloads memoize-autoloads lv-autoloads magit-autoloads magit-section-autoloads git-commit-autoloads with-editor-autoloads transient-autoloads compat-autoloads editorconfig-autoloads yasnippet-autoloads web-completion-data-autoloads cargo-autoloads markdown-mode-autoloads pfuture-autoloads flycheck-autoloads pkg-info-autoloads epl-autoloads info dash-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 663746 79685)  (symbols 48 45967 1)  (strings 32 201584 10115)  (string-bytes 1 6033340)  (vectors 16 85585)  (vector-slots 8 1060389 121544)  (floats 8 989 979)  (intervals 56 9805 2324)  (buffers 984 57)) -- Kind regards *Jostein Kjønigsen* Software Architect SuperOffice AS www.superoffice.com --------------Jb14n0vz5cQQOJSfh0lOfyjZ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

When working in large projects, and using completion engines like Helm, one often navigates within an Emacs-project by first typing some preliminary filtering-criteria, observing the result, and then further limiting the results until one eventually finds the one file you want to work with.

For this flow to work well, one needs to have related files show up close to one another, and not being listed in "random" order.

However, in some projects I've observed that generated files (not part of VC) are shown on top, and VC-files comes later.

When the generated files are supposed to be alongside the checked in files, this makes navigation using project-find-file hard, because of the low data-locality in the presented results.

Example:

- src/someFile.d.ts   # compiled files
- src/someFile.js

- tests/someTest.d.ts
- tests/someTest.js
- src/someFile.ts     # vc-files
- tests/someTest.ts

If the results are sorted, the proper files are much easier to find quickly:

- src/someFile.d.ts
- src/someFile.js

- src/someFile.ts
- tests/someTest.d.ts
- tests/someTest.js
- tests/someTest.ts

Are there any reason we're currently not doing that?

If we can agree sorting the result is a proper thing to do, attached is a patch which implements this change.

--
Jostein

In GNU Emacs 29.0.60 (build 13, x86_64-pc-linux-gnu, GTK+ Version

 3.24.33, cairo version 1.16.0) of 2023-01-06 built on dev-jostein
Repository revision: 699711786ac7aa6d6524467076a45568e283e061
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.1 LTS

Configured using:
 'configure --with-json --with-tree-sitter
 PKG_CONFIG_PATH=/home/jostein/.opam/default/lib/pkgconfig:'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

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

Major mode: ELisp/l

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  bug-reference-prog-mode: t
  elisp-slime-nav-mode: t
  paredit-mode: t
  highlight-symbol-mode: t
  flycheck-mode: t
  editorconfig-mode: t
  company-mode: t
  which-function-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  shell-dirtrack-mode: t
  helm--remap-mouse-mode: t
  async-bytecomp-package-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-nlinum-mode: t
  nlinum-mode: t
  ido-yes-or-no-mode: t
  override-global-mode: t
  server-mode: t
  global-hl-line-mode: t
  pixel-scroll-precision-mode: t
  doom-modeline-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  hs-minor-mode: t

Load-path shadows:
/home/jostein/.emacs.d/elpa/transient-20221202.1727/transient hides /home/jostein/build/emacs/lisp/transient

Features:
(shadow sort emacsbug flyspell ispell mail-extr pulse cl-print dired-aux
misearch multi-isearch tabify cus-start help-fns radix-tree mule-util
apropos helm-command helm-elisp helm-eval edebug helm-info executable
markdown-mode color elec-pair typescript-ts-mode js c-ts-mode cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs treesit goto-addr magit-extras face-remap 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 diff
git-commit log-edit message sendmail yank-media rfc822 mml mml-sec epa
derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
pcvs-util magit-core magit-autorevert magit-margin magit-transient
magit-process with-editor magit-mode transient magit-git magit-base
magit-section crm compat-27 compat-26 disp-table bug-reference vc-git
diff-mode vc-dispatcher vc-svn winner ffap tramp-archive tramp-gvfs
tramp-cache time-stamp zeroconf dbus add-log ido-completing-read+
memoize minibuf-eldef elisp-slime-nav paredit highlight-symbol flycheck
editorconfig editorconfig-core editorconfig-core-handle
editorconfig-fnmatch company-oddmuse company-keywords company-etags
etags fileloop generator company-gtags company-dabbrev-code
company-dabbrev company-files company-clang company-capf company-cmake
company-semantic company-template company-bbdb company eglot
external-completion array jsonrpc ert ewoc debug backtrace flymake-proc
flymake warnings which-func hideshow eww url-queue thingatpt shr
pixel-fill kinsoku url-file svg xml dom puny mm-url gnus nnheader
gnus-util mail-utils range mm-util mail-prsvr helm-imenu pcase imenu
ob-plantuml org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src ob-comint org-pcomplete org-list org-footnote org-faces
org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func
cal-menu calendar cal-loaddefs org-version org-compat org-macs helm-mode
helm-misc helm-files image-dired image-dired-tags image-dired-external
image-dired-util xdg image-mode dired dired-loaddefs exif tramp
tramp-loaddefs trampver tramp-integration cus-edit pp cus-load icons
wid-edit files-x tramp-compat shell pcomplete parse-time iso8601
time-date ls-lisp helm-buffers helm-occur helm-tags helm-locate
helm-grep helm-regexp format-spec helm-utils helm-help helm-types helm
helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source
helm-multi-match helm-lib async helm-config delsel autorevert filenotify
yasnippet nlinum linum ido-yes-or-no advice ido edmacro kmacro
use-package-bind-key bind-key easy-mmode xref project server hl-line
pixel-scroll cua-base compile-eslint compile comint ansi-osc ansi-color
ring doom-modeline doom-modeline-segments doom-modeline-env
doom-modeline-core all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons shrink-path rx f f-shortdoc shortdoc
text-property-search s dash compat compat-macs dracula-theme cl-extra
help-mode use-package-ensure use-package-core finder-inf
expand-region-autoloads ido-yes-or-no-autoloads doom-modeline-autoloads
elisp-slime-nav-autoloads multiple-cursors-autoloads
dracula-theme-autoloads crontab-mode-autoloads
highlight-symbol-autoloads ssh-config-mode-autoloads dap-mode-autoloads
lsp-treemacs-autoloads treemacs-autoloads cfrs-autoloads
posframe-autoloads powershell-autoloads company-web-autoloads
shrink-path-autoloads paredit-autoloads bui-autoloads
all-the-icons-autoloads rust-mode-autoloads yaml-mode-autoloads
helm-autoloads popup-autoloads helm-core-autoloads async-autoloads
lsp-docker-autoloads yaml-autoloads lsp-mode-autoloads spinner-autoloads
f-autoloads hydra-autoloads nlinum-autoloads ht-autoloads
undo-tree-autoloads queue-autoloads ace-window-autoloads avy-autoloads
cmake-mode-autoloads bmx-mode-autoloads s-autoloads company-autoloads
ido-completing-read+-autoloads memoize-autoloads lv-autoloads
magit-autoloads magit-section-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads compat-autoloads
editorconfig-autoloads yasnippet-autoloads web-completion-data-autoloads
cargo-autoloads markdown-mode-autoloads pfuture-autoloads
flycheck-autoloads pkg-info-autoloads epl-autoloads info dash-autoloads
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode 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 lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
emacs)

Memory information:
((conses 16 663746 79685)
 (symbols 48 45967 1)
 (strings 32 201584 10115)
 (string-bytes 1 6033340)
 (vectors 16 85585)
 (vector-slots 8 1060389 121544)
 (floats 8 989 979)
 (intervals 56 9805 2324)
 (buffers 984 57))

--
Kind regards
Jostein Kjønigsen
Software Architect
SuperOffice AS
www.superoffice.com
--------------Jb14n0vz5cQQOJSfh0lOfyjZ-- --------------NG3DNkUmXMEygoG0Qkhtq06w Content-Type: text/x-patch; charset=UTF-8; name="0001-Make-project-find-files-return-files-in-sorted-order.patch" Content-Disposition: attachment; filename*0="0001-Make-project-find-files-return-files-in-sorted-order.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA2ZGYwODhmOThlN2M0ZTdjZDNjMDA5MTlhNTUzNGZkMzE1ZDJjZGUxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Sm9zdGVpbj0yMEtqPUMzPUI4bmlnc2VuPz0g PGpvc3RlaW5Aa2pvbmlnc2VuLm5ldD4KRGF0ZTogRnJpLCA2IEphbiAyMDIzIDEwOjMzOjUxICsw MTAwClN1YmplY3Q6IFtQQVRDSF0gTWFrZSBwcm9qZWN0LWZpbmQtZmlsZXMgcmV0dXJuIGZpbGVz IGluIHNvcnRlZCBvcmRlci4KCi0tLQogbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbCB8IDEwICsr KysrLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA1IGluc2VydGlvbnMoKyksIDUgZGVsZXRpb25zKC0p CgpkaWZmIC0tZ2l0IGEvbGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbCBiL2xpc3AvcHJvZ21vZGVz L3Byb2plY3QuZWwKaW5kZXggNzMwOTk4NzI3Y2UuLjAzMTE5YjE2Y2U3IDEwMDY0NAotLS0gYS9s aXNwL3Byb2dtb2Rlcy9wcm9qZWN0LmVsCisrKyBiL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwK QEAgLTEwODAsMTEgKzEwODAsMTEgQEAgcHJvamVjdC1maW5kLWZpbGUtaW4KICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGNvbmNhdCBkaXIgIi8iKSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHZjLWRpcmVjdG9yeS1leGNsdXNpb24tbGlzdCkpCiAgICAgICAgICAoYWxsLWZpbGVz Ci0gICAgICAgICAgKGlmIGluY2x1ZGUtYWxsCi0gICAgICAgICAgICAgIChtYXBjYW4KLSAgICAg ICAgICAgICAgIChsYW1iZGEgKGRpcikgKHByb2plY3QtLWZpbGVzLWluLWRpcmVjdG9yeSBkaXIg dmMtZGlycy1pZ25vcmVzKSkKLSAgICAgICAgICAgICAgIGRpcnMpCi0gICAgICAgICAgICAocHJv amVjdC1maWxlcyBwcm9qZWN0IGRpcnMpKSkKKyAgICAgICAgICAoc29ydCAoaWYgaW5jbHVkZS1h bGwKKyAgICAgICAgICAgICAgICAgICAgKG1hcGNhbgorICAgICAgICAgICAgICAgICAgICAgKGxh bWJkYSAoZGlyKSAocHJvamVjdC0tZmlsZXMtaW4tZGlyZWN0b3J5IGRpciB2Yy1kaXJzLWlnbm9y ZXMpKQorICAgICAgICAgICAgICAgICAgICAgZGlycykKKyAgICAgICAgICAgICAgICAgIChwcm9q ZWN0LWZpbGVzIHByb2plY3QgZGlycykpICMnc3RyaW5nPCkpCiAgICAgICAgICAoY29tcGxldGlv bi1pZ25vcmUtY2FzZSByZWFkLWZpbGUtbmFtZS1jb21wbGV0aW9uLWlnbm9yZS1jYXNlKQogICAg ICAgICAgKGZpbGUgKGZ1bmNhbGwgcHJvamVjdC1yZWFkLWZpbGUtbmFtZS1mdW5jdGlvbgogICAg ICAgICAgICAgICAgICAgICAgICAgIkZpbmQgZmlsZSIgYWxsLWZpbGVzIG5pbCAnZmlsZS1uYW1l LWhpc3RvcnkKLS0gCjIuMzQuMQoK --------------NG3DNkUmXMEygoG0Qkhtq06w-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 20:37:27 2023 Received: (at 60601) by debbugs.gnu.org; 10 Jan 2023 01:37:27 +0000 Received: from localhost ([127.0.0.1]:38414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pF3Zv-0000FK-C7 for submit@debbugs.gnu.org; Mon, 09 Jan 2023 20:37:27 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:40604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pF3Zt-0000F4-JG for 60601@debbugs.gnu.org; Mon, 09 Jan 2023 20:37:26 -0500 Received: by mail-wm1-f42.google.com with SMTP id k26-20020a05600c1c9a00b003d972646a7dso10657467wms.5 for <60601@debbugs.gnu.org>; Mon, 09 Jan 2023 17:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Gz97eoIFa68f8oZAWmXUvvAl+0mbMZ4koOEayMA7p0k=; b=Ekk7lAy3vcI9raJpSwhmt+0nlFU3xKjQfWutji95OXcl/mRNxVpTyW9nTltRhUoyG7 P5WZw/QgejrqHJHd3U5qrETfEwOo88Rl8eDgl+WdJYGkEfOMFv7eAhNclx3csVGjhf5o 8Y34N9Rpq94ZDPGH4gW6XZWK49Afkq6YPU5itKxOItQqypAxx6eSo8DlV/Xf9ni/KdZ5 PoZSq0UBC+QLDK1v6ry8RL5Z1LwdlPnOkcHEe8cU5/2pKZ2CEoVW6Z4ugoYq98/TUabx vUbJnq2cZQw3WkvDOMseJp8zWXW/eofAuSYwTcesIRNxuHCEg2nTxKunAxU9cr4acKJD SdOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gz97eoIFa68f8oZAWmXUvvAl+0mbMZ4koOEayMA7p0k=; b=bLdF+3sy4427QAqJQmU3HOM6ztDvskyTFdrXci3mfW4Zc0RDLsL1Ojul5mDb5TkW9P YCRDGyaxjYaepyQtqYrsppdhWe0E3XdbxDoQWkgrRblWB9mWHNwTL/jksgKc7hvkia1B SQRZJzEoQWNYTGznb7Iyn8grY0hr4JUToTDrAZfJ7AJ65H1a6imvrw4e8vWw0QY56qR6 sxigIM9fhXeM2rsLhIZrrL07C7XmzPNfXJ9I+tK7uUB9Mz4RsyG8nsOwz2/6Sx76xxkU 6b/usS7vxM5hqKSmstzpjHDgve4ypjYm+eCDwnj9GpLzwfzTkyv+UnsSj4IvIMnC1Le6 V+eA== X-Gm-Message-State: AFqh2kpDHgtbYo1wHjN+cr+cBxrD81B0yBHgYskLVPSoY7EpKqzkJ82c seAtDDJ5MOHPit7q3l9ZU+w= X-Google-Smtp-Source: AMrXdXs4xtLDeYcv/EZ8r3ucU23/8vg6sHtrplv8cXPrghQcUufYX1h5inyCCUlYYytisIjs9t/Vaw== X-Received: by 2002:a05:600c:3c93:b0:3d9:ed30:79d with SMTP id bg19-20020a05600c3c9300b003d9ed30079dmr5181579wmb.18.1673314639540; Mon, 09 Jan 2023 17:37:19 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id n14-20020a05600c4f8e00b003c6b7f5567csm437968wmq.0.2023.01.09.17.37.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Jan 2023 17:37:18 -0800 (PST) Message-ID: Date: Tue, 10 Jan 2023 03:37:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60601: 29.0.60; project-find-files reports files in seemingly random order Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= , 60601@debbugs.gnu.org References: From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60601 Cc: Eli Zaretskii 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.9 (-) Hi! On 06/01/2023 11:48, Jostein Kjønigsen via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > When working in large projects, and using completion engines like Helm, > one often navigates within an Emacs-project by first typing some > preliminary filtering-criteria, observing the result, and then further > limiting the results until one eventually finds the one file you want to > work with. > > For this flow to work well, one needs to have related files show up > close to one another, and not being listed in "random" order. One of the problems is, Helm is not a proper/compatible completing-read substitute. Just like Ivy, which I myself use. If you check out the default completion, you'll see the file names are sorted, because a completing-read-function is supposed to obey the display-sort-function metadata, and when it's absent -- the variable completions-sort (in Emacs <29 it was hardcoded alphabetical sort by default). So one solution would be to use a framework-specific way to apply sorting, e.g. helm-completing-read-handlers-alist. In Ivy's case, I think ivy-sort-functions-alist is supposed to fill that role, but apparently it's not used when the collection is a function. I'll probably file that as a bug later. > However, in some projects I've observed that generated files (not part > of VC) are shown on top, and VC-files comes later. > > When the generated files are supposed to be alongside the checked in > files, this makes navigation using project-find-file hard, because of > the low data-locality in the presented results. This never bothered me much personally, but the reason is apparently that 'git ls-files' behaves like that. We do apply sorting to find's output (the default project-files impl), starting with https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23179#296. > Example: > > - src/someFile.d.ts   # compiled files > - src/someFile.js > - tests/someTest.d.ts > - tests/someTest.js > - src/someFile.ts     # vc-files > - tests/someTest.ts > > If the results are sorted, the proper files are much easier to find quickly: > > - src/someFile.d.ts > - src/someFile.js > - src/someFile.ts > - tests/someTest.d.ts > - tests/someTest.js > - tests/someTest.ts > > Are there any reason we're currently not doing that? > > If we can agree sorting the result is a proper thing to do, attached is > a patch which implements this change. No hard reason not to, but the minor ones are: - A little extra garbage collection. - We'll probably apply the new sorting in project-files, keeping the one in project--files-in-directory already in place. Then I suppose we'll need to document the new restriction on project-files that it returns alphabetically sorted files (option A)? Or if we move the sorting to project-find-file-in, that will keep the xref output unsorted. Do we sort the results after the search is done instead? That might be an improvement, but it could create a performance hit in the pathological case when there are a lot more matches than files. So we can do that (option A), probably. Alternatively, this could be a good occasion to file the bug reports to Helm and Ivy, to bring their completing-read functions closer to conformant behavior.