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 9165039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:49:22+00:00 2026-06-17T14:49:22+00:00

Title says it, is it possible to alter yasnippets behavior so that it is

  • 0

Title says it, is it possible to alter yasnippets behavior so that it is not possible to expand on “-or” but it is possible to expand on “[newline]or” or “[tab]or” only?

I would like this because I am trying to expand my yasnippets automatically when expansion is possible, and there is only ever confliction when I am writing variable names.

  • 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-06-17T14:49:23+00:00Added an answer on June 17, 2026 at 2:49 pm

    I got the solution here:
    http://ergoemacs.org/emacs/emacs_tip_yasnippet_expand_whole_hyphenated_word.html

    There is variable (defvar yas-key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ")..), which controls kinds of expansions. "w" means that `”-or” is expanded as separate “or”.

    If

    (setq yas-key-syntaxes '("w_" "w_." "w_.()" "^ "))
    

    then "-or" is expanded as complex expression "<some>-or" only. But " or" is expanded as usually.

    So, "buffer-substring" will be expanded only if there is file buffer-substring.yasnippet with content

    # contributor: Xah Lee (XahLee.org)
    # name: buffer-substring
    # key: buffer-substring
    # --
    (buffer-substring START$0 END)
    

    But with "w" keyword "buffer-substring" will be expanded as substring.yasnippet.

    If there is additional string # key: bs in file buffer-substring.yasnippet then "buffer-substring" won’t be expanded at all. (For Version: 0.8.0)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title says, is it possible to select elements in XPath that only
What the title says, really. I have a named pipe. I would like to
Pretty much what the title says. Is it possible to show the MDX that
Like the title says, i would like to change the route depending on if
Possible Duplicate: KVO and NSMutableArray Like the title says, I need to be able
Like the title says, is it possible? My purpose is to make a little
Like the title says, is it possible for a successful WSASend call on a
Just as title says. I don't believe it is possible to do this but
Like the title says: Is it possible to export my javadoc comments for web
Possible Duplicate: PHP remove accents The title says most of it, but anyways... I

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.