unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org, monnier+gnu/emacs@cs.yale.edu,
	monnier+gnu/emacs@rum.cs.yale.edu
Subject: Re: popup menu support for smerge-mode
Date: 19 Sep 2003 11:57:47 -0400	[thread overview]
Message-ID: <jwv8yoku5xg.fsf@vor.iro.umontreal.ca> (raw)
In-Reply-To: <20030919.182502.242160171.jet@gyve.org>

>>>> It's simpler to just place a single overlay over
>>>> the whole conflict (including markers).
>> 
>>> I have not done as you wrote.
>>> I expect "Keep Current" works on the region which is highlighted.
>> 
>> The highlight does not have to apply to the same region as the
>> `keymap' overlay.

> I think applying highlight and keymap to the same region is not so
> complex....probably I have not understood the intent of your
> suggestions.

You justified using 2 or 3 overlays over each alternative rather than
a single one over the whole conflict by saying that "keep current"
should work on the region which is highlighted.

What I meant to reply is that you could place a single overlay over the
whole conflict with a `keymap' property and then when mouse-3 is pressed
and you add the highlight, you can create a new overlay that covers only
the relevant alternative and place the highlight there: the highlight
and the keymap do not have to apply to the same region.

If you place the overlay over the whole conflict, then the "current"
alternative can be empty without any problem (other than the fact
that the highlighting will not aplly to any character) so you
don't need smerge-delete-current.

BTW, I don't understand this `smerge-delete-current'.  It seems to take
a conflict with a non-empty current alternative and replaces it with
a conflict with an empty current alternative, is that right ?  What I said
I need is to take a conflict where the current alternative is empty and
select that alternative (i.e. just delete the whole conflict).

> I've removed smerge-reset-all-overlays. Instead I use evaporate property
> of overlays. When an overlay is created, I put t to evaporate property of 
> the overlay. The overlay will be deleted when its region becomes empty.

I was thinking of suggesting that but wasn't sure whether it'd work.
Does it ?  If it does, it's probably the simplest alternative, indeed.

> +(defvar smerge-overlays nil "Overlays managed by smerge-mode")
> +(easy-mmode-defmap smerge-popup-menu-map
> +  `((,smerge-command-prefix . ,smerge-basic-map)

What is this line for ?

> +    ([down-mouse-3] . smerge-activate-popup-menu))
> +  "Keymap for popup menu appeared on conflicts area.")
> +(easy-menu-define smerge-mode-popup-menu smerge-popup-menu-map

This adds the popup menu inside smerge-popup-menu-map which I don't
think you want because you popup smerge-mode-popup-menu
from smerge-activate-popup-menu.  I guess it doesn't hurt because
it's placed somewhere in smerge-popup-menu-map where it has no effect ?
Or maybe it adds the popup menu in the menubar when point is in an area
covered by an overlay with the keymap property ?  Ahh... probably not
because you use a `nil' name.  In any case, you should use another name
for the popup-menu-map (or just leave it nil because you don't need it).

> +(defun smerge-reset-all-overlays ()
> +  "Delete all overlays of smerge-mode and put overlays on the all conflicts again."
> +  (smerge-delete-overlays)
> +  (save-excursion 
> +    (goto-char (point-min))
> +    (while (smerge-find-conflict)
> +      (smerge-put-overlays (cddr (match-data))))))

Left over?


        Stefan

  reply	other threads:[~2003-09-19 15:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10 12:16 popup menu support for smerge-mode Masatake YAMATO
2003-01-11 19:41 ` Stefan Monnier
2003-08-24  6:03   ` Masatake YAMATO
2003-08-24 14:42     ` Stefan Monnier
2003-09-18  8:54       ` Masatake YAMATO
2003-09-18 15:27         ` Stefan Monnier
2003-09-19  9:25           ` Masatake YAMATO
2003-09-19 15:57             ` Stefan Monnier [this message]
2003-09-26  7:58               ` Masatake YAMATO
2003-09-26  8:44                 ` Miles Bader
2003-09-26  8:53                   ` Behavior of evaporate Masatake YAMATO
2003-09-26  9:05                     ` Miles Bader
2003-09-26  9:17                     ` David Kastrup
2003-09-26 15:59                       ` Stefan Monnier
2003-09-27  2:31                       ` Richard Stallman
2003-09-30 20:56                         ` Alex Schroeder
2003-10-20 21:23                 ` popup menu support for smerge-mode Stefan Monnier
2004-03-10  4:32                   ` Masatake YAMATO
2004-03-11  7:00                   ` Masatake YAMATO
2003-10-14  3:59               ` Masatake YAMATO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8yoku5xg.fsf@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=monnier+gnu/emacs@cs.yale.edu \
    --cc=monnier+gnu/emacs@rum.cs.yale.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).