unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54962: 28.1; insert-directory-program should be ls-program
@ 2022-04-15 19:24 Howard Melman
  2022-04-15 19:50 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Howard Melman @ 2022-04-15 19:24 UTC (permalink / raw)
  To: 54962

This is minor, but I think insert-directory-program should
be called ls-program.  I'm sure it's for historical reasons
but a variable alias or other solution would be great.

On the mac I think it's common to install gnu ls as "gls"
and I had hard time finding the emacs variable to set to
have it use this.  There are several dozen such variables
and they all follow a similar more discoverable naming
pattern as this sample:

find-program
grep-program
xargs-program
dig-program
dired-chmod-program
dired-chown-program
dired-touch-program
ediff-cmp-program
ediff-diff-program
epg-gpg-program
mm-url-program
sendmail-program
tramp-adb-program
vc-bzr-program
vc-git-program
vc-hg-program
vc-mtn-program
vc-src-program
vc-svn-program


Howard

In GNU Emacs 28.1 (build 1, x86_64-apple-darwin20.6.0, Carbon Version 164 AppKit 2022.6)
of 2022-04-09 built on Mac-1649520554451.local
Repository revision: ee79b048bbb2fd4a962dfb2204cc7a2f0d5237d8
Repository branch: 28.1-mac-9.0-CI
Windowing system distributor 'Apple Inc.', version 11.6.5
System Description:  macOS 11.6.5

Configured using:
'configure --with-mac
--enable-locallisppath=/usr/local/share/emacs/site-lisp:/opt/homebrew/share/emacs/site-lisp
--enable-mac-app=/Users/runner/work/homebrew-emacsmacport/homebrew-emacsmacport/build-scripts/emacs-source/tmproot
--prefix=/Users/runner/work/homebrew-emacsmacport/homebrew-emacsmacport/build-scripts/emacs-source/tmproot
--enable-mac-self-contained --with-modules'






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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 19:24 bug#54962: 28.1; insert-directory-program should be ls-program Howard Melman
@ 2022-04-15 19:50 ` Eli Zaretskii
  2022-04-15 19:56   ` Howard Melman
  2022-04-15 20:16   ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-15 19:50 UTC (permalink / raw)
  To: Howard Melman; +Cc: 54962

> From: Howard Melman <hmelman@gmail.com>
> Date: Fri, 15 Apr 2022 15:24:41 -0400
> 
> This is minor, but I think insert-directory-program should
> be called ls-program.  I'm sure it's for historical reasons
> but a variable alias or other solution would be great.

No one said it has to be 'ls'.  It can be anything else, as long as it
produces the same output.

So I see no reason to change the name of that variable.

> On the mac I think it's common to install gnu ls as "gls"
> and I had hard time finding the emacs variable to set to
> have it use this.

That is not a reason to rename the variable, it is perhaps a reason to
improve our Help and Apropos facilities.

> There are several dozen such variables
> and they all follow a similar more discoverable naming
> pattern as this sample:

Those are much more specific.





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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 19:50 ` Eli Zaretskii
@ 2022-04-15 19:56   ` Howard Melman
  2022-04-15 20:09     ` Eli Zaretskii
  2022-04-15 20:16   ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Howard Melman @ 2022-04-15 19:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54962



> On Apr 15, 2022, at 3:50 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> No one said it has to be 'ls'.  It can be anything else, as long as it
> produces the same output.
> 
>> There are several dozen such variables
>> and they all follow a similar more discoverable naming
>> pattern as this sample:
> 
> Those are much more specific.

Could you explain how these are more specific than something else
"as long as it produces the same out"?  I don't follow the distinction
you're drawing.

Howard





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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 19:56   ` Howard Melman
@ 2022-04-15 20:09     ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-15 20:09 UTC (permalink / raw)
  To: Howard Melman; +Cc: 54962

> From: Howard Melman <hmelman@gmail.com>
> Date: Fri, 15 Apr 2022 15:56:58 -0400
> Cc: 54962@debbugs.gnu.org
> 
> 
> 
> > On Apr 15, 2022, at 3:50 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> > No one said it has to be 'ls'.  It can be anything else, as long as it
> > produces the same output.
> > 
> >> There are several dozen such variables
> >> and they all follow a similar more discoverable naming
> >> pattern as this sample:
> > 
> > Those are much more specific.
> 
> Could you explain how these are more specific than something else
> "as long as it produces the same out"?  I don't follow the distinction
> you're drawing.

The distinction is that there's only one program that can be used in
the other examples of these variables, and the variable exists only to
support different installation directories for that program, and
sometimes popular renames like 'gfind' instead of 'find'.  That's not
the case with 'ls'.  Some systems call this 'dir', for example.
Besides, insert-directory-program is used not just by dired, it is
also used by a function names 'insert-directory'.





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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 19:50 ` Eli Zaretskii
  2022-04-15 19:56   ` Howard Melman
@ 2022-04-15 20:16   ` Eli Zaretskii
  2022-04-15 21:35     ` Howard Melman
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-15 20:16 UTC (permalink / raw)
  To: hmelman; +Cc: 54962

> Date: Fri, 15 Apr 2022 22:50:38 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 54962@debbugs.gnu.org
> 
> > On the mac I think it's common to install gnu ls as "gls"
> > and I had hard time finding the emacs variable to set to
> > have it use this.
> 
> That is not a reason to rename the variable, it is perhaps a reason to
> improve our Help and Apropos facilities.

I've now added a reference to insert-directory-program in the doc
string of Dired, and vice versa.  I think this addresses the problems
you had in finding the variable.





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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 20:16   ` Eli Zaretskii
@ 2022-04-15 21:35     ` Howard Melman
  2022-04-16  6:42       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Howard Melman @ 2022-04-15 21:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54962


> On Apr 15, 2022, at 4:16 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> I've now added a reference to insert-directory-program in the doc
> string of Dired, and vice versa.  I think this addresses the problems
> you had in finding the variable.

Yes that helps.  

> The distinction is that there's only one program that can be used in
> the other examples of these variables, and the variable exists only to
> support different installation directories for that program, and
> sometimes popular renames like 'gfind' instead of 'find'.  

This is exactly my case.

> That's not the case with 'ls'.  Some systems call this 'dir', for example.

I don't see why that system couldn't just as easily do

    (setq ls-program "dir")

On the mac I configure locate-command to use mdfind, which seems
similar.

> Besides, insert-directory-program is used not just by dired, it is
> also used by a function names 'insert-directory'.

Which I think is just used by dired and list-directory the latter
of which says in the first line of its docstring:

    Display a list of files in or matching DIRNAME, a la ls.

And there's ls-lisp-use-insert-directory-program which is also very 
ls centric.

So I still don't get your distinction and think a variable alias would
break nothing and help findability.  

In my case I changed my system configuration and knew I had to
tell emacs about "gls" and knew about setting grep-program and
find-program and locate-command and thought this one would be
called ls-program in part because those others weren't called
something like search-files-for-regexp-program.

Howard





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

* bug#54962: 28.1; insert-directory-program should be ls-program
  2022-04-15 21:35     ` Howard Melman
@ 2022-04-16  6:42       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-16  6:42 UTC (permalink / raw)
  To: Howard Melman; +Cc: 54962-done

> From: Howard Melman <hmelman@gmail.com>
> Date: Fri, 15 Apr 2022 17:35:38 -0400
> Cc: 54962@debbugs.gnu.org
> 
> And there's ls-lisp-use-insert-directory-program which is also very 
> ls centric.

That's unrelated: it is used by the ls-lisp.el package, which emulates
'ls' in Emacs Lisp.

Anyway, I think your original problem is now adequately addressed, and
since I don't think we can rename that variable after so many years,
I'm closing this bug report.





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

end of thread, other threads:[~2022-04-16  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 19:24 bug#54962: 28.1; insert-directory-program should be ls-program Howard Melman
2022-04-15 19:50 ` Eli Zaretskii
2022-04-15 19:56   ` Howard Melman
2022-04-15 20:09     ` Eli Zaretskii
2022-04-15 20:16   ` Eli Zaretskii
2022-04-15 21:35     ` Howard Melman
2022-04-16  6:42       ` Eli Zaretskii

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).