Closed c02y closed 4 years ago
Confirmed.
The issue occurs when the dotspacemacs-distribution
variable is set to 'spacemacs
at the top of .spacemacs
.
But it works as expected when it's set to 'spacemacs-base
.
So there's some setting/package that causes it.
(emacs-lisp git helm markdown multiple-cursors org treemacs version-control)
'spacemacs-base configures ediff like this
This could explain the difference.
On develop branch, commenting spacemacs-purpose
in spacemacs/layers/+distributions/spacemacs/layers.el
(line) does the trick. There is something to blame in the spacemacs-purpose
layer.
@f380cedric Nice catch, it seems like it might be window-purpose
related.
@bmag Do you know what could be going on here?
Two example functions:
(defun clipboard/set (astring)
"Copy a string to clipboard"
(with-temp-buffer
(insert astring)
(clipboard-kill-region (point-min) (point-max))))
(defun clipboard/get ()
"Return the content of clipboard as string"
(interactive)
(with-temp-buffer
(clipboard-yank)
(buffer-substring-no-properties (point-min) (point-max))))
source: https://caiorss.github.io/Emacs-Elisp-Programming/Elisp_Snippets.html#sec-1-5
SPC b N n
.p
M-x ediff-regions-wordwise RET
Region's A buffer:
prompt, choose untitled
, RET
Region's B buffer:
prompt, type un
to highlight and choose untitled
, RET
v
%
C-M-c
Esc
.
(This is probably an ediff issue).v
v
, now the initial selection is gone.v
%
C-M-c
window-purpose
(Spacemacs develop
branch without any window-purpose
changes)ediff-regions-wordwise
ediff-regions-linewise
.window-purpose
excluded (and Spacemacs restarted)dotspacemacs-excluded-packages '(window-purpose)
ediff-regions-wordwise
ediff-regions-linewise
Thanks for the report and repro steps everyone. I looked into the matter and found that:
purpose-mode
is enabled.ediff-clone-buffer-for-region-comparison
. The function is called twice to prompt the user for the desired regions, and the second call (for determining region B) somehow changes the region A (which was determined in the first call).I wasn't able to find what causes the buggy behavior in ediff-clone-buffer-for-region-comparison
, but I was to come up with a workaround. Put this in user-config, it disables purpose-mode
during the call to ediff-clone-buffer-for-region-comparison
:
(defun bm-adv-without-purpose (fn &rest args)
(without-purpose (apply fn args)))
(advice-add #'ediff-clone-buffer-for-region-comparison :around #'bm-adv-without-purpose)
Are there any more buggy ediff commands other than ediff-region-wordwise/linewise
?
Confirmed that snippet seems to fix it.
I tried a couple of the other ediff commands and they seem to work, it might just be the region commands that have this issue.
I'm getting an unrelated issue with ediff3
, ediff-buffers3
, ediff-files3
and ediff-merge
/usr/bin/diff3: diff failed:
Even though:
(executable-find "diff3")
returns:
"c:/tools/cygwin/bin/diff3.exe"
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
This bug seems fixed without the code snippet(bm-adv-without-purpose
) posted by @bmag
Same here, seems fixed.
Confirmed, it seems to be working as expected without any changes.
#### System Info :computer: - OS: windows-nt - Emacs: 27.1 - Spacemacs: 0.300.0 - Spacemacs branch: develop (rev. 76301564c) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ```elisp (emacs-lisp git helm lsp multiple-cursors org (python :variables python-backend 'lsp python-lsp-server 'mspyls) version-control treemacs) ``` - System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP
Description :octocat:
When I try to use
ediff-region-wordwise/linewise
in vanilla emacs, emacs asks me to choose buffers and then mark one region,C-M-c
, and mark another region,C-M-c
again to ediff the regions. This works very well when I try it inemacs -q
or emacs with my own init.el, but when I try it in spacemacs with even fresh installation, one of the two regions in ediff session is not right, it is empty or just part of what I marked. I recorded a gif. Sorry about that the keystrokes were not captured, but I did follow the instructions to hit the keystrokes.Reproduction guide :beetle:
v
orC-Space
C-M-c
as toldv
orC-Space
C-M-c
as toldObserved behaviour: :eyes: :broken_heart: One of the two buffers in ediff session is not right, it is empty or just part of what I marked
Expected behaviour: :heart: :smile: Two buffers in ediff session should be exactly what I marked.
System Info :computer:
Backtrace :paw_prints: