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

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

[elpa] master 2f5cb2e 56/63: Make yas-debug-process-command-line easier


From: Noam Postavsky
Subject: [elpa] master 2f5cb2e 56/63: Make yas-debug-process-command-line easier to debug
Date: Mon, 17 Jul 2017 22:54:20 -0400 (EDT)

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

    Make yas-debug-process-command-line easier to debug
    
    * yasnippet-debug.el (yas-debug-process-command-line): Allow giving
    options programatically
---
 yasnippet-debug.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/yasnippet-debug.el b/yasnippet-debug.el
index c080a11..ac0d237 100644
--- a/yasnippet-debug.el
+++ b/yasnippet-debug.el
@@ -288,18 +288,19 @@
            (format "snippet exit at %d"
                    (marker-position (yas--fom-start fom)))))))
 
-(defun yas-debug-process-command-line ()
+(defun yas-debug-process-command-line (&optional options)
   "Implement command line processing."
   (setq yas-verbosity 99)
   (setq yas-triggers-in-field t)
   (setq debug-on-error t)
   (let* ((snippet-file nil)
          (snippet-mode 'fundamental-mode)
-         (options (cl-loop for opt = (pop command-line-args-left)
-                           while (and opt (not (equal opt "--"))
-                                      (string-prefix-p "-" opt))
-                           collect opt))
          (snippet-key nil))
+    (unless options
+      (setq options (cl-loop for opt = (pop command-line-args-left)
+                             while (and opt (not (equal opt "--"))
+                                        (string-prefix-p "-" opt))
+                             collect opt)))
     (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))



reply via email to

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