[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ff8e833 23/51: ; yasnippet-debug.el: Fix deprecation warni
From: |
Noam Postavsky |
Subject: |
[elpa] master ff8e833 23/51: ; yasnippet-debug.el: Fix deprecation warning. |
Date: |
Sun, 13 May 2018 13:11:43 -0400 (EDT) |
branch: master
commit ff8e833375a3cc3cc7d39d9c573250f0bf3101d3
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
; yasnippet-debug.el: Fix deprecation warning.
---
yasnippet-debug.el | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/yasnippet-debug.el b/yasnippet-debug.el
index 8d4e79e..22c4035 100644
--- a/yasnippet-debug.el
+++ b/yasnippet-debug.el
@@ -46,13 +46,19 @@
(require 'color nil t)
(require 'edebug)
(eval-when-compile
- (unless (and (require 'subr-x nil t) (fboundp 'when-let))
- ;; Introduced in 25.1
- (defmacro when-let (key-val &rest body)
- (declare (indent 1) (debug ((symbolp form) body)))
- `(let ((,(car key-val) ,(cadr key-val)))
- (when ,(car key-val)
- ,@body)))))
+ (require 'subr-x nil t)
+ (cond ((fboundp 'when-let*) nil) ; Introduced in 26.
+ ((fboundp 'when-let) ; Introduced in 25.1,
+ (defalias 'when-let* 'when-let)) ; deprecated in 26.
+ (t (defmacro when-let* (key-vals &rest body)
+ (declare (indent 1) (debug ((symbolp form) body)))
+ (let ((key-val (pop key-vals)))
+ (if key-val
+ `(let ((,(car key-val) ,(cadr key-val)))
+ (if ,(car key-val)
+ (when-let* ,key-vals
+ ,@body)))
+ (macroexp-progn body)))))))
(defvar yas-debug-live-indicators
(make-hash-table :test #'eq))
@@ -73,7 +79,7 @@
(setq beg (setq end (marker-position location)))
(setq beg (yas-debug-ov-fom-start location)
end (yas-debug-ov-fom-end location)))
- (or (when-let (color-ov (gethash location yas-debug-live-indicators))
+ (or (when-let* ((color-ov (gethash location yas-debug-live-indicators)))
(if (and beg end) (move-overlay (cdr color-ov) beg end)
(delete-overlay (cdr color-ov)))
color-ov)
@@ -170,18 +176,18 @@
(defun yas-debug-snippet (snippet &optional outbuf)
(yas-debug-with-tracebuf outbuf
- (when-let (overlay (yas--snippet-control-overlay snippet))
+ (when-let* ((overlay (yas--snippet-control-overlay snippet)))
(printf "\tsid: %d control overlay %s\n"
(yas--snippet-id snippet)
(yas-debug-live-range overlay)))
- (when-let (active-field (yas--snippet-active-field snippet))
+ (when-let* ((active-field (yas--snippet-active-field snippet)))
(unless (consp (yas--field-start active-field))
(printf "\tactive field: #%d %s %s covering \"%s\"\n"
(or (yas--field-number active-field) -1)
(if (yas--field-modified-p active-field) "**" "--")
(yas-debug-live-range active-field)
(buffer-substring-no-properties (yas--field-start
active-field) (yas--field-end active-field)))))
- (when-let (exit (yas--snippet-exit snippet))
+ (when-let* ((exit (yas--snippet-exit snippet)))
(printf "\tsnippet-exit: %s next: %s\n"
(yas-debug-live-marker (yas--exit-marker exit))
(yas--exit-next exit)))
@@ -308,15 +314,15 @@ buffer-locally, otherwise install it globally. If HOOK is
while (and opt (not (equal opt "--"))
(string-prefix-p "-" opt))
collect opt)))
- (when-let (mode (cl-member "-M:" options :test #'string-prefix-p))
+ (when-let* ((mode (cl-member "-M:" options :test #'string-prefix-p)))
(setq snippet-mode (intern (concat (substring (car mode) 3) "-mode"))))
- (when-let (mode (cl-member "-M." options :test #'string-prefix-p))
+ (when-let* ((mode (cl-member "-M." options :test #'string-prefix-p)))
(setq snippet-mode
(cdr (cl-assoc (substring (car mode) 2) auto-mode-alist
:test (lambda (ext regexp) (string-match-p regexp
ext))))))
(switch-to-buffer (get-buffer-create "*yas test*"))
(funcall snippet-mode)
- (when-let (snippet-file (cl-member "-S:" options :test #'string-prefix-p))
+ (when-let* ((snippet-file (cl-member "-S:" options :test
#'string-prefix-p)))
(setq snippet-file (substring (car snippet-file) 3))
(if (file-exists-p snippet-file)
(with-temp-buffer
@@ -331,7 +337,7 @@ buffer-locally, otherwise install it globally. If HOOK is
(error "No such snippet `%s'" snippet-file)))))
(display-buffer (find-file-noselect
(expand-file-name "yasnippet.el" yas--loaddir)))
- (when-let (verbosity (car (or (member "-v" options) (member "-vv"
options))))
+ (when-let* ((verbosity (car (or (member "-v" options) (member "-vv"
options)))))
(set-window-buffer
(split-window) (yas-debug-snippets
nil (if (equal verbosity "-vv") 'edebug-create t))))
- [elpa] master 4467e93 40/51: Use fancy field adjustment for fixed indent too, (continued)
- [elpa] master 4467e93 40/51: Use fancy field adjustment for fixed indent too, Noam Postavsky, 2018/05/13
- [elpa] master 7c9edb5 29/51: ; doc/snippet-development.org: Further copy edit., Noam Postavsky, 2018/05/13
- [elpa] master cf23537 33/51: Fix expansion of commands snippet, Noam Postavsky, 2018/05/13
- [elpa] master fa6a71c 45/51: ; Wait until post-command, or bad auto-fill call to print stacktrace, Noam Postavsky, 2018/05/13
- [elpa] master c9277d3 32/51: Change yas-lookup-snippet to return a yas--template struct, Noam Postavsky, 2018/05/13
- [elpa] master 6066631 28/51: Fix typos in "Writing Templates" documentation, Noam Postavsky, 2018/05/13
- [elpa] master b0aa5c2 48/51: Tweak bug-reporting information slightly, Noam Postavsky, 2018/05/13
- [elpa] master fe9f8b6 21/51: ; yasnippet-debug.el: Update yas-debug-snippets arg for previous change., Noam Postavsky, 2018/05/13
- [elpa] master caf3dba 30/51: Don't use global variable for backquote expression locations, Noam Postavsky, 2018/05/13
- [elpa] master ff26e3b 19/51: Close #824: Simple fields can be parented like other fields or mirrors, Noam Postavsky, 2018/05/13
- [elpa] master ff8e833 23/51: ; yasnippet-debug.el: Fix deprecation warning.,
Noam Postavsky <=
- [elpa] master a0d2cff 44/51: ; Don't enter debugger for kill-all-local-variables case, Noam Postavsky, 2018/05/13
- [elpa] master 5170f05 42/51: Don't indent first and only line of expanded snippet, Noam Postavsky, 2018/05/13
- [elpa] master 5a29fe6 50/51: Release 0.13.0, Noam Postavsky, 2018/05/13
- [elpa] master 8b421bc 20/51: Reinstate the old debug behaviour for yas-tryout-snippet, Noam Postavsky, 2018/05/13
- [elpa] master 074d670 26/51: Add yasnippet-unload-function, Noam Postavsky, 2018/05/13
- [elpa] master d364425 38/51: * yasnippet.el (yas-field-value): Fix docstring., Noam Postavsky, 2018/05/13
- [elpa] master 05ac1da 31/51: ; yasnippet-tests.el (yas-no-memory-of-bad-snippet): Fix docstring., Noam Postavsky, 2018/05/13
- [elpa] master 3032337 37/51: Improve rendering of docstrings in manual's reference section, Noam Postavsky, 2018/05/13
- [elpa] master ae95810 43/51: ; Try to get more info about 873/919, Noam Postavsky, 2018/05/13
- [elpa] master 15761e8 41/51: Adjust previous fix, Noam Postavsky, 2018/05/13