Discussion:
ns-popup-color-panel
(too old to reply)
Konrad Podczeck
2018-04-16 22:40:53 UTC
Permalink
The Emacs manual that comes with the recent 26.1 pretest promises:

"You can bring up a color panel with ‘M-x ns-popup-color-panel’ and
drag the color you want over the Emacs face you want to change. Normal
dragging will alter the foreground color. Shift dragging will alter the
background color“


However, while ns-popup-color-panel works, dragging a color to an Emacs frame fails to give the promised result.

(NB, it works, as promised, in the Aquamacs version of Emacs)

Konrad Podczeck
Alan Third
2018-04-21 13:11:08 UTC
Permalink
Post by Konrad Podczeck
"You can bring up a color panel with ‘M-x ns-popup-color-panel’ and
drag the color you want over the Emacs face you want to change. Normal
dragging will alter the foreground color. Shift dragging will alter the
background color“
However, while ns-popup-color-panel works, dragging a color to an
Emacs frame fails to give the promised result.
I can confirm it doesn’t do anything. I turned on NSTrace and it
doesn’t even seem to be causing the drag/drop functions to be called.
It doesn’t work in Emacs 25 either.

Out of interest, what is the use case for this functionality? Can you
use it to modify a face then save it?
Post by Konrad Podczeck
(NB, it works, as promised, in the Aquamacs version of Emacs)
They must be applying a patch to fix it.

I was going to submit a documentation fix for Emacs 26, but I’ve just
noticed the macos.texi file is full of nonsense. There must have been
some big changes to drag and drop functionality (at least) since this
was written.

I’ll try and sort it out.
--
Alan Third
Alan Third
2018-04-21 13:39:05 UTC
Permalink
I was going to submit a documentation fix for Emacs 26, but I’ve just
noticed the macos.texi file is full of nonsense. There must have been
some big changes to drag and drop functionality (at least) since this
was written.
I’ll try and sort it out.
Patch attached. Is this OK to go straight into emacs-26?
--
Alan Third
Eli Zaretskii
2018-04-21 13:45:15 UTC
Permalink
Date: Sat, 21 Apr 2018 14:39:05 +0100
Post by Alan Third
I was going to submit a documentation fix for Emacs 26, but I’ve just
noticed the macos.texi file is full of nonsense. There must have been
some big changes to drag and drop functionality (at least) since this
was written.
I’ll try and sort it out.
Patch attached. Is this OK to go straight into emacs-26?
Yes, thanks.
martin rudalics
2018-04-22 07:19:02 UTC
Permalink
The default behavior is to open a file in the
current window, or to insert text in the buffer it is dropped into.
Please verify both statements: Is it really the "current" (better
"selected") window or the window under the mouse? And what is "the
buffer it is dropped into"? The buffer displayed at the position of
the mouse?

Thanks, martin
Alan Third
2018-04-22 10:08:48 UTC
Permalink
Post by martin rudalics
The default behavior is to open a file in the
current window, or to insert text in the buffer it is dropped into.
Please verify both statements: Is it really the "current" (better
"selected") window or the window under the mouse? And what is "the
buffer it is dropped into"? The buffer displayed at the position of
the mouse?
Turns out in both cases it’s whatever is under the mouse. Insert text
into the buffer under the mouse, and open the file in the window under
the mouse.

Is this better?

modified doc/emacs/macos.texi
@@ -169,9 +169,9 @@ Mac / GNUstep Events
@item ns-drag-n-drop
This event occurs when a user drags an object from another application
into an Emacs frame. The default behavior is to open a file in the
-current window, or to insert text in the buffer it is dropped into.
-It may sometimes be necessary to use the @key{META} key in conjunction
-with dragging to force text insertion.
+window under the mouse, or to insert text at point in the buffer under
+the mouse. It may sometimes be necessary to use the @key{META} key in
+conjunction with dragging to force text insertion.

@item ns-change-font
This event occurs when the user selects a font in a Nextstep font
--
Alan Third
martin rudalics
2018-04-22 10:21:00 UTC
Permalink
Post by Alan Third
insert text at point in the buffer under
Is it 'point' or 'window-point'? That is, if you have windows 1 and 2
both show the same buffer with different window points, window 1 is
selected and window 2 is the one where you drop the text does it go to
point or window 2's window point?

martin
Alan Third
2018-04-24 18:39:02 UTC
Permalink
Post by martin rudalics
Post by Alan Third
insert text at point in the buffer under
Is it 'point' or 'window-point'? That is, if you have windows 1 and 2
both show the same buffer with different window points, window 1 is
selected and window 2 is the one where you drop the text does it go to
point or window 2's window point?
It’s point in the window under the mouse. Should that read ‘insert
text at point in the window under’ instead, or something else?
--
Alan Third
martin rudalics
2018-04-26 07:04:48 UTC
Permalink
Post by Alan Third
It’s point in the window under the mouse. Should that read ‘insert
text at point in the window under’ instead,
Yes.
Post by Alan Third
or something else?
"at point of the window" might be even less ambiguous but we have no
strict nomenclature for that.

Thanks, martin
Alan Third
2018-04-26 19:56:59 UTC
Permalink
Post by martin rudalics
Post by Alan Third
It’s point in the window under the mouse. Should that read ‘insert
text at point in the window under’ instead,
Yes.
Post by Alan Third
or something else?
"at point of the window" might be even less ambiguous but we have no
strict nomenclature for that.
Thanks. I’ve fixed and pushed it.
--
Alan Third
Nick Helm
2018-04-21 21:59:48 UTC
Permalink
Post by Alan Third
Post by Konrad Podczeck
However, while ns-popup-color-panel works, dragging a color to an
Emacs frame fails to give the promised result.
I can confirm it doesn’t do anything. I turned on NSTrace and it
doesn’t even seem to be causing the drag/drop functions to be called.
It doesn’t work in Emacs 25 either.
I think dnd using the system pickers was removed from NS with commit
1269a680862a9bc6cd65e3d26ef05f68c7521632 back in 2013. The reason in the
changelog was it doesn't work on newer versions of macOS and the feature
isn't available on other platforms.

Is this still true? If people want it perhaps it should be added back
in?
Loading...