emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master b0e729b 58/63: Optionally add undo list to debug info


From: Noam Postavsky
Subject: [elpa] master b0e729b 58/63: Optionally add undo list to debug info
Date: Mon, 17 Jul 2017 22:54:22 -0400 (EDT)

branch: master
commit b0e729b1decbef605e59dc906897c9c84affbdfe
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Optionally add undo list to debug info
    
    * yasnippet-debug.el (yas-debug-undo): New variable.
    (yas-toggle-debug-undo): New command.
    (yas-debug-snippets): Print undo list if `yas-debug-undo' is non-nil.
---
 yasnippet-debug.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/yasnippet-debug.el b/yasnippet-debug.el
index 65b773f..f198219 100644
--- a/yasnippet-debug.el
+++ b/yasnippet-debug.el
@@ -192,6 +192,12 @@
 
 (defvar yas-debug-target-buffer nil)
 (defvar-local yas-debug-target-snippets nil)
+(defvar yas-debug-undo nil)
+
+(defun yas-toggle-debug-undo (value)
+  (interactive (list (not yas-debug-undo)))
+  (setq yas-debug-undo value)
+  (yas--message 3 "debug undo %sabled" (if yas-debug-undo "en" "dis")))
 
 (defadvice yas--snippet-parse-create (before yas-debug-target-snippet 
(snippet))
   (add-to-list 'yas-debug-target-snippets snippet))
@@ -223,7 +229,11 @@
                        (unless (memq loc yas-debug-recently-live-indicators)
                          (delete-overlay (cdr color-ov))
                          (remhash loc yas-debug-live-indicators)))
-                     yas-debug-live-indicators)))
+                     yas-debug-live-indicators))
+          (when (and yas-debug-undo (listp buffer-undo-list))
+            (printf "Undo list has %s elements:\n" (length buffer-undo-list))
+            (cl-loop for undo-elem in buffer-undo-list
+                     do (printf "%S\n" undo-elem))))
         (when hook
           (setq yas-debug-target-buffer (current-buffer))
           (ad-enable-advice 'yas--snippet-parse-create 'before 
'yas-debug-target-snippet)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]