diff options
author | Ulrich Müller <ulm@gentoo.org> | 2024-08-10 19:53:36 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2024-08-10 19:53:36 +0200 |
commit | ab8dd19e115bbc43e5a6aaa90e0b524976eb50fe (patch) | |
tree | 6385b7b092c7971562e0aea24b0debc578612867 /ebuild-mode.el | |
parent | Move binding of format-time-string to a macro (diff) | |
download | ebuild-mode-ab8dd19e115bbc43e5a6aaa90e0b524976eb50fe.tar.gz ebuild-mode-ab8dd19e115bbc43e5a6aaa90e0b524976eb50fe.tar.bz2 ebuild-mode-ab8dd19e115bbc43e5a6aaa90e0b524976eb50fe.zip |
New function ebuild-mode-find-build-log
* ebuild-mode.el (ebuild-mode-find-build-log): New function.
(ebuild-mode-map, ebuild-mode-menu): Keybinding and menu entry.
* ebuild-mode.texi (ebuild-mode): Document it.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r-- | ebuild-mode.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el index 06a30a9..46af991 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -674,6 +674,23 @@ With prefix argument OTHER-WINDOW, visit the directory in another window." (find-file-other-window s) (find-file s))))) +(defun ebuild-mode-find-build-log (&optional other-window) + "Visit the build log for the ebuild in this buffer. +With prefix argument OTHER-WINDOW, visit the directory in another window." + (interactive "P") + (let ((build-log (concat (ebuild-mode-get-builddir) "/temp/build.log"))) + (unless (file-readable-p build-log) + (error "Cannot read file \"%s\"" build-log)) + (if other-window + (find-file-other-window build-log) + (find-file build-log)) + ;; decode ANSI SGR control sequences if possible (tty-format.el) + (and (assq 'ansi-colors format-alist) + (save-excursion + (goto-char (point-min)) + (re-search-forward "\e\\[[0-9;]*m" nil t)) + (format-decode-buffer 'ansi-colors)))) + ;;; Modify package keywords. ;; This is basically a reimplementation of "ekeyword" in Emacs Lisp. @@ -988,6 +1005,7 @@ in a Gentoo profile." ("\C-c\C-e\C-c" ebuild-mode-run-pkgcheck) ("\C-c\C-e\C-w" ebuild-mode-find-workdir) ("\C-c\C-e\C-s" ebuild-mode-find-s) + ("\C-c\C-e\C-l" ebuild-mode-find-build-log) ("\C-c\C-e\C-k" ebuild-mode-keyword) ("\C-c\C-e\C-y" ebuild-mode-ekeyword) ("\C-c\C-e\C-u" ebuild-mode-all-keywords-unstable) @@ -1011,6 +1029,8 @@ in a Gentoo profile." :active (eq major-mode 'ebuild-mode)] ["Find build directory (S)" ebuild-mode-find-s :active (eq major-mode 'ebuild-mode)] + ["Find build log" ebuild-mode-find-build-log + :active (eq major-mode 'ebuild-mode)] ["Insert ebuild skeleton" ebuild-mode-insert-skeleton :active (eq major-mode 'ebuild-mode)] ["Set/unset keyword" ebuild-mode-keyword] |