all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
@ 2020-05-17 10:23 David Ponce
  2020-05-17 13:09 ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: David Ponce @ 2020-05-17 10:23 UTC (permalink / raw)
  To: 41351

Hello,

The option `mouse-drag-and-drop-region-show-tooltip' cannot be
customized as mentioned in the doc string. Only an integer value can be
entered via customization. The proposed patch below fixed the defcustom
for me.

Thanks!

diff --git a/installs/emacs/lisp/mouse.el b/home/dponce/emacs.d/mouse.el
index 795b4da..47a7f20 100644
--- a/installs/emacs/lisp/mouse.el
+++ b/home/dponce/emacs.d/mouse.el
@@ -2577,7 +2577,10 @@ tooltips.  If this is t, it shows the entire text dragged in a
  tooltip.  If this is an integer (as with the default value of
  256), it will show that many characters of the dragged text in
  a tooltip."
-  :type 'integer
+  :type '(choice
+          (const :tag "Do not show tooltips" nil)
+          (const :tag "Show the entire text dragged" t)
+          (integer :tag "Show that many characters of the dragged text" 256))
    :version "26.1")
  
  (defcustom mouse-drag-and-drop-region-show-cursor t


In GNU Emacs 28.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, cairo version 1.16.0)
  of 2020-05-17 built on kilauea
Repository revision: 313955110b242cd18fc19bd168032d3ddf39fe94
Repository branch: master
Windowing system distributor 'Fedora Project', version 11.0.12006000
System Description: Fedora 31 (KDE Plasma)






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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 10:23 bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip David Ponce
@ 2020-05-17 13:09 ` Stefan Kangas
  2020-05-17 13:43   ` David Ponce
  2020-05-17 15:40   ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-05-17 13:09 UTC (permalink / raw)
  To: David Ponce, 41351

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

Hi David,

David Ponce <da_vid@orange.fr> writes:

> diff --git a/installs/emacs/lisp/mouse.el b/home/dponce/emacs.d/mouse.el
> index 795b4da..47a7f20 100644
> --- a/installs/emacs/lisp/mouse.el
> +++ b/home/dponce/emacs.d/mouse.el
> @@ -2577,7 +2577,10 @@ tooltips.  If this is t, it shows the entire text dragged in a
>   tooltip.  If this is an integer (as with the default value of
>   256), it will show that many characters of the dragged text in
>   a tooltip."
> -  :type 'integer
> +  :type '(choice
> +          (const :tag "Do not show tooltips" nil)
> +          (const :tag "Show the entire text dragged" t)
> +          (integer :tag "Show that many characters of the dragged text" 256))

Thanks for the bug report.

I think these should be made shorter to better fit in the customize
buffer.

I also found a bug where if you set this option to 0, the text is
incorrectly shown in full.

How about the below patch?

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Fix-minor-issues-with-mouse-drag-and-drop-region-sho.patch --]
[-- Type: text/x-diff, Size: 1826 bytes --]

From e632fd4cf42ea697906adf8e08c9b9851d2bdfb5 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sun, 17 May 2020 14:59:10 +0200
Subject: [PATCH] Fix minor issues with mouse-drag-and-drop-region-show-tooltip

* lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Fix
defcustom type to allow all valid values.  Suggested by David
Ponce.  (Bug#41351)
(mouse-drag-and-drop-region): Fix bug where setting
`drag-and-drop-region-show-tooltip' to 0 would still show a
tooltip.
---
 lisp/mouse.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 795b4da19e..f045e5bdce 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2575,9 +2575,12 @@ mouse-drag-and-drop-region-show-tooltip
 If this option is nil, `mouse-drag-and-drop-region' does not show
 tooltips.  If this is t, it shows the entire text dragged in a
 tooltip.  If this is an integer (as with the default value of
-256), it will show that many characters of the dragged text in
-a tooltip."
-  :type 'integer
+256), it will show up to that many characters of the dragged text
+in a tooltip."
+  :type '(choice
+          (const :tag "Do not show tooltips" nil)
+          (const :tag "Show all text" t)
+          (integer :tag "Show characters (max)" 256))
   :version "26.1")
 
 (defcustom mouse-drag-and-drop-region-show-cursor t
@@ -2611,6 +2614,7 @@ mouse-drag-and-drop-region
   (let* ((mouse-button (event-basic-type last-input-event))
          (mouse-drag-and-drop-region-show-tooltip
           (when (and mouse-drag-and-drop-region-show-tooltip
+                     (> mouse-drag-and-drop-region-show-tooltip 0)
                      (display-multi-frame-p)
                      (require 'tooltip))
             mouse-drag-and-drop-region-show-tooltip))
-- 
2.26.2


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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 13:09 ` Stefan Kangas
@ 2020-05-17 13:43   ` David Ponce
  2020-05-17 13:55     ` Stefan Kangas
  2020-05-17 15:40   ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: David Ponce @ 2020-05-17 13:43 UTC (permalink / raw)
  To: Stefan Kangas, 41351

On 17/05/2020 15:09, Stefan Kangas wrote:
> Hi David,
[...]
> Thanks for the bug report.
> 
> I think these should be made shorter to better fit in the customize
> buffer.
> 
> I also found a bug where if you set this option to 0, the text is
> incorrectly shown in full.
> 
> How about the below patch?
> 
> Best regards,
> Stefan Kangas
> 

Hi Stefan,

I agree, your patch is better, tags are clear and will fit better in
the customize buffer.

Also, good catch about when the option sets to 0 :-)

Please feel free to apply.

Thanks for your quick answer!
Regards,
David Ponce





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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 13:43   ` David Ponce
@ 2020-05-17 13:55     ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-05-17 13:55 UTC (permalink / raw)
  To: David Ponce, 41351; +Cc: control

close 41351 28.1
thanks

David Ponce <da_vid@orange.fr> writes:

> I agree, your patch is better, tags are clear and will fit better in
> the customize buffer.
>
> Also, good catch about when the option sets to 0 :-)
>
> Please feel free to apply.

Thanks!

Now pushed to master as commit a8f24a89d7.  Closing this bug.

Best regards,
Stefan Kangas





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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 13:09 ` Stefan Kangas
  2020-05-17 13:43   ` David Ponce
@ 2020-05-17 15:40   ` Eli Zaretskii
  2020-05-17 21:00     ` Stefan Kangas
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2020-05-17 15:40 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: da_vid, 41351

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sun, 17 May 2020 06:09:09 -0700
> 
> +          (integer :tag "Show characters (max)" 256))

IMO, the original text was much more clear.  maybe it can be
shortened, but your variant goes too far.





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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 15:40   ` Eli Zaretskii
@ 2020-05-17 21:00     ` Stefan Kangas
  2020-05-18  2:25       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2020-05-17 21:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: da_vid, 41351

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stefan Kangas <stefankangas@gmail.com>
>> Date: Sun, 17 May 2020 06:09:09 -0700
>>
>> +          (integer :tag "Show characters (max)" 256))
>
> IMO, the original text was much more clear.  maybe it can be
> shortened, but your variant goes too far.

Thanks, I appreciate the attention to detail.

Having thought a bit about this, the best alternatives I could come up
with are:

  (1) Max number of characters

  (2) Show only N characters

Any preference, or better ideas?

Best regards,
Stefan Kangas





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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-17 21:00     ` Stefan Kangas
@ 2020-05-18  2:25       ` Eli Zaretskii
  2020-05-19  0:25         ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2020-05-18  2:25 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: da_vid, 41351

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sun, 17 May 2020 14:00:45 -0700
> Cc: da_vid@orange.fr, 41351@debbugs.gnu.org
> 
>   (1) Max number of characters
> 
>   (2) Show only N characters
> 
> Any preference, or better ideas?

"Max number of characters to show", I guess.





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

* bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip
  2020-05-18  2:25       ` Eli Zaretskii
@ 2020-05-19  0:25         ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-05-19  0:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: da_vid, 41351

Eli Zaretskii <eliz@gnu.org> writes:

> "Max number of characters to show", I guess.

Fixed on master.





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

end of thread, other threads:[~2020-05-19  0:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-17 10:23 bug#41351: 28.0.50; Cannot customize mouse-drag-and-drop-region-show-tooltip David Ponce
2020-05-17 13:09 ` Stefan Kangas
2020-05-17 13:43   ` David Ponce
2020-05-17 13:55     ` Stefan Kangas
2020-05-17 15:40   ` Eli Zaretskii
2020-05-17 21:00     ` Stefan Kangas
2020-05-18  2:25       ` Eli Zaretskii
2020-05-19  0:25         ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.