mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Fixup yasnippet-debug.el
* yasnippet-debug.el: Replace cl with cl-lib, replace yas--snippets-at-point with yas-active-snippets.
This commit is contained in:
parent
65952e3054
commit
c98672eb54
@ -25,7 +25,7 @@
|
|||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'yasnippet)
|
(require 'yasnippet)
|
||||||
(require 'cl)
|
(require 'cl-lib)
|
||||||
|
|
||||||
(defun yas-debug-snippet-vars ()
|
(defun yas-debug-snippet-vars ()
|
||||||
"Debug snippets, fields, mirrors and the `buffer-undo-list'."
|
"Debug snippets, fields, mirrors and the `buffer-undo-list'."
|
||||||
@ -36,12 +36,12 @@
|
|||||||
(princ (format "\nPost command hook: %s\n" post-command-hook))
|
(princ (format "\nPost command hook: %s\n" post-command-hook))
|
||||||
(princ (format "\nPre command hook: %s\n" pre-command-hook))
|
(princ (format "\nPre command hook: %s\n" pre-command-hook))
|
||||||
|
|
||||||
(princ (format "%s live snippets in total\n" (length (yas--snippets-at-point (quote all-snippets)))))
|
(princ (format "%s live snippets in total\n" (length (yas-active-snippets 'all-snippets))))
|
||||||
(princ (format "%s overlays in buffer:\n\n" (length (overlays-in (point-min) (point-max)))))
|
(princ (format "%s overlays in buffer:\n\n" (length (overlays-in (point-min) (point-max)))))
|
||||||
(princ (format "%s live snippets at point:\n\n" (length (yas--snippets-at-point))))
|
(princ (format "%s live snippets at point:\n\n" (length (yas-active-snippets))))
|
||||||
|
|
||||||
|
|
||||||
(dolist (snippet (yas--snippets-at-point))
|
(dolist (snippet (yas-active-snippets))
|
||||||
(princ (format "\tsid: %d control overlay from %d to %d\n"
|
(princ (format "\tsid: %d control overlay from %d to %d\n"
|
||||||
(yas--snippet-id snippet)
|
(yas--snippet-id snippet)
|
||||||
(overlay-start (yas--snippet-control-overlay snippet))
|
(overlay-start (yas--snippet-control-overlay snippet))
|
||||||
@ -76,11 +76,13 @@
|
|||||||
"ENABLED")
|
"ENABLED")
|
||||||
(point-max)))
|
(point-max)))
|
||||||
(unless (eq buffer-undo-list t)
|
(unless (eq buffer-undo-list t)
|
||||||
(princ (format "Undpolist has %s elements. First 10 elements follow:\n" (length buffer-undo-list)))
|
(princ (format "Undpolist has %s elements. First 10 elements follow:\n"
|
||||||
(let ((first-ten (subseq buffer-undo-list 0 (min 19
|
(length buffer-undo-list)))
|
||||||
(length buffer-undo-list)))))
|
(let ((first-ten (cl-subseq buffer-undo-list 0
|
||||||
|
(min 19 (length buffer-undo-list)))))
|
||||||
(dolist (undo-elem first-ten)
|
(dolist (undo-elem first-ten)
|
||||||
(princ (format "%2s: %s\n" (position undo-elem first-ten) (truncate-string-to-width (format "%s" undo-elem) 70))))))))
|
(princ (format "%2s: %s\n" (cl-position undo-elem first-ten)
|
||||||
|
(truncate-string-to-width (format "%s" undo-elem) 70))))))))
|
||||||
|
|
||||||
(defun yas--debug-format-fom-concise (fom)
|
(defun yas--debug-format-fom-concise (fom)
|
||||||
(when fom
|
(when fom
|
||||||
@ -108,12 +110,11 @@
|
|||||||
|
|
||||||
(defun yas-debug-test (&optional quiet)
|
(defun yas-debug-test (&optional quiet)
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(yas-load-directory (or (and (listp yas-snippet-dirs)
|
(yas-load-directory (or (car-safe yas-snippet-dirs)
|
||||||
(first yas-snippet-dirs))
|
|
||||||
yas-snippet-dirs
|
yas-snippet-dirs
|
||||||
"~/Source/yasnippet/snippets/"))
|
"~/Source/yasnippet/snippets/"))
|
||||||
(set-buffer (switch-to-buffer "*YAS TEST*"))
|
(set-buffer (switch-to-buffer "*YAS TEST*"))
|
||||||
(mapc #'yas--commit-snippet (yas--snippets-at-point 'all-snippets))
|
(mapc #'yas--commit-snippet (yas-active-snippets 'all-snippets))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(setq buffer-undo-list nil)
|
(setq buffer-undo-list nil)
|
||||||
(setq undo-in-progress nil)
|
(setq undo-in-progress nil)
|
||||||
@ -128,6 +129,5 @@
|
|||||||
(provide 'yasnippet-debug)
|
(provide 'yasnippet-debug)
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; indent-tabs-mode: nil
|
;; indent-tabs-mode: nil
|
||||||
;; byte-compile-warnings: (not cl-functions)
|
|
||||||
;; End:
|
;; End:
|
||||||
;;; yasnippet-debug.el ends here
|
;;; yasnippet-debug.el ends here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user