From 0d1d4e10c1850649eab601ef30676ab8c919a806 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 26 Dec 2024 00:11:10 -0800 Subject: [PATCH] Update firejail-mode.el --- elisp/firejail-mode.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/elisp/firejail-mode.el b/elisp/firejail-mode.el index e16be3c..1d4b497 100644 --- a/elisp/firejail-mode.el +++ b/elisp/firejail-mode.el @@ -1,6 +1,7 @@ ;;; firejail-mode --- Major mode for editing firejail profiles -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: +(require 'find-file) (defconst firejail-profile-font-lock-keywords (let* ((normal '("quiet" "include" "noblacklist" "nowhitelist" @@ -120,6 +121,11 @@ dbus-\\(system\\|user\\) +\\(none\\|filter\\)?\\)" . 2)) (point) firejail-profile--keyword-list))) +(defvar-keymap firejail-profile-mode-map + :doc "Keymap for `firejail-profile-mode'." + :parent prog-mode-map + "C-c C-o" #'ff-find-other-file) + (define-derived-mode firejail-profile-mode prog-mode "Firejail-Profile" "Major mode for editing firejail profiles." :syntax-table firejail-profile-syntax-table @@ -127,7 +133,14 @@ dbus-\\(system\\|user\\) +\\(none\\|filter\\)?\\)" . 2)) #'firejail-profile-capf) (setq-local font-lock-defaults '(firejail-profile-font-lock-keywords) comment-start "#" - comment-end "")) + comment-end "" + ff-search-directories + ;; the map page firejail-profile(5) seems to suggest that this + ;; does _NOT_ respect $XDG_CONFIG_HOME + `("." "~/.config/firejail" "/etc/firejail" + "/usr/share/etc/firejail") + ff-other-file-alist '(("\\.local\\'" (".profile")) + ("\\.profile\\'" (".local"))))) (add-to-list 'auto-mode-alist '("\\.\\(firejail\\|profile\\|local\\)$" . firejail-profile-mode))