all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Cursor on images not visible
@ 2006-02-07 10:57 Juri Linkov
  2006-02-09 17:48 ` Richard M. Stallman
  0 siblings, 1 reply; 17+ messages in thread
From: Juri Linkov @ 2006-02-07 10:57 UTC (permalink / raw)


Moving point on small thumbnail images in the Emacs buffer reveals the
following problem: the cursor around the image is not visible when the
cursor type is box and the image has a dark background, or when the cursor
type is bar and the image has a light background.

But when the image displayed in Emacs has the value of `:margin' greater
than 0, then the cursor is visible (as a frame around the image).

So how about changing the default value of the property `:margin'
from 0 to 1?  This is better than fixing all packages (e.g. iimage.el
and cus-edit.el for button images) and adding `:margin 1' to every
image specification.

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: Cursor on images not visible
  2006-02-07 10:57 Cursor on images not visible Juri Linkov
@ 2006-02-09 17:48 ` Richard M. Stallman
  2006-02-09 19:18   ` Juri Linkov
  2006-02-10 10:17   ` Mathias Dahl
  0 siblings, 2 replies; 17+ messages in thread
From: Richard M. Stallman @ 2006-02-09 17:48 UTC (permalink / raw)
  Cc: emacs-devel

    So how about changing the default value of the property `:margin'
    from 0 to 1?  This is better than fixing all packages (e.g. iimage.el
    and cus-edit.el for button images) and adding `:margin 1' to every
    image specification.

That sounds rather drastic--do we know if it will break anything?
Can you find all the Emacs features that use images, and see
if any of them would have a problem with this change?

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

* Re: Cursor on images not visible
  2006-02-09 17:48 ` Richard M. Stallman
@ 2006-02-09 19:18   ` Juri Linkov
  2006-02-10 23:02     ` Richard M. Stallman
  2006-02-10 10:17   ` Mathias Dahl
  1 sibling, 1 reply; 17+ messages in thread
From: Juri Linkov @ 2006-02-09 19:18 UTC (permalink / raw)
  Cc: emacs-devel

>     So how about changing the default value of the property `:margin'
>     from 0 to 1?  This is better than fixing all packages (e.g. iimage.el
>     and cus-edit.el for button images) and adding `:margin 1' to every
>     image specification.
>
> That sounds rather drastic--do we know if it will break anything?
> Can you find all the Emacs features that use images, and see
> if any of them would have a problem with this change?

This also affects all packages outside Emacs, so maybe a better solution
is to try to change code that draws a frame around images under the cursor
to draw it as if the image had a 1-pixel margin?

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: Cursor on images not visible
  2006-02-09 17:48 ` Richard M. Stallman
  2006-02-09 19:18   ` Juri Linkov
@ 2006-02-10 10:17   ` Mathias Dahl
  1 sibling, 0 replies; 17+ messages in thread
From: Mathias Dahl @ 2006-02-10 10:17 UTC (permalink / raw)


"Richard M. Stallman" <rms@gnu.org> writes:

>     So how about changing the default value of the property `:margin'
>     from 0 to 1?  This is better than fixing all packages (e.g. iimage.el
>     and cus-edit.el for button images) and adding `:margin 1' to every
>     image specification.
>
> That sounds rather drastic--do we know if it will break anything?
> Can you find all the Emacs features that use images, and see
> if any of them would have a problem with this change?

I agree. In tumme there is a defcustom for the margin so that the user
can decide how much "space" he wants around the thumbnails. Is it so
bad to require other packages to do something similar?

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

* Re: Cursor on images not visible
  2006-02-09 19:18   ` Juri Linkov
@ 2006-02-10 23:02     ` Richard M. Stallman
  2006-02-11 18:51       ` Kim F. Storm
  0 siblings, 1 reply; 17+ messages in thread
From: Richard M. Stallman @ 2006-02-10 23:02 UTC (permalink / raw)
  Cc: emacs-devel

    This also affects all packages outside Emacs, so maybe a better solution
    is to try to change code that draws a frame around images under the cursor
    to draw it as if the image had a 1-pixel margin?

It sounds good to me, if it looks good in practice.
Would this ever look bad due to overlapping adjoining images?
Maybe that could happen with image slices.

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

* Re: Cursor on images not visible
  2006-02-10 23:02     ` Richard M. Stallman
@ 2006-02-11 18:51       ` Kim F. Storm
  2006-02-12  0:57         ` David Kastrup
                           ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Kim F. Storm @ 2006-02-11 18:51 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel

"Richard M. Stallman" <rms@gnu.org> writes:

>     This also affects all packages outside Emacs, so maybe a better solution
>     is to try to change code that draws a frame around images under the cursor
>     to draw it as if the image had a 1-pixel margin?
>
> It sounds good to me, if it looks good in practice.
> Would this ever look bad due to overlapping adjoining images?
> Maybe that could happen with image slices.

I think it would be very bad to always add a margin to images.

If we ever want to make a full web browser in emacs, we definitely
need to be able to "glue" images together without any margins around
them.  (I have some ideas how to modify the redisplay engine to allow
this, but that for emacs 24.x)...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Cursor on images not visible
  2006-02-11 18:51       ` Kim F. Storm
@ 2006-02-12  0:57         ` David Kastrup
  2006-02-12 19:28         ` Richard M. Stallman
  2006-02-13  0:40         ` David Kastrup
  2 siblings, 0 replies; 17+ messages in thread
From: David Kastrup @ 2006-02-12  0:57 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> "Richard M. Stallman" <rms@gnu.org> writes:
>
>>     This also affects all packages outside Emacs, so maybe a better
>>     solution is to try to change code that draws a frame around
>>     images under the cursor to draw it as if the image had a
>>     1-pixel margin?
>>
>> It sounds good to me, if it looks good in practice.  Would this
>> ever look bad due to overlapping adjoining images?  Maybe that
>> could happen with image slices.
>
> I think it would be very bad to always add a margin to images.

Agreed.

> If we ever want to make a full web browser in emacs, we definitely
> need to be able to "glue" images together without any margins around
> them.  (I have some ideas how to modify the redisplay engine to
> allow this, but that for emacs 24.x)...

It would also be necessary for sliced large graphics (the slicing
serves for being able to place the cursor on subelements of the
graphics).  There will probably be table support in that manner for
preview-latex at one point of time.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Cursor on images not visible
  2006-02-11 18:51       ` Kim F. Storm
  2006-02-12  0:57         ` David Kastrup
@ 2006-02-12 19:28         ` Richard M. Stallman
  2006-02-14  1:42           ` Juri Linkov
  2006-02-13  0:40         ` David Kastrup
  2 siblings, 1 reply; 17+ messages in thread
From: Richard M. Stallman @ 2006-02-12 19:28 UTC (permalink / raw)
  Cc: juri, emacs-devel

    If we ever want to make a full web browser in emacs, we definitely
    need to be able to "glue" images together without any margins around
    them.  (I have some ideas how to modify the redisplay engine to allow
    this, but that for emacs 24.x)...

Ok, so that solution is out.

Should we change some specific packages now to add some margins?

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

* Re: Cursor on images not visible
  2006-02-11 18:51       ` Kim F. Storm
  2006-02-12  0:57         ` David Kastrup
  2006-02-12 19:28         ` Richard M. Stallman
@ 2006-02-13  0:40         ` David Kastrup
  2006-02-15 12:51           ` Kim F. Storm
  2 siblings, 1 reply; 17+ messages in thread
From: David Kastrup @ 2006-02-13  0:40 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> "Richard M. Stallman" <rms@gnu.org> writes:
>
>>     This also affects all packages outside Emacs, so maybe a better
>>     solution is to try to change code that draws a frame around
>>     images under the cursor to draw it as if the image had a
>>     1-pixel margin?
>>
>> It sounds good to me, if it looks good in practice.
>> Would this ever look bad due to overlapping adjoining images?
>> Maybe that could happen with image slices.
>
> I think it would be very bad to always add a margin to images.
>
> If we ever want to make a full web browser in emacs, we definitely
> need to be able to "glue" images together without any margins around
> them.  (I have some ideas how to modify the redisplay engine to
> allow this, but that for emacs 24.x)...

Apropos image slices: adding a margin could possibly be implemented by
image slices that happen to be larger than the image itself: the
additional area would then get filled with the background color.

I have no idea whether this would work with the current code, but it
seems like a straightforward extension of the slice semantics.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Cursor on images not visible
  2006-02-12 19:28         ` Richard M. Stallman
@ 2006-02-14  1:42           ` Juri Linkov
  2006-02-14  9:20             ` martin rudalics
  2006-02-14 22:17             ` Richard M. Stallman
  0 siblings, 2 replies; 17+ messages in thread
From: Juri Linkov @ 2006-02-14  1:42 UTC (permalink / raw)
  Cc: emacs-devel, storm

>     If we ever want to make a full web browser in emacs, we definitely
>     need to be able to "glue" images together without any margins around
>     them.  (I have some ideas how to modify the redisplay engine to allow
>     this, but that for emacs 24.x)...
>
> Ok, so that solution is out.
>
> Should we change some specific packages now to add some margins?

The file that needs this the most is wid-edit.el.  When the cursor type is
`bar', typing TAB repeatedly on a column of checkboxes for face attributes
in the face customization buffer has no visual feedback at all.  I propose
the patch below to add 1-pixel margin around checkbox images.

Another place where I noticed this problem is thumbnail packages.
This will be fixed soon separately.

Index: lisp/wid-edit.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.163
diff -c -r1.163 wid-edit.el
*** lisp/wid-edit.el	6 Feb 2006 14:33:35 -0000	1.163
--- lisp/wid-edit.el	14 Feb 2006 01:35:32 -0000
***************
*** 2158,2163 ****
--- 2158,2164 ----
  			   :background "grey75"	; like default mode line
  			   :foreground "black"
  			   :relief -2
+ 			   :margin 1
  			   :ascent 'center)
    :off "[ ]"
    :off-glyph '(create-image (make-string 8 0)
***************
*** 2165,2170 ****
--- 2166,2172 ----
  			    :background "grey75"
  			    :foreground "black"
  			    :relief -2
+ 			    :margin 1
  			    :ascent 'center)
    :help-echo "Toggle this item."
    :action 'widget-checkbox-action)

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: Cursor on images not visible
  2006-02-14  1:42           ` Juri Linkov
@ 2006-02-14  9:20             ` martin rudalics
  2006-02-14 17:46               ` Juri Linkov
  2006-02-14 21:27               ` Kim F. Storm
  2006-02-14 22:17             ` Richard M. Stallman
  1 sibling, 2 replies; 17+ messages in thread
From: martin rudalics @ 2006-02-14  9:20 UTC (permalink / raw)
  Cc: storm, rms, emacs-devel

 > The file that needs this the most is wid-edit.el.  When the cursor type is
 > `bar', typing TAB repeatedly on a column of checkboxes for face attributes
 > in the face customization buffer has no visual feedback at all.

Personally, I have even more problems distinguishing active checkboxes
from inactive ones, the ticks are hardly visible.  Maybe you could do
something about this too?  I currently use

(define-widget 'checkbox 'toggle
   "A checkbox toggle."
   :button-suffix ""
   :button-prefix ""
   :format "%[%v%]"
   :on "[X]"
   ;; We could probably do the same job as the images using single
   ;; space characters in a boxed face with a stretch specification to
   ;; make them square.
   :on-glyph '(create-image (make-string 8 0)
			   'xbm t :width 8 :height 8
			   :background "black"	; like default mode line
			   :foreground "black"
			   :relief -1
			   :ascent 'center)
   :off "[ ]"
   :off-glyph '(create-image (make-string 8 0)
			    'xbm t :width 8 :height 8
			    :background "grey"
			    :foreground "grey"
			    :relief 1
			    :ascent 'center)
   :help-echo "Toggle this item."
   :action 'widget-checkbox-action)

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

* Re: Cursor on images not visible
  2006-02-14  9:20             ` martin rudalics
@ 2006-02-14 17:46               ` Juri Linkov
  2006-02-20  0:54                 ` Juri Linkov
  2006-02-14 21:27               ` Kim F. Storm
  1 sibling, 1 reply; 17+ messages in thread
From: Juri Linkov @ 2006-02-14 17:46 UTC (permalink / raw)
  Cc: storm, rms, emacs-devel

> Personally, I have even more problems distinguishing active checkboxes
> from inactive ones, the ticks are hardly visible.  Maybe you could do
> something about this too?  I currently use

Your checkbox images don't look too intuitive on the black background.

I have seen different checkbox images: ticks, crosses, percent signs,
filled areas.  The most widespread symbol currently is a tick.  There is
even a Unicode symbol for it: U+2611 - BALLOT BOX WITH CHECK.

So I think the current default value is ok.  But definitely it should be
easily customizable.  I noticed that in the same file wid-edit.el there is
the following definition of the radio button:

(define-widget 'radio-button 'toggle
  "A radio button for use in the `radio' widget."
  :notify 'widget-radio-button-notify
  :format "%[%v%]"
  :button-suffix ""
  :button-prefix ""
  :on "(*)"
  :on-glyph "radio1"
  :off "( )"
  :off-glyph "radio0")

After putting images of two states of the radio button to the files
emacs/etc/images/radio0.xpm and emacs/etc/images/radio1.xpm, customize
displayed them instead of their textual representations "(*)" and "( )".
I wonder why these images isn't in CVS?

It is possible to do the same for checkboxes and to install their default
images to emacs/etc/images/check0.xpm and emacs/etc/images/check1.xpm.

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: Cursor on images not visible
  2006-02-14  9:20             ` martin rudalics
  2006-02-14 17:46               ` Juri Linkov
@ 2006-02-14 21:27               ` Kim F. Storm
  2006-02-15 10:14                 ` martin rudalics
  1 sibling, 1 reply; 17+ messages in thread
From: Kim F. Storm @ 2006-02-14 21:27 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

martin rudalics <rudalics@gmx.at> writes:

> Personally, I have even more problems distinguishing active checkboxes
> from inactive ones, the ticks are hardly visible.  

This puzzles me.  The ticks are VERY visible to me.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Cursor on images not visible
  2006-02-14  1:42           ` Juri Linkov
  2006-02-14  9:20             ` martin rudalics
@ 2006-02-14 22:17             ` Richard M. Stallman
  1 sibling, 0 replies; 17+ messages in thread
From: Richard M. Stallman @ 2006-02-14 22:17 UTC (permalink / raw)
  Cc: emacs-devel, storm

    The file that needs this the most is wid-edit.el.  When the cursor type is
    `bar', typing TAB repeatedly on a column of checkboxes for face attributes
    in the face customization buffer has no visual feedback at all.  I propose
    the patch below to add 1-pixel margin around checkbox images.

Please do this in a week if nobody objects.

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

* Re: Cursor on images not visible
  2006-02-14 21:27               ` Kim F. Storm
@ 2006-02-15 10:14                 ` martin rudalics
  0 siblings, 0 replies; 17+ messages in thread
From: martin rudalics @ 2006-02-15 10:14 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

 >>Personally, I have even more problems distinguishing active checkboxes
 >>from inactive ones, the ticks are hardly visible.
 >
 >
 > This puzzles me.  The ticks are VERY visible to me.

Probably my eyesight is deteriorating.

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

* Re: Cursor on images not visible
  2006-02-13  0:40         ` David Kastrup
@ 2006-02-15 12:51           ` Kim F. Storm
  0 siblings, 0 replies; 17+ messages in thread
From: Kim F. Storm @ 2006-02-15 12:51 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel, rms, Kim F. Storm

David Kastrup <dak@gnu.org> writes:

> Apropos image slices: adding a margin could possibly be implemented by
> image slices that happen to be larger than the image itself: the
> additional area would then get filled with the background color.

Yes, but this only works for whole images where you know the size of
the image in advance.  You can obtain that info, but I don't think it
is worth the trouble.  Also, it don't work if you want to put
a margin around a sub-slice of an image.

To add a margin around an image or image slice, you can just put a
face with a box property on the image.

-- 
Kim F. Storm  http://www.cua.dk

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

* Re: Cursor on images not visible
  2006-02-14 17:46               ` Juri Linkov
@ 2006-02-20  0:54                 ` Juri Linkov
  0 siblings, 0 replies; 17+ messages in thread
From: Juri Linkov @ 2006-02-20  0:54 UTC (permalink / raw)
  Cc: emacs-devel, rms, storm

>> Personally, I have even more problems distinguishing active checkboxes
>> from inactive ones, the ticks are hardly visible.  Maybe you could do
>> something about this too?  I currently use
>
> I think the current default value is ok.  But definitely it should be
> easily customizable.

The patch below makes possible the customization of the checkbox's
appearance.  It checks whether files emacs/etc/images/custom/check0.xpm
and emacs/etc/images/custom/check1.xpm exist, then uses them.  Otherwise,
it creates the checkbox image on the fly, exactly as it does now.

> After putting images of two states of the radio button to the files
> emacs/etc/images/radio0.xpm and emacs/etc/images/radio1.xpm, customize
> displayed them instead of their textual representations "(*)" and "( )".
> I wonder why these images isn't in CVS?

I think if someone wants to add images for radio buttons, then the correct
place is emacs/etc/images/custom, not the current emacs/etc/custom.
The same patch below checks for emacs/etc/images/custom, and also
starts using the new variable image-load-path:

Index: lisp/wid-edit.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.166
diff -c -r1.166 wid-edit.el
*** lisp/wid-edit.el	16 Feb 2006 15:58:32 -0000	1.166
--- lisp/wid-edit.el	20 Feb 2006 00:54:05 -0000
***************
*** 627,633 ****
  	 image)
  	((stringp image)
  	 ;; A string.  Look it up in relevant directories.
! 	 (let* ((load-path (cons widget-image-directory load-path))
  		specs)
  	   (dolist (elt widget-image-conversion)
  	     (dolist (ext (cdr elt))
--- 627,637 ----
  	 image)
  	((stringp image)
  	 ;; A string.  Look it up in relevant directories.
! 	 (let* ((image-load-path
! 		 (cons (file-name-as-directory
! 			(expand-file-name "images/custom" data-directory))
! 		       (cons widget-image-directory
! 			     image-load-path)))
  		specs)
  	   (dolist (elt widget-image-conversion)
  	     (dolist (ext (cdr elt))
***************
*** 2162,2180 ****
    ;; We could probably do the same job as the images using single
    ;; space characters in a boxed face with a stretch specification to
    ;; make them square.
!   :on-glyph '(create-image "\300\300\141\143\067\076\034\030"
! 			   'xbm t :width 8 :height 8
! 			   :background "grey75"	; like default mode line
! 			   :foreground "black"
! 			   :relief -2
! 			   :ascent 'center)
    :off "[ ]"
!   :off-glyph '(create-image (make-string 8 0)
! 			    'xbm t :width 8 :height 8
! 			    :background "grey75"
! 			    :foreground "black"
! 			    :relief -2
! 			    :ascent 'center)
    :help-echo "Toggle this item."
    :action 'widget-checkbox-action)
  
--- 2164,2189 ----
    ;; We could probably do the same job as the images using single
    ;; space characters in a boxed face with a stretch specification to
    ;; make them square.
!   :on-glyph '(if (widget-image-find "check1")
! 		 "check1"
! 	       (create-image "\300\300\141\143\067\076\034\030"
! 			     'xbm t :width 8 :height 8
! 			     :background "grey75" ; like default mode line
! 			     :foreground "black"
! 			     :relief -2
! 			     :margin 1
! 			     :ascent 'center)
! 	       )
    :off "[ ]"
!   :off-glyph '(if (widget-image-find "check0")
! 		  "check0"
! 		(create-image (make-string 8 0)
! 			      'xbm t :width 8 :height 8
! 			      :background "grey75"
! 			      :foreground "black"
! 			      :relief -2
! 			      :margin 1
! 			      :ascent 'center))
    :help-echo "Toggle this item."
    :action 'widget-checkbox-action)
  
-- 
Juri Linkov
http://www.jurta.org/emacs/

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

end of thread, other threads:[~2006-02-20  0:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07 10:57 Cursor on images not visible Juri Linkov
2006-02-09 17:48 ` Richard M. Stallman
2006-02-09 19:18   ` Juri Linkov
2006-02-10 23:02     ` Richard M. Stallman
2006-02-11 18:51       ` Kim F. Storm
2006-02-12  0:57         ` David Kastrup
2006-02-12 19:28         ` Richard M. Stallman
2006-02-14  1:42           ` Juri Linkov
2006-02-14  9:20             ` martin rudalics
2006-02-14 17:46               ` Juri Linkov
2006-02-20  0:54                 ` Juri Linkov
2006-02-14 21:27               ` Kim F. Storm
2006-02-15 10:14                 ` martin rudalics
2006-02-14 22:17             ` Richard M. Stallman
2006-02-13  0:40         ` David Kastrup
2006-02-15 12:51           ` Kim F. Storm
2006-02-10 10:17   ` Mathias Dahl

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.