holomorph / systemd-mode Goto Github PK
View Code? Open in Web Editor NEWMajor mode for editing systemd units
License: GNU General Public License v3.0
Major mode for editing systemd units
License: GNU General Public License v3.0
Related to #5, with the Emacs 26 pretest (26.0.90) and the following init file:
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(use-package systemd
:ensure t)
The following byte compilation error is being reported:
Compiling file /home/drot/.emacs.d/elpa/systemd-20171006.1352/systemd.el at Tue Oct 17 19:01:57 2017
Entering directory ‘/home/drot/.emacs.d/elpa/systemd-20171006.1352/’
Error (bytecomp): Opening input file: No such file or directory, /home/drot/.emacs.d/unit-directives.txt
Invoking systemd-doc-directives
opens man page for systemd.directives, which contains a list of directives. But I can't figure out how to jump to a man page of a particular directive.
would you mind adding automatic mode switching for systemd's edit
(usually with --full
) command. This command creates a temporary file of the form :
.#offlineimap.service71e9b5a2a790ace9
So basically I would need this:
(add-to-list 'auto-mode-alist '("\\.#.*\\.service[0-9a-f]*\\'" . systemd-mode))
up to you if you want for mount, timers etc.
Regards
When enabling company-mode
we get the following error while systemd-mode
is active:
Company backend ’t’ could not be initialized:
Symbol’s function definition is void: t
GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2016-08-22
On GNU Emacs 25.0.93.1
upon package-install
:
For information about GNU Emacs and the GNU system, type C-h C-a.
Importing package-keyring.gpg...done
Contacting host: melpa.org:443 [2 times]
Contacting host: elpa.gnu.org:80
Package refresh done [2 times]
Saving file /home/drot/.emacs.d/init.el...
Wrote /home/drot/.emacs.d/init.el [2 times]
Saving file /home/drot/.emacs.d/init.el...
Wrote /home/drot/.emacs.d/init.el [2 times]
Contacting host: melpa.org:443
Making version-control local to systemd-autoloads.el while let-bound!
Generating autoloads for systemd.el...done
Wrote /home/drot/.emacs.d/elpa/systemd-20160430.1915/systemd-autoloads.el
Error loading autoloads: (void-variable systemd-autoload-regexp)
Checking /home/drot/.emacs.d/elpa/systemd-20160430.1915... [3 times]
Compiling /home/drot/.emacs.d/elpa/systemd-20160430.1915/systemd.el...done
Wrote /home/drot/.emacs.d/elpa/systemd-20160430.1915/systemd.elc
Checking /home/drot/.emacs.d/elpa/systemd-20160430.1915...
Done (Total of 1 file compiled, 2 skipped)
Error loading autoloads: (void-variable systemd-autoload-regexp)
You can run the command ‘package-install’ with M-x p-ins RET
Error loading autoloads: (void-variable systemd-autoload-regexp)
For some reason something in the source code of this packages breaks Emacs 25.1.1 initialization because this error:
Eager macro-expansion failure: (file-error "Opening input file" "No such file or directory" "/home/jorge/unit-directives.txt")
progn: Opening input file: No such file or directory, /home/jorge/unit-directives.txt
This is my setup for systemd:
(use-package systemd)
systemd-nspawn
files are a bit different from service files, see systemd.nspawn(5).
I might add this support if I get the time, just tracking this for posterity.
Trying it on doom emacs, GNU Emacs 29.1, but running systemd-mode
in a buffer gives an error:
File mode specification error: (error Eager macro-expansion failure: (file-missing "Opening input file" "No such file or directory" "/home/user/.config/emacs/.local/straight/build-29.1/systemd-mode/unit-directives.txt"))
Hi. I think it's a regression bug related to #4 . I open a new issue because #4 is closed.
Now I still get the same error messages while systemd-mode
is active.
Company backend ’t’ could not be initialized:
Symbol’s function definition is void: t
My system info:
In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4)
of 2021-03-27 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Manjaro Linux
I checked source code, and found this line L410
Should it be changed to (add-hook 'completion-at-point-functions #'systemd-complete-at-point nil 'local)
?
I am not familiar with emacs lisp. It's just my guess, because L409 is (add-hook 'company-backends #'systemd-company-backend nil 'local)
, I think L410 and L409 are very similar, then maybe L410 should also use 'local
as the last parameter of add-hook
function.
This site https://elpa.gnu.org/packages/systemd.html mentioned about the file systemctl.el
, where is it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.