phillord / lentic

Create views of the same content in two Emacs buffers
183 stars 12 forks source link

Bad interaction with yasnippet #51

Open rsbowman opened 7 years ago

rsbowman commented 7 years ago

What a cool package, thank you for your work on this!

When I try your python example I have some trouble with yasnippet. If I go to the python-mode buffer and insert a snippet (say if), the default snippet text is never removed from the org-mode buffer. For example, if the default text is cond, after inserting the snippet I see this in both buffers:

if cond:

When I type v, say, to replace the default text, I see

if v:

in the python-mode buffer, but

if vcond:

in the org-mode buffer. This is with GNU Emacs 26.0.50.2, and I can reproduce it with a config consisting only of

(use-package lentic)

(use-package yasnippet
  :init
  (yas-global-mode)

  :config
  (setq yas-snippet-dirs `(,(locate-user-emacs-file "snippets"))))

Thanks for any help you can offer!

phillord commented 7 years ago

Thanks for the report, and the nice reproduction!

The problem (as you can probably see) is that the deletion of "cond" is not being percolated between buffers. It happens because yasnippet is disabling the modification hooks that I am using -- the deletion never signalled so lentic doesn't copy it.

I'll see if yasnippet folks can help. If not I can think of a nasty workaround...

phillord commented 7 years ago

Turns out, it's not yasnippet but Emacs itself which is disabling the modification hooks....

npostavs commented 5 years ago

@rsbowman this should be fixed with yasnippet 0.12.0 or later (released Jul 17, 2017).