all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12067: 24.1; improper menu formatting with multiple \t chars
@ 2012-07-27  6:49 Drew Adams
  2012-07-27 14:53 ` Jason Rumney
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Drew Adams @ 2012-07-27  6:49 UTC (permalink / raw)
  To: 12067

emacs -Q

(defcustom foo [:ascii:]
  "..."
  :type
  '(choice :tag "Foobar"
    (const :tag "A\t\t- [:ascii:]"                                [:ascii:])
    (const :tag "Bbbbbb\t\t- [:nonascii:]"                        [:nonascii:])
    (const :tag "Cccccccccccc\t\t- [:word:]"                      [:word:])
    (const :tag "Dddddddddddddddddddddddddd\t\t- [:alnum:]"       [:alnum:])
    (const :tag "Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\t- [:alpha:]" [:alpha:]))
  :group 'convenience)

M-x customize-option foo
 
Click button Value Menu to see the menu.  Each time \t\t is used, there
is a rectangular artifact added also.
 
It turns out that using only a single \t does the right thing in terms
of alignment in this case.  But shouldn't multiple \t's let you tab
(indent) further, as they do in text buffers, doc strings, etc.?  And
presumably \t\t should not draw a rectangle, in any case.
 

In GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600)
 of 2012-06-10 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'
 






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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27  6:49 bug#12067: 24.1; improper menu formatting with multiple \t chars Drew Adams
@ 2012-07-27 14:53 ` Jason Rumney
  2012-07-27 15:06   ` Drew Adams
  2012-07-27 15:49 ` Eli Zaretskii
  2014-02-09  3:29 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 14+ messages in thread
From: Jason Rumney @ 2012-07-27 14:53 UTC (permalink / raw)
  To: Drew Adams; +Cc: 12067

"Drew Adams" <drew.adams@oracle.com> writes:

> It turns out that using only a single \t does the right thing in terms
> of alignment in this case.  But shouldn't multiple \t's let you tab
> (indent) further, as they do in text buffers, doc strings, etc.?  And
> presumably \t\t should not draw a rectangle, in any case.

No. A menu is not a buffer.





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 14:53 ` Jason Rumney
@ 2012-07-27 15:06   ` Drew Adams
  2012-07-27 16:19     ` Jason Rumney
  0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-07-27 15:06 UTC (permalink / raw)
  To: 'Jason Rumney'; +Cc: 12067

> > It turns out that using only a single \t does the right 
> > thing in terms of alignment in this case.  But shouldn't
> > multiple \t's let you tab (indent) further, as they do
> > in text buffers, doc strings, etc.?  And
> > presumably \t\t should not draw a rectangle, in any case.
> 
> No. A menu is not a buffer.

No one said it is.






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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27  6:49 bug#12067: 24.1; improper menu formatting with multiple \t chars Drew Adams
  2012-07-27 14:53 ` Jason Rumney
@ 2012-07-27 15:49 ` Eli Zaretskii
  2012-07-27 16:24   ` Drew Adams
  2014-02-09  3:29 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2012-07-27 15:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 12067

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Thu, 26 Jul 2012 23:49:55 -0700
> 
> emacs -Q
> 
> (defcustom foo [:ascii:]
>   "..."
>   :type
>   '(choice :tag "Foobar"
>     (const :tag "A\t\t- [:ascii:]"                                [:ascii:])
>     (const :tag "Bbbbbb\t\t- [:nonascii:]"                        [:nonascii:])
>     (const :tag "Cccccccccccc\t\t- [:word:]"                      [:word:])
>     (const :tag "Dddddddddddddddddddddddddd\t\t- [:alnum:]"       [:alnum:])
>     (const :tag "Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\t- [:alpha:]" [:alpha:]))
>   :group 'convenience)
> 
> M-x customize-option foo
>  
> Click button Value Menu to see the menu.  Each time \t\t is used, there
> is a rectangular artifact added also.

I cannot reproduce this here, neither in Emacs 24.1 nor in the current
trunk version.

What I did was copy-paste your example to a fresh Emacs session, then
"M-x eval-region RET", then "M-x customize-option RET foo RET" and
click the "Value Menu" to display the menu.  It displayed correctly,
nicely aligned and with no artifacts.





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 15:06   ` Drew Adams
@ 2012-07-27 16:19     ` Jason Rumney
  2012-07-27 16:33       ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Rumney @ 2012-07-27 16:19 UTC (permalink / raw)
  To: Drew Adams; +Cc: 12067

"Drew Adams" <drew.adams@oracle.com> writes:

>> > It turns out that using only a single \t does the right 
>> > thing in terms of alignment in this case.  But shouldn't
>> > multiple \t's let you tab (indent) further, as they do
>> > in text buffers, doc strings, etc.?  And
>> > presumably \t\t should not draw a rectangle, in any case.
>> 
>> No. A menu is not a buffer.
>
> No one said it is.

You seem to be requesting it to act like one above.

In Windows menus, a tab character is a not valid printing character,
hence is drawn as a rectangle.  An exception is that if one, and only
one, tab character appears in a menu string, it is used as a separator
to separate the menu text (left aligned in most locales) from the key
shortcut (right aligned in those locales).

YMMV with menus on other platforms however.






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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 15:49 ` Eli Zaretskii
@ 2012-07-27 16:24   ` Drew Adams
  2012-07-27 20:24     ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-07-27 16:24 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 12067

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

> > emacs -Q
> > (defcustom foo [:ascii:]
> >   "..."
> >   :type
> >   '(choice :tag "Foobar"
> >     (const :tag "A\t\t- [:ascii:]"  [:ascii:])
...
>
> I cannot reproduce this here, neither in Emacs 24.1 nor in the current
> trunk version.
> 
> What I did was copy-paste your example to a fresh Emacs session, then
> "M-x eval-region RET", then "M-x customize-option RET foo RET" and
> click the "Value Menu" to display the menu.  It displayed correctly,
> nicely aligned and with no artifacts.

What can I say?  I do exactly that, with Emacs 24.1 and emacs -Q, and I see what
is in the attached screenshot.

[-- Attachment #2: throw-emacs-menu-w-tabs.png --]
[-- Type: image/png, Size: 11428 bytes --]

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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 16:19     ` Jason Rumney
@ 2012-07-27 16:33       ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-07-27 16:33 UTC (permalink / raw)
  To: 'Jason Rumney'; +Cc: 12067

> In Windows menus, a tab character is a not valid printing character,
> hence is drawn as a rectangle.  An exception is that if one, and only
> one, tab character appears in a menu string, it is used as a separator
> to separate the menu text (left aligned in most locales) from the key
> shortcut (right aligned in those locales).

I see.  Perhaps that should be mentioned in the doc?

If Emacs cannot control or work around that limitation, so be it.
Feel free to close the enhancement request as unrealizable in that case.

> YMMV with menus on other platforms however.

Got it.  Thx.






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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 16:24   ` Drew Adams
@ 2012-07-27 20:24     ` Michael Heerdegen
  2012-07-28  6:56       ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2012-07-27 20:24 UTC (permalink / raw)
  To: 12067

"Drew Adams" <drew.adams@oracle.com> writes:

> > > emacs -Q
> > > (defcustom foo [:ascii:]
> > >   "..."
> > >   :type
> > >   '(choice :tag "Foobar"
> > >     (const :tag "A\t\t- [:ascii:]"  [:ascii:])
> ...
> >
> > I cannot reproduce this here, neither in Emacs 24.1 nor in the current
> > trunk version.
> > 
> > What I did was copy-paste your example to a fresh Emacs session, then
> > "M-x eval-region RET", then "M-x customize-option RET foo RET" and
> > click the "Value Menu" to display the menu.  It displayed correctly,
> > nicely aligned and with no artifacts.
>
> What can I say?  I do exactly that, with Emacs 24.1 and emacs -Q, and
> I see what
> is in the attached screenshot.

A third version: I see no artifacts, but also no nice alignment.  Looks
like tab chars are formatted for me as spaces with constant width.  (I
use emacs-snapshot on Debian.)





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27 20:24     ` Michael Heerdegen
@ 2012-07-28  6:56       ` Eli Zaretskii
  2012-07-28 12:51         ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2012-07-28  6:56 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 12067

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Fri, 27 Jul 2012 22:24:00 +0200
> 
> A third version: I see no artifacts, but also no nice alignment.  Looks
> like tab chars are formatted for me as spaces with constant width.  (I
> use emacs-snapshot on Debian.)

Please state the toolkit that was used to build Emacs.  This issue is
definitely toolkit-dependent.





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-28  6:56       ` Eli Zaretskii
@ 2012-07-28 12:51         ` Michael Heerdegen
  2012-07-28 19:58           ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2012-07-28 12:51 UTC (permalink / raw)
  To: 12067

Eli Zaretskii <eliz@gnu.org> writes:

> > A third version: I see no artifacts, but also no nice alignment.  Looks
> > like tab chars are formatted for me as spaces with constant width.  (I
> > use emacs-snapshot on Debian.)
>
> Please state the toolkit that was used to build Emacs.  This issue is
> definitely toolkit-dependent.

GNU Emacs 24.1.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2012-07-21 on keller, modified by Debian





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-28 12:51         ` Michael Heerdegen
@ 2012-07-28 19:58           ` Eli Zaretskii
  2012-07-28 20:10             ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2012-07-28 19:58 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 12067

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Sat, 28 Jul 2012 14:51:31 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > > A third version: I see no artifacts, but also no nice alignment.  Looks
> > > like tab chars are formatted for me as spaces with constant width.  (I
> > > use emacs-snapshot on Debian.)
> >
> > Please state the toolkit that was used to build Emacs.  This issue is
> > definitely toolkit-dependent.
> 
> GNU Emacs 24.1.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
>  of 2012-07-21 on keller, modified by Debian

Thanks.

If we care about this issue, we could perhaps expand TABs into the
appropriate number of spaces, before passing the menu items to the
toolkit.





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-28 19:58           ` Eli Zaretskii
@ 2012-07-28 20:10             ` Drew Adams
  2012-07-29  2:49               ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Drew Adams @ 2012-07-28 20:10 UTC (permalink / raw)
  To: 'Eli Zaretskii', 'Michael Heerdegen'; +Cc: 12067

> If we care about this issue, we could perhaps expand TABs into the
> appropriate number of spaces, before passing the menu items to the
> toolkit.

I thought of that, but menu items are often realized using proportional fonts.

What is really needed, I guess, is the equivalent of `move-to-column'.






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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-28 20:10             ` Drew Adams
@ 2012-07-29  2:49               ` Eli Zaretskii
  0 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2012-07-29  2:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: michael_heerdegen, 12067

> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: <12067@debbugs.gnu.org>
> Date: Sat, 28 Jul 2012 13:10:50 -0700
> 
> > If we care about this issue, we could perhaps expand TABs into the
> > appropriate number of spaces, before passing the menu items to the
> > toolkit.
> 
> I thought of that, but menu items are often realized using proportional fonts.
> 
> What is really needed, I guess, is the equivalent of `move-to-column'.

move-to-column won't help, as it doesn't take pixel width of each
character into account.





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

* bug#12067: 24.1; improper menu formatting with multiple \t chars
  2012-07-27  6:49 bug#12067: 24.1; improper menu formatting with multiple \t chars Drew Adams
  2012-07-27 14:53 ` Jason Rumney
  2012-07-27 15:49 ` Eli Zaretskii
@ 2014-02-09  3:29 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 14+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-09  3:29 UTC (permalink / raw)
  To: Drew Adams; +Cc: 12067

"Drew Adams" <drew.adams@oracle.com> writes:

> emacs -Q
>
> (defcustom foo [:ascii:]
>   "..."
>   :type
>   '(choice :tag "Foobar"
>     (const :tag "A\t\t- [:ascii:]"                                [:ascii:])
>     (const :tag "Bbbbbb\t\t- [:nonascii:]"                        [:nonascii:])
>     (const :tag "Cccccccccccc\t\t- [:word:]"                      [:word:])
>     (const :tag "Dddddddddddddddddddddddddd\t\t- [:alnum:]"       [:alnum:])
>     (const :tag "Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\t- [:alpha:]" [:alpha:]))
>   :group 'convenience)
>
> M-x customize-option foo

The conclusion seems to be "tabs aren't really supported in menus".
Closing.

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





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

end of thread, other threads:[~2014-02-09  3:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27  6:49 bug#12067: 24.1; improper menu formatting with multiple \t chars Drew Adams
2012-07-27 14:53 ` Jason Rumney
2012-07-27 15:06   ` Drew Adams
2012-07-27 16:19     ` Jason Rumney
2012-07-27 16:33       ` Drew Adams
2012-07-27 15:49 ` Eli Zaretskii
2012-07-27 16:24   ` Drew Adams
2012-07-27 20:24     ` Michael Heerdegen
2012-07-28  6:56       ` Eli Zaretskii
2012-07-28 12:51         ` Michael Heerdegen
2012-07-28 19:58           ` Eli Zaretskii
2012-07-28 20:10             ` Drew Adams
2012-07-29  2:49               ` Eli Zaretskii
2014-02-09  3:29 ` Lars Ingebrigtsen

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.