all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* make smerge-mode move the point?
@ 2008-01-13 20:14 Dan Nicolaescu
  2008-01-13 21:55 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2008-01-13 20:14 UTC (permalink / raw)
  To: emacs-devel


Wouldn't it be better if smerge-mode moved the point to the first
conflict marker? 

Resolving conflicts is the reason this mode gets turned on, so it would
be nicer for the user if it would move the point to the first conflict.
It would be one less action to do, and it would make it easier to see
there's a conflict.

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

* Re: make smerge-mode move the point?
  2008-01-13 20:14 make smerge-mode move the point? Dan Nicolaescu
@ 2008-01-13 21:55 ` Stefan Monnier
  2008-01-14  0:43   ` Dan Nicolaescu
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-01-13 21:55 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

> Wouldn't it be better if smerge-mode moved the point to the first
> conflict marker? 

> Resolving conflicts is the reason this mode gets turned on, so it would
> be nicer for the user if it would move the point to the first conflict.
> It would be one less action to do, and it would make it easier to see
> there's a conflict.

I think it would be wrong for the `smerge-mode' command to move point.
(De)activating such a minor mode shouldn't move point.

OTOH when smerge-mode gets enabled in response to a VC action, it
probably makes sense to move point, indeed.  So I suggest to add a new
command that activates smerge-mode and moves to the first conflict (and
probably run a hook where the user can place things like
smerge-resolve-all).


        Stefan

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

* Re: make smerge-mode move the point?
  2008-01-13 21:55 ` Stefan Monnier
@ 2008-01-14  0:43   ` Dan Nicolaescu
  2008-01-14  1:55     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2008-01-14  0:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > > Wouldn't it be better if smerge-mode moved the point to the first
  > > conflict marker? 
  > 
  > > Resolving conflicts is the reason this mode gets turned on, so it would
  > > be nicer for the user if it would move the point to the first conflict.
  > > It would be one less action to do, and it would make it easier to see
  > > there's a conflict.
  > 
  > I think it would be wrong for the `smerge-mode' command to move point.
  > (De)activating such a minor mode shouldn't move point.
  > 
  > OTOH when smerge-mode gets enabled in response to a VC action, it
  > probably makes sense to move point, indeed.  So I suggest to add a new
  > command that activates smerge-mode and moves to the first conflict 

Like this?

;;;###autoload
(defun smerge-auto ()
  "Turn on `smerge-mode' and move point to first conflict marker.
If no conflict maker is found, turn off `smerge-mode'."
  (smerge-mode 1)
  (condition-case nil
      (smerge-next)
    (error (smerge-auto-leave))))

  > (and probably run a hook where the user can place things like
  > smerge-resolve-all).

Not sure what you mean here. Is this for something like
vc-svn-resolve-when-done, or something else?

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

* Re: make smerge-mode move the point?
  2008-01-14  0:43   ` Dan Nicolaescu
@ 2008-01-14  1:55     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2008-01-14  1:55 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

>> OTOH when smerge-mode gets enabled in response to a VC action, it
>> probably makes sense to move point, indeed.  So I suggest to add a new
>> command that activates smerge-mode and moves to the first conflict 

> Like this?

> ;;;###autoload
> (defun smerge-auto ()
>   "Turn on `smerge-mode' and move point to first conflict marker.
> If no conflict maker is found, turn off `smerge-mode'."
>   (smerge-mode 1)
>   (condition-case nil
>       (smerge-next)
>     (error (smerge-auto-leave))))

Looks OK.

>> (and probably run a hook where the user can place things like
>> smerge-resolve-all).

> Not sure what you mean here. Is this for something like
> vc-svn-resolve-when-done, or something else?

No, as the docstring of smerge-resolve-all explains: "Perform automatic
resolution on all conflicts".


        Stefan

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

end of thread, other threads:[~2008-01-14  1:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-13 20:14 make smerge-mode move the point? Dan Nicolaescu
2008-01-13 21:55 ` Stefan Monnier
2008-01-14  0:43   ` Dan Nicolaescu
2008-01-14  1:55     ` Stefan Monnier

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.