Skip to main content
20 events
when toggle format what by license comment
Apr 24, 2021 at 18:36 comment added Hi-Angel @alper as you wish, but in case you count on me to solve this bug: I don't find myself motivated, actually. For me it's just a rare corner-case, so… 🤷
Apr 24, 2021 at 18:27 comment added alper Should I ask it as an another question, if it could be helpful? Ah I messed up the keybindings so I wasn't using your function , and it was using the default one
Apr 24, 2021 at 14:25 comment added Hi-Angel @alper no worries! I didn't really understand what was the problem but I'm glad that it solved. Regarding you last comment about the caret jumping to the end of the file when it is right at the beginning of a <<<<<<< HEAD, in absence of other conflicts: it is a bug in (smerge-next) function. It is reproducible it by evaluating this function alone while at the beginning of the last conflict marker. At some point I dug into the Emacs code to fix it, I figured the smerge-mode is defined through easy-mmode framework, and the problem lies somewhere inside it. I didn't dig further into it.
Apr 24, 2021 at 14:15 comment added alper Ah my bad :( I was using C-c-v n for next conflict instead when I use binding for next-conflict in your code it worked! When I am on top of <<<<<<< HEAD and if there is no more conflict it jumps right away to end of file
Mar 26, 2021 at 12:30 comment added Hi-Angel @alper as you can see in the screencast the code that works for me is the one you provided a link to. I don't think I have anything else to share. You'd need to try to pin down what part of code exactly doesn't work for you, I'm afraid there's not much else I can do because I simply can't reproduce the problem.
Mar 26, 2021 at 12:10 comment added alper Hm I did not had (require 'smerge-mode) but (eval-after-load 'smerge-mode (lambda () (define-key smerge-mode-map (kbd "C-c v") smerge-basic-map) (define-key smerge-mode-map (kbd "C-c C-v") smerge-basic-map))) before (next-conflict) // but didn't help. Can you share me a minimal code that works that I can try to integrate into my init.el file
Mar 25, 2021 at 22:54 comment added Hi-Angel @alper another thought: by any chance, doesn't evaluating a (require 'smerge-mode) line before executing (next-conflict) help?
Mar 25, 2021 at 22:48 comment added Hi-Angel @alper so, what I'd try to do in your case: try inserting (print "here")s on various lines after the (when (eq buffer (current-buffer))… condition. If you don't see the caret going to the conflict marker specifically when you're at the end of the file, that means something goes wrong after that condition. The (smerge-next-safe) function per se is not able to wrap around, so what the code does is it saves your current position, then goes to the buffer beginning and executes (smerge-next-safe) from there. Then if it returned nil, it goes back to original position and prints a message.
Mar 25, 2021 at 22:11 comment added Hi-Angel @alper np. So, yeah, I can't seem to reproduce what you describe. I recorded a screencast here, hopefully I do there what you expect me to do? In particular, I go to the end of file, and then I execute next-conflict. It always brings me back to the conflict marker.
Mar 25, 2021 at 21:18 comment added alper Sorry for keep bringing this up , I have tried: gist.github.com/avatar-lavventura/… which does not detect any conflict if I am at the end of file, does it work on your end?
Mar 7, 2021 at 12:49 comment added Hi-Angel @alper me neither 😄 I am not sure what you're referring to.
Mar 7, 2021 at 12:46 comment added alper I am not sure why but this won't detect conflicts on different files if exist
Mar 3, 2021 at 22:59 comment added Hi-Angel @alper from the original answer, there was an additional fix that I hesitate to include here, since this question is specific to "how to modify the code from question to resolve the question".
Mar 3, 2021 at 22:53 comment added alper Thanks for the update! Should I update the changes from this questions or from original answer?
Feb 16, 2021 at 17:52 history edited Hi-Angel CC BY-SA 4.0
mention, emacs behavior was also changed
Feb 15, 2021 at 22:26 history edited Hi-Angel CC BY-SA 4.0
replace `when not` with `unless`
Feb 15, 2021 at 22:13 vote accept alper
Feb 15, 2021 at 18:35 history edited Hi-Angel CC BY-SA 4.0
added 12 characters in body
Feb 15, 2021 at 18:16 history edited Hi-Angel CC BY-SA 4.0
added 109 characters in body
Feb 15, 2021 at 18:09 history answered Hi-Angel CC BY-SA 4.0