Organisational commit

Modified input method is the main highlight.
This commit is contained in:
2026-01-09 21:40:51 +09:00
parent 9cd88d6be9
commit f99504e8f0
5 changed files with 122 additions and 32 deletions

View File

@@ -1,8 +1,8 @@
;;; 15-lsp.el --- Setup LSP -*- no-byte-compile: t; lexical-binding: t; -*-
;;; Description:
;;; Commentary:
;; Despite the name, this file not only sets up LSP integration, but
;; also native emacs modes for various programming lanuguages, such as
;; also native Emacs modes for various programming lanuguages, such as
;; Prolog, that do not use LSP.
;;; Code:
@@ -28,13 +28,16 @@
(setq jsonrpc-event-hook nil))
;; This function raises the window to the front using KDE KWin.
(defun my/raise-window ()
(defun my-raise-window ()
"Raises the window to the front using KDE KWin.
Won't work if the script is not there."
(call-process-shell-command "~/wayland-window -f emacs &" nil 0))
;; Usually, when I open a file with emacsclient and the frame already exists, I
;; want it to be raised to the top. Unfortunately, that does not happen by
;; default. Here is my solution.
(add-hook 'server-visit-hook #'my/raise-window)
(add-hook 'server-visit-hook #'my-raise-window)
;; This package provides syntax highlighting for gdscript.
(use-package gdscript-mode
@@ -77,12 +80,24 @@
:ensure t
:defer t
:commands (prolog-mode)
:init
(setq ediprolog-program "systemd-run")
(setq ediprolog-program-switches '("--user" "--scope" "-p" "MemoryMax=2G" "-p" "MemoryHigh=1.9G" "scryer-prolog")))
:config
(my-ediprolog-select-system "swi-prolog"))
(defun ediprolog-set-term-type (orig &rest args)
"Advice to set the TERM env var to dumb for the function call.
Originally created for scryer prolog, as either it itself or systemd-run
used to constrain its resources assumed that the terminal supports
escape codes (it does not in this case), so this was used as an
\":around\" advice on 'ediprolog-run-prolog', to clearly indicate that
control codes are not supported."
(let ((process-environment process-environment))
(setenv "TERM" "dumb")
(apply orig args)))
(with-eval-after-load "prolog"
(bind-key "C-c C-e" #'ediprolog-dwim prolog-mode-map))
(bind-key "C-c C-e" #'ediprolog-dwim prolog-mode-map)
(advice-add 'ediprolog-run-prolog :around #'ediprolog-set-term-type))
(add-to-list 'auto-mode-alist '("\\.plt?\\'" . prolog-mode))
(add-to-list 'auto-mode-alist '("\\.axaml?\\'" . nxml-mode))
@@ -126,17 +141,17 @@
;; Add other languages as needed
(indent-bars-treesit-scope '((python function_definition class_definition for_statement
if_statement with_statement while_statement)
(rust trait_item impl_item
macro_definition macro_invocation
struct_item enum_item mod_item
const_item let_declaration
function_item for_expression
if_expression loop_expression
while_expression match_expression
match_arm call_expression
token_tree token_tree_pattern
(rust trait_item impl_item
macro_definition macro_invocation
struct_item enum_item mod_item
const_item let_declaration
function_item for_expression
if_expression loop_expression
while_expression match_expression
match_arm call_expression
token_tree token_tree_pattern
token_repetition)))
(indent-bars-treesit-wrap '((rust arguments parameters)))
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
;;; 15-lsp.el end here
;;; 15-lsp.el ends here