Open saf-dmitry opened 4 years ago
Can you show the whole snippet that you are talking about? It seems to work here (but maybe this is macOS specific? I know it has a different menu system)
Sure. Here is the snippet:
# -*- mode: snippet -*-
# name: parentheses
# key: ()
# group: Math – Delimiters
# condition: (yas-texmathp)
# --
\left( $0 \right)
and here the corresponding menu selection:
Hmm, I guess you've customized yas-trigger-symbol
? I'm puzzled what code is apparently wrapping the the snippet's abbrev key in parens though (afaict yas-trigger-symbol
only allows putting a string between the name and key). Can you reproduce this starting from emacs -Q
?
Hmm, I guess you've customized
yas-trigger-symbol
?
Here the menu selection without customization of yas-trigger-symbol
:
I expected to see here something like parentheses (() =>)
and not parentheses () =>)
.
Can you reproduce this starting from
emacs -Q
?
Yes, I can reproduce the issue.
Can you show the resulting "Test Menu" entry after evaluating the elisp below in a fresh emacs -Q
session:
(defun test-fun ()
(interactive)
(message "ran the test fun"))
(defvar menu-bar-test-menu (make-sparse-keymap "Test Menu"))
(define-key menu-bar-test-menu [test-fun]
'(menu-item "Test Menu Item" test-fun . (:keys "C-c x")))
(define-key menu-bar-test-menu [test-fun-paren]
'(menu-item "Test Menu Item paren :keys" test-fun . (:keys "()")))
(define-key global-map [menu-bar menu-bar-test]
(list 'menu-item "Test Menu" menu-bar-test-menu))
Here's what I get:
Can you show the resulting "Test Menu" entry after evaluating the elisp below in a fresh
emacs -Q
session:
Here is what I get:
You are right, the issue is macOS-specific. macOS wraps item keys in parentheses and this "eats" a leading left parenthesis being part of a key expression.
When an abbreviation starts with the left parenthesis (
(
), this parenthesis is not shown up in the YASnippet snippets menu.Software Versions: