Add strace mode

This commit is contained in:
2026-08-16 16:24:01 -07:00
parent f332923172
commit fe65b9bbe4
2 changed files with 71 additions and 1 deletions
+4 -1
View File
@@ -2292,6 +2292,9 @@ This is :around advice, so OLDFUN is the real function
;; firejail
(require 'firejail-mode)
;; strace output
(require 'strace-mode)
;; yaml
(use-package yaml-ts-mode
:hook (;; (yaml-ts-mode . my/eglot-if-trusted)
@@ -3923,7 +3926,7 @@ one of the normal rainbow-delimiters-depth-N-face faces."
;; chatting
(use-package gptel
:defer t
:defer nil
:hook (gptel-mode . my/-setup-gptel-mode)
:custom-face (pulse-highlight-start-face ((default (:background "gray20"))))
:init
+67
View File
@@ -0,0 +1,67 @@
;;; strace-mode.el --- strace output syntax highlighting -*- lexical-binding: t -*-
;; Copyright © 2016, by Preston Moore
;; Author: Preston Moore (prestonkmoore@gmail.com)
;; Version: 0.0.2
;; Keywords: languages
;; Homepage: https://github.com/pkmoore/strace-mode
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This package provides a major mode with highlighting for output
;; from `strace'.
;;; Code:
;; create the list for font-lock.
;; each category of keyword is given a particular face
(defvar strace-font-lock-keywords)
(setq strace-font-lock-keywords `(
("^\\([0-9]+\\) " . (1 font-lock-warning-face))
("^[0-9]+ \\([a-zA-Z0-9_]*\\)(" . (1 font-lock-constant-face))
(" = 0x[[:xdigit:]]+ \\([[:upper:]]+\\).*$" . (1 font-lock-warning-face))
(" = -?[[:digit:]?]+ \\([[:upper:]]+\\).*$" . (1 font-lock-warning-face))
(" = \\(0x[[:xdigit:]]+\\).*$" . (1 font-lock-keyword-face))
(" = \\(-?[[:digit:]?]+\\).*$" . (1 font-lock-keyword-face))
("[ =\(\[\{]\\([[:upper:]_|]+\\)[] |\,\(\)\}]" . (1 font-lock-constant-face))
(" \\((.*)\\)$" . (1 font-lock-comment-face))
("\\(/\\*.*\\*/\\)" . (1 font-lock-comment-face))
("0x[[:xdigit:]]+" . font-lock-type-face)
("-?[[:digit:]]+" . font-lock-type-face)
)
)
;;;###autoload
(define-derived-mode strace-mode fundamental-mode
"strace"
"Major mode for strace output."
(setq font-lock-defaults '((strace-font-lock-keywords)))
)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.strace\\'" . strace-mode))
;; add the mode to the `features' list
(provide 'strace-mode)
;; Local Variables:
;; coding: utf-8
;; End:
;;; strace-mode.el ends here