unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7518: image-dired defcustom'd paths
@ 2010-11-30  0:40 MON KEY
  2010-12-05  1:05 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: MON KEY @ 2010-11-30  0:40 UTC (permalink / raw)
  To: 7518

current through bzr revision 102504

Now that ImageMagick libs are accessble to Emacs24 maybe more users
will be using image-dired.

The defcustom form for variables

`image-dired-dir',
`image-dired-db-file',
`image-dired-temp-image-file',
`image-dired-gallery-dir'
`image-dired-temp-rotate-image-file',

each evaluate `locate-user-emacs-file' when binding their default path
values.

There is something wrong about this.

AFAIK `image-dired' isn't loaded by default. Why should _each_ of
these variables elevate to creation of a `user-emacs-directory'
if/when one doesn't already exit? By the time (require 'image-dired)
gets evaluated shouldnt' `user-emacs-directory' already be well
established?

At best only `image-dired-dir' should need to to this and even then it
is suspect. Maybe the rest of the do somethign more like:

(make-directory
 (expand-file-name "some/path-for/image-dired-var" image-dired-dir))

or, respectively:

(make-directory
 (expand-file-name "some/path-for/image-dired-var" image-dired-dir) t)


Also, w/re those of the above variables which bind directory paths for
a temporary files, e.g.:

 `image-dired-temp-image-file' and `image-dired-temp-rotate-image-file'

Why not just use `temporary-file-directory' and/or
`small-temporary-file-directory' as the base paths?

--
/s_P\





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

* bug#7518: image-dired defcustom'd paths
  2010-11-30  0:40 bug#7518: image-dired defcustom'd paths MON KEY
@ 2010-12-05  1:05 ` Chong Yidong
  2010-12-06  0:56   ` MON KEY
  0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2010-12-05  1:05 UTC (permalink / raw)
  To: MON KEY; +Cc: 7518

MON KEY <monkey@sandpframing.com> writes:

> `image-dired-dir', `image-dired-db-file',
> `image-dired-temp-image-file', `image-dired-gallery-dir'
> `image-dired-temp-rotate-image-file',
>
> each evaluate `locate-user-emacs-file' when binding their default path
> values.
>
> There is something wrong about this.
>
> AFAIK `image-dired' isn't loaded by default. Why should _each_ of
> these variables elevate to creation of a `user-emacs-directory'
> if/when one doesn't already exit?

This sentence does not parse.

The usage of locate-user-emacs-file in image-dired is correct, as far as
I can tell.





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

* bug#7518: image-dired defcustom'd paths
  2010-12-05  1:05 ` Chong Yidong
@ 2010-12-06  0:56   ` MON KEY
  2010-12-06 19:47     ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: MON KEY @ 2010-12-06  0:56 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 7518

On Sat, Dec 4, 2010 at 8:05 PM, Chong Yidong <cyd@stupidchicken.com> wrote:
> MON KEY <monkey@sandpframing.com> writes:

>> AFAIK `image-dired' isn't loaded by default. Why should _each_ of
>> these variables elevate to creation of a `user-emacs-directory'
>> if/when one doesn't already exit?
>

> This sentence does not parse.
>

>> Why should _each_ of these variables elevate to creation of a
>> `user-emacs-directory' if/when one doesn't already exit?
>

`image-dired-dir' is the "top-level" defcustom from which other related
`image-dired-*' vars derive their path default values.  As such, only
`image-dired-dir' need evaluate a form containing `locate-user-emacs-file'
any other of the paths which "inherit" from `image-dired-dir' will either find
an existing directoy already available or will incorrectly create one which
may otherwise be separate from a user paths specified the in some other
`image-dired-*' var.

IOW, "hands of my directory tree image-dired!"

Moreover, I would argue that none of the `image-dired-*' vars should
be hardwired
by default to `user-home-directory' not only is this non-transparently intrusive
but it is potentially error prone on w32.

Let the user explicitly specify a path for these instead if this is
what is wanted.

As an aside, none of the `image-dired-*' path customizations have :type
specializations more specific than string
so at the very least it isn't immediately clear that these vars are creat.

>
> The usage of locate-user-emacs-file in image-dired is correct, as far as
> I can tell.
>

Maybe not. :)
Most other packages don't operate this way to they?

--
/s_P\





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

* bug#7518: image-dired defcustom'd paths
  2010-12-06  0:56   ` MON KEY
@ 2010-12-06 19:47     ` Chong Yidong
  2010-12-07  2:49       ` MON KEY
  0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2010-12-06 19:47 UTC (permalink / raw)
  To: MON KEY; +Cc: 7518

MON KEY <monkey@sandpframing.com> writes:

> `image-dired-dir' is the "top-level" defcustom from which other related
> `image-dired-*' vars derive their path default values.  As such, only
> `image-dired-dir' need evaluate a form containing `locate-user-emacs-file'
> any other of the paths which "inherit" from `image-dired-dir' will either find
> an existing directoy already available or will incorrectly create one which
> may otherwise be separate from a user paths specified the in some other
> `image-dired-*' var.

If you mean that the other image-dired-* variables should use the value
of image-dired-dir, that would be fine, and a little cleaner.  I've
committed such a change.  Thanks.

> Moreover, I would argue that none of the `image-dired-*' vars should
> be hardwired by default to `user-home-directory' not only is this
> non-transparently intrusive but it is potentially error prone on w32.

If you encounter a problem with locate-user-emacs-dir on w32, report a
different bug.





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

* bug#7518: image-dired defcustom'd paths
  2010-12-06 19:47     ` Chong Yidong
@ 2010-12-07  2:49       ` MON KEY
  0 siblings, 0 replies; 5+ messages in thread
From: MON KEY @ 2010-12-07  2:49 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 7518

On Mon, Dec 6, 2010 at 2:47 PM, Chong Yidong <cyd@stupidchicken.com> wrote:
> MON KEY <monkey@sandpframing.com> writes:

> If you mean that the other image-dired-* variables should use the value
> of image-dired-dir, that would be fine, and a little cleaner.  I've
> committed such a change.  Thanks.
>

Yes, this is what I was trying to get at.
Thanks for taking the time to interpret Mon-ish.

>
> If you encounter a problem with locate-user-emacs-dir on w32, report a
> different bug.
>
I'll keep an eye open once 24 rolls out (which is when I suspect it
will rear its head again [-: )

--
/s_P\





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

end of thread, other threads:[~2010-12-07  2:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-30  0:40 bug#7518: image-dired defcustom'd paths MON KEY
2010-12-05  1:05 ` Chong Yidong
2010-12-06  0:56   ` MON KEY
2010-12-06 19:47     ` Chong Yidong
2010-12-07  2:49       ` MON KEY

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