0

Having created the following YASnippet (to automate title creation in Org mode):

# key: org
# name: org
# --
#+TITLE: ${1:`(capitalize (file-name-nondirectory (file-name-sans-extension
(buffer-file-name))))`}
#+Time-stamp: <2013-10-08 Tue 21:32>
#+INCLUDE: "preamble.org"

$0

everything is right in most cases, except when I type a "t" character in the title...

It works well with other letters, not with that one. Can't find why. Any idea?

fniessen
  • 4,408
  • 19
  • 18
  • Works fine for me. Can you clarify "fails"? Is there a backtrace or a message? Also, why is the timestamp static? – abo-abo Oct 13 '13 at 20:12
  • t is interpreted as a prefix for a command, it seems. See demo at http://screencast.com/t/VmwEJiuw. – fniessen Oct 13 '13 at 21:04
  • Regarding the static timestamp, you're right, but anyway it gets updated in my Emacs configuration, thanks to a save-hook and the use of the "timestamp" package – fniessen Oct 13 '13 at 21:04
  • 1
    Must be some part of your config that causes this. Try to reproduce with `emacs -q` and load only yasnippet. – abo-abo Oct 13 '13 at 21:14

1 Answers1

0

The problem was in the following code:

  ;; allow YASnippet to do its thing in Org files
  (add-hook 'org-mode-hook
            (lambda ()
              ;; YASnippet (using the new org-cycle hooks)
              (add-to-list 'org-tab-first-hook
                           'yas/org-very-safe-expand)

              ;; When enabled, problem with inserting letter `t' in YASnippet fields
              ;; (define-key yas/keymap
              ;;   (kbd "tab") 'yas/next-field) ; `yas/next-field-or-maybe-expand'?
              ))
fniessen
  • 4,408
  • 19
  • 18