GNU bug report logs - #14925
24.3.50; `image-dired.el' code (minor)

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 21 Jul 2013 19:38:02 UTC

Severity: wishlist

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14925 in the body.
You can then email your comments to 14925 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Sun, 21 Jul 2013 19:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 21 Jul 2013 19:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; `image-dired.el' code (minor)
Date: Sun, 21 Jul 2013 12:37:24 -0700 (PDT)
Generally, it would be better if `image-dired.el' followed the
conventions used in dired.el, dired-aux.el, and dired-x.el wrt (a)
naming and (b) parameter ARG (prefix argument).  That helps users by
providing relatively consistent command names and UI behavior.

Also a minor coding remark (#1).

1. `image-dired-dired-file-marked-p' uses regexp "^ .*$", which I think
is the same as "^ " (which is simpler).  I also wonder why it does not
just use `dired-re-mark'.

2. Commands that act on the marked files should perhaps follow the
naming convention used in dired.el, dired-aux.el, and dired-x.el:
`*-do-*'.  Thus perhaps rename `image-dired-dired-comment-files',
`image-dired-tag-files', `image-dired-delete-tag',
`image-dired-display-thumbs', `image-dired-copy-with-exif-file-name',
`image-dired-dired-edit-comment-and-tags', and
`image-dired-create-thumbs'.

The equivalent Dired command that acts on the current file only, when
available, is named similarly, but without the `*-do-*' part.

3. Those commands do not treat parameter ARG the same way as do the
Dired `*-do-*' commands.  For the image-dired commands, ARG is
essentially boolean (and should thus have a name that reflects that).
Wouldn't it be better for it to be the `prefix-numeric-value' and let
you act on the next ARG files?  That would give users more flexibility
and provide a more consistent UI.  Is there a downside I am missing?


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-07-14 on ODIEONE
Bzr revision: 113423 lekktu <at> gmail.com-20130715004922-i67tg2ois14h3fpm
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 CFLAGS='-O0 -g3' CPPFLAGS='-Ic:/Devel/emacs/include'
 LDFLAGS='-Lc:/Devel/emacs/lib''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Sun, 21 Jul 2013 19:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: 14925 <at> debbugs.gnu.org
Subject: RE: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Sun, 21 Jul 2013 12:54:29 -0700 (PDT)
Forgot to mention: "selected" should be "marked" in the doc string
of `image-dired-delete-tag'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Thu, 25 Jul 2013 19:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 14925 <at> debbugs.gnu.org
Subject: Re: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Thu, 25 Jul 2013 15:13:00 -0400
> 1. `image-dired-dired-file-marked-p' uses regexp "^ .*$", which I think
> is the same as "^ " (which is simpler).

It's similar, except for (match-end 0) and the position of point after
re-search-forward.  I haven't looked at the code to see if the
difference matters.

> I also wonder why it does not just use `dired-re-mark'.

No idea.

> 2. Commands that act on the marked files should perhaps follow the
> naming convention used in dired.el, dired-aux.el, and dired-x.el:
> `*-do-*'.  Thus perhaps rename `image-dired-dired-comment-files',
> `image-dired-tag-files', `image-dired-delete-tag',
> `image-dired-display-thumbs', `image-dired-copy-with-exif-file-name',
> `image-dired-dired-edit-comment-and-tags', and
> `image-dired-create-thumbs'.

> The equivalent Dired command that acts on the current file only, when
> available, is named similarly, but without the `*-do-*' part.

> 3. Those commands do not treat parameter ARG the same way as do the
> Dired `*-do-*' commands.  For the image-dired commands, ARG is
> essentially boolean (and should thus have a name that reflects that).
> Wouldn't it be better for it to be the `prefix-numeric-value' and let
> you act on the next ARG files?  That would give users more flexibility
> and provide a more consistent UI.  Is there a downside I am missing?

2 and 3 sound like good ideas.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Fri, 26 Jul 2013 01:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14925 <at> debbugs.gnu.org
Subject: RE: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Thu, 25 Jul 2013 18:02:18 -0700 (PDT)
> > 1. `image-dired-dired-file-marked-p' uses regexp "^ .*$", which I think
> > is the same as "^ " (which is simpler).
> 
> It's similar, except for (match-end 0) and the position of point after
> re-search-forward.  I haven't looked at the code to see if the
> difference matters.

It does not; the match data and the position of point are not used.
(The `-p' suffix provides a clue.)  There is currently only one occurrence
of `image-dired-dired-file-marked-p':

(if (image-dired-dired-file-marked-p)
    (dired-unmark 1)
  (dired-mark 1))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Fri, 26 Jul 2013 05:32:02 GMT) Full text and rfc822 format available.

Message #17 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier
 <monnier <at> iro.umontreal.ca>
Cc: 14925 <at> debbugs.gnu.org
Subject: RE: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Thu, 25 Jul 2013 22:31:06 -0700 (PDT)
> > > 1. `image-dired-dired-file-marked-p' uses regexp "^ .*$", which I think
> > > is the same as "^ " (which is simpler).
> >
> > It's similar, except for (match-end 0) and the position of point after
> > re-search-forward.  I haven't looked at the code to see if the
> > difference matters.
> 
> It does not; the match data and the position of point are not used.
> (The `-p' suffix provides a clue.)  There is currently only one occurrence
> of `image-dired-dired-file-marked-p':
> 
> (if (image-dired-dired-file-marked-p)
>     (dired-unmark 1)
>   (dired-mark 1))

It also uses `save-excursion' and `looking-at', not `re-search-forward'.

However, as it is in principle just a predicate it should probably also
use `looking-at-p', not `looking-at'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Mon, 06 Sep 2021 10:13:01 GMT) Full text and rfc822 format available.

Message #20 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 14925 <at> debbugs.gnu.org
Subject: Re: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Mon, 06 Sep 2021 12:12:31 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> 1. `image-dired-dired-file-marked-p' uses regexp "^ .*$", which I think
> is the same as "^ " (which is simpler).  I also wonder why it does not
> just use `dired-re-mark'.

I've now changed this function to use `dired-re-mark' instead in Emacs
28.

As for the other two points -- changing the names of all these dired
commands -- I don't think the gain we get from more regular function
names in this area outweighs the pain we'd inflict on users that may be
using the old names.  So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 14925 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 06 Sep 2021 10:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14925; Package emacs. (Mon, 06 Sep 2021 21:50:02 GMT) Full text and rfc822 format available.

Message #25 received at 14925 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "14925 <at> debbugs.gnu.org" <14925 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#14925: 24.3.50; `image-dired.el' code (minor)
Date: Mon, 6 Sep 2021 21:49:32 +0000
> As for the other two points -- changing the names of all these dired
> commands -- I don't think the gain we get from more regular function
> names in this area outweighs the pain we'd inflict on users that may be
> using the old names.  So I'm closing this bug report.

Renaming and deprecation of the old names is the
right approach, IMO.  There's no reason that
something that's deprecated can't continue to be
supported forever, if you like.

Dired has very consistent command and argument
behaviors, especially when it comes to commands
that act on or are affected by marks.  It's a
pity to keep this wart - in the name of what
exactly?

It's trivial to make the renaming 100% painless
to all users of the old names - they'd just
continue to work, as long as you like. 

And what about changing the behavior of the ARG
argument?  Or if you don't change its behavior
to fit Dired, what about changing its name to
reflect what it does?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Oct 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.