unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Face remapping on mouse menu
@ 2008-06-12  5:26 Chong Yidong
  2008-06-12  7:07 ` joakim
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Chong Yidong @ 2008-06-12  5:26 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

Currently, shift-down-mouse-1 pops up a menu that lets the user choose a
different font to apply to the current frame.

This doesn't seem like a very useful operation for a mouse binding.
Also, the choices aren't very suitable when fontconfig is in use; the
menu consists of a pre-generated list of non-fontconfig fonts
(x-fixed-font-alist) plus whichever fontconfig fonts happen to be loaded
(generate-fontset-menu).

Now that the face-remapping code has been checked in, I'd suggest
changing this menu to a "buffer faces" menu.  It should contain a few
items that remap the `default' face in the current buffer: an item to
increase the face size, an item to decrease the face size, and an item
to change the face font.  When fontconfig is available, the latter can
use x-popup-dialog to pop up the GTK font selector, instead of relying
on x-fixed-font-alist.

WDYT?




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

* Re: Face remapping on mouse menu
  2008-06-12  5:26 Chong Yidong
@ 2008-06-12  7:07 ` joakim
  2008-06-12  8:21 ` Miles Bader
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: joakim @ 2008-06-12  7:07 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, Miles Bader

Chong Yidong <cyd@stupidchicken.com> writes:

> Currently, shift-down-mouse-1 pops up a menu that lets the user choose a
> different font to apply to the current frame.
>
> This doesn't seem like a very useful operation for a mouse binding.
> Also, the choices aren't very suitable when fontconfig is in use; the
> menu consists of a pre-generated list of non-fontconfig fonts
> (x-fixed-font-alist) plus whichever fontconfig fonts happen to be loaded
> (generate-fontset-menu).
>
> Now that the face-remapping code has been checked in, I'd suggest
> changing this menu to a "buffer faces" menu.  It should contain a few
> items that remap the `default' face in the current buffer: an item to
> increase the face size, an item to decrease the face size, and an item
> to change the face font.  When fontconfig is available, the latter can
> use x-popup-dialog to pop up the GTK font selector, instead of relying
> on x-fixed-font-alist.
>
> WDYT?

+1

-- 
Joakim Verona




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

* Re: Face remapping on mouse menu
  2008-06-12  5:26 Chong Yidong
  2008-06-12  7:07 ` joakim
@ 2008-06-12  8:21 ` Miles Bader
  2008-06-12 15:14 ` Drew Adams
  2008-06-15 20:08 ` Chong Yidong
  3 siblings, 0 replies; 12+ messages in thread
From: Miles Bader @ 2008-06-12  8:21 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:
> Now that the face-remapping code has been checked in, I'd suggest
> changing this menu to a "buffer faces" menu.  It should contain a few
> items that remap the `default' face in the current buffer: an item to
> increase the face size, an item to decrease the face size, and an item
> to change the face font.  When fontconfig is available, the latter can
> use x-popup-dialog to pop up the GTK font selector, instead of relying
> on x-fixed-font-alist.

It sounds like a great idea to me!

I agree that the current font-menu is not really all that useful for
many people... (I certainly never use it except in very exceptional
circumstances; in fact, I'm not sure the last time I used it... 1997 or
thereabouts? :-).

-Miles

-- 
Guilt, n. The condition of one who is known to have committed an indiscretion,
as distinguished from the state of him who has covered his tracks.




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

* RE: Face remapping on mouse menu
  2008-06-12  5:26 Chong Yidong
  2008-06-12  7:07 ` joakim
  2008-06-12  8:21 ` Miles Bader
@ 2008-06-12 15:14 ` Drew Adams
  2008-06-12 15:38   ` Chong Yidong
  2008-06-15 20:08 ` Chong Yidong
  3 siblings, 1 reply; 12+ messages in thread
From: Drew Adams @ 2008-06-12 15:14 UTC (permalink / raw)
  To: 'Chong Yidong', 'Miles Bader'; +Cc: emacs-devel

> Currently, shift-down-mouse-1 pops up a menu that lets the 
> user choose a different font to apply to the current frame.
> 
> This doesn't seem like a very useful operation for a mouse binding.

Reason?

> Also, the choices aren't very suitable when fontconfig is in use; the
> menu consists of a pre-generated list of non-fontconfig fonts
> (x-fixed-font-alist) plus whichever fontconfig fonts happen 
> to be loaded (generate-fontset-menu).

Can you please separate that from the first topic (separate thread)?

On Windows, doesn't S(-down)-mouse-1 still call up the Windows Font dialog box?
How is that related to this "fontconfig" change? Note: I know nothing about
fontconfig.

> Now that the face-remapping code has been checked in, I'd suggest
> changing this menu to a "buffer faces" menu.  It should contain a few
> items that remap the `default' face in the current buffer: an item to
> increase the face size, an item to decrease the face size, and an item
> to change the face font.  When fontconfig is available, the latter can
> use x-popup-dialog to pop up the GTK font selector, instead of relying
> on x-fixed-font-alist.
> 
> WDYT?

I don't really follow it, frankly, perhaps because I'm not very familiar with
the face-remapping code.

Are you suggesting to replace the dialog to choose a font for the current frame
by a dialog to choose a font for the current buffer? Is that essentially what
you are suggesting?

Can you please describe the changes you propose more concretely? What bindings
for what menus, what changes to the existing menus, reasons, etc.






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

* Re: Face remapping on mouse menu
  2008-06-12 15:14 ` Drew Adams
@ 2008-06-12 15:38   ` Chong Yidong
  2008-06-12 16:01     ` Drew Adams
  2008-06-12 16:17     ` Jason Rumney
  0 siblings, 2 replies; 12+ messages in thread
From: Chong Yidong @ 2008-06-12 15:38 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel, 'Miles Bader'

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

>> Now that the face-remapping code has been checked in, I'd suggest
>> changing this menu to a "buffer faces" menu.  It should contain a few
>> items that remap the `default' face in the current buffer: an item to
>> increase the face size, an item to decrease the face size, and an
>> item to change the face font.  When fontconfig is available, the
>> latter can use x-popup-dialog to pop up the GTK font selector,
>> instead of relying on x-fixed-font-alist.
>> 
>> WDYT?
>
> I don't really follow it, frankly, perhaps because I'm not very
> familiar with the face-remapping code.
>
> Are you suggesting to replace the dialog to choose a font for the
> current frame by a dialog to choose a font for the current buffer? Is
> that essentially what you are suggesting?
>
> Can you please describe the changes you propose more concretely? What
> bindings for what menus, what changes to the existing menus, reasons,
> etc.

The idea is for shift-down-mouse-1 to pop up a context menu something
like this:

 Increase Text Size
 Decrease Text Size
 Change Buffer Font
 Restore Default Text Size

The operations in this menu would affect the text in the current buffer
only, via the face-remapping code.  The "Restore Default Text Size" item
would simply remove the face remapping.

With GTK/Fontconfig, the "Change Buffer Font" item pops up a GTK font
dialog to choose the font for the current buffer.  On Win32, it pops up
a Windows font dialog for the same purpose.  Otherwise, it would be a
submenu containing the old mouse-select-font choices.




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

* RE: Face remapping on mouse menu
  2008-06-12 15:38   ` Chong Yidong
@ 2008-06-12 16:01     ` Drew Adams
  2008-06-12 16:17     ` Jason Rumney
  1 sibling, 0 replies; 12+ messages in thread
From: Drew Adams @ 2008-06-12 16:01 UTC (permalink / raw)
  To: 'Chong Yidong'; +Cc: emacs-devel, 'Miles Bader'

> > Are you suggesting to replace the dialog to choose a font for the
> > current frame by a dialog to choose a font for the current 
> > buffer? Is that essentially what you are suggesting?
> >
> > Can you please describe the changes you propose more 
> > concretely? What bindings for what menus, what changes to the
> > existing menus, reasons, etc.
> 
> The idea is for shift-down-mouse-1 to pop up a context menu something
> like this:
> 
>  Increase Text Size
>  Decrease Text Size
>  Change Buffer Font
>  Restore Default Text Size
> 
> The operations in this menu would affect the text in the 
> current buffer only, via the face-remapping code.  The
> "Restore Default Text Size" item
> would simply remove the face remapping.
> 
> With GTK/Fontconfig, the "Change Buffer Font" item pops up a GTK font
> dialog to choose the font for the current buffer.  On Win32, 
> it pops up
> a Windows font dialog for the same purpose.

Thanks for the clarification.

Sounds good to me. Would we also want to include something in the menu to do the
same thing for the frame? Or perhaps for all frames? Or perhaps for all buffers
of the same mode?

I'm thinking that what users will typically want to do is one of these: 

1. Change the font for the current buffer (what you propose).
2. Change the font for the current frame (what we used to have).
3. Change the font for all buffers that have the same mode as the
   current buffer.

We might accommodate all of these use cases with the same menu items, just by
including a multiple-choice set of radio buttons at the end of the menu:

(.) Current Buffer
( ) Current Frame
( ) Buffers with Current Mode

The last of these would affect also future buffers in the current mode, not just
existing buffers in that mode.

Regardless of whether this idea appeals to people, I am in favor of the change
you proposed: current buffer instead of current frame.

> Otherwise, it would be a
> submenu containing the old mouse-select-font choices.

I didn't quite understand that part.





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

* Re: Face remapping on mouse menu
  2008-06-12 15:38   ` Chong Yidong
  2008-06-12 16:01     ` Drew Adams
@ 2008-06-12 16:17     ` Jason Rumney
  1 sibling, 0 replies; 12+ messages in thread
From: Jason Rumney @ 2008-06-12 16:17 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 'Miles Bader', Drew Adams, emacs-devel

Chong Yidong wrote:
> With GTK/Fontconfig, the "Change Buffer Font" item pops up a GTK font
> dialog to choose the font for the current buffer.  On Win32, it pops up
> a Windows font dialog for the same purpose.  Otherwise, it would be a
> submenu containing the old mouse-select-font choices.
>   

I think we can do better than the old mouse-select-font choices, using 
font-family-list or list-fonts with appropriate filtering.




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

* Re: Face remapping on mouse menu
  2008-06-12  5:26 Chong Yidong
                   ` (2 preceding siblings ...)
  2008-06-12 15:14 ` Drew Adams
@ 2008-06-15 20:08 ` Chong Yidong
  2008-06-15 23:55   ` Juanma Barranquero
  3 siblings, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2008-06-15 20:08 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

As per my previous email, I've installed a new binding for
S-down-mouse-1, which pops up a menu for remapping the default face in
the current buffer.  Please let me know if there are any problems.




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

* Re: Face remapping on mouse menu
  2008-06-15 20:08 ` Chong Yidong
@ 2008-06-15 23:55   ` Juanma Barranquero
  2008-06-16  1:25     ` Chong Yidong
  0 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2008-06-15 23:55 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, Miles Bader

On Sun, Jun 15, 2008 at 22:08, Chong Yidong <cyd@stupidchicken.com> wrote:

> As per my previous email, I've installed a new binding for
> S-down-mouse-1, which pops up a menu for remapping the default face in
> the current buffer.  Please let me know if there are any problems.

If I try to select one of the WST fonts (these are bitmapped fonts
installed by default on Windows XP) I get an assertion failure:

Breakpoint 1, w32_abort () at w32fns.c:9360
9360      button = MessageBox (NULL,
(gdb) bt
#0  w32_abort () at w32fns.c:9360
#1  0x011990a7 in font_style_symbolic_from_value
(prop=FONT_WEIGHT_INDEX, val=1600, for_face=0) at font.c:372
#2  0x01206c94 in Fx_select_font (frame=25765889,
include_proportional=25765889) at w32font.c:1944
#3  0x01019c10 in Ffuncall (nargs=1, args=0x82f930) at eval.c:3045
#4  0x011416d4 in Fbyte_code (bytestr=19602731, vector=19603036,
maxdepth=72) at bytecode.c:678
#5  0x0101c0f6 in funcall_lambda (fun=19602692, nargs=1,
arg_vector=0x82fac4) at eval.c:3229
#6  0x0101983e in Ffuncall (nargs=2, args=0x82fac0) at eval.c:3088
#7  0x0114488d in Fcall_interactively (function=40888897,
record_flag=25765889, keys=25799428) at callint.c:857
#8  0x01019c48 in Ffuncall (nargs=4, args=0x82fc88) at eval.c:3048
#9  0x01019eca in call3 (fn=25959361, arg1=40888897, arg2=25765889,
arg3=25765889) at eval.c:2868
#10 0x01090b98 in command_loop_1 () at keyboard.c:1910
#11 0x01018f96 in internal_condition_case (bfun=0x10905bf
<command_loop_1>, handlers=25829593, hfun=0x1087826 <cmd_error>)
    at eval.c:1511
#12 0x01086b3b in command_loop_2 () at keyboard.c:1367
#13 0x01019040 in internal_catch (tag=25825665, func=0x1086b18
<command_loop_2>, arg=25765889) at eval.c:1247
#14 0x0108766b in command_loop () at keyboard.c:1346
#15 0x010879bf in recursive_edit_1 () at keyboard.c:955
#16 0x01087b2a in Frecursive_edit () at keyboard.c:1017
#17 0x01002c47 in main (argc=8585136, argv=0xa82750) at emacs.c:1772

Lisp Backtrace:
"x-select-font" (0x82f934)
"mouse-appearance-menu" (0x82fac4)
"call-interactively" (0x82fc8c)
(gdb)

   Juanma




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

* Re: Face remapping on mouse menu
  2008-06-15 23:55   ` Juanma Barranquero
@ 2008-06-16  1:25     ` Chong Yidong
  2008-06-16 23:03       ` Juanma Barranquero
  0 siblings, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2008-06-16  1:25 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel, Miles Bader

"Juanma Barranquero" <lekktu@gmail.com> writes:

>> As per my previous email, I've installed a new binding for
>> S-down-mouse-1, which pops up a menu for remapping the default face in
>> the current buffer.  Please let me know if there are any problems.
>
> If I try to select one of the WST fonts (these are bitmapped fonts
> installed by default on Windows XP) I get an assertion failure:
>
> Breakpoint 1, w32_abort () at w32fns.c:9360
> 9360      button = MessageBox (NULL,
> (gdb) bt
> #0  w32_abort () at w32fns.c:9360
> #1  0x011990a7 in font_style_symbolic_from_value
> (prop=FONT_WEIGHT_INDEX, val=1600, for_face=0) at font.c:372
> #2  0x01206c94 in Fx_select_font (frame=25765889,
> include_proportional=25765889) at w32font.c:1944

Do you get a similar assertion selecting the font using "X resources",
or using (set-face-attribute 'default nil :face FONT)?




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

* Re: Face remapping on mouse menu
@ 2008-06-16 10:43 Robert J. Chassell
  0 siblings, 0 replies; 12+ messages in thread
From: Robert J. Chassell @ 2008-06-16 10:43 UTC (permalink / raw)
  To: emacs-devel

    > As per my previous email, I've installed a new binding for
    > S-down-mouse-1, which pops up a menu for remapping the default
    > face in the current buffer.  Please let me know if there are any
    > problems.

How does one change the font for a whole frame?

Today's GNU Emacs CVS snapshot, Mon, 2008 Jun 16  09:51 UTC
GNU Emacs 23.0.60.29 (i686-pc-linux-gnu, GTK+ Version 2.12.9)
started with

    emacs -Q -D

-- 
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    bob@rattlesnake.com                         bob@gnu.org
    http://www.rattlesnake.com                  http://www.teak.cc




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

* Re: Face remapping on mouse menu
  2008-06-16  1:25     ` Chong Yidong
@ 2008-06-16 23:03       ` Juanma Barranquero
  0 siblings, 0 replies; 12+ messages in thread
From: Juanma Barranquero @ 2008-06-16 23:03 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, Miles Bader

On Mon, Jun 16, 2008 at 03:25, Chong Yidong <cyd@stupidchicken.com> wrote:

> Do you get a similar assertion selecting the font using "X resources",
> or using (set-face-attribute 'default nil :face FONT)?

It does not fail now (I think Jason has fixed it).

   Juanma




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

end of thread, other threads:[~2008-06-16 23:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-16 10:43 Face remapping on mouse menu Robert J. Chassell
  -- strict thread matches above, loose matches on Subject: below --
2008-06-12  5:26 Chong Yidong
2008-06-12  7:07 ` joakim
2008-06-12  8:21 ` Miles Bader
2008-06-12 15:14 ` Drew Adams
2008-06-12 15:38   ` Chong Yidong
2008-06-12 16:01     ` Drew Adams
2008-06-12 16:17     ` Jason Rumney
2008-06-15 20:08 ` Chong Yidong
2008-06-15 23:55   ` Juanma Barranquero
2008-06-16  1:25     ` Chong Yidong
2008-06-16 23:03       ` Juanma Barranquero

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