Browse Source

Emacs: Improve buffer group separation for projects

master
Riyyi 1 week ago
parent
commit
9d7b1f5850
  1. 10
      .config/emacs/site-lisp/dot-development.el
  2. 26
      .config/emacs/site-lisp/dot-elpaca.el
  3. 1
      .config/emacs/site-lisp/dot-keybinds.el
  4. 1
      .config/emacs/site-lisp/dot-org-mode.el

10
.config/emacs/site-lisp/dot-development.el

@ -144,7 +144,11 @@
"Return project name."
(let ((project (project-current)))
(if project
(file-name-nondirectory (directory-file-name (project-root project)))
(let* ((project (file-truename (directory-file-name (project-root (project-current)))))
(parent-dir-full (file-name-directory (directory-file-name project)))
(parent-dir (file-name-nondirectory (substring parent-dir-full 0 -1)))
(filename (file-name-nondirectory project)))
(concat filename "/" parent-dir))
"-")))
(defun dot/project-save-project-buffers ()
@ -350,7 +354,9 @@
;;; HTML
(elpaca-setup web-mode)
(elpaca-setup web-mode
(:file-match "\\.ts")
(:file-match "\\.vue"))
;;; Kotlin

26
.config/emacs/site-lisp/dot-elpaca.el

@ -9,7 +9,7 @@
;; -----------------------------------------
;; Elpaca bootstrap
(defvar elpaca-installer-version 0.7)
(defvar elpaca-installer-version 0.8)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
@ -26,18 +26,18 @@
(make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))

1
.config/emacs/site-lisp/dot-keybinds.el

@ -41,6 +41,7 @@
"M-j" nil
"M-k" nil
"M-l" nil
"<pinch>" nil ; Do not scale text when pinching touchpad
)))
(elpaca-nil (setup org

1
.config/emacs/site-lisp/dot-org-mode.el

@ -190,6 +190,7 @@ When ANYWHERE is non-nil, search beyond the preamble."
(elpaca-nil (setup ox-latex ; built-in
(:when-loaded
;; Define how minted (highlighted src code) is added to src code blocks
;; Requires packages: texlive-bin, texlive-latexextra and python-pygments
(setq org-latex-listings 'minted)
(setq org-latex-minted-options '(("frame" "lines") ("linenos=true")))
;; Set 'Table of Contents' layout

Loading…
Cancel
Save