[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8452227 13/42: Consider fundamental-mode as ultimate ances
From: |
Noam Postavsky |
Subject: |
[elpa] master 8452227 13/42: Consider fundamental-mode as ultimate ancestor |
Date: |
Sun, 22 Dec 2019 17:37:58 -0500 (EST) |
branch: master
commit 845222774b1681a4becb240dc2489d12c5f199d7
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Consider fundamental-mode as ultimate ancestor
* yasnippet.el (yas--modes-to-activate): If a mode doesn't have a
`derived-mode-parent' property, use `fundamental-mode'.
* yasnippet-tests.el (loading-with-cyclic-parenthood)
(issue-492-and-494): Expect fundamental-mode to be active.
* doc/snippet-expansion.org (Eligible snippets): Mention that
fundamental-mode is a fallback parent mode.
---
doc/snippet-expansion.org | 10 ++++++----
yasnippet-tests.el | 6 ++++--
yasnippet.el | 5 ++++-
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/doc/snippet-expansion.org b/doc/snippet-expansion.org
index a699d57..0a00981 100644
--- a/doc/snippet-expansion.org
+++ b/doc/snippet-expansion.org
@@ -161,11 +161,13 @@ In particular, the following things matter:
=M-x describe-variable RET major-mode RET= to find out which major
mode you are in currently.
-- Parent tables
+- Parent tables
- Snippet tables defined as the parent of some other eligible table are
- also considered. This works recursively, i.e. parents of parents of
- eligible tables are also considered.
+ Snippet tables defined as the parent of some other eligible table
+ are also considered. This works recursively, i.e., parents of
+ parents of eligible tables are also considered. As a special case,
+ if a mode doesn't have a parent, then =fundamental-mode= is
+ considered to be its parent.
- Buffer-local list of extra modes
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index cccd54c..064d6c9 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -1260,7 +1260,8 @@ hello ${1:$(when (stringp yas-text) (funcall func
yas-text))} foo${1:$$(concat \
(yas-reload-all)
(with-temp-buffer
(let* ((major-mode 'c-mode)
- (expected `(c-mode
+ (expected `(fundamental-mode
+ c-mode
cc-mode
yet-another-c-mode
and-also-this-one
@@ -1313,7 +1314,8 @@ hello ${1:$(when (stringp yas-text) (funcall func
yas-text))} foo${1:$$(concat \
(yas-reload-all)
(with-temp-buffer
(let* ((major-mode 'yas--test-mode)
- (expected `(c-mode
+ (expected `(fundamental-mode
+ c-mode
,@(if (fboundp 'prog-mode)
'(prog-mode))
yas--phony-c-mode
diff --git a/yasnippet.el b/yasnippet.el
index 766de4e..dd8ca98 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -801,7 +801,10 @@ which decides on the snippet to expand.")
(yas--dfs
(lambda (mode)
(cl-loop for neighbour
- in (cl-list* (get mode 'derived-mode-parent)
+ in (cl-list* (or (get mode 'derived-mode-parent)
+ ;; Consider `fundamental-mode'
+ ;; as ultimate ancestor.
+ 'fundamental-mode)
;; NOTE: `fboundp' check is redundant
;; since Emacs 24.4.
(and (fboundp mode) (symbol-function mode))
- [elpa] master updated (2604824 -> 32f3512), Noam Postavsky, 2019/12/22
- [elpa] master 4af3354 02/42: Make less garbage in overlay heavy buffers, Noam Postavsky, 2019/12/22
- [elpa] master e67592c 03/42: Don't use overlays to find active snippets, Noam Postavsky, 2019/12/22
- [elpa] master 79b90c9 04/42: Remove compatibility code for Emacs 22 and earlier, Noam Postavsky, 2019/12/22
- [elpa] master d3bb879 05/42: Remove last-buffer-undo-list compat definition, Noam Postavsky, 2019/12/22
- [elpa] master 4f78d03 01/42: Close #937: Officially support automatically moving to next field, Noam Postavsky, 2019/12/22
- [elpa] master 1e71360 06/42: Per #947: fix typo in README.md, Noam Postavsky, 2019/12/22
- [elpa] master 7a178a2 07/42: Remove spurious change of before-change-functions, Noam Postavsky, 2019/12/22
- [elpa] master 8328c38 08/42: Fix another failure of cc-mode indentation, Noam Postavsky, 2019/12/22
- [elpa] master eeb05f0 10/42: Handle field adjust of pending active fields, Noam Postavsky, 2019/12/22
- [elpa] master 8452227 13/42: Consider fundamental-mode as ultimate ancestor,
Noam Postavsky <=
- [elpa] master fb253ac 15/42: New public function yas-maybe-expand-abbrev-key-filter, Noam Postavsky, 2019/12/22
- [elpa] master bceb65b 16/42: Make backspace/DEL clear field (#957), Noam Postavsky, 2019/12/22
- [elpa] master 3c0be40 11/42: Update FAQ, Noam Postavsky, 2019/12/22
- [elpa] master 8b25d62 20/42: * doc/snippet-development.org: Fix typos., Noam Postavsky, 2019/12/22
- [elpa] master 7612bc1 24/42: Don't check this-command in yas-not-string-or-comment-condition, Noam Postavsky, 2019/12/22
- [elpa] master dabc719 21/42: Don't turn on yas-minor-mode in temp buffers, Noam Postavsky, 2019/12/22
- [elpa] master fc33b2f 28/42: Make overlay-modification protection optional, Noam Postavsky, 2019/12/22
- [elpa] master 048d030 22/42: Fix line-relative snapshotting for org src blocks, Noam Postavsky, 2019/12/22
- [elpa] master bae20af 27/42: ; * doc/faq.org: Linkify bug reference., Noam Postavsky, 2019/12/22
- [elpa] master ffc733d 09/42: ; Debug code fixes, Noam Postavsky, 2019/12/22