This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-06
Channels
- # babashka (31)
- # beginners (108)
- # calva (6)
- # clj-kondo (62)
- # cljsrn (5)
- # clojure (29)
- # clojure-australia (2)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-uk (7)
- # clojurescript (25)
- # code-reviews (1)
- # datomic (13)
- # deps-new (7)
- # editors (1)
- # emacs (31)
- # figwheel-main (3)
- # garden (4)
- # graalvm (18)
- # helix (10)
- # improve-getting-started (12)
- # jobs (3)
- # lsp (20)
- # malli (12)
- # off-topic (7)
- # polylith (30)
- # re-frame (10)
- # remote-jobs (2)
- # shadow-cljs (18)
- # spacemacs (5)
- # sql (11)
- # tools-deps (10)
- # vim (9)
- # xtdb (1)
how do people deal with resolving conflicts with Emacs? for example I use smartparens-strict-mode and when I open a file with conflicts I always have to disable that
I solve them by "force-deleting" lines for example for the conflict
>>>
a
===
b
<<<<<
I force-delete all lines but b
Works pretty well for most conflicts I get. Sometimes I might have to do some surgical edits. At least under my setup paredit
doesn't get in the way i.e. it can keep working even in face of slightly broken codemy force-delete isn't particularly fancy
(defun vemv/delete-this-line ()
(end-of-line)
(cua-set-mark)
(previous-line)
(end-of-line)
(call-interactively 'kill-region))
actually I just found out that by default smerge-mode is already enabled
when I open a file with conflicts, so I can probably just use that (have to try if smartparens is happy with that though)
the only issue I guess is that the keybindings are a bit weird, I think it would be nicer if it just opened a read only buffer with simple keybindings to do the various actions
but I guess I can do it myself with the right mapping
there are some more rare cases in which I have to actually merge manually changes from the two versions, but I guess I can just first pick one and then apply the manual changes
yeah I know, which is what I've done until now
but it's quite annoying
there is also a magit-diff-mode-hook I could probably use
to turn it off automatically otherwise
mm actually maybe that's something else though
yeah no I don't think it opens the file in magit-diff-mode actually
that's the mode to look at diffs
but I can maybe add a hook to smerge-mode since that's enabled
> [...] you could use Ediff, which uses separate buffers for the different versions of the file. To resolve conflicts in a file using Ediff press e
while point is on such a file in the status buffer.
>
From the magit manual https://magit.vc/manual/magit/Resolving-Conflicts.html
I've tried smerge but didn't like the ergonomics as much
yeah I could try ediff again
I’m just using smerge on mine and setting some shortcuts to use them
:leader
"g n" #'smerge-next
"g <up>" #'smerge-keep-upper
"g <down>" #'smerge-keep-lower
"g <left>" #'smerge-keep-all
ah cool @U028TA3H3PA,does it mean your buffer is also read only?
It’s definitely read/write for me and that’s probably beneficial as it’s often I have to resolve the conflicts somewhat manually at times
I guess it would be nice to just have a different mode to solve conflicts, or just automatically disable things that get in the way