* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist @ 2022-05-05 3:24 Pankaj Jangid [not found] ` <handler.55267.B.165172109316668.ack@debbugs.gnu.org> 0 siblings, 1 reply; 9+ messages in thread From: Pankaj Jangid @ 2022-05-05 3:24 UTC (permalink / raw) To: 55267 [Feature request] I use project feature of emacs. And I feel that there is a need for a customization variable like "project-savehist-enable". When value is "t", save the files opened with "project-find-file" into savehist. In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2022-05-05 built on anant Repository revision: 5784533cb6e1fe5edf4d5f6c24c02ab8ef5be732 Repository branch: master System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure --prefix=/home/pankaj/.local --with-pgtk' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB Important settings: value of $LC_MONETARY: en_IN.UTF-8 value of $LC_NUMERIC: en_IN.UTF-8 value of $LC_TIME: en_IN.UTF-8 value of $LANG: en_IN value of $XMODIFIERS: @im=ibus locale-coding-system: iso-latin-1-unix Major mode: ELisp/l Minor modes in effect: company-mode: t flymake-mode: t electric-pair-mode: t editorconfig-mode: t which-key-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t override-global-mode: t savehist-mode: t desktop-save-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 indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/pankaj/.emacs.d/elpa/transient-20220503.1118/transient hides /home/pankaj/.local/share/emacs/29.0.50/lisp/transient Features: (shadow sort flyspell ispell mail-extr shortdoc help-fns emacsbug autoload radix-tree diary-lib diary-loaddefs sql view dockerfile-mode sh-script smie executable markdown-mode conf-mode ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file url-dired svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi yaml-mode mule-util jka-compr tramp-cache prettier nvm f s iter2 js vc-git checkdoc company-oddmuse company-keywords company-etags etags fileloop company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-cmake company-semantic company-template company-bbdb company flymake-proc flymake elec-pair editorconfig-core editorconfig-core-handle editorconfig-fnmatch init my-init org-element avl-tree generator org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-plantuml ob-sql ob-css ob-js ob-java ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-python python ob-R ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat advice org-macs org-loaddefs cal-menu calendar cal-loaddefs warnings sesman vc vc-dispatcher clojure-mode lisp-mnt align thingatpt editorconfig tree-sitter-langs tree-sitter-langs-build tar-mode arc-mode archive-mode tree-sitter-hl tree-sitter tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get dired-aux tsc-obsolete gtags-mode xref project which-key vterm magit-bookmark bookmark tramp tramp-loaddefs trampver tramp-integration cus-edit pp wid-edit files-x tramp-compat parse-time iso8601 ls-lisp face-remap compile color term disp-table ehelp find-func vterm-module term/xterm xterm 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 pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ring server ansi-color magit-mode transient magit-git magit-base magit-section format-spec crm dash compat-27 compat-26 compat exec-path-from-shell bbdb-message message sendmail yank-media rmc puny dired 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 bbdb bbdb-site timezone edmacro kmacro modus-vivendi-theme modus-themes pcase delight cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core hl-line savehist desktop frameset avoid cus-load finder-inf tex-site info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib early-init iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win 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 simple cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button 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 gtk pgtk lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 706707 35589) (symbols 48 49850 1) (strings 32 197900 6452) (string-bytes 1 6185931) (vectors 16 88510) (vector-slots 8 1746492 208908) (floats 8 556 53) (intervals 56 1933 43) (buffers 992 96)) ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <handler.55267.B.165172109316668.ack@debbugs.gnu.org>]
* bug#55267: Acknowledgement (29.0.50; Provide customization to save project-find-file arg to savehist) [not found] ` <handler.55267.B.165172109316668.ack@debbugs.gnu.org> @ 2022-05-05 3:50 ` Pankaj Jangid 2022-05-05 7:28 ` bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Juri Linkov 0 siblings, 1 reply; 9+ messages in thread From: Pankaj Jangid @ 2022-05-05 3:50 UTC (permalink / raw) To: 55267 I just noticed that "project-find-file" is ultimately calling "find-file" only. So it should save the file to minibuffer history if savehist-mode is enabled. But this is not happening in my environment right now. Is this a bug (instead of feature request)? ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-05 3:50 ` bug#55267: Acknowledgement (29.0.50; Provide customization to save project-find-file arg to savehist) Pankaj Jangid @ 2022-05-05 7:28 ` Juri Linkov 2022-05-12 16:38 ` Juri Linkov 2022-05-29 21:42 ` Dmitry Gutov 0 siblings, 2 replies; 9+ messages in thread From: Juri Linkov @ 2022-05-05 7:28 UTC (permalink / raw) To: Pankaj Jangid; +Cc: 55267 > I just noticed that "project-find-file" is ultimately calling > "find-file" only. So it should save the file to minibuffer history if > savehist-mode is enabled. > > But this is not happening in my environment right now. Is this a bug > (instead of feature request)? Recently I noticed this problem too. So project-find-file-in needs to specify the same history variable 'file-name-history' as used in read-file-name-default. Then you could add 'file-name-history' to savehist-additional-variables. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-05 7:28 ` bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Juri Linkov @ 2022-05-12 16:38 ` Juri Linkov 2022-05-29 21:44 ` Dmitry Gutov 2022-05-29 21:42 ` Dmitry Gutov 1 sibling, 1 reply; 9+ messages in thread From: Juri Linkov @ 2022-05-12 16:38 UTC (permalink / raw) To: Pankaj Jangid; +Cc: 55267 [-- Attachment #1: Type: text/plain, Size: 763 bytes --] >> I just noticed that "project-find-file" is ultimately calling >> "find-file" only. So it should save the file to minibuffer history if >> savehist-mode is enabled. >> >> But this is not happening in my environment right now. Is this a bug >> (instead of feature request)? > > Recently I noticed this problem too. So project-find-file-in > needs to specify the same history variable 'file-name-history' > as used in read-file-name-default. > > Then you could add 'file-name-history' to savehist-additional-variables. BTW, here is another improvement for project-find-file. If there is no file name under point, it could propose the current file name for editing in the minibuffer, to find another file based on the current file when their names are similar. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: project-find-file.patch --] [-- Type: text/x-diff, Size: 760 bytes --] diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 6c50135358..5eee20e408 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -863,8 +863,12 @@ project-find-file for VCS directories listed in `vc-directory-exclusion-list'." (interactive "P") (let* ((pr (project-current t)) - (dirs (list (project-root pr)))) - (project-find-file-in (thing-at-point 'filename) dirs pr include-all))) + (root (project-root pr)) + (dirs (list root))) + (project-find-file-in + (or (thing-at-point 'filename) + (and buffer-file-name (file-relative-name buffer-file-name root))) + dirs pr include-all))) ;;;###autoload (defun project-or-external-find-file (&optional include-all) ^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-12 16:38 ` Juri Linkov @ 2022-05-29 21:44 ` Dmitry Gutov 2022-05-30 6:08 ` Pankaj Jangid 0 siblings, 1 reply; 9+ messages in thread From: Dmitry Gutov @ 2022-05-29 21:44 UTC (permalink / raw) To: Juri Linkov, Pankaj Jangid; +Cc: 55267 On 12.05.2022 19:38, Juri Linkov wrote: > BTW, here is another improvement for project-find-file. > If there is no file name under point, it could propose > the current file name for editing in the minibuffer, > to find another file based on the current file > when their names are similar. Here as well: if you find this helpful, that sounds okay to me. I haven't ever felt a need for this particular behavior, but it shouldn't hurt either. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-29 21:44 ` Dmitry Gutov @ 2022-05-30 6:08 ` Pankaj Jangid 2022-05-30 9:21 ` Dmitry Gutov 0 siblings, 1 reply; 9+ messages in thread From: Pankaj Jangid @ 2022-05-30 6:08 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 55267, Juri Linkov Dmitry Gutov <dgutov@yandex.ru> writes: > On 12.05.2022 19:38, Juri Linkov wrote: >> BTW, here is another improvement for project-find-file. >> If there is no file name under point, it could propose >> the current file name for editing in the minibuffer, >> to find another file based on the current file >> when their names are similar. > > Here as well: if you find this helpful, that sounds okay to me. > > I haven't ever felt a need for this particular behavior, but it > shouldn't hurt either. To be consistent with other subsystems of Emacs, we can do something that Dired does. 1. Press ’R’ to rename a file. 2. Then press ’M-n’. It invokes (next-history-element) which fills current file in the minibuffer for editing. the advantage of this above approach is that it offers user a choice - continue using the same behaviour or press ’M-n’ to prefill current file name. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-30 6:08 ` Pankaj Jangid @ 2022-05-30 9:21 ` Dmitry Gutov 0 siblings, 0 replies; 9+ messages in thread From: Dmitry Gutov @ 2022-05-30 9:21 UTC (permalink / raw) To: Pankaj Jangid; +Cc: 55267, Juri Linkov On 30.05.2022 09:08, Pankaj Jangid wrote: > To be consistent with other subsystems of Emacs, we can do something > that Dired does. > > 1. Press ’R’ to rename a file. > > 2. Then press ’M-n’. It invokes (next-history-element) which fills > current file in the minibuffer for editing. > > the advantage of this above approach is that it offers user a > choice - continue using the same behaviour or press ’M-n’ to prefill > current file name. I think that's what Juri is suggesting, more or less. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-05 7:28 ` bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Juri Linkov 2022-05-12 16:38 ` Juri Linkov @ 2022-05-29 21:42 ` Dmitry Gutov 2022-05-30 16:32 ` Juri Linkov 1 sibling, 1 reply; 9+ messages in thread From: Dmitry Gutov @ 2022-05-29 21:42 UTC (permalink / raw) To: Juri Linkov, Pankaj Jangid; +Cc: 55267 Hi Juri, On 05.05.2022 10:28, Juri Linkov wrote: > Recently I noticed this problem too. So project-find-file-in > needs to specify the same history variable 'file-name-history' > as used in read-file-name-default. If this works for you, and looks helpful, please go ahead with that change. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist 2022-05-29 21:42 ` Dmitry Gutov @ 2022-05-30 16:32 ` Juri Linkov 0 siblings, 0 replies; 9+ messages in thread From: Juri Linkov @ 2022-05-30 16:32 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Pankaj Jangid, 55267 close 55267 29.0.50 thanks >> Recently I noticed this problem too. So project-find-file-in >> needs to specify the same history variable 'file-name-history' >> as used in read-file-name-default. > > If this works for you, and looks helpful, please go ahead with that change. Thanks for approval, now both changes were added to project.el. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-05-30 16:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-05 3:24 bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Pankaj Jangid [not found] ` <handler.55267.B.165172109316668.ack@debbugs.gnu.org> 2022-05-05 3:50 ` bug#55267: Acknowledgement (29.0.50; Provide customization to save project-find-file arg to savehist) Pankaj Jangid 2022-05-05 7:28 ` bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Juri Linkov 2022-05-12 16:38 ` Juri Linkov 2022-05-29 21:44 ` Dmitry Gutov 2022-05-30 6:08 ` Pankaj Jangid 2022-05-30 9:21 ` Dmitry Gutov 2022-05-29 21:42 ` Dmitry Gutov 2022-05-30 16:32 ` Juri Linkov
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.