unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 1/3] emacs: Enable 'guix-build-log-mode' for build log files.
Date: Thu, 29 Oct 2015 23:32:54 +0300	[thread overview]
Message-ID: <878u6lza89.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

As suggested by Ludovic on IRC, after this patch, build log files (from
/var/log/guix/drvs) will be displayed in a 'guix-build-log-mode'.

I'm not sure about regexp though: are these files always "bz2" and
".../XX/XXXXX-30-more-characters-XXXXX/..."?

I didn't put "/var/log" in the beginning of the regexp to match, for example, /mnt/guix-from-sdc/var/log/guix/... files or alike.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-emacs-Enable-guix-build-log-mode-for-build-log-files.patch --]
[-- Type: text/x-patch, Size: 1037 bytes --]

From 5a2beec8d91334ea755b709e51492c44fd2d0773 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Thu, 29 Oct 2015 20:48:53 +0300
Subject: [PATCH 1/3] emacs: Enable 'guix-build-log-mode' for build log files.

* emacs/guix-build-log.el (auto-mode-alist): Add 'guix-build-log-mode'
  to 'auto-mode-alist'.
---
 emacs/guix-build-log.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/emacs/guix-build-log.el b/emacs/guix-build-log.el
index c0855b2..0e13213 100644
--- a/emacs/guix-build-log.el
+++ b/emacs/guix-build-log.el
@@ -329,6 +329,13 @@ programmatically using hooks:
   (when font-lock-mode
     (font-lock-fontify-buffer)))
 
+;;;###autoload
+(add-to-list 'auto-mode-alist
+             ;; Regexp for log files (usually placed in /var/log/guix/...)
+             (cons (rx "guix/drvs/" (= 2 alnum) "/" (= 30 alnum)
+                       "-" (+ (any alnum "-.")) ".drv.bz2" string-end)
+                   'guix-build-log-mode))
+
 (provide 'guix-build-log)
 
 ;;; guix-build-log.el ends here
-- 
2.5.0


             reply	other threads:[~2015-10-29 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 20:32 Alex Kost [this message]
2015-10-30 16:49 ` [PATCH 1/3] emacs: Enable 'guix-build-log-mode' for build log files Ludovic Courtès
2015-10-31 20:30   ` Alex Kost
2015-11-01 17:20     ` Ludovic Courtès
2015-11-02 13:01       ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878u6lza89.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).