From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 65376@debbugs.gnu.org
Cc: andrew@trop.in, liliana.prikler@gmail.com
Subject: [bug#65376] [PATCH emacs-team 7/7] gnu: emacs-yasnippet: Fix build.
Date: Sat, 19 Aug 2023 08:40:03 +0200 [thread overview]
Message-ID: <ca7e310f7ac32354b2e693e9a0f783320952a8fc.1692427560.git.liliana.prikler@gmail.com> (raw)
In-Reply-To: <cover.1692427560.git.liliana.prikler@gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6099 bytes --]
* gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/emacs-xyz.scm (emacs-yasnippet)[source]<patches>: Use it here.
* gnu/packages/patches/emacs-yasnippet-fix-tests.patch: Also fix
delete-numberless-inner-snippet-issue-562.
---
gnu/local.mk | 1 +
gnu/packages/emacs-xyz.scm | 3 +-
...acs-yasnippet-fix-empty-snippet-next.patch | 59 +++++++++++++++++++
.../patches/emacs-yasnippet-fix-tests.patch | 14 +++++
4 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index fb58b4eac8..bdaa9935b1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1107,6 +1107,7 @@ dist_patch_DATA = \
%D%/packages/patches/emacs-telega-path-placeholder.patch \
%D%/packages/patches/emacs-telega-test-env.patch \
%D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \
+ %D%/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch \
%D%/packages/patches/emacs-yasnippet-fix-tests.patch \
%D%/packages/patches/emacs-kv-fix-tests.patch \
%D%/packages/patches/emacs-pgtk-super-key-fix.patch \
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 89ce0fa900..811728d170 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -17117,7 +17117,8 @@ (define-public emacs-yasnippet
(sha256
(base32 "0via9dzw8m5lzymg1h78xkwjssh39zr3g6ccyamlf1rjzjsyxknv"))
(patches
- (search-patches "emacs-yasnippet-fix-tests.patch"))))
+ (search-patches "emacs-yasnippet-fix-empty-snippet-next.patch"
+ "emacs-yasnippet-fix-tests.patch"))))
(build-system emacs-build-system)
(arguments
`(#:tests? #t
diff --git a/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch b/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch
new file mode 100644
index 0000000000..1faea2b456
--- /dev/null
+++ b/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch
@@ -0,0 +1,59 @@
+From 925292484162bc35c4258e72c36462bb13a5c69a Mon Sep 17 00:00:00 2001
+From: Liliana Marie Prikler <liliana.prikler@gmail.com>
+Date: Sat, 19 Aug 2023 08:38:17 +0200
+Subject: [PATCH] Guard against empty snippet in yas-next-field.
+
+---
+ yasnippet.el | 29 +++++++++++++++--------------
+ 1 file changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/yasnippet.el b/yasnippet.el
+index e0b5537..41d86dd 100644
+--- a/yasnippet.el
++++ b/yasnippet.el
+@@ -136,6 +136,7 @@
+ (declare-function cl-progv-after "cl-extra") ; Needed for 23.4.
+ (require 'easymenu)
+ (require 'help-mode)
++(require 'subr-x)
+
+ (defvar yas--editing-template)
+ (defvar yas--guessed-modes)
+@@ -3386,20 +3387,20 @@ Otherwise delegate to `yas-next-field'."
+ If there's none, exit the snippet."
+ (interactive)
+ (unless arg (setq arg 1))
+- (let* ((active-field (overlay-get yas--active-field-overlay 'yas--field))
+- (snippet (car (yas-active-snippets (yas--field-start active-field)
+- (yas--field-end active-field))))
+- (target-field (yas--find-next-field arg snippet active-field)))
+- (yas--letenv (yas--snippet-expand-env snippet)
+- ;; Apply transform to active field.
+- (when active-field
+- (let ((yas-moving-away-p t))
+- (when (yas--field-update-display active-field)
+- (yas--update-mirrors snippet))))
+- ;; Now actually move...
+- (if target-field
+- (yas--move-to-field snippet target-field)
+- (yas-exit-snippet snippet)))))
++ (and-let* ((active-field (overlay-get yas--active-field-overlay 'yas--field))
++ (snippet (car (yas-active-snippets (yas--field-start active-field)
++ (yas--field-end active-field)))))
++ (let ((target-field (yas--find-next-field arg snippet active-field)))
++ (yas--letenv (yas--snippet-expand-env snippet)
++ ;; Apply transform to active field.
++ (when active-field
++ (let ((yas-moving-away-p t))
++ (when (yas--field-update-display active-field)
++ (yas--update-mirrors snippet))))
++ ;; Now actually move...
++ (if target-field
++ (yas--move-to-field snippet target-field)
++ (yas-exit-snippet snippet))))))
+
+ (defun yas--place-overlays (snippet field)
+ "Correctly place overlays for SNIPPET's FIELD."
+--
+2.41.0
+
diff --git a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch
index c70cc75d92..5995b0afa4 100644
--- a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch
+++ b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch
@@ -10,6 +10,11 @@ Content-Transfer-Encoding: 8bit
- A test that was temporarily broken passes again.
- The default for ‘org-adapt-indentation’ has changed.
- buffer-list may be called with arguments when native-comp is enabled.
+
+2023-08-19 Liliana Marie Prikler <liliana.prikler@gmail.com>
+
+ * delete-numberless-inner-snippet-issue-562: Correct value in
+ looking-at.
---
yasnippet-tests.el | 45 ++++++++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 17 deletions(-)
@@ -26,6 +31,15 @@ index f7ca2bb..7618ab7 100644
;; Author: João Távora <joaot@siscog.pt>
;; Keywords: emulations, convenience
+@@ -289,7 +289,7 @@ attention to case differences."
+ (should (looking-at "testblable"))
+ (ert-simulate-command '(yas-next-field-or-maybe-expand))
+ (ert-simulate-command '(yas-skip-and-clear-field))
+- (should (looking-at "ble"))
++ (should (looking-at "blable"))
+ (should (null (yas-active-snippets)))))
+
+ (ert-deftest delete-nested-simple-field-issue-824 ()
@@ -556,16 +556,19 @@ XXXXX ------------------------"))))
(yas-mock-insert "foo bar")
(ert-simulate-command '(yas-next-field))
--
2.41.0
next prev parent reply other threads:[~2023-08-19 8:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 6:46 [bug#65376] [PATCH emacs-team 0/7] Fix some more builds Liliana Marie Prikler
2023-08-18 22:22 ` [bug#65376] [PATCH emacs-team 1/7] gnu: emacs-all-the-icons: Honour #:tests? Liliana Marie Prikler
2023-08-18 22:52 ` [bug#65376] [PATCH emacs-team 2/7] gnu: emacs-haskell-mode: Update to 17.4 Liliana Marie Prikler
2023-08-18 23:05 ` [bug#65376] [PATCH emacs-team 3/7] gnu: emacs-helpful: Update to 0.21 Liliana Marie Prikler
2023-08-18 23:37 ` [bug#65376] [PATCH emacs-team 4/7] guix: emacs-utils: Add ert-number-tests Liliana Marie Prikler
2023-08-18 23:37 ` [bug#65376] [PATCH emacs-team 5/7] gnu: emacs-libgit: Fix build Liliana Marie Prikler
2023-08-18 23:55 ` [bug#65376] [PATCH emacs-team 6/7] gnu: emacs-all-the-icons: " Liliana Marie Prikler
2023-08-19 6:40 ` Liliana Marie Prikler [this message]
2023-08-20 16:53 ` [bug#65376] [PATCH emacs-team 0/7] Fix some more builds Andrew Tropin
2023-09-07 18:22 ` bug#65376: " Liliana Marie Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca7e310f7ac32354b2e693e9a0f783320952a8fc.1692427560.git.liliana.prikler@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=65376@debbugs.gnu.org \
--cc=andrew@trop.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.