all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Marking squares
@ 2013-02-02  2:47 Lars Magne Ingebrigtsen
  2013-02-02  3:06 ` Xue Fuqiao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2013-02-02  2:47 UTC (permalink / raw)
  To: emacs-devel

I'm contemplating implementing a very, very simple image editor in
Emacs, which would mainly just allow image cropping.  To do that, it
would be nice if `mouse-drag-region' would allow highlighting a "box"
instead of the lines between mark and the mouse position.

So my question is -- does Emacs have an option of highlighting
rectangles instead of "the region"?  It might be useful when using
commands like `C-x r k', too, perhaps.

I've looked at the code, but I can't find anything obvious
immediately...

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




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

* Re: Marking squares
  2013-02-02  2:47 Marking squares Lars Magne Ingebrigtsen
@ 2013-02-02  3:06 ` Xue Fuqiao
  2013-02-02  8:08   ` Xue Fuqiao
  2013-02-02  8:37   ` Eli Zaretskii
  2013-02-02  7:06 ` Thierry Volpiatto
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Xue Fuqiao @ 2013-02-02  3:06 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

On Sat, 02 Feb 2013 03:47:59 +0100
Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> So my question is -- does Emacs have an option of highlighting
> rectangles instead of "the region"?  It might be useful when using
> commands like `C-x r k', too, perhaps.

   CUA mode provides enhanced rectangle support with visible rectangle
highlighting.  Use `C-RET' to start a rectangle, extend it using the
movement commands, and cut or copy it using `C-x' or `C-c'.  And you
can also have a look at this library:

http://www.emacswiki.org/emacs/rect-mark.el

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: Marking squares
  2013-02-02  2:47 Marking squares Lars Magne Ingebrigtsen
  2013-02-02  3:06 ` Xue Fuqiao
@ 2013-02-02  7:06 ` Thierry Volpiatto
  2013-02-02  8:26 ` joakim
  2013-02-02  8:35 ` Eli Zaretskii
  3 siblings, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2013-02-02  7:06 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I'm contemplating implementing a very, very simple image editor in
> Emacs, which would mainly just allow image cropping.  To do that, it
> would be nice if `mouse-drag-region' would allow highlighting a "box"
> instead of the lines between mark and the mouse position.
>
> So my question is -- does Emacs have an option of highlighting
> rectangles instead of "the region"?  It might be useful when using
> commands like `C-x r k', too, perhaps.
>
> I've looked at the code, but I can't find anything obvious
> immediately...
Maybe https://github.com/jave/dragbox.git ?

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: Marking squares
  2013-02-02  3:06 ` Xue Fuqiao
@ 2013-02-02  8:08   ` Xue Fuqiao
  2013-02-02  8:37   ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Xue Fuqiao @ 2013-02-02  8:08 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: Lars Magne Ingebrigtsen, emacs-devel

On Sat, 2 Feb 2013 11:06:44 +0800
Xue Fuqiao <xfq.free@gmail.com> wrote:

> On Sat, 02 Feb 2013 03:47:59 +0100
> Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> 
> > So my question is -- does Emacs have an option of highlighting
> > rectangles instead of "the region"?  It might be useful when using
> > commands like `C-x r k', too, perhaps.
> 
>    CUA mode provides enhanced rectangle support with visible rectangle
> highlighting.  Use `C-RET' to start a rectangle, extend it using the
> movement commands, and cut or copy it using `C-x' or `C-c'.  And you
> can also have a look at this library:
> 
> http://www.emacswiki.org/emacs/rect-mark.el

Or do you mean something like `doc-view-set-slice-using-mouse'?

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: Marking squares
  2013-02-02  2:47 Marking squares Lars Magne Ingebrigtsen
  2013-02-02  3:06 ` Xue Fuqiao
  2013-02-02  7:06 ` Thierry Volpiatto
@ 2013-02-02  8:26 ` joakim
  2013-02-02  8:35 ` Eli Zaretskii
  3 siblings, 0 replies; 8+ messages in thread
From: joakim @ 2013-02-02  8:26 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I'm contemplating implementing a very, very simple image editor in
> Emacs, which would mainly just allow image cropping.  To do that, it
> would be nice if `mouse-drag-region' would allow highlighting a "box"
> instead of the lines between mark and the mouse position.
>
> So my question is -- does Emacs have an option of highlighting
> rectangles instead of "the region"?  It might be useful when using
> commands like `C-x r k', too, perhaps.
>
> I've looked at the code, but I can't find anything obvious
> immediately...

I'm not sure if it's relevant but heres my approach:
https://github.com/jave/dragbox

You view the image wrapped in SVG. Then you can mark a region, drawn
with a svg rectangle, using the mouse. Then you can use the region for
whatever purpose. I use it to select regions for OCR.

-- 
Joakim Verona



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

* Re: Marking squares
  2013-02-02  2:47 Marking squares Lars Magne Ingebrigtsen
                   ` (2 preceding siblings ...)
  2013-02-02  8:26 ` joakim
@ 2013-02-02  8:35 ` Eli Zaretskii
  3 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2013-02-02  8:35 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 02 Feb 2013 03:47:59 +0100
> 
> I'm contemplating implementing a very, very simple image editor in
> Emacs, which would mainly just allow image cropping.  To do that, it
> would be nice if `mouse-drag-region' would allow highlighting a "box"
> instead of the lines between mark and the mouse position.

I'm confused: "lines between mark and the mouse position" seems to
refer to region highlighting, whereas you are talking about
highlighting parts of an image, I think.  An image is a single line
for region marking purposes, so I wonder how these two issues could be
related.  What am I missing?

> So my question is -- does Emacs have an option of highlighting
> rectangles instead of "the region"?  It might be useful when using
> commands like `C-x r k', too, perhaps.

Rectangles of text or rectangles of pixels?  Emacs doesn't normally
work at pixel level, except at the lowest level of its
display-specific back end, like xterm.c and w32term.c, which I doubt
is relevant to what you are looking for.



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

* Re: Marking squares
  2013-02-02  3:06 ` Xue Fuqiao
  2013-02-02  8:08   ` Xue Fuqiao
@ 2013-02-02  8:37   ` Eli Zaretskii
  2013-02-02 10:02     ` Xue Fuqiao
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2013-02-02  8:37 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: larsi, emacs-devel

> Date: Sat, 2 Feb 2013 11:06:44 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> Cc: emacs-devel@gnu.org
> 
> On Sat, 02 Feb 2013 03:47:59 +0100
> Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> 
> > So my question is -- does Emacs have an option of highlighting
> > rectangles instead of "the region"?  It might be useful when using
> > commands like `C-x r k', too, perhaps.
> 
>    CUA mode provides enhanced rectangle support with visible rectangle
> highlighting.

If you look at CUA Rectangle mode code, you will see that it has
nothing to do with highlighting.  It creates an _illusion_ of
highlighting by placing overlays at some portions of text, and moving
those overlays as mouse or point move.



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

* Re: Marking squares
  2013-02-02  8:37   ` Eli Zaretskii
@ 2013-02-02 10:02     ` Xue Fuqiao
  0 siblings, 0 replies; 8+ messages in thread
From: Xue Fuqiao @ 2013-02-02 10:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, emacs-devel

On Sat, 02 Feb 2013 10:37:08 +0200
Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Sat, 2 Feb 2013 11:06:44 +0800
> > From: Xue Fuqiao <xfq.free@gmail.com>
> > Cc: emacs-devel@gnu.org
> > 
> >    CUA mode provides enhanced rectangle support with visible rectangle
> > highlighting.
> 
> If you look at CUA Rectangle mode code, you will see that it has
> nothing to do with highlighting.  It creates an _illusion_ of
> highlighting by placing overlays at some portions of text, and moving
> those overlays as mouse or point move.

You're right, that was my carelessness.  I haven't used CUA mode for a
long time.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

end of thread, other threads:[~2013-02-02 10:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02  2:47 Marking squares Lars Magne Ingebrigtsen
2013-02-02  3:06 ` Xue Fuqiao
2013-02-02  8:08   ` Xue Fuqiao
2013-02-02  8:37   ` Eli Zaretskii
2013-02-02 10:02     ` Xue Fuqiao
2013-02-02  7:06 ` Thierry Volpiatto
2013-02-02  8:26 ` joakim
2013-02-02  8:35 ` Eli Zaretskii

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.