Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7594905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:32:16+00:00 2026-05-30T21:32:16+00:00

EDIT My issue was related to snippet syntax all along… The configuration below totally

  • 0

EDIT My issue was related to snippet syntax all along… The configuration below totally works.


I’m trying to use org-mode and yasnippet together and it’s not working even with some of the workarounds on the org-mode FAQ. Whenever I hit TAB on a snippet abbreviation the word gets deleted. TAB behaves normally if I’m not over a snippet word, so there’s something going on…

I’m using Org-mode version 7.7, yasnippet (version 0.7.0), and GNU Emacs 23.4.1.

Here’s my setup:

(setq load-path
      (append (list nil
                    "~/.emacs.d/site-lisp/yasnippet"
                    "~/.emacs.d/site-lisp/org-7.7/lisp")
              load-path))

;; set up yasnippet
(require 'yasnippet)
(yas/initialize)
(setq yas/snippet-dirs '("~/.emacs.d/mysnippets"
                         "~/.emacs.d/site-lisp/yasnippet/snippets"))
(mapc 'yas/load-directory yas/snippet-dirs)

;; set up org mode
(require 'org-install)
;; fix some org-mode + yasnippet conflicts:
(defun yas/org-very-safe-expand ()
  (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))

(add-hook 'org-mode-hook
          (lambda ()
            (make-variable-buffer-local 'yas/trigger-key)
            (setq yas/trigger-key [tab])
            (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
            (define-key yas/keymap [tab] 'yas/next-field)))

And I’m pretty sure the hook is running as expected because of the following output of C-h v org-tab-first-hook in an org buffer:

org-tab-first-hook is a variable defined in `org.el'.
Its value is
(yas/org-very-safe-expand org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe)

And here’s C-h k TAB in an org buffer:

<tab> runs the command org-cycle, which is an interactive Lisp
function in `org.el'.

EDIT

After doing a edebug-defun on my yas/org-very-safe-expand function I’m seeing the following message

Result: "[yas] elisp error! Symbol's value as variable is void: err"

So yas is error’ing out somewhere… My edebug foo is not quite up to par but if I get some time I’ll try to single step through and see where the error is. My full emacs configuration is on github here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:32:17+00:00Added an answer on May 30, 2026 at 9:32 pm

    Turns out my issue was related to snippet syntax, not setup. Silly silly me…

    In other words, this totally works:

    ;; fix some org-mode + yasnippet conflicts:
    (defun yas/org-very-safe-expand ()
      (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
    
    (add-hook 'org-mode-hook
              (lambda ()
                (make-variable-buffer-local 'yas/trigger-key)
                (setq yas/trigger-key [tab])
                (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
                (define-key yas/keymap [tab] 'yas/next-field)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, This appears to be Firefox related issue (havent tried Opera & IE). I
//EDIT My issue was related to something else, I thought the implementation was incorrect
EDIT: This issue is already submitted on Github. Changing the Act part to this
EDIT: It was some issue with Notepad++'s regex engine. The regex worked fine in
EDIT : Accepted answer points out what my issue was. I added another answer
EDIT: I've found what's causing the issue, but I don't know why and I
EDIT: I am basically running into the following documented issue . I am using
Edit: closing anchor fixed. This issue exists when testing on the following browsers: Google
Edit 4/4/12 I STILL HAVE ONE QUESTION: I solved my issue but it adds
I'm workin' on a web project where performance is a very important issue. EDIT:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.