From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Sep 2023 23:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 66260@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169594364215133 (code B ref -1); Thu, 28 Sep 2023 23:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Sep 2023 23:27:22 +0000 Received: from localhost ([127.0.0.1]:54709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm0PX-0003vm-FL for submit@debbugs.gnu.org; Thu, 28 Sep 2023 19:27:22 -0400 Received: from lists.gnu.org ([2001:470:142::17]:36944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm0PS-0003vD-Q8 for submit@debbugs.gnu.org; Thu, 28 Sep 2023 19:27:10 -0400 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 1qm0P8-0003xR-MB for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2023 19:26:46 -0400 Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qm0P6-0007cV-8y for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2023 19:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:mime-version:to:content-type:content-transfer-encoding: cc:content-type:from:subject:to; s=s1; bh=u7mLK1BfEfoVJNLJKfrnHKgJydTizx3o74adj0HwIds=; b=FgtIqZHLwu/+6ROY7dBQ2q7MFnWVM2upu/W10oJcC1l/HDtubQJ9FJZuzkSPlPKFeTcG x9TwoI8XUJ/T3WJyE2vPQmeAt0ltrs3AYJ3dCkUkN5vrSe5HCzARt7y1ZX9iQ8EQyepII/ sbg1HHT2I3Qg/Wa0oFRpCkzhMU2zcHO40psdCINz74er8/RsrnfoWFENNxEn6PbGd9L6qQ rWXjsssF8nTdzk/Cjf57GCPCKTJdDbfGDsGARlbC6yzJTHSiTk67VoNg1hYVYFX17xUxiy RoNggTq4CeHYn3H7fQ4snUoEB1xMPTjyQXa9OdazepPjF2gOLKawRLOsB8dsCiKQ== Received: by filterdrecv-84b96456cb-qhzcj with SMTP id filterdrecv-84b96456cb-qhzcj-1-65160BB1-1A 2023-09-28 23:26:41.940779837 +0000 UTC m=+615615.031687384 Received: from earth.catern.com (unknown) by geopod-ismtpd-0 (SG) with ESMTP id ppYzs7siQHGRjvMs27vRgA for ; Thu, 28 Sep 2023 23:26:41.667 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id C40CA6019D for ; Thu, 28 Sep 2023 19:26:40 -0400 (EDT) From: sbaugh@catern.com Date: Thu, 28 Sep 2023 23:26:41 +0000 (UTC) Message-ID: <875y3t2827.fsf@catern.com> MIME-Version: 1.0 X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbKMQ6S/4gf8r4PqQs9x0q05ke3JXUnDxocy/J8LZ9r0mwyMFP/PtcFnvUlCsndMyWY0dWw9UdaR+AFYAznO3UeDPzWVaBvaq2uSj1MaYxXz3c9WixniVMitmJvhBkti2V/48+C8qENclRR4sWtuJ6Jwy2RYgPCgP8Xhghhj0MZuew== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=149.72.154.232; envelope-from=bounces+21787432-3678-bug-gnu-emacs=gnu.org@em8926.catern.com; helo=s.wrqvwxzv.outbound-mail.sendgrid.net X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 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, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL=1.31, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: When communicating with others, it is often useful to copy a file path to the current file which is relative to the project root. For example I'd rather send someone the path lisp/progmodes/project.el [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 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: -0.0 (/) When communicating with others, it is often useful to copy a file path to the current file which is relative to the project root. For example I'd rather send someone the path lisp/progmodes/project.el than ~/src/emacs/trunk/lisp/progmodes/project.el. project.el should have a way to copy this file path. Almost good enough is: C-x p f ;; project-find-file M-n ;; next-history-element C-k ;; kill-line but with project--read-file-cpd-relative, if all the files in project-files start with a common-parent-directory which is a subdirectory of project-root, the resulting file path will not be relative to the project-root but to the subdirectory. Maybe the thing to do is just make project--read-file-cpd-relative use project-root instead of calculating a common-parent-directory? I would be happy to make that patch if that's acceptable. I think that's probably the best option. Alternatively, it might be cool if there was a variation on: C-x C-j ;; dired-jump M-0 ;; digit-argument w ;; dired-copy-filename-as-kill (which copies an absolute path) to instead copy a project-root-relative path. In GNU Emacs 29.0.92 (build 68, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2023-07-15 built on earth Repository revision: 36d3460f9f6064c03fd88e0c969c8e4f4d645235 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: NixOS 23.05 (Stoat) Configured using: 'configure --cache-file=3Dconfig.cache --with-x-toolkit=3Dlucid --with-tree-sitter --with-xinput2 CC=3Dgcc PKG_CONFIG=3Dpkg-config PKG_CONFIG_PATH=3D/nix/store/s3r15m8wbl4wqk4khqlf41ikryhjm1bi-file-5.44-de= v/lib/pkgconfig:/nix/store/f9jbn419h46c78z1pi49yn9a8742b0ql-gnutls-3.8.0-de= v/lib/pkgconfig:/nix/store/knq0pv08wm4dins7m4jh0n7cv7pjvdjr-nettle-3.9.1-de= v/lib/pkgconfig:/nix/store/dy8p07vrrhdgpnl45xz9c0k0didbikdh-gmp-with-cxx-6.= 2.1-dev/lib/pkgconfig:/nix/store/6hkdabzyqhyq5ypq4c9b2cibr1d1zg1s-harfbuzz-= 7.3.0-dev/lib/pkgconfig:/nix/store/hyns944pqgblw4icskylvlpm5krmfvcr-graphit= e2-1.3.14-dev/lib/pkgconfig:/nix/store/08cdp9vgvy023ysfa2y01gzsm2jv6phx-jan= sson-2.14/lib/pkgconfig:/nix/store/nqlbk40lh7igs61l77dwgdkn8dc2akcm-libxml2= -2.10.4-dev/lib/pkgconfig:/nix/store/b3axl73v3yvqqx7g47njqb5wzxvm280p-zlib-= 1.2.13-dev/lib/pkgconfig:/nix/store/3f2rc4inlcxmq11718qmz94v2rpybw70-ncurse= s-6.4-dev/lib/pkgconfig:/nix/store/bxy745kyb1fwhpfkiaaz3wgvpkpvwcpq-dbus-1.= 14.8-dev/lib/pkgconfig:/nix/store/9714v7c4cgpm4yqcyqk6n9xw9iq3a1bs-expat-2.= 5.0-dev/lib/pkgconfig:/nix/store/zzi7pcadidqh798yddxv6pwdbwpkikma-libselinu= x-3.3-dev/lib/pkgconfig:/nix/store/w14j7y5nl14vy4ikcivss35jmrqq3fxj-libotf-= 0.9.16-dev/lib/pkgconfig:/nix/store/arhk7hsch4scyv6m24fw03yq6wq5wbbx-m17n-l= ib-1.8.2/lib/pkgconfig:/nix/store/1jbbrny8xcjb68lb5m30cvxycfkyhvsv-sqlite-3= .42.0-dev/lib/pkgconfig:/nix/store/5vx779yqkxaysv48gicwlgv0ippbrhc4-systemd= -253.5-dev/lib/pkgconfig:/nix/store/5vx779yqkxaysv48gicwlgv0ippbrhc4-system= d-253.5-dev/share/pkgconfig:/nix/store/djifahvk3qp06ssqxv6gy1ixdnnypr9s-tre= e-sitter-0.20.8/lib/pkgconfig:/nix/store/74aasy1d2r5y27zn68cs1rxwy1llzn05-l= ibwebp-1.3.0/lib/pkgconfig:/nix/store/8sk7bp89iwb4gw96fq6xakb6lcy2x52n-Xaw3= d-1.6.3/lib/pkgconfig:/nix/store/ppvb3ha8148am3ajnzxnm6i3ri38c01n-libXmu-1.= 1.3-dev/lib/pkgconfig:/nix/store/jyxf8cjbj3nzh00x48nfram79i63chdi-libX11-1.= 8.6-dev/lib/pkgconfig:/nix/store/zk9v0nr5zdfi1ybkhcfifmxsng7hfl23-xorgproto= -2021.5/share/pkgconfig:/nix/store/3q1k18v8aa6mxs538bha4ry0mp3m321l-libxcb-= 1.14-dev/lib/pkgconfig:/nix/store/hcscz68zvfk1skyb25wrnha959f6hhrc-libXt-1.= 2.1-dev/lib/pkgconfig:/nix/store/kl55wj6qc3v481jsgvzm5w2csnhm84zf-libSM-1.2= .3-dev/lib/pkgconfig:/nix/store/s3f67kvsn55rxp2rc98xv0hkq364yci1-libICE-1.0= .10-dev/lib/pkgconfig:/nix/store/rsw4ri8025jgln8vpsrmg82bzgbcw3zr-cairo-1.1= 6.0-dev/lib/pkgconfig:/nix/store/jir0rqbcy0d9qr9kf5cwf2yphql4ykyw-fontconfi= g-2.14.2-dev/lib/pkgconfig:/nix/store/n2g3xblaz1k4civv1z6hhm1nsmp3m17p-free= type-2.13.0-dev/lib/pkgconfig:/nix/store/isbmyzm2shmp0wsjr4cy45v2i58h2zvw-b= zip2-1.0.8-dev/lib/pkgconfig:/nix/store/bl2qwy78jr2sqm260imgxmd5dzhjqvag-br= otli-1.0.9-dev/lib/pkgconfig:/nix/store/z96jh9ag5b3565lwwb5chjb9bfp5i2qv-li= bpng-apng-1.6.39-dev/lib/pkgconfig:/nix/store/jjd4z18grhky6lh8n463v648nnf56= 28b-pixman-0.42.2/lib/pkgconfig:/nix/store/qd14wrazwcspjv3q65vgh35pl7b8nifq= -libXext-1.3.4-dev/lib/pkgconfig:/nix/store/gj8i21xx87ip9b971j2d1m0rmrzyhbi= r-libXau-1.0.9-dev/lib/pkgconfig:/nix/store/4gpinwwdqhi927xkrfpr1hvdd56baxg= k-libXrender-0.9.10-dev/lib/pkgconfig:/nix/store/d1jbygs6hcn6dysk706i9zf07y= d18wmr-xcb-util-0.4.1-dev/lib/pkgconfig:/nix/store/hdc4ika0mb1cv0cf6dchwxbr= 004rc50i-glib-2.76.3-dev/lib/pkgconfig:/nix/store/wxyh848a6xcqy2v8727vcwspr= i53pqwi-libffi-3.4.4-dev/lib/pkgconfig:/nix/store/42jx72681qzliic0xsjhvx24c= il2gapk-libGL-1.6.0-dev/lib/pkgconfig:/nix/store/b9lmdkxpvgkj6zc956fvhshzis= qpi767-libglvnd-1.6.0-dev/lib/pkgconfig:/nix/store/gff29sbhg1gcw969mpm5rb69= 3kj5v18w-libXaw-1.0.14-dev/lib/pkgconfig:/nix/store/776xijk8rsb1b4c0dsxwq0k= 82bvm7mm9-libXpm-3.5.15-dev/lib/pkgconfig:/nix/store/qizdmm43xi65mdngal8bpb= pqcdc8290d-libjpeg-turbo-2.1.5.1-dev/lib/pkgconfig:/nix/store/db7ix62fx4nvr= 9j1fjdvnznl2npff4pr-librsvg-2.55.1-dev/lib/pkgconfig:/nix/store/q0hg0951w1d= v9y40m9ggln8phwil6lxc-gdk-pixbuf-2.42.10-dev/lib/pkgconfig:/nix/store/34rr5= nvgljsc4bi3mxjxg8abmjr1f7hn-libtiff-4.5.0-dev/lib/pkgconfig:/nix/store/zwkr= 4kjcjs213pw9mhzi46bzlw6qwxzq-libdeflate-1.18/lib/pkgconfig:/nix/store/6na55= 2yzwml88j8g5vqf5h9ir3vw8myi-xz-5.4.3-dev/lib/pkgconfig CXX=3Dg++' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: notmuch-search Minor modes in effect: hl-line-mode: t envrc-global-mode: t envrc-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t windmove-mode: t pixel-scroll-precision-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/sbaugh/.emacs.d/elpa/transient-0.3.7/transient hides /home/sbaugh/src= /emacs/emacs-29/lisp/transient Features: (shadow emacsbug wdired tramp-archive tramp-gvfs nov recentf tree-widget magit-bookmark bookmark esxml-query arc-mode archive-mode dired-aux dired-x textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check sort mail-extr em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util whitespace log-view pcmpl-unix erc-pcomplete erc-goodies erc erc-backend erc-networks erc-common erc-compat erc-loaddefs debug backtrace tramp-cmds cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs pulse color xref bug-reference completion cl-print shortdoc help-fns radix-tree pcmpl-linux tramp-cache time-stamp tramp-sh tramp tramp-loaddefs trampver tramp-integration tramp-compat mm-archive vc-git package-vc vc vc-dispatcher lisp-mnt network-stream url-cache url-http url-auth url-gw nsm display-line-numbers org-element org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi org org-macro org-pcomplete org-list org-footnote org-faces org-entities noutline outline ob-python python compat ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func org-version org-compat org-macs ffap mule-util misearch multi-isearch notmuch notmuch-tree notmuch-jump notmuch-hello notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash coolj goto-addr icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag notmuch-lib notmuch-compat hl-line mm-view mml-smime smime dig sh-script smie treesit executable project files-x face-remap exwm-randr xcb-randr exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types xcb-debug lui-autopaste circe advice lui-irc-colors irc gnutls lcs lui-logging lui-format lui tracking shorten thingatpt flyspell ispell circe-compat agda2 envrc inheritenv page-ext magit-extras 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 which-func imenu magit-diff smerge-mode diff diff-mode git-commit rx log-edit message sendmail yank-media puny dired desktop frameset dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc server ansi-color magit-mode transient cl-extra edmacro kmacro help-mode format-spec magit-git magit-section magit-utils crm dash windmove easy-mmode pixel-scroll cua-base ring modus-vivendi-theme modus-themes pcase cus-edit pp cus-load icons wid-edit savehist saveplace finder-inf ace-window-autoloads auctex-autoloads tex-site avy-autoloads circe-autoloads corfu-autoloads compat-autoloads csv-mode-autoloads cyberpunk-theme-autoloads debbugs-autoloads eat-autoloads envrc-autoloads exwm-autoloads ggtags-autoloads graphviz-dot-mode-autoloads htmlize-autoloads inheritenv-autoloads magit-autoloads git-commit-autoloads markdown-mode-autoloads mastodon-autoloads mentor-autoloads async-autoloads mpv-autoloads nix-mode-autoloads magit-section-autoloads dash-autoloads notmuch-autoloads persist-autoloads request-autoloads rust-mode-autoloads transient-autoloads url-scgi-autoloads vundo-autoloads which-key-autoloads info with-editor-autoloads xelb-autoloads xml-rpc-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 dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1626286 137327) (symbols 48 54331 39) (strings 32 272934 16451) (string-bytes 1 8527712) (vectors 16 136502) (vector-slots 8 2511205 204833) (floats 8 581 399) (intervals 56 122255 2589) (buffers 984 43)) From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 07:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@catern.com Cc: 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.16959708133050 (code B ref 66260); Fri, 29 Sep 2023 07:01:02 +0000 Received: (at 66260) by debbugs.gnu.org; 29 Sep 2023 07:00:13 +0000 Received: from localhost ([127.0.0.1]:55025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm7Tu-0000n4-5H for submit@debbugs.gnu.org; Fri, 29 Sep 2023 03:00:13 -0400 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:52981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm7Tp-0000kt-Kc for 66260@debbugs.gnu.org; Fri, 29 Sep 2023 03:00:08 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 831A21BF206; Fri, 29 Sep 2023 06:59:40 +0000 (UTC) From: Juri Linkov In-Reply-To: <875y3t2827.fsf@catern.com> (sbaugh@catern.com's message of "Thu, 28 Sep 2023 23:26:41 +0000 (UTC)") Organization: LINKOV.NET References: <875y3t2827.fsf@catern.com> Date: Fri, 29 Sep 2023 09:57:50 +0300 Message-ID: <86il7tihzl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net 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 (-) > When communicating with others, it is often useful to copy a file path > to the current file which is relative to the project root. For example > I'd rather send someone the path lisp/progmodes/project.el than > ~/src/emacs/trunk/lisp/progmodes/project.el. I have the same problem. Often for a project directory I give a name of the current branch, but later after switching branches sending an absolute file path with an obsolete directory name would be very confusing. So every time need to spend too much time manually removing the prefix. > project.el should have a way to copy this file path. > > Almost good enough is: > > C-x p f ;; project-find-file > M-n ;; next-history-element > C-k ;; kill-line > > but with project--read-file-cpd-relative, if all the files in > project-files start with a common-parent-directory which is a > subdirectory of project-root, the resulting file path will not be > relative to the project-root but to the subdirectory. > > Maybe the thing to do is just make project--read-file-cpd-relative use > project-root instead of calculating a common-parent-directory? I would > be happy to make that patch if that's acceptable. I think that's > probably the best option. Sorry, I have no opinion about the option above, because I always use dired-copy-filename-as-kill with the zero prefix argument: > Alternatively, it might be cool if there was a variation on: > > C-x C-j ;; dired-jump > M-0 ;; digit-argument > w ;; dired-copy-filename-as-kill > > (which copies an absolute path) to instead copy a project-root-relative > path. Sometimes an absolute path is needed too even in project directories. Maybe it's possible to find a new prefix argument to copy a project-root-relative path like 'C-u C-u w'? From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 13:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169608186213213 (code B ref 66260); Sat, 30 Sep 2023 13:52:01 +0000 Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 13:51:02 +0000 Received: from localhost ([127.0.0.1]:57863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmaN4-0003R3-9T for submit@debbugs.gnu.org; Sat, 30 Sep 2023 09:51:02 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:2992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmaMy-0003QR-0l for 66260@debbugs.gnu.org; Sat, 30 Sep 2023 09:51:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: cc:content-type:from:subject:to; s=s1; bh=ycrKjgIrgy/YbmoYkSfUsAW4qi9QI5BMC0aFviQmJ94=; b=Ulo3VQKhKM3MOwi7GNMGeYMcg99VuY06PNx8PSPz0ivhGkghBvmW0JvHkcR+2maQdFal +32xTcqiaKQhRDvm9quGKRccoZSkC4aY1ICaBG862hD11HczOIIx7p5hfcO9cvq9frBup6 xr9RSjLYskfsV77yWsXiYek/q85bqJfAhJgcD9S7Z/v5RV6ffsWT04AFOetqckOnfTuKDU n+39NSHT3OA6kuH1wIV2FWf86VVzibrnHP2j4kLcMnXCxv/EO7Cn23obJr55azLcZZ33pk 5t9df01VZfoz1m/mqTaL0c04OfPU0glCQsdrnLHryZd08Mis4HQi9s6mtvFfQqag== Received: by filterdrecv-8684c58db7-5vsrj with SMTP id filterdrecv-8684c58db7-5vsrj-1-651827A9-16 2023-09-30 13:50:33.555806704 +0000 UTC m=+238988.294772895 Received: from earth.catern.com (unknown) by geopod-ismtpd-32 (SG) with ESMTP id RhOrKL30Q0iwGjFdxyR5DA Sat, 30 Sep 2023 13:50:33.227 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=linkov.net Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 890A36584B; Sat, 30 Sep 2023 09:50:32 -0400 (EDT) From: sbaugh@catern.com In-Reply-To: <86il7tihzl.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 29 Sep 2023 09:57:50 +0300") References: <875y3t2827.fsf@catern.com> <86il7tihzl.fsf@mail.linkov.net> Date: Sat, 30 Sep 2023 13:50:33 +0000 (UTC) Message-ID: <8734yv22jb.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbLDZ4OA+uecRKF6HGxytE24Dlu5Y8Kx/B/AIOFnAkTqGjOAkCaZUnuNmmpqgSfainFy4ifqxV74vsDj40xFG/niYAGvv9kRyLmmNulGm/xYgmZX/lGOqXvqgkNyPZNwjbHfk2jW47YjdbCiAK60KY/Am16UitvD5+yyMNTN3bnGog== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" 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 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Juri Linkov writes: > Sometimes an absolute path is needed too even in project directories. > Maybe it's possible to find a new prefix argument to copy > a project-root-relative path like 'C-u C-u w'? I initially considered M-1 w, but that loses the ability to mark files and then only copy one of them. C-u C-u seems good. Here's the implementation. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Project-support-in-dired-copy-filename-as-kill.patch >From 95bd0a8775284dc59119198b02fcc64b904c4d7f Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 30 Sep 2023 09:49:03 -0400 Subject: [PATCH] Project support in dired-copy-filename-as-kill It is often useful to get a filename relative to project-root; now it is easier. * lisp/dired.el (dired-get-filename): Support 'project. (dired-copy-filename-as-kill): Make C-u C-u pass 'project. --- lisp/dired.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index cc8c74839b9..cc2cf24fac2 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3016,6 +3016,12 @@ dired-get-filename (if (and handler (not (get handler 'safe-magic))) (concat "/:" file) file))) + ((eq localp 'project) + (if-let ((project (project-current nil (dired-current-directory)))) + (file-relative-name + (concat (dired-current-directory) file) + (project-root project)) + (concat (dired-current-directory t) file))) (t (concat (dired-current-directory localp) file))))) @@ -3240,6 +3246,7 @@ dired-copy-filename-as-kill With a zero prefix arg, use the absolute file name of each marked file. With \\[universal-argument], use the file name relative to the Dired buffer's `default-directory'. (This still may contain slashes if in a subdirectory.) +With \\[universal-argument] \\[universal-argument], use the file name relative to `project-root'. If on a subdir headerline, use absolute subdirname instead; prefix arg and marked files are ignored in this case. @@ -3251,8 +3258,10 @@ dired-copy-filename-as-kill (if arg (cond ((zerop (prefix-numeric-value arg)) (dired-get-marked-files)) - ((consp arg) + ((and (consp arg) (= 4 (prefix-numeric-value arg))) (dired-get-marked-files t)) + ((and (consp arg) (>= 16 (prefix-numeric-value arg))) + (dired-get-marked-files 'project)) (t (dired-get-marked-files 'no-dir (prefix-numeric-value arg)))) -- 2.41.0 --=-=-=-- From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 14:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@catern.com Cc: 66260@debbugs.gnu.org, Juri Linkov Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169608526120910 (code B ref 66260); Sat, 30 Sep 2023 14:48:02 +0000 Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 14:47:41 +0000 Received: from localhost ([127.0.0.1]:59634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmbFs-0005RB-EL for submit@debbugs.gnu.org; Sat, 30 Sep 2023 10:47:41 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:55010 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmbFo-0005R0-Dh for 66260@debbugs.gnu.org; Sat, 30 Sep 2023 10:47:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1696085240; bh=2HtsINsXmFMaXJB+otLVTXKWJruZi+67mxsJl1twMaM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gLyOku07UXiRpUudpjyYWyi0qLJ8AGtTH2QC6OBhlWkGRmeK9H21DqVBJ3LInUTAk /pWSnQOfrLJ+8TTqQR0CrVo31XNz31NmhigL1uZXNkqEhGYJJHNumG0DjERXYl+1rD xQ0fllZBXDiLJJb9ustP8G5aBK1jUqRX0GHHZ1eq/s/IT/IarrJPQ29cmogEGjMCuF di49/3L2+qI89pUt7CILfllr/yf9Cy0Jg3kKw+p8wZRUjzVZ8WvEGGQFsajDED1XX/ VOjnZHY5igr2iNnWxsExBr0uUJ1pbFQ92niAK6MxWELdDJP5qsSyu3nUbqkEoFpgRp D7wxbSm+ZcWbA== From: Eshel Yaron In-Reply-To: <8734yv22jb.fsf@catern.com> (sbaugh@catern.com's message of "Sat, 30 Sep 2023 13:50:33 +0000 (UTC)") References: <875y3t2827.fsf@catern.com> <86il7tihzl.fsf@mail.linkov.net> <8734yv22jb.fsf@catern.com> X-Hashcash: 1:20:230930:sbaugh@catern.com::axFEve5tmRw+EWxU:0ggf X-Hashcash: 1:20:230930:juri@linkov.net::LH2uu6EjfzIrffQG:4DU0 X-Hashcash: 1:20:230930:66260@debbugs.gnu.org::9xw2PEQ+hjcmBKer:E8E/ Date: Sat, 30 Sep 2023 16:47:18 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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 (-) Hi, sbaugh@catern.com writes: > Juri Linkov writes: >> Sometimes an absolute path is needed too even in project directories. >> Maybe it's possible to find a new prefix argument to copy >> a project-root-relative path like 'C-u C-u w'? > > I initially considered M-1 w, but that loses the ability to mark files > and then only copy one of them. C-u C-u seems good. FWIW I think a separate command and binding would be preferable, namely `C-x p w`. That'd leave `w` intact and clearly indicate the project-related nature of the (new) command, so it's arguably more intuitive than `C-u C-u w`. We could also have that binding in non-Dired buffers, and have it operate on the visited file. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 15:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eshel Yaron Cc: 66260@debbugs.gnu.org, Juri Linkov Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169608709924863 (code B ref 66260); Sat, 30 Sep 2023 15:19:02 +0000 Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 15:18:19 +0000 Received: from localhost ([127.0.0.1]:59658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmbjW-0006Sx-Mp for submit@debbugs.gnu.org; Sat, 30 Sep 2023 11:18:18 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:56910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmbjU-0006Sh-EN for 66260@debbugs.gnu.org; Sat, 30 Sep 2023 11:18:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=HV0ZwOFEIUdunMV8n94MNW9FtlpMULjNqon/+q9uGvo=; b=xh7yS/17qrN0nZceolu8IsCbH8cjBZUq0QvIo1aoTbUWwU/fTxbPSa6rsU9vGr8usSjO qFkGZ0pUbraKPkv/lsg8x//FnxWQWBohaeL+BF0T32XhZU4CiRUBZfGVQ0+5xWc0v0nQ8g 4KPvdsNMNRgW2glSIpy0szrbPIOddpS0bC1SLgebvt9EGNRzdPcUi1knyTyy/xGNySI54c aSRB6yi04SbvHwToOh7SlkCel1YS/EfzjYrjxMDFsKxYPd6Cn1TsE7Rb66cRB9uA1KG/o2 haa9gb4Euu63FqGMaCCPE/suY6caJZCMwzwuOM+B66VAxeft5UYWmdUgtXRO2YSw== Received: by filterdrecv-8684c58db7-nd6mk with SMTP id filterdrecv-8684c58db7-nd6mk-1-65183C22-15 2023-09-30 15:17:54.754758172 +0000 UTC m=+759092.505623576 Received: from earth.catern.com (unknown) by geopod-ismtpd-23 (SG) with ESMTP id 98bRTk0vRROytNB0gvWJQg Sat, 30 Sep 2023 15:17:54.487 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=eshelyaron.com Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id F155965929; Sat, 30 Sep 2023 11:17:53 -0400 (EDT) From: sbaugh@catern.com In-Reply-To: (Eshel Yaron's message of "Sat, 30 Sep 2023 16:47:18 +0200") References: <875y3t2827.fsf@catern.com> <86il7tihzl.fsf@mail.linkov.net> <8734yv22jb.fsf@catern.com> Date: Sat, 30 Sep 2023 15:17:54 +0000 (UTC) Message-ID: <87zg13zo4e.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbK07N+nhvoRc2TBCIawc+4QTIcHvf8hdmzV5jd2kfLEK7xozg4ZJQ229r4kG3h+WhH6C/iZpJ9PfCFcpJ8+Tfls5X5NYQCpLpbx/qvmesnuWLwZLeWiN7cll5Pn9+qMWdEgWC6T3bptUZF9F+Gr29b2ZSIdLvOfZDTg2jrKrGZBfQ== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 (-) Eshel Yaron writes: > Hi, > > sbaugh@catern.com writes: > >> Juri Linkov writes: >>> Sometimes an absolute path is needed too even in project directories. >>> Maybe it's possible to find a new prefix argument to copy >>> a project-root-relative path like 'C-u C-u w'? >> >> I initially considered M-1 w, but that loses the ability to mark files >> and then only copy one of them. C-u C-u seems good. > > FWIW I think a separate command and binding would be preferable, namely > `C-x p w`. That'd leave `w` intact and clearly indicate the > project-related nature of the (new) command, so it's arguably more > intuitive than `C-u C-u w`. We could also have that binding in > non-Dired buffers, and have it operate on the visited file. I don't think there's any need to avoid modifying w, so even if we added this other C-x p w command, I would still like C-u C-u w to work. It's useful when navigating a project tree in dired. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 30 19:05:23 2023 Received: (at control) by debbugs.gnu.org; 30 Sep 2023 23:05:23 +0000 Received: from localhost ([127.0.0.1]:59926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmj1X-0005yI-8t for submit@debbugs.gnu.org; Sat, 30 Sep 2023 19:05:23 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:54673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmj1V-0005xw-Gp for control@debbugs.gnu.org; Sat, 30 Sep 2023 19:05:21 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so14282094f8f.1 for ; Sat, 30 Sep 2023 16:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696115100; x=1696719900; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=J0OLfE0kOUH9Oy3Vw49m9/VaSZu19RaNBKa8E5D7Tts=; b=UxK4pdUchU0IAZcpv/h8EYP16i5d4C5vmrSKOuaYOfr/ZQla3OMjVJKY1UiHRzvq40 zBciKO7hwnz1Bu1fqXT5O5+PxUEx7mk7nLjr5VzkHu3PovWdidXXwFmga0vlyXnWnQGN Xgqr57EITBFhiSSqbrKz6B1zjngG3VV5A+VIOT80VgJuJ5db2qwodPNI/MqlfeCSHjmF 32BdC4wsWg4HRFWyfkv86U8yV57NSgbsRH0fmPzzLKliiGxrpk/wsFwvq3ah67jQ/Dks 3T5dRyRH/ehOSDbZDJFOpaWO/rhXyZyrTMX4z8ks89GQ7jvWlPivz5aPKEtds1jWQ45l LLXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696115100; x=1696719900; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=J0OLfE0kOUH9Oy3Vw49m9/VaSZu19RaNBKa8E5D7Tts=; b=MA2o5pzEZzov61874XBcs+gDo02ow7MVEjQFO35OKRoHroJCJglw+WnIXrp6QaZXws 8Q2ZoIkWU9k3Ia4BiLgCen95vdohdrOKtFqSX/W7bSFKSr55jrcfH5SEr5Zjp/xUr7/f y29UZhshFz7XLurm3wk1XZsW+7xtETPLkv3YYg+R1z5x2BUY5HN0sx4xHysS2LizalCu wQBt3cFZW2yMsHowWJSEwOhKgxKphul7mEcrlXlUU4L3yx3pWrFIIHCR2smM2308oACX OXw7j+4fF6I8OWzcSPCWafYsu26U1XydqR73TyAr99Gt7FRKisNd5ZLCqGv8YnNGLLCo 3/uA== X-Gm-Message-State: AOJu0YwXdcp3oj4t6Yz/bJfDaeZrP/tNnt6hlqyBJNld9hXys2n7/YqH rbwk5xIXf557ZhkAfvap+bavwoOsAX3mc6HizwyMomKN X-Google-Smtp-Source: AGHT+IE2S+0UjcmesfrGatKrpijnkTl9Ks5kEbGREzGTDbfyWbNyqc3pG/Gffe1sn1oyKKB6hH9MEGPmbmgkWeVm6P8= X-Received: by 2002:a5d:46c2:0:b0:31f:fdd8:7d56 with SMTP id g2-20020a5d46c2000000b0031ffdd87d56mr6434687wrs.12.1696115100045; Sat, 30 Sep 2023 16:05:00 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Sep 2023 16:04:59 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sat, 30 Sep 2023 16:04:59 -0700 Message-ID: Subject: control message for bug #66260 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" 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 (-) severity 66260 wishlist quit From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Oct 2023 22:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@catern.com, 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169620030820532 (code B ref 66260); Sun, 01 Oct 2023 22:46:02 +0000 Received: (at 66260) by debbugs.gnu.org; 1 Oct 2023 22:45:08 +0000 Received: from localhost ([127.0.0.1]:35534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qn5BU-0005L6-Fk for submit@debbugs.gnu.org; Sun, 01 Oct 2023 18:45:08 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:52917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qn5BR-0005KD-H9 for 66260@debbugs.gnu.org; Sun, 01 Oct 2023 18:45:06 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 37AFE32011CD; Sun, 1 Oct 2023 18:44:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 01 Oct 2023 18:44:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1696200282; x=1696286682; bh=l7hi23flo/Qb88PHYq3VFi8QO/vH7QJGLpn Concwed4=; b=X2yLRQcqLKih7lrEUoO5XfqeYTYGaVRZoGmtKsOPrn4tu6umYTv VQCGtyeKKtLQ8E1tdnoMCDUKN+wtVIel/sZO8gVMqI/YvfVB4w2uw97YbP5ywFXA eW/iXs/hNApDWeD6E7v+8mc6XUiK8lteDV9xFSGNQ1TzWL+r7bhj0J3Pz68ZiPWU fRKi6TXrWDKjVDE7N/c9uPaWbFRaSYHBhaCk3hHoWD6DAe/KAMNqU3f09kP5dw/T HVK/r+DGAUenwUO1YKdkev7HX/vBc14xXmvKEPpjG0rfJTKZ/e8J8Hr6M3vBNOlL ezf1qFFc5zBCuoaaZDfPDAFdk6ysSOyYB7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1696200282; x= 1696286682; bh=l7hi23flo/Qb88PHYq3VFi8QO/vH7QJGLpnConcwed4=; b=Q bkit+ANl0wWLaiEBvoQdpd7sibTV2pbyrrQTswRrGfj+krXe21RBB4OEUy3OTWhA Udg007bte/uEap6qoGkl3gDf5FASh7hTRcfswABpnlBXJEtUFUMo5gdFDffd+XeL j4Rl/SoXsX265oeyMkf61E90YL/IK42B5tYKbOYVELfUBSM51/kkUbFqjBZBkn9Z lB9t3ToYy8cQCkKjnxhr2ZtWWpX8G0WRED/ays4V3Xp1XqT7dQzU7BELjoAQepHz V5y+dpqCFFNUGwMZpTP7rYxg8ugSN9mN7zVEUJDIAjWL6nVxpmtJ92MH0XYiTLAC 401cAnLUteeTOiItrlLVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeggddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhht ohhvrdguvghvqeenucggtffrrghtthgvrhhnpeeghedthedujeeiteeutddtjeekheejte eukeehffdutdejuedvfeevueevieduudenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Oct 2023 18:44:41 -0400 (EDT) Message-ID: <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> Date: Mon, 2 Oct 2023 01:44:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: <875y3t2827.fsf@catern.com> From: Dmitry Gutov In-Reply-To: <875y3t2827.fsf@catern.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) 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: -3.2 (---) On 29/09/2023 02:26, sbaugh@catern.com wrote: > When communicating with others, it is often useful to copy a file path > to the current file which is relative to the project root. For example > I'd rather send someone the path lisp/progmodes/project.el than > ~/src/emacs/trunk/lisp/progmodes/project.el. > > project.el should have a way to copy this file path. > > Almost good enough is: > > C-x p f ;; project-find-file > M-n ;; next-history-element > C-k ;; kill-line > > but with project--read-file-cpd-relative, if all the files in > project-files start with a common-parent-directory which is a > subdirectory of project-root, the resulting file path will not be > relative to the project-root but to the subdirectory. A problem with modifying the above function's behavior like that is that sometimes it is passed a wider range of file names, where not all of them are inside the project root (M-x project-or-external-find-file). > Maybe the thing to do is just make project--read-file-cpd-relative use > project-root instead of calculating a common-parent-directory? I would > be happy to make that patch if that's acceptable. I think that's > probably the best option. > > Alternatively, it might be cool if there was a variation on: > > C-x C-j ;; dired-jump > M-0 ;; digit-argument > w ;; dired-copy-filename-as-kill > > (which copies an absolute path) to instead copy a project-root-relative > path. This is unfortunately less discoverable, but sounds good otherwise. Regarding the potential binding (discussed further downthread), I have no opinion: copying the relative name doesn't happen too often for me, and when it does, I can usually do that from the VC-Dir buffer (where the file in question would usually be 'edited'). Should we add 'w' to vc-dir-mode too? 'C-x p w' does make sense as such, but it would be unfortunate if we find a more important command later which fits the 'w' mnemonics. Maybe 'C-x p W' would be a more conservative choice. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Oct 2023 05:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: sbaugh@catern.com, 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169622625518026 (code B ref 66260); Mon, 02 Oct 2023 05:58:02 +0000 Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 05:57:35 +0000 Received: from localhost ([127.0.0.1]:35764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnBvz-0004gg-1E for submit@debbugs.gnu.org; Mon, 02 Oct 2023 01:57:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnBvx-0004gR-BE for 66260@debbugs.gnu.org; Mon, 02 Oct 2023 01:57:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnBvb-0001zW-Ho; Mon, 02 Oct 2023 01:57:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XQ6nXQkcc8JmB+7bjwZeXtTf6hbiP0eKQP1+K8yrafw=; b=jYUpYLcAY3mm oI9N7Mc98BGRl8c4Y3wlxvc5G9iMWe5qIFln7A2LsTw02QfNLHH7QVHTrV6QTmwgRT6PW5mT+7A4Y mg2Va9f8LRKsSryEo0iaB08ePPhuLFIBmgpgX0lUMBZ2V91fsEuDWH5SJ2ANfjsnGibugOo4b75aQ iJm8vwCT+cc0yBjPI1w11+1HKmPhjJj+qNtxgkLELkvoF3dRvqSaucVeM9nKfcfwKH1bZqUHdYAKs tF1Rw8RD+6hpbrnFX9xLxpYSevLz4mCpNJKGIsygZLypeg6MxvHG1ANw4Ie0NiTs3QDnxRWI71BSb py8xhNoB25KcurUHKxrj2Q==; Date: Mon, 02 Oct 2023 08:57:12 +0300 Message-Id: <834jj98t3b.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> (message from Dmitry Gutov on Mon, 2 Oct 2023 01:44:38 +0300) References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > Date: Mon, 2 Oct 2023 01:44:38 +0300 > From: Dmitry Gutov > > 'C-x p w' does make sense as such, but it would be unfortunate if we > find a more important command later which fits the 'w' mnemonics. Maybe > 'C-x p W' would be a more conservative choice. Or even "C-x p C-w". From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Oct 2023 07:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Dmitry Gutov , 66260@debbugs.gnu.org, sbaugh@catern.com Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169622999325022 (code B ref 66260); Mon, 02 Oct 2023 07:00:03 +0000 Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 06:59:53 +0000 Received: from localhost ([127.0.0.1]:35819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnCuG-0006VW-ND for submit@debbugs.gnu.org; Mon, 02 Oct 2023 02:59:52 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:49015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnCuE-0006V1-D3 for 66260@debbugs.gnu.org; Mon, 02 Oct 2023 02:59:50 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 26570240005; Mon, 2 Oct 2023 06:59:25 +0000 (UTC) From: Juri Linkov In-Reply-To: <834jj98t3b.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Oct 2023 08:57:12 +0300") Organization: LINKOV.NET References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> <834jj98t3b.fsf@gnu.org> Date: Mon, 02 Oct 2023 09:53:41 +0300 Message-ID: <865y3pqzoa.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net 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 (-) >> 'C-x p w' does make sense as such, but it would be unfortunate if we >> find a more important command later which fits the 'w' mnemonics. Maybe >> 'C-x p W' would be a more conservative choice. > > Or even "C-x p C-w". Or 'C-x p C-c' like 'c' in Info-mode-map for Info-copy-current-node-name. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Oct 2023 11:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Dmitry Gutov Cc: sbaugh@catern.com, 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169624523029925 (code B ref 66260); Mon, 02 Oct 2023 11:14:02 +0000 Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 11:13:50 +0000 Received: from localhost ([127.0.0.1]:36152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnGs2-0007mb-1t for submit@debbugs.gnu.org; Mon, 02 Oct 2023 07:13:50 -0400 Received: from qs51p00im-qukt01071501.me.com ([17.57.155.4]:62575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnGs0-0007mJ-0t for 66260@debbugs.gnu.org; Mon, 02 Oct 2023 07:13:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1696245205; bh=teVL9KBENx/lDD40jO/KnHvVTTDAhPzIOifaIl3/Jvc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=J0EG4qtFOh2jja+udmfevRND/n66DioOESxjh+2An3rN7pnx478nyXHc8p3wnlRSJ n8Ihbbzxcpno8pDAPAEXsHjtyAd+Zrw+dqTQSDar2Je6buWveMFVJjiVnPjMjX7iXY YcB2Hd3bJZU6ZggsbxGZDBydvXGfNJSLj0OVzKQuAgqmMXCGkPJjva8TrEWm3C9wUy Stem6Db8eR660KyXCJ3kl6wglqAZ3SnwvBw0zIWckS9sSgUzzTvAPdmfXnprEK/ZIC 2HInz1YPGA9dM/RSz3bJNqKAjRQafeUi2feY8xX1Q1kKwzc+/g+Sl3aGWxUv9OzgSm 4sPa/4b5WsBKA== Received: from Rudolfs-MacBook-Air.local (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01071501.me.com (Postfix) with ESMTPSA id 824F41C40347; Mon, 2 Oct 2023 11:13:24 +0000 (UTC) From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= In-Reply-To: <834jj98t3b.fsf@gnu.org> References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> <834jj98t3b.fsf@gnu.org> Date: Mon, 02 Oct 2023 13:13:22 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: m0Z1YnOpwcT8ai8hWtxmJG7GHk3Y3orb X-Proofpoint-ORIG-GUID: m0Z1YnOpwcT8ai8hWtxmJG7GHk3Y3orb X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.138,18.0.790,17.11.62.513.0000000 definitions=2022-01-12_02:2020-02-14_02,2022-01-12_02,2021-12-02_01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 clxscore=1011 mlxlogscore=732 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2310020084 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 (-) Eli Zaretskii writes: > Or even "C-x p C-w". Why not 'C-x p M-w' to match 'M-w (kill-ring-save)' instead? P.S. It would also match Vertico, where 'M-w' already saves the relative path of the currently selected file after 'C-x p f'. Rudy --=20 "If you're thinking without writing, you only think you're thinking." --- Leslie Lamport Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Oct 2023 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov , Eli Zaretskii Cc: sbaugh@catern.com, 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169624722910845 (code B ref 66260); Mon, 02 Oct 2023 11:48:01 +0000 Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 11:47:09 +0000 Received: from localhost ([127.0.0.1]:36171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnHOH-0002oq-JD for submit@debbugs.gnu.org; Mon, 02 Oct 2023 07:47:09 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnHOG-0002oc-La for 66260@debbugs.gnu.org; Mon, 02 Oct 2023 07:47:09 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D6D285C0227; Mon, 2 Oct 2023 07:46:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 02 Oct 2023 07:46:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1696247206; x=1696333606; bh=CSjU8Twe8M8vY8h5O4QUICqFEZUYTO8WZko 5u8BEhdk=; b=lD867WI0xzAYdUvymIm7i6uqLopUH6owsE3jcmoCslLlJ75ghlM 1Qqwn37dVCwJvmfjpKvbOc2sunOJhRISqr4c4wyT/Xce9lr2preB49+Lm8ONwKLr WQ2jTy7edNkeU+2bBXous0oy2tEOJjo/nELLmaZpdK3oXyvLRc9/L7VCdLR0EFcj kOi5R5cyNMtx1yyuNoi7ToT4hY7KV7cAGG7zItVmoAPTtodqb8qDxSC5W2VgE3lW ummWzWd1cImB8VhHwxShlMlDZjzEZYfGvDj9S+sjOR/IpibDTfdin2aaiS9i22AP o9WLYEpYMvrLvJA/QGSAI9Gk1ynSBVsmoOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696247206; x=1696333606; bh=CSjU8Twe8M8vY8h5O4QUICqFEZUYTO8WZko 5u8BEhdk=; b=KoJjGJLVIYajWslfCGfVrLCukOwj/sF8/uqgHh+ACxWx1jUB3Dm AjViowLphuCrG6jkWIpgG3v5WsBypHZRKPhKjks6ASdHhgq73wYPfwDum1ErdYPa TS9c50O9es/VV/At+EFrpTgI9L/6BX3C+IP/QQTlOmtmEVe6D3YR95oYkaqxR6yg 0Y0sMSSBjrCt3vkFZNYG10+qBwMg75Ug2Y3uDCSiq1IekKWkuYi0ZU2l5u8vIo1l ErZYQ18zH77tU81gkn+n7HDWN9SjVNvGenaFjL0AQlti44d4BT/lsQeVXe9wNELh rwxc1XIgmt5Tekn8cCLNm5pSMjT4r2PLDQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdelgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Oct 2023 07:46:45 -0400 (EDT) Message-ID: <6a454175-c709-3473-fdb4-e4be39e2d8fe@gutov.dev> Date: Mon, 2 Oct 2023 14:46:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> <834jj98t3b.fsf@gnu.org> <865y3pqzoa.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <865y3pqzoa.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) 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: -3.2 (---) On 02/10/2023 09:53, Juri Linkov wrote: >>> 'C-x p w' does make sense as such, but it would be unfortunate if we >>> find a more important command later which fits the 'w' mnemonics. Maybe >>> 'C-x p W' would be a more conservative choice. >> Or even "C-x p C-w". > Or 'C-x p C-c' like 'c' in Info-mode-map for Info-copy-current-node-name. That one was probably made from the CUA user's standpoint. I sympathize, but even Info-mode-map has a 'w' binding (thanks to you, looks like). So C-w or M-w seem like a better choice for the default bindings. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Oct 2023 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: Eli Zaretskii , 66260@debbugs.gnu.org, Juri Linkov Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169636620021562 (code B ref 66260); Tue, 03 Oct 2023 20:50:02 +0000 Received: (at 66260) by debbugs.gnu.org; 3 Oct 2023 20:50:00 +0000 Received: from localhost ([127.0.0.1]:40797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnmL9-0005bh-J8 for submit@debbugs.gnu.org; Tue, 03 Oct 2023 16:49:59 -0400 Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:22492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnmL7-0005bS-JC for 66260@debbugs.gnu.org; Tue, 03 Oct 2023 16:49:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=Jd8iT4soTEL+SEB91KfVIzopd5r+/6adVuWPtpVi4YA=; b=ekH53e0INgJqYlK/SW+TGVIA1GhJuZLt4Du+Kw46qMf+Jr6xCU7w8sAgJlhTvj5FQWrJ diNyziGwYpKpvLN0STHwPR0OgWbAO4wg8pEj3yg6i5fQpiHASZL87xkjWHM6P0boG/BzsO 7Dfat1OYhRE+rrEZluGSCqE5KVbg4WvieVc7AeB250TyklKb5p29o6XLDPzpIN2VA4DtPF /jDqVPI/T7tMZM9HonJYF/9/b0steoVg0Z4/7nTyWdCmKY6v0MHKYnKmfgbdDlbPiNZKjN jgQK6XQtHXF6N9dGOv82G/KYbKD0qCViopur3hNdzMrEc174c0fa63OfM8yXsBrQ== Received: by filterdrecv-84b96456cb-b9h64 with SMTP id filterdrecv-84b96456cb-b9h64-1-651C7E5D-7 2023-10-03 20:49:33.155215738 +0000 UTC m=+5541998.491284502 Received: from earth.catern.com (unknown) by geopod-ismtpd-33 (SG) with ESMTP id LoUPmdJRRVi80YiOHxzJcA Tue, 03 Oct 2023 20:49:32.873 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 4D32862ED2; Tue, 3 Oct 2023 16:49:32 -0400 (EDT) From: sbaugh@catern.com In-Reply-To: <6a454175-c709-3473-fdb4-e4be39e2d8fe@gutov.dev> (Dmitry Gutov's message of "Mon, 2 Oct 2023 14:46:43 +0300") References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> <834jj98t3b.fsf@gnu.org> <865y3pqzoa.fsf@mail.linkov.net> <6a454175-c709-3473-fdb4-e4be39e2d8fe@gutov.dev> Date: Tue, 03 Oct 2023 20:49:33 +0000 (UTC) Message-ID: <87jzs3zb1f.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbJiOgWFv+kkAT2s0poKXS1pkDbpz7/uEtPLcXezycBZamV2vX01PVAY7zsEk8+lZ0m5C8O1QYSXDXaKEvpciGeFxO9H7z/n12dUwMBsdEhsYlRravL1SJe0/sOUdOB8hMCFTZnuKwjnLf9w+MWpnVXu3z1myfJSyoIqYzRsTa/dKw== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 (-) Dmitry Gutov writes: > On 02/10/2023 09:53, Juri Linkov wrote: >>>> 'C-x p w' does make sense as such, but it would be unfortunate if we >>>> find a more important command later which fits the 'w' mnemonics. Maybe >>>> 'C-x p W' would be a more conservative choice. >>> Or even "C-x p C-w". >> Or 'C-x p C-c' like 'c' in Info-mode-map for Info-copy-current-node-name. > > That one was probably made from the CUA user's standpoint. > > I sympathize, but even Info-mode-map has a 'w' binding (thanks to you, > looks like). > > So C-w or M-w seem like a better choice for the default bindings. I don't think C-x p w is quite necessary. But even if it was, I think there's a good other candidate for what it should do: copy the project root. That would also be pretty useful. For example, I often move a patch between two projects by first rendering it in one project (with C-x v D), entering M-x cd other/project/root in the *vc-diff* buffer, and then applying the diff. If there was a quick way to get other/project/root, it would speed this up. Sometimes I also run shell commands which need the project root. I can always do C-x p D then copy the file name of that buffer, but that's about as painful as C-x C-j C-u C-u w, so if C-x C-j C-u C-u w is too cumbersome then it seems to me that so is C-x p D and copy. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Oct 2023 21:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@catern.com Cc: Eli Zaretskii , 66260@debbugs.gnu.org, Juri Linkov Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169636788324436 (code B ref 66260); Tue, 03 Oct 2023 21:19:01 +0000 Received: (at 66260) by debbugs.gnu.org; 3 Oct 2023 21:18:03 +0000 Received: from localhost ([127.0.0.1]:40820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnmmI-0006Lu-Cj for submit@debbugs.gnu.org; Tue, 03 Oct 2023 17:18:02 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnmmG-0006LX-51 for 66260@debbugs.gnu.org; Tue, 03 Oct 2023 17:18:01 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 990F75C02E3; Tue, 3 Oct 2023 17:17:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 03 Oct 2023 17:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1696367857; x=1696454257; bh=QgS+U6qGAKo6nn2AF4zkjQ7WWpUlhPfE5HM wL22mK8g=; b=nRK4F69C2Pqq56kQa+BLW3fULH2VAYAsAAxJrfnn1heHCiC7wYI fb72xk7E8woY+mn10ofj0Wk+0MZ71a33DgUwtEKl2xnXjmWWnQQfc1EggIJERyeT jlpY1wNnuWVmpcLDY3R1AHRHtS9NE3UJJ85np0zURj40x893qsN1y8afUMqBSaBw 36cTMdSC+o40ES29Pd7crtJ8cuhbNFsBMrAvCtDu6Ne73tZ2kC1fG+0HY+vRLj2q rrm1+1kZjUwRY9kw7nioJj5M0sHTJjxJoaiiTX+ZagAYXTlOp8DIaHcm4EoC7TtS L/VnShSWrHhp4VYoV5Z0G4OnaEiC1gt9xhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696367857; x=1696454257; bh=QgS+U6qGAKo6nn2AF4zkjQ7WWpUlhPfE5HM wL22mK8g=; b=ShuEhH5ND/GSB/ZgYjZc7xpQ9OpaiUTCyjptjlykGVeGqX6YVja 6xfGTgxix7JyIiMXrjsoOYBF6+VaMHjd+kwFVjVN7krK3QSaawq8VoXX4zhXYafN rd+Xh0cWYW3GfiHn5LhXM9rMvsF+XbjlLMQeMBZiK3aJKsnxfZFeZmZqnlID4CyH sKxb7a0w5aQ1MST8ZmVsxyY6cLPmlMkjJiq8ShIHwp2HFJDaHsXHXzX9CVEM0W+e BMzAg/4OoCyb8LAx/xsAsGJ/5+rWdg5iTwH/6aQRoBoESIHcSNglgJuDQQhrRo7Z yOXLi8zgNRNapBTcD9c7yl+S/S/k6R2Zb7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfeejgdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Oct 2023 17:17:36 -0400 (EDT) Message-ID: Date: Wed, 4 Oct 2023 00:17:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> <834jj98t3b.fsf@gnu.org> <865y3pqzoa.fsf@mail.linkov.net> <6a454175-c709-3473-fdb4-e4be39e2d8fe@gutov.dev> <87jzs3zb1f.fsf@catern.com> From: Dmitry Gutov In-Reply-To: <87jzs3zb1f.fsf@catern.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) 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: -3.2 (---) On 03/10/2023 23:49, sbaugh@catern.com wrote: > Dmitry Gutov writes: >> On 02/10/2023 09:53, Juri Linkov wrote: >>>>> 'C-x p w' does make sense as such, but it would be unfortunate if we >>>>> find a more important command later which fits the 'w' mnemonics. Maybe >>>>> 'C-x p W' would be a more conservative choice. >>>> Or even "C-x p C-w". >>> Or 'C-x p C-c' like 'c' in Info-mode-map for Info-copy-current-node-name. >> >> That one was probably made from the CUA user's standpoint. >> >> I sympathize, but even Info-mode-map has a 'w' binding (thanks to you, >> looks like). >> >> So C-w or M-w seem like a better choice for the default bindings. > > I don't think C-x p w is quite necessary. But even if it was, I think > there's a good other candidate for what it should do: copy the project > root. That would also be pretty useful. Not necessary, but if more than one user likes that, I think we can dedicate the C-w binding for it. > For example, I often move a patch between two projects by first > rendering it in one project (with C-x v D), entering M-x cd > other/project/root in the *vc-diff* buffer, and then applying the diff. > If there was a quick way to get other/project/root, it would speed this > up. Depending on how often you do either thing, 'C-x p C-w' could copy the relative file name, and 'c-u C-x p C-w' could copy the root. Or the latter action could be moved to 'C-x p C-S-w', for example (by analogy with C-x v D'. > Sometimes I also run shell commands which need the project root. > > I can always do C-x p D then copy the file name of that buffer, but > that's about as painful as C-x C-j C-u C-u w, so if C-x C-j C-u C-u w is > too cumbersome then it seems to me that so is C-x p D and copy. From unknown Sat Aug 09 09:37:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66260: 29.0.92; project.el should support copying a file path relative to the project root Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 13:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: 66260@debbugs.gnu.org Received: via spool by 66260-submit@debbugs.gnu.org id=B66260.169789405131743 (code B ref 66260); Sat, 21 Oct 2023 13:15:02 +0000 Received: (at 66260) by debbugs.gnu.org; 21 Oct 2023 13:14:11 +0000 Received: from localhost ([127.0.0.1]:42549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quBnv-0008Fu-3M for submit@debbugs.gnu.org; Sat, 21 Oct 2023 09:14:11 -0400 Received: from s.wfbtzhsv.outbound-mail.sendgrid.net ([159.183.224.104]:9002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quBns-0008Fc-G5 for 66260@debbugs.gnu.org; Sat, 21 Oct 2023 09:14:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: cc:content-type:from:subject:to; s=s1; bh=IwZ3Uv8253ab+6tur8LUIA6GPQ1t8cRUB1/C/Z8nxe8=; b=OvmFsYVJ3qjTfetb7vjxedPSbnTdUXw/4Z6M78In7Pteb0gTlRV9XpNM18RqQLZKT3MU KoMeDESweZ8FmnyGfM4VXm7Xx7SLaFzuUd/vNC8lhhhyPTtvp6zC++2fP1B0iMA+HVx+rW DqH08whzaLEy16NpcKve0UnB+czXxRVwTAr4e8INQD4zF1PK/YiPsYjNUDOGzXkBjbfXNS BpUNXCCZFeOmnKqNqfAy+RCvUcDuOKyHuurhzzbwuKG/M8X1RYT6l41bxV8aCmTKN4Y4kY W/yMroZFlpmLP7Lq1EcKg0bRugrqOQo3zpZGIsR2kqOYI9Qj2FB61VteKJJbIzNg== Received: by filterdrecv-6b68c9f446-8bxlf with SMTP id filterdrecv-6b68c9f446-8bxlf-1-6533CE7D-29 2023-10-21 13:13:33.974753895 +0000 UTC m=+325962.811723049 Received: from earth.catern.com (unknown) by geopod-ismtpd-0 (SG) with ESMTP id dfMti6vFQW2fBZCSBV83_Q Sat, 21 Oct 2023 13:13:33.886 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 626EE601BB; Sat, 21 Oct 2023 09:13:33 -0400 (EDT) From: sbaugh@catern.com In-Reply-To: <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> (Dmitry Gutov's message of "Mon, 2 Oct 2023 01:44:38 +0300") References: <875y3t2827.fsf@catern.com> <15010505-0b2f-5dc3-e16a-228183779d43@gutov.dev> Date: Sat, 21 Oct 2023 13:13:34 +0000 (UTC) Message-ID: <87jzrgt8xu.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbJEH/P2L4/q99KQJRVSKiN47/wAAS3UQvWN+RhbX9ceUgoL6cTvB1rrHba0M1tiscDyD0kHBuz3GXbWLRmeyce66VxC6eSllm3loOLnHIOXIcXRhYJ+VmDJWQUuAkIcjWt6We9Pg30/YdKBER5f5jF77OYZepl1g36/VP8BYTss/w== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) 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.5 (-) --=-=-= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dmitry Gutov writes: > On 29/09/2023 02:26, sbaugh@catern.com wrote: >> When communicating with others, it is often useful to copy a file path >> to the current file which is relative to the project root. For example >> I'd rather send someone the path lisp/progmodes/project.el than >> ~/src/emacs/trunk/lisp/progmodes/project.el. >> project.el should have a way to copy this file path. >> Almost good enough is: >> C-x p f ;; project-find-file >> M-n ;; next-history-element >> C-k ;; kill-line >> but with project--read-file-cpd-relative, if all the files in >> project-files start with a common-parent-directory which is a >> subdirectory of project-root, the resulting file path will not be >> relative to the project-root but to the subdirectory. > > A problem with modifying the above function's behavior like that is > that sometimes it is passed a wider range of file names, where not all > of them are inside the project root (M-x > project-or-external-find-file). Oh, what if we just *check* if the common-parent-directory is below the project root, and in that case use the project root instead? That elegantly resolves this without breaking that. Like this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-project-root-in-project-find-file-if-all-files-a.patch >From c5b2e49cc8117e063d9e16a9072eb07ddff8aaa5 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 21 Oct 2023 09:11:52 -0400 Subject: [PATCH] Use project-root in project-find-file if all files are below it project-files can return a list of files all of whom are in a subdirectory of project-root. We should still use project-root in project--read-file-cpd-relative in that case, for several reasons: - Now M-n will always bring up the full path of the current file for copying - Now if the user wants to manually type in a path starting at the root, they can. * lisp/progmodes/project.el (project--read-file-cpd-relative): Always use project-root if all files are below that. (bug#66260) --- lisp/progmodes/project.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0d6539113cc..dcd1cab4f96 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1117,9 +1117,16 @@ project--read-file-cpd-relative MB-DEFAULT is used as part of \"future history\", to be inserted by the user at will." (let* ((common-parent-directory - (let ((common-prefix (try-completion "" all-files))) - (if (> (length common-prefix) 0) - (file-name-directory common-prefix)))) + (let* ((common-prefix (try-completion "" all-files)) + (root (project-root (project-current))) + (expand-root (expand-file-name root)) + (abbrev-root (abbreviate-file-name root))) + (cond + ;; We try use the project-root even if all the files have + ;; a c-p-d below the project-root. + ((string-prefix-p expand-root common-prefix) expand-root) + ((string-prefix-p abbrev-root common-prefix) abbrev-root) + ((> (length common-prefix) 0) (file-name-directory common-prefix))))) (cpd-length (length common-parent-directory)) (prompt (if (zerop cpd-length) prompt -- 2.41.0 --=-=-=--