From 925292484162bc35c4258e72c36462bb13a5c69a Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler 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 lin.scm?id=36f9348675b5f06a9906c32c203d174446a8a043&showmsg=1'>Expand)Author 2024-11-12tests: Fix gremlin.scm for GCC 14...* tests/gremlin.scm: Include stdio.h before using puts since GCC 14 no longer allows implicit declarations. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Ting-Wei Lan 2022-01-16tests: Fix file-needed/recursive on aarch64-linux....Fixes: <https://issues.guix.gnu.org/52943>. * tests/gremlin.scm (file-needed/recursive)[ground-truth]: On aarch64-linux, remove the dynamic linker from this list. Pierre Langlois 2022-01-14gremlin: Adjust tests for i686 and beyond....Fixes <https://issues.guix.gnu.org/52752>. Reported by Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>. * tests/gremlin.scm ("file-needed/recursive"): Augment the list of vDSO names. Ludovic Courtès 2022-01-08tests: Fix file-needed/recursive on powerpc64le-linux....Fixes: <https://issues.guix.gnu.org/52940>. * tests/gremlin.scm (file-needed/recursive): Consider two entries to be equivalent not when they are the same string, but rather when they refer to the same file. [ground-truth]: In addition to strings that begin with "linux-vdso.so", remove strings that begin with "linux-vdso64.so". Chris Marusich 2021-06-23tests: gremlin: Skip file-needed/recursive if DT_NEEDED is empty....* tests/gremlin.scm (file-needed/recursive): Skip the test when (file-runpath %guile-executable) evaluates to the empty list. This causes the test to be correctly skipped in the case where Guix has been built using a foreign distro's toolchain and libraries. Chris Marusich 2021-04-22gremlin: 'elf-dynamic-info' returns a file name rathern than a dynamic entry....* guix/build/gremlin.scm (elf-dynamic-info): Return the dynamic entry value, not the dynamic entry. * tests/gremlin.scm ("elf-dynamic-info-soname"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Dion Mendel 2020-12-01gremlin: Add 'file-needed/recursive'....* guix/build/gremlin.scm (file-needed/recursive): New procedure. * tests/gremlin.scm ("file-needed/recursive"): New test. Ludovic Courtès 2020-09-19gremlin: Add 'set-file-runpath', 'file-runpath', and 'file-needed'....* guix/build/gremlin.scm (file-dynamic-info, file-runpath, file-needed): New procedures. (&missing-runpath-error, &runpath-too-long-error): New condition types. (set-file-runpath): New procedure. * tests/gremlin.scm ("set-file-runpath + file-runpath"): New test. Ludovic Courtès