emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make smerge-mode move the point?


From: Dan Nicolaescu
Subject: Re: make smerge-mode move the point?
Date: Sun, 13 Jan 2008 16:43:47 -0800

Stefan Monnier <address@hidden> 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]