unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49846: 28.0.50; project-find-regexp results does not open target file
@ 2021-08-03 17:12 Pankaj Jangid
  2021-08-04 20:10 ` Juri Linkov
  2021-08-05  3:06 ` Dmitry Gutov
  0 siblings, 2 replies; 11+ messages in thread
From: Pankaj Jangid @ 2021-08-03 17:12 UTC (permalink / raw)
  To: 49846


Steps to reproduce:
1. emacs -Q
2. C-x p p (project-switch-project)
3. select project
4. press g (Find Regexp) and search for a term then RET
5. In the results select any file

Result: No reference at point

Expectation: step-5 should open the file-at-point and point should be
placed at a suitable place in the opened file.


In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.5 (Build 20G71))
 of 2021-08-03 built on mb2.local
Repository revision: 09c362025338ff1597593a90f4be5eeac589a7b4
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.5

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY
KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB

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

Major mode: Info

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  global-company-mode: t
  company-mode: t
  shell-dirtrack-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  savehist-mode: t
  desktop-save-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/pankaj/.emacs.d/elpa/transient-20210723.1601/transient hides /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/transient

Features:
(shadow flyspell emacsbug cl-print shr-color qp gnus-html sort smiley
gnus-cite flow-fill mail-extr gnus-async gnus-bcklg gnus-ml hl-line
disp-table help-fns mailalias tempo ispell git-rebase ediff ediff-merg
ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util
magit-bookmark bookmark ido benchmark pkg-info epl cus-edit cus-start
align cc-langs autoload radix-tree tar-mode arc-mode archive-mode
mm-archive url-http url-gw url-cache url-auth yaml-mode goto-addr
bug-reference 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 which-func magit-diff smerge-mode diff
git-commit log-edit pcvs-util add-log magit-core magit-autorevert
magit-margin magit-transient magit-process with-editor magit-mode
transient magit-git magit-section magit-utils dash misearch
multi-isearch php-mode mode-local php-face php php-project cursor-sensor
nndraft nnmh utf-7 nnml nnfolder epa-file gnutls network-stream nsm
gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache
.gnus find-dired grep diary-lib diary-loaddefs dired-aux markdown-mode
color ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info
ol-gnus nnselect gnus-search ol-docview doc-view image-mode exif
ol-bibtex bibtex ol-bbdb ol-w3m autorevert hideshow vc-mtn vc-hg vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs vc eglot array filenotify jsonrpc
ert pp ewoc debug backtrace imenu haskell-mode haskell-cabal
haskell-utils haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme rx haskell-align-imports
haskell-complete-module haskell-ghc-support dabbrev haskell-customize
sh-script smie executable checkdoc lisp-mnt vc-git diff-mode
vc-dispatcher flymake-proc flymake compile warnings thingatpt elec-pair
jka-compr company-oddmuse company-keywords company-etags etags fileloop
xref project company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company init my-init enet org-element
avl-tree generator org org-macro org-footnote org-pcomplete org-list
org-faces org-entities noutline outline easy-mmode 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 tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete ls-lisp ob-R ob ob-tangle org-src ob-ref
ob-lob ob-table ob-exp ob-comint comint ansi-color ring ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat advice org-macs
org-loaddefs format-spec server edmacro kmacro modus-operandi-theme
modus-themes exec-path-from-shell yasnippet-snippets yasnippet delight
ebdb-message sendmail ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo
gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7
netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message rmc
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums text-property-search time-date mail-utils mm-util mail-prsvr
wid-edit ebdb-mua ebdb-com crm ebdb-format ebdb mailabbrev eieio-opt
cl-extra help-mode speedbar ezimage dframe find-func eieio-base pcase
cal-menu calendar cal-loaddefs timezone savehist desktop frameset avoid
paren 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 subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
early-init iso-transl tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 1980381 183384)
 (symbols 48 53328 10)
 (strings 32 332742 35011)
 (string-bytes 1 11081919)
 (vectors 16 118198)
 (vector-slots 8 2274105 156789)
 (floats 8 567 530)
 (intervals 56 170560 6549)
 (buffers 992 63))

-- 
Regards ~Pankaj





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-03 17:12 bug#49846: 28.0.50; project-find-regexp results does not open target file Pankaj Jangid
@ 2021-08-04 20:10 ` Juri Linkov
  2021-08-05  3:11   ` Dmitry Gutov
  2021-08-05  3:06 ` Dmitry Gutov
  1 sibling, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2021-08-04 20:10 UTC (permalink / raw)
  To: 49846

> Steps to reproduce:
> 1. emacs -Q
> 2. C-x p p (project-switch-project)
> 3. select project
> 4. press g (Find Regexp) and search for a term then RET
> 5. In the results select any file
>
> Result: No reference at point
>
> Expectation: step-5 should open the file-at-point and point should be
> placed at a suitable place in the opened file.

I have the same problem.  When calling xref-find-references
from a subdirectory, not from the project root, it creates
an *xref* buffer where file names are relative to the
project root (when xref-file-name-display is 'project-relative'),
but the default directory is not the project root.
So using file-at-point fails to find the relative file.

But I don't see the same problem with project-find-regexp,
it correctly changes the directory to the project root,
and opens the file-at-point.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-03 17:12 bug#49846: 28.0.50; project-find-regexp results does not open target file Pankaj Jangid
  2021-08-04 20:10 ` Juri Linkov
@ 2021-08-05  3:06 ` Dmitry Gutov
  2021-08-05  3:58   ` Pankaj Jangid
  1 sibling, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2021-08-05  3:06 UTC (permalink / raw)
  To: 49846, Pankaj Jangid

On 03.08.2021 20:12, Pankaj Jangid wrote:
> 
> Steps to reproduce:
> 1. emacs -Q
> 2. C-x p p (project-switch-project)
> 3. select project
> 4. press g (Find Regexp) and search for a term then RET
> 5. In the results select any file
> 
> Result: No reference at point
> 
> Expectation: step-5 should open the file-at-point and point should be
> placed at a suitable place in the opened file.

To be clear: you position the point on a group name, press RET and see 
this message? That is expected.

If we do end up changing this behavior, what would the "suitable place" 
be? The first match in the group?





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-04 20:10 ` Juri Linkov
@ 2021-08-05  3:11   ` Dmitry Gutov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Gutov @ 2021-08-05  3:11 UTC (permalink / raw)
  To: Juri Linkov, 49846

On 04.08.2021 23:10, Juri Linkov wrote:
> I have the same problem.  When calling xref-find-references
> from a subdirectory, not from the project root, it creates
> an*xref*  buffer where file names are relative to the
> project root (when xref-file-name-display is 'project-relative'),
> but the default directory is not the project root.
> So using file-at-point fails to find the relative file.

That sounds different. Could you file a separate report with exact 
reproduction steps? Try to make sure you're using the latest master 
first (I fixed bug ~like that a couple of months ago).

FWIW, I'm cannot reproduce.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05  3:06 ` Dmitry Gutov
@ 2021-08-05  3:58   ` Pankaj Jangid
  2021-08-05 13:13     ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Pankaj Jangid @ 2021-08-05  3:58 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 49846

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 03.08.2021 20:12, Pankaj Jangid wrote:
>> Steps to reproduce:
>> 1. emacs -Q
>> 2. C-x p p (project-switch-project)
>> 3. select project
>> 4. press g (Find Regexp) and search for a term then RET
>> 5. In the results select any file
>> Result: No reference at point
>> Expectation: step-5 should open the file-at-point and point should
>> be
>> placed at a suitable place in the opened file.
>
> To be clear: you position the point on a group name, press RET and see
> this message? That is expected.
>

Okay. I didn’t know this. Has this change in recently? I remember
hitting on the group and opening the target file. But true, with
multiple results in the group that would be confusing.

> If we do end up changing this behavior, what would the "suitable
> place" be? The first match in the group?

There are two options here:

1. We just change the message. Something like: "select a match to open".

2. In addition to above, we may have a customization variable. Something
   like - xref-open-first-match

For this bug, (1) should be sufficient.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05  3:58   ` Pankaj Jangid
@ 2021-08-05 13:13     ` Dmitry Gutov
  2021-08-05 14:02       ` Pankaj Jangid
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2021-08-05 13:13 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 49846

On 05.08.2021 06:58, Pankaj Jangid wrote:

>> To be clear: you position the point on a group name, press RET and see
>> this message? That is expected.
>>
> 
> Okay. I didn’t know this. Has this change in recently? I remember
> hitting on the group and opening the target file. But true, with
> multiple results in the group that would be confusing.

I don't think this ever was different.

>> If we do end up changing this behavior, what would the "suitable
>> place" be? The first match in the group?
> 
> There are two options here:
> 
> 1. We just change the message. Something like: "select a match to open".
> 
> 2. In addition to above, we may have a customization variable. Something
>     like - xref-open-first-match
> 
> For this bug, (1) should be sufficient.

2. probably won't require a user option, there's no real danger in such 
change.

But which of the (1, 2) do you want to happen?





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05 13:13     ` Dmitry Gutov
@ 2021-08-05 14:02       ` Pankaj Jangid
  2021-08-05 14:03         ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Pankaj Jangid @ 2021-08-05 14:02 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 49846

Dmitry Gutov <dgutov@yandex.ru> writes:

>> There are two options here:
>> 1. We just change the message. Something like: "select a match to
>> open".
>> 2. In addition to above, we may have a customization
>> variable. Something
>>     like - xref-open-first-match
>> For this bug, (1) should be sufficient.
>
> 2. probably won't require a user option, there's no real danger in
> such change.
>
> But which of the (1, 2) do you want to happen?

This is tricky. I want (2). But suppose there is such a variable. Then,

If the value is ‘t’ then open the first link. But if it is ‘nil’ then
again there should be a message of sort “select a match to open”.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05 14:02       ` Pankaj Jangid
@ 2021-08-05 14:03         ` Dmitry Gutov
  2021-08-05 14:27           ` Pankaj Jangid
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2021-08-05 14:03 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 49846

On 05.08.2021 17:02, Pankaj Jangid wrote:
> But suppose there is such a variable

Suppose there isn't?





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05 14:03         ` Dmitry Gutov
@ 2021-08-05 14:27           ` Pankaj Jangid
  2021-08-05 23:51             ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Pankaj Jangid @ 2021-08-05 14:27 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 49846

Dmitry Gutov <dgutov@yandex.ru> writes:

>> But suppose there is such a variable
>
> Suppose there isn't?

Then I just want an appropriate message i.e. option-1 from my previous
post.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05 14:27           ` Pankaj Jangid
@ 2021-08-05 23:51             ` Dmitry Gutov
  2021-08-06  3:07               ` Pankaj Jangid
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2021-08-05 23:51 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 49846-done

On 05.08.2021 17:27, Pankaj Jangid wrote:
> Then I just want an appropriate message i.e. option-1 from my previous
> post.

OK, I've changed the message in commit 232be9bf87. Hope you like the result.

A "match" is something specific in Xref terms, so the new message says 
"reference", which should be more general.





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

* bug#49846: 28.0.50; project-find-regexp results does not open target file
  2021-08-05 23:51             ` Dmitry Gutov
@ 2021-08-06  3:07               ` Pankaj Jangid
  0 siblings, 0 replies; 11+ messages in thread
From: Pankaj Jangid @ 2021-08-06  3:07 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 49846-done

Dmitry Gutov <dgutov@yandex.ru> writes:

>> Then I just want an appropriate message i.e. option-1 from my previous
>> post.
>
> OK, I've changed the message in commit 232be9bf87. Hope you like the result.
>
> A "match" is something specific in Xref terms, so the new message says
> "reference", which should be more general.

Thanks. I have tested it. I like the new message. :-)





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

end of thread, other threads:[~2021-08-06  3:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03 17:12 bug#49846: 28.0.50; project-find-regexp results does not open target file Pankaj Jangid
2021-08-04 20:10 ` Juri Linkov
2021-08-05  3:11   ` Dmitry Gutov
2021-08-05  3:06 ` Dmitry Gutov
2021-08-05  3:58   ` Pankaj Jangid
2021-08-05 13:13     ` Dmitry Gutov
2021-08-05 14:02       ` Pankaj Jangid
2021-08-05 14:03         ` Dmitry Gutov
2021-08-05 14:27           ` Pankaj Jangid
2021-08-05 23:51             ` Dmitry Gutov
2021-08-06  3:07               ` Pankaj Jangid

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

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

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