Skip to content

Commit 2517b39

Browse files
committed
Added a simple drupal-tail-drupal-debug-txt function.
Fixes #20.
1 parent e20d8fe commit 2517b39

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drupal-mode.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,24 @@ should save your files with unix style end of line."
403403
(format-spec drupal-search-url `((?v . ,(drupal-major-version drupal-version))
404404
(?s . ,symbol)))))))))
405405

406+
(defun drupal-tail-drupal-debug-txt ()
407+
"Tail drupal_debug.txt.
408+
If a drupal_debug.txt exists in the sites temporary directory
409+
visit it and enable `auto-revert-tail-mode' in the visiting
410+
buffer."
411+
(interactive)
412+
(when drupal-drush-program
413+
(let* ((tmp (ignore-errors
414+
(replace-regexp-in-string
415+
"[\n\r]" ""
416+
(with-output-to-string
417+
(with-current-buffer standard-output
418+
(call-process drupal-drush-program nil (list t nil) nil "core-status" "temp" "--pipe" "--format=list" "--strict=0"))))))
419+
(dd (concat tmp "/drupal_debug.txt")))
420+
(when (file-readable-p dd)
421+
(find-file-other-window dd)
422+
(auto-revert-tail-mode 1)))))
423+
406424

407425

408426
(defvar drupal-form-id-history nil

0 commit comments

Comments
 (0)