emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* yasnippet and Org-mode: depressing relationship
@ 2014-11-23 12:41 Karl Voit
  2014-11-23 12:48 ` C-c C-c in table takes 12 seconds (was: yasnippet and Org-mode) Karl Voit
  0 siblings, 1 reply; 9+ messages in thread
From: Karl Voit @ 2014-11-23 12:41 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

If you're using Org-mode together with yasnippet: how do you do it
without getting performance issues or expand-key troubles?


Background with a specific issue:

My yas-specific init-lines:
  #+BEGIN_EXAMPLE
  812:(require 'yasnippet)
  813:(setq yas-root-directory "~/.emacs.d/snippets")
  814:(yas-load-directory yas-root-directory)
  887:(add-hook 'org-mode-hook 'yas-minor-mode-on)
  888:(setq yas-indent-line 'fixed) ;; fixes Org-mode issue with yasnippets: https://github.com/capitaomorte/yasnippet/iss
  #+END_EXAMPLE

- Org-mode version 8.3beta (release_8.3beta-544-g77f088) from Git
- yasnippet (version 0.8.0beta) (Github)
- GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)


Issue: Whenever I change table cells via TAB, it takes twelve
seconds with 100% CPU core:

org-table-next-field very slow:
#+BEGIN_EXAMPLE
- command-execute                           31397  99%
 - call-interactively                       31397  99%
  - yas-expand                              31298  98%
   - yas--fallback                          31298  98%
    - call-interactively                    31298  98%
     - org-cycle                            31298  98%
      - call-interactively                  31291  98%
       - org-table-next-field               31291  98%
        - org-table-align                   15676  49%
         + org-activate-bracket-links          36   0%
[...]
#+END_EXAMPLE

In org-table-next-field I suspect the re-calculation process. And
yes, also the simple ~C-c C-c~ on a table takes very long. Even
within the primitive table "| |".

Profiling the re-calculation ends up with:
#+BEGIN_EXAMPLE
- command-execute                             43157  99%
 - call-interactively                         43157  99%
  - yas-expand                                31871  73%
   - yas--fallback                            31871  73%
    - call-interactively                      31871  73%
     - org-cycle                              31871  73%
      - call-interactively                    31864  73%
       - org-table-next-field                 31864  73%
        - org-table-align                     15782  36%
         - org-activate-bracket-links            46   0%
[...]
#+END_EXAMPLE

So I guess that yas-expand has a certain role in this drama.

- http://orgmode.org/worg/org-faq.html#YASnippet
  - "Note: yasnippet is not compatible with org-indent-mode currently
    there is no known way to use both successfully with
    yas/trigger-key set to TAB (or [tab] etc…) "

I tried both methods to fix the issue and none had any positive
effect on this.

Fun fact: my Windows machine (same Emacs config, same Emacs major
version) does *not* have this issue!


So: how to have both Org-mode and yasnippet?

Do I have to switch the trigger key of yasnippet? What trigger key
do you use if you also changed it?

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-23 19:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-23 12:41 yasnippet and Org-mode: depressing relationship Karl Voit
2014-11-23 12:48 ` C-c C-c in table takes 12 seconds (was: yasnippet and Org-mode) Karl Voit
2014-11-23 16:58   ` C-c C-c in table takes 12 seconds Nicolas Goaziou
2014-11-23 17:08     ` Rasmus
2014-11-23 18:03       ` Nicolas Goaziou
2014-11-23 18:14         ` Rasmus
2014-11-23 18:19           ` Nicolas Goaziou
2014-11-23 17:28     ` Karl Voit
2014-11-23 19:04       ` Bernt Hansen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).