unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Mac - why no proxy badge for dired mode?
@ 2006-11-02 20:13 Randal L. Schwartz
  2006-11-04  3:19 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-02 20:13 UTC (permalink / raw)



I notice there's a title-bar "proxy icon" for a frame containing a selected
buffer visiting a file.  I can drag this icon to another app, and it presents
the full file path to the other app.

However, there's no such "proxy icon" for a dired buffer.  Just the
"Emacs@$hostname" in the title bar.  I spent about 20 minutes poking through
the mac-specific code and the file-visiting code, but I didn't see anything
that hooks the two together.  Can someone who knows more about carbon apps
than I do please look at this and help me make it work?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-02 20:13 Mac - why no proxy badge for dired mode? Randal L. Schwartz
@ 2006-11-04  3:19 ` YAMAMOTO Mitsuharu
  2006-11-04  8:05   ` Randal L. Schwartz
  0 siblings, 1 reply; 15+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-11-04  3:19 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On 02 Nov 2006 12:13:03 -0800, merlyn@stonehenge.com (Randal L. Schwartz) said:

> However, there's no such "proxy icon" for a dired buffer.  Just the
> "Emacs@$hostname" in the title bar.  I spent about 20 minutes poking
> through the mac-specific code and the file-visiting code, but I
> didn't see anything that hooks the two together.  Can someone who
> knows more about carbon apps than I do please look at this and help
> me make it work?

It's not under the control of Lisp.  It is set by
mac_update_proxy_icon in macfns.c according to the value of
buffer-file-name of the buffer of the selected window.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04  3:19 ` YAMAMOTO Mitsuharu
@ 2006-11-04  8:05   ` Randal L. Schwartz
  2006-11-04  9:10     ` Andreas Schwab
  2006-11-04 14:16     ` Benjamin Riefenstahl
  0 siblings, 2 replies; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-04  8:05 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> "YAMAMOTO" == YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

>>>>> On 02 Nov 2006 12:13:03 -0800, merlyn@stonehenge.com (Randal L. Schwartz) said:
>> However, there's no such "proxy icon" for a dired buffer.  Just the
>> "Emacs@$hostname" in the title bar.  I spent about 20 minutes poking
>> through the mac-specific code and the file-visiting code, but I
>> didn't see anything that hooks the two together.  Can someone who
>> knows more about carbon apps than I do please look at this and help
>> me make it work?

YAMAMOTO> It's not under the control of Lisp.  It is set by
YAMAMOTO> mac_update_proxy_icon in macfns.c according to the value of
YAMAMOTO> buffer-file-name of the buffer of the selected window.

Wow.  In a dired buffer in Carbon Emacs, I just executed
the following:

        (setq buffer-file-name ".")

And it did exactly the right expected useful thing: a badge was created that
represented the current directory, and I could command-click on the title bar
to see the filepath to the directory and select parent directories.

The question is, will this break anything else?  Can we make this a global
change, or at least a change on carbon emacs?

I know that I could personally add a hook that does this.  I'm just thinking
out loud for everyone.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04  8:05   ` Randal L. Schwartz
@ 2006-11-04  9:10     ` Andreas Schwab
  2006-11-04  9:12       ` Randal L. Schwartz
  2006-11-04 14:16     ` Benjamin Riefenstahl
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Schwab @ 2006-11-04  9:10 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

merlyn@stonehenge.com (Randal L. Schwartz) writes:

> The question is, will this break anything else?  Can we make this a global
> change, or at least a change on carbon emacs?

It is semantically wrong (it is supposed to be set only in a buffer that
visits a file).  If you try to run save-buffer you'll get an error instead
of being prompted for the file name.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04  9:10     ` Andreas Schwab
@ 2006-11-04  9:12       ` Randal L. Schwartz
  2006-11-04 10:54         ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-04  9:12 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:

Andreas> merlyn@stonehenge.com (Randal L. Schwartz) writes:
>> The question is, will this break anything else?  Can we make this a global
>> change, or at least a change on carbon emacs?

Andreas> It is semantically wrong (it is supposed to be set only in a buffer that
Andreas> visits a file).  If you try to run save-buffer you'll get an error instead
Andreas> of being prompted for the file name.

Well, then is there some other way to nudge the mac code to do the right thing
for dired buffers?  I suspect it'll take changes on both sides.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04  9:12       ` Randal L. Schwartz
@ 2006-11-04 10:54         ` YAMAMOTO Mitsuharu
  2006-11-04 11:02           ` Randal L. Schwartz
  0 siblings, 1 reply; 15+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-11-04 10:54 UTC (permalink / raw)
  Cc: schwab, emacs-devel

>>>>> On 04 Nov 2006 01:12:29 -0800, merlyn@stonehenge.com (Randal L. Schwartz) said:

> Well, then is there some other way to nudge the mac code to do the
> right thing for dired buffers?  I suspect it'll take changes on both
> sides.

I doubt whether displaying the proxy icon for a dired buffer is the
right thing.  Is there any application having that behavior?  Also,
the icon is not draggable when the buffer modification flag is set.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 10:54         ` YAMAMOTO Mitsuharu
@ 2006-11-04 11:02           ` Randal L. Schwartz
  2006-11-04 12:09             ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-04 11:02 UTC (permalink / raw)
  Cc: schwab, emacs-devel

>>>>> "YAMAMOTO" == YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

YAMAMOTO> I doubt whether displaying the proxy icon for a dired buffer is the
YAMAMOTO> right thing.  Is there any application having that behavior?

Yes.  Finder.  I can drag the icon representing the finder folder
into another app.  And finder's view of a folder is very analogoes
to dired mode in emacs.

YAMAMOTO>   Also,
YAMAMOTO> the icon is not draggable when the buffer modification flag is set.

This is a deliberate Mac apps UI decision.  You can't drag a proxy icon if it
doesn't actually represent what is "on disk".

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 11:02           ` Randal L. Schwartz
@ 2006-11-04 12:09             ` YAMAMOTO Mitsuharu
  2006-11-04 14:00               ` Randal L. Schwartz
  0 siblings, 1 reply; 15+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-11-04 12:09 UTC (permalink / raw)


>>>>> On 04 Nov 2006 03:02:37 -0800, merlyn@stonehenge.com (Randal L. Schwartz) said:

YAMAMOTO> I doubt whether displaying the proxy icon for a dired buffer
YAMAMOTO> is the right thing.  Is there any application having that
YAMAMOTO> behavior?

> Yes.  Finder.  I can drag the icon representing the finder folder
> into another app.  And finder's view of a folder is very analogoes
> to dired mode in emacs.

I see.  I overlooked a big one.

YAMAMOTO> Also, the icon is not draggable when the buffer modification
YAMAMOTO> flag is set.

> This is a deliberate Mac apps UI decision.  You can't drag a proxy
> icon if it doesn't actually represent what is "on disk".

What I meant is that even if the proxy icon is displayed for a dired
buffer, it becomes undraggable once the buffer modification flag is
set.

Anyway, I don't have a good idea about implementing the Finder-like
proxy icon behavior in an acceptable way now.  Non-trivial changes
should be avoided at this stage, and I'm negative about changing the
dired code just for this Mac-only feature.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 12:09             ` YAMAMOTO Mitsuharu
@ 2006-11-04 14:00               ` Randal L. Schwartz
  0 siblings, 0 replies; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-04 14:00 UTC (permalink / raw)


>>>>> "YAMAMOTO" == YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

YAMAMOTO> Anyway, I don't have a good idea about implementing the Finder-like
YAMAMOTO> proxy icon behavior in an acceptable way now.  Non-trivial changes
YAMAMOTO> should be avoided at this stage, and I'm negative about changing the
YAMAMOTO> dired code just for this Mac-only feature.

OK, can this conversation be noted for the next release then?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04  8:05   ` Randal L. Schwartz
  2006-11-04  9:10     ` Andreas Schwab
@ 2006-11-04 14:16     ` Benjamin Riefenstahl
  2006-11-04 14:53       ` Randal L. Schwartz
  2006-11-05  4:00       ` YAMAMOTO Mitsuharu
  1 sibling, 2 replies; 15+ messages in thread
From: Benjamin Riefenstahl @ 2006-11-04 14:16 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

Hi Randal,

> YAMAMOTO Mitsuharu writes:
>> It's not under the control of Lisp.  It is set by
>> mac_update_proxy_icon in macfns.c according to the value of
>> buffer-file-name of the buffer of the selected window.

Randal L. Schwartz writes:
> Wow.  In a dired buffer in Carbon Emacs, I just executed the
> following:
>
>         (setq buffer-file-name ".")

I had to try this out ;-)

> And it did exactly the right expected useful thing: a badge was
> created that represented the current directory,

Actually it seems to represents the parent directory, not the actual
directory shown.  Which is logical, with an ordinary file, you would
expect "." to mean the parent directory.

> and I could command-click on the title bar to see the filepath to
> the directory and select parent directories.

But when I select a directory from that drop-down it gets shown in
Finder.  I'd want it to show up in dired, of course.

It seems this whole feature is not really thought out yet, even for
files.

benny

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 14:16     ` Benjamin Riefenstahl
@ 2006-11-04 14:53       ` Randal L. Schwartz
  2006-11-04 15:47         ` Sean O'Rourke
  2006-11-05  4:00       ` YAMAMOTO Mitsuharu
  1 sibling, 1 reply; 15+ messages in thread
From: Randal L. Schwartz @ 2006-11-04 14:53 UTC (permalink / raw)


>>>>> "Benjamin" == Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net> writes:
Benjamin> Actually it seems to represents the parent directory, not the actual
Benjamin> directory shown.  Which is logical, with an ordinary file, you would
Benjamin> expect "." to mean the parent directory.

Ahh, actually, it seems to always represent *my* home directory.
So that's not working.  I should have tried more cases.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 14:53       ` Randal L. Schwartz
@ 2006-11-04 15:47         ` Sean O'Rourke
  2006-11-06 16:48           ` Kevin Rodgers
  0 siblings, 1 reply; 15+ messages in thread
From: Sean O'Rourke @ 2006-11-04 15:47 UTC (permalink / raw)
  Cc: emacs-devel

merlyn@stonehenge.com (Randal L. Schwartz) writes:
> Ahh, actually, it seems to always represent *my* home directory.
> So that's not working.  I should have tried more cases.

I've currently added

    (setq buffer-file-name dired-directory)

to dired-mode-hook, and that seems to do what you want.  Now to
see what it breaks...

/s

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 14:16     ` Benjamin Riefenstahl
  2006-11-04 14:53       ` Randal L. Schwartz
@ 2006-11-05  4:00       ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 15+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-11-05  4:00 UTC (permalink / raw)
  Cc: emacs-devel, merlyn

>>>>> On Sat, 04 Nov 2006 15:16:49 +0100, Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net> said:

>> and I could command-click on the title bar to see the filepath to
>> the directory and select parent directories.

> But when I select a directory from that drop-down it gets shown in
> Finder.  I'd want it to show up in dired, of course.

Opening with Finder is the default behavior of WindowPathSelect().
And it is nontrivial task to change the behavior in an Emacs way of
menu handling.  I doubted it's worth doing while the next release was
approaching when I added this feature in May.

> It seems this whole feature is not really thought out yet, even for
> files.

Actually I thought of the use of dired, but if this functionality is
useful, then it should be (and can be) implemented in a
platform-independent way, like pop-up menu from the mode line.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-04 15:47         ` Sean O'Rourke
@ 2006-11-06 16:48           ` Kevin Rodgers
  2006-11-07  0:58             ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 15+ messages in thread
From: Kevin Rodgers @ 2006-11-06 16:48 UTC (permalink / raw)


Sean O'Rourke wrote:
> merlyn@stonehenge.com (Randal L. Schwartz) writes:
>> Ahh, actually, it seems to always represent *my* home directory.
>> So that's not working.  I should have tried more cases.
> 
> I've currently added
> 
>     (setq buffer-file-name dired-directory)
> 
> to dired-mode-hook, and that seems to do what you want.  Now to
> see what it breaks...

I suspect the case where dired-directory is a wildcard spec or a list
will cause problems.  Would default-directory be a good fallback for
mac_update_proxy_icon to use, when buffer-file-name is nil?

,----
| dired-directory is a variable defined in `dired.el'.
| Its value is nil
|
| Documentation:
| The directory name or wildcard spec that this dired directory lists.
| Local to each dired buffer.  May be a list, in which case the car is the
| directory name and the cdr is the list of files to mention.
| The directory name must be absolute, but need not be fully expanded.
|
| [back]
`----


-- 
Kevin

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

* Re: Mac - why no proxy badge for dired mode?
  2006-11-06 16:48           ` Kevin Rodgers
@ 2006-11-07  0:58             ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 15+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-11-07  0:58 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Mon, 06 Nov 2006 09:48:10 -0700, Kevin Rodgers <ihs_4664@yahoo.com> said:

> I suspect the case where dired-directory is a wildcard spec or a
> list will cause problems.  Would default-directory be a good
> fallback for mac_update_proxy_icon to use, when buffer-file-name is
> nil?

I also thought of introducing a buffer-local variable that is 1) a
flag to determine whether to fallback on default-directory (I don't
think that "always fallback" is the right thing).  But this can easily
be generalized to 2) a symbol to fallback on, or 3) a hook to call
when the file name for the proxy icon is needed. (Note that a single
dired buffer can contain multiple directories.)  Among them, 3) should
be after-the-release issue definitely, and if 1) or 2) is implemented
now, it will become obsolete.

I'd rather keep the principle simple for now, i.e.,

  * The proxy icon represents the value of buffer-file-name.
  * The dot in the close button and draggability of the proxy icon
    (they cannot be set differently) represents the buffer
    modification flag.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

end of thread, other threads:[~2006-11-07  0:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-02 20:13 Mac - why no proxy badge for dired mode? Randal L. Schwartz
2006-11-04  3:19 ` YAMAMOTO Mitsuharu
2006-11-04  8:05   ` Randal L. Schwartz
2006-11-04  9:10     ` Andreas Schwab
2006-11-04  9:12       ` Randal L. Schwartz
2006-11-04 10:54         ` YAMAMOTO Mitsuharu
2006-11-04 11:02           ` Randal L. Schwartz
2006-11-04 12:09             ` YAMAMOTO Mitsuharu
2006-11-04 14:00               ` Randal L. Schwartz
2006-11-04 14:16     ` Benjamin Riefenstahl
2006-11-04 14:53       ` Randal L. Schwartz
2006-11-04 15:47         ` Sean O'Rourke
2006-11-06 16:48           ` Kevin Rodgers
2006-11-07  0:58             ` YAMAMOTO Mitsuharu
2006-11-05  4:00       ` YAMAMOTO Mitsuharu

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