mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
Make yas-debug-process-command-line easier to debug
* yasnippet-debug.el (yas-debug-process-command-line): Allow giving options programatically
This commit is contained in:
parent
274406ee44
commit
2f5cb2e2ef
@ -288,18 +288,19 @@
|
|||||||
(format "snippet exit at %d"
|
(format "snippet exit at %d"
|
||||||
(marker-position (yas--fom-start fom)))))))
|
(marker-position (yas--fom-start fom)))))))
|
||||||
|
|
||||||
(defun yas-debug-process-command-line ()
|
(defun yas-debug-process-command-line (&optional options)
|
||||||
"Implement command line processing."
|
"Implement command line processing."
|
||||||
(setq yas-verbosity 99)
|
(setq yas-verbosity 99)
|
||||||
(setq yas-triggers-in-field t)
|
(setq yas-triggers-in-field t)
|
||||||
(setq debug-on-error t)
|
(setq debug-on-error t)
|
||||||
(let* ((snippet-file nil)
|
(let* ((snippet-file nil)
|
||||||
(snippet-mode 'fundamental-mode)
|
(snippet-mode 'fundamental-mode)
|
||||||
(options (cl-loop for opt = (pop command-line-args-left)
|
(snippet-key nil))
|
||||||
|
(unless options
|
||||||
|
(setq options (cl-loop for opt = (pop command-line-args-left)
|
||||||
while (and opt (not (equal opt "--"))
|
while (and opt (not (equal opt "--"))
|
||||||
(string-prefix-p "-" opt))
|
(string-prefix-p "-" opt))
|
||||||
collect opt))
|
collect opt)))
|
||||||
(snippet-key nil))
|
|
||||||
(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"))))
|
(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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user