Path name missing in the file names

57 views
Skip to first unread message

York Zhao

unread,
Jun 6, 2012, 10:53:27 AM6/6/12
to emacs...@googlegroups.com
Hi,

Get lost for a period of time as I didn't know "anything" had renamed to "helm"
which was why I had noticed for awhile that there had been no new commit to git
repository until I got some time to read this list and figured out ...

So I have moved from "anything" to "helm", the first thing I noticed is that
"path" get lost in the file candidates. For example, both
`helm-c-source-recentf' and `helm-c-source-locate' have dropped path in the
display. IMO this is very bad and I'm very uncomfortable with this, especially
when you are using the "locate" source, it is extremely common that there are
different file with exactly the same name but in different locations on the hard
drive, when the path of the file names are not shown, you can't tell which file
is the one you want if there are several files with the same name. What I have
been doing now is that I have to guess all the time which is too bad. This used
to be working in "anything", I don't understand why it gets changed in "helm"
and if you don't want to change this behavior back can you please tell me how I
can customize it to suit my requirement?

Thanks,
York

Michael Markert

unread,
Jun 6, 2012, 11:12:06 AM6/6/12
to public-emacs-helm-/J...@plane.gmane.org
On Wed, Jun 06 2012 (16:53), York Zhao <gtdplatform-Re5JQ...@public.gmane.org> wrote:

> This used to be working in "anything", I don't understand why it gets
> changed in "helm" and if you don't want to change this behavior back
> can you please tell me how I can customize it to suit my requirement?

This is a more recent change than anything -> helm, but this bothered me
for a while as well, the problem is the match definition here:

(defvar helm-c-source-recentf
`((name . "Recentf")
(init . (lambda ()
(require 'recentf)
(or recentf-mode (recentf-mode 1))))
(candidates . recentf-list)
(keymap . ,helm-generic-files-map)
(help-message . helm-generic-file-help-message)
(mode-line . helm-generic-file-mode-line-string)
(match helm-c-match-on-basename)
(type . file))
"See (info \"(emacs)File Conveniences\").
Set `recentf-max-saved-items' to a bigger value if default is too small.")

to match on the whole filename again you can use

(setcdr (assoc 'match helm-c-source-recentf) 'helm-c-match-on-file-name)

For locate `helm-ff-transformer-show-only-basename' is relevant

(setq helm-ff-transformer-show-only-basename nil)

I'd consider the inconsistency in the recentf source a bug, and think
removing the match clause a better way.

I think changing the default of `helm-ff-transformer-show-only-basename`
to nil is also a useful change. What do you think?

Michael

York Zhao

unread,
Jun 6, 2012, 12:26:31 PM6/6/12
to emacs...@googlegroups.com, public-emacs-helm-/J...@plane.gmane.org



> to match on the whole filename again you can use
>
>    (setcdr (assoc 'match helm-c-source-recentf) 'helm-c-match-on-file-name)
>
> For locate `helm-ff-transformer-show-only-basename' is relevant
>
>    (setq helm-ff-transformer-show-only-basename nil)

Thank you very much Michael for your reply and it really has addressed
my problems. Just
that what really makes difference is changing the value of
`helm-ff-transformer-show-only-basename' to nil. Changing the "match" function
in `helm-c-source-recentf' however doesn't make difference. And I have confirmed
this by checking the `anything-c-source-recentf' in "anything-config.el" and the
match function is the same as that of in "helm", also there is no change in the
function `helm-c-match-on-basename' compared with it's "anything" counterpart.

> I think changing the default of `helm-ff-transformer-show-only-basename` to
> nil is also a useful change. What do you think?

I believe so, displaying the path name is extremely important IMO. Actually the
default value of `helm-ff-transformer-show-only-basename' in anything was nil,
and it has been changed to t in "helm". And I think an even better approach is
to just display part of the path that is enough to differentiate the files with
the same name, similar to what Emacs does when displaying a buffer's file name
in mode line. Not sure whether it is feasible though.


Thanks,
York


Thierry Volpiatto

unread,
Jun 6, 2012, 12:41:17 PM6/6/12
to emacs...@googlegroups.com, public-emacs-helm-/J...@plane.gmane.org
Agree, need to remove the match clause.
Michael go ahead and do it if you want, otherwise I will do it as soon
as possible.

> I think changing the default of `helm-ff-transformer-show-only-basename`
> to nil is also a useful change. What do you think?
Note that with the actual code you only need to switch to
a nil value of `helm-ff-transformer-show-only-basename` with `C-]` in
`helm-find-files`. This will affect all files sources recentf locate
etc...
Note also all candidates have an help-echo to show you the full path of
files.(Move mouse over candidate)

If everybody prefer a nil default value for
`helm-ff-transformer-show-only-basename` I agree to change this.


> Michael

--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

Thierry Volpiatto

unread,
Jun 6, 2012, 12:47:08 PM6/6/12
to emacs...@googlegroups.com
Hi York,
happy you switch to helm.

York Zhao <gtdpl...@gmail.com> writes:

> Hi,
>
> Get lost for a period of time as I didn't know "anything" had renamed to "helm"
> which was why I had noticed for awhile that there had been no new commit to git
> repository until I got some time to read this list and figured out ...
>
> So I have moved from "anything" to "helm", the first thing I noticed is that
> "path" get lost in the file candidates. For example, both
> `helm-c-source-recentf' and `helm-c-source-locate' have dropped path in the
> display. IMO this is very bad and I'm very uncomfortable with this, especially
> when you are using the "locate" source, it is extremely common that there are
> different file with exactly the same name but in different locations on the hard
> drive, when the path of the file names are not shown, you can't tell which file
> is the one you want if there are several files with the same name.
Use `C-]` in *-recentf, *-locate, *-find-files at any moment.
You can also for a quick overlook move mouse over candidate.


> What I have been doing now is that I have to guess all the time which
> is too bad. This used to be working in "anything", I don't understand
> why it gets changed in "helm" and if you don't want to change this
> behavior back can you please tell me how I can customize it to suit my
> requirement?
(set helm-ff-transformer-show-only-basename nil)

> Thanks,
> York

Thierry Volpiatto

unread,
Jun 7, 2012, 10:47:15 AM6/7/12
to emacs...@googlegroups.com, public-emacs-helm-/J...@plane.gmane.org
As I said before just hit `C-]` at any time.

York Zhao

unread,
Jun 10, 2012, 10:02:34 PM6/10/12
to emacs...@googlegroups.com
> Hi York,
> happy you switch to helm.

Hi Thierry,

Thanks for the wonderful tool, you have done a great job, keep going.

York
Reply all
Reply to author
Forward
0 new messages