Emacs. Desire. Конфигурация

2024-06-11 · 121 мин. для прочтения
blog computer-science

Конфигурация для пакета desire.

Содержание

1 Каталоги конфигурации

2 Установка переменных

3 Верхняя строка

  • В строке задаём язык программирования, режимы.
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    

4 Заголовок

  • В файле rc.packages.el находится список используемых пакетов.

  • Заголовок файла:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; rc.packages.el
    
    ;;; Commentary:
    
    ;;
    ;;  File id
    ;;
    ;;      Copyright (C)  2002-2026 Dmitry S. Kulyabov
    ;;      Keywords:      rc.packages
    ;;      Author:        Dmitry S. Kulyabov <yamadharma@gmail.com>
    ;;      Maintainer:    Dmitry S. Kulyabov <yamadharma@gmail.com>
    ;;
    ;;      This code is free software in terms of GNU Gen. pub. Lic. v3 or later
    ;;
    
    ;;;  Description:
    
    ;;; Change Log:
    
    ;;; Code:
    
    Распечатка 1: rc.packages.el
  • Файл:

;; (desire-conf 'tiny)
(desire-conf 'personal)
;;
;; Mule
;;
(desire-conf 'mule)
;;(desire-conf 'mule-fontset)
;; ----------------------------------------------------------------------
;;
;;{{{ Xemacs

(if (string-match "XEmacs" emacs-version)
    (desired 'xemacs))

;;}}}

5 Управление пакетами

;;; Package management

5.1 Встроенный пакетный менеджер

5.1.1 Подключение

  • Файл: rc.packages.el
;;;; Packaging
(desire 'package)

5.1.2 Загрузка

  • Файл: packages/package/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Set up the package
    
    ;;; Code:
    
    (setopt warning-suppress-log-types '((package reinitialization)))
    
    (setopt package-enable-at-startup nil
          package-user-dir (concat home-data-path "elpa/")
          package-gnupghome-dir (expand-file-name "gpg" package-user-dir))
    
    (require 'package)
    
    ;;;
    

5.1.3 Настройка

  • Файл: packages/package/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    
    ;;; Code:
    
    ;;;
    

5.1.4 Компиляция пакетов

  • Файл: packages/package/desire.ecd/native-compile.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Set up the package
    
    ;;; Code:
    
    ;;;; Supports ahead-of-time native compilation when installing a package
    (setopt package-native-compile t)
    
    ;;;
    

5.1.5 Обновлять встроенные пакеты

  • Файл: packages/
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Set up the package
    
    ;;; Code:
    
    ;;;; Upgrade built-in packages
    (setopt package-install-upgrade-built-in t)
    
    ;;;
    

5.1.6 Репозитории

  • Файл: packages/package/desire.ecd/repos.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Set up repos
    
    ;;; Code:
    
    ;;;; Repos
    ;;;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
    
    (setopt package-archives
          '(("gnu" . "https://elpa.gnu.org/packages/")
            ("nongnu" . "https://elpa.nongnu.org/nongnu/")
            ("gnu-devel" . "https://elpa.gnu.org/devel/")
            ("melpa" . "https://melpa.org/packages/")
            ("melpa-stable" . "https://stable.melpa.org/packages/")))
    
    ;;;; Mirror for some Emacs package archives
    ;;;; https://github.com/d12frosted/elpa-mirror
    ;; (setopt package-archives
    ;;       '(("melpa" . "https://raw.githubusercontent.com/d12frosted/elpa-mirror/master/melpa/")
    ;; 	("melpa-stable" . "https://raw.githubusercontent.com/d12frosted/elpa-mirror/master/stable-melpa")
    ;;         ("gnu" . "https://raw.githubusercontent.com/d12frosted/elpa-mirror/master/gnu/")
    ;; 	("nongnu" . "https://raw.githubusercontent.com/d12frosted/elpa-mirror/master/nongnu")))
    
    ;;;; https://gitlab.com/d12frosted/elpa-mirror/
    ;; (setopt package-archives
    ;;       '(("melpa" . "https://gitlab.com/d12frosted/elpa-mirror/-/tree/master/melpa")
    ;; 	("melpa-stable" . "https://gitlab.com/d12frosted/elpa-mirror/-/tree/master/stable-melpa")
    ;;         ("gnu" . "https://gitlab.com/d12frosted/elpa-mirror/-/tree/master/gnu")
    ;; 	("nongnu" . "https://gitlab.com/d12frosted/elpa-mirror/-/tree/master/nongnu")))
    
    (unless package--initialized
      (package-initialize))
    
    ;;;; Refreshing the content or the list-packages in case it is empty
    (when (not package-archive-contents)
      (package-refresh-contents))
    
    ;;;; Dirty hack
    (setopt package-check-signature nil)
    ;;;; Network timeout
    (setopt url-request-timeout 10)  ; 10 секунд
    
    (desire 'gnu-elpa-keyring-update)
    
    ;;;
    

5.2 Пакетный менеджер quelpa

  • Необходим для emacs-29 и старше.
  • Начиная с emacs-30 можно использовать package-vc.
  • Подключение:
    ;;; Build and install your Emacs Lisp packages on-the-fly and directly from source
    ;; (desire 'quelpa)
    
    Распечатка 2: rc.packages.el
  • Загружаем:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Build and install your Emacs Lisp packages on-the-fly directly from source
    ;; https://github.com/quelpa/quelpa
    
    (require 'quelpa)
    
    ;;;
    
    Распечатка 3: packages/quelpa/loaddefs.ecf
  • Асинхронные операции:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Build and install your Emacs Lisp packages on-the-fly directly from source
    ;; https://github.com/quelpa/quelpa
    
    ;;; If non-nil, quelpa operation will not block Emacs input
    ;; (setopt quelpa-async-p t)
    
    ;;;
    
    Распечатка 4: packages/quelpa/desire.ecf
  • Обновление пакетов:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Build and install your Emacs Lisp packages on-the-fly directly from source
    ;; https://github.com/quelpa/quelpa
    
    ;;; To run quelpa-upgrade-all at most every 14 days
    ;; (setopt quelpa-upgrade-interval 14)
    ;; (add-hook #'after-init-hook #'quelpa-upgrade-all-maybe)
    
    ;;;
    
    Распечатка 5: packages/quelpa/personal.ecf

5.3 Пакетный менеджер straight

;;; A declarative package management system with a command line interface
(desire 'straight)

5.4 Автообновление пакетов

;;; Auto update packages
(desire 'auto-package-update)

;;;}}}

6 Компиляция файлов

6.1 compile-angel

  • Подключим пакет:
    ;;; compile-angel.el
    (desire 'compile-angel)
    
    Распечатка 6: rc.packages.el
  • Настроим начальную конфигурацию:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Compile Emacs Lisp libraries automatically.
    ;;; https://github.com/jamescherti/compile-angel.el
    
    ;; (require 'compile-angel)
    
    ;;;
    
    Распечатка 7: packages/compile-angel/loaddefs.ecf
  • Настроим основные параметры:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Compile Emacs Lisp libraries automatically.
    ;;; https://github.com/jamescherti/compile-angel.el
    
    ;;; Ensure Emacs loads the most recent byte-compiled files.
    (setopt load-prefer-newer t)
    
    ;;; Ensure JIT compilation is enabled for improved performance by
    ;;; native-compiling loaded .elc files asynchronously
    (setopt native-comp-jit-compilation t)
    (setopt native-comp-deferred-compilation t) ; Deprecated in Emacs > 29.1
    
    ;;; Enable/Disable byte compilation and native compilation
    (setopt compile-angel-enable-byte-compile t)
    (setopt compile-angel-enable-native-compile t)
    
    ;;; Enable verbose (Set it to t while debugging)
    (setopt compile-angel-verbose nil)
    
    ';; Display the *Compile-Log* buffer (Set it to t while writing elisp)
    (setopt compile-angel-display-buffer nil)
    
    ;;; Perform byte/native compilation of .el files only once during initial loading
    ;;; (Setting this to nil will try to compile each time an .el file is loaded)
    (setopt compile-angel-on-load-mode-compile-once t)
    
    ;;; Ignore certain files, for example, for users of the `dir-config` package:
    (setopt compile-angel-excluded-files-regexps '("/\\.dir-config\\.el$"))
    
    ;;; Function that determines if an .el file should be compiled. It takes one
    ;;; argument (an EL file) and returns t if the file should be compiled,
    ;;; (By default, `compile-angel-predicate-function` is set to nil, which
    ;;; means that the predicate function is not called.)
    (setopt compile-angel-predicate-function
          #'(lambda(el-file)
           ;; Show a message
           (message "PREDICATE: %s" el-file)
           ;; Return t (Compile all)
           t))
    
    ;; Ensure that quitting only occurs once Emacs finishes native compiling,
    ;; preventing incomplete or leftover compilation files in `/tmp`.
    (setopt native-comp-async-query-on-exit t)
    (setopt confirm-kill-processes t)
    
    ;;; Show buffer when there is a warning.
    ;;; (NOT RECOMMENDED, except during development).
    ;; (setopt warning-minimum-level :warning)
    ;; (setopt byte-compile-verbose t)
    ;; (setopt byte-compile-warnings t)
    ;; (setopt native-comp-async-report-warnings-errors t)
    ;; (setopt native-comp-warning-on-missing-source t)
    
    ;;; Non-nil means to natively compile packages as part of their installation.
    (setopt package-native-compile t)
    
    (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
    
    (compile-angel-on-save-mode)
    (compile-angel-on-load-mode)
    
    ;;;
    
    Распечатка 8: packages/compile-angel/desire.ecf

7 Системные настройки


;; (desire 'esup)

7.1 Разные настройки

  • Покидал сюда разные настройки, которые не знаю, куда разместить.
  • Подключение:
    (desire-conf 'site-stuff)
    
    Распечатка 9: rc.packages.el
  • Подключение:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    
    ;;; Code:
    
    Распечатка 10: packages/site-stuff.ecf
  • Изменение поведения C-g:
    ;;;; Make C-g a bit more helpful
    ;;;;; https://protesilaos.com/codelog/2024-11-28-basic-emacs-configuration/
    
    (defun ecf/keyboard-quit-dwim ()
      "Do-What-I-Mean behaviour for a general `keyboard-quit'.
    
    The generic `keyboard-quit' does not do the expected thing when
    the minibuffer is open.  Whereas we want it to close the
    minibuffer, even without explicitly focusing it.
    
    The DWIM behaviour of this command is as follows:
    
    - When the region is active, disable it.
    ​- When a minibuffer is open, but not focused, close the minibuffer.
    ​- When the Completions buffer is selected, close it.
    ​- In every other case use the regular `keyboard-quit'."
      (interactive)
      (cond
       ((region-active-p)
        (keyboard-quit))
       ((derived-mode-p 'completion-list-mode)
        (delete-completion-window))
       ((> (minibuffer-depth) 0)
        (abort-recursive-edit))
       (t
        (keyboard-quit))))
    
    (define-key global-map (kbd "C-g") #'ecf/keyboard-quit-dwim)
    
    Распечатка 11: packages/site-stuff.ecf
  • Оформление интерфейса:
    ;;;; Scroll bar mode
    (set-scroll-bar-mode 'left)
    (scroll-bar-mode -1)
    
    ;;;; Disable the toolbar
    (tool-bar-mode -1)
    
    ;;;; Menu bar
    (menu-bar-mode 1)
    
    Распечатка 12: packages/site-stuff.ecf
;;; Automatic decompression, hooks for tar-mode
;;;
;;(require 'jka-compr)
(auto-compression-mode t)

(require 'icomplete) ; Interactive completion in minibuffer.

;; Strip hostname from domain when posting news
                                      ;(setopt gnus-use-generic-from t)

                                      ;(auto-compression-mode t)
;; Time in 24 hour format, plus day and date.
;;
(add-hook 'write-file-hooks 'time-stamp)
                                      ; (require 'mc)


(setopt max-specpdl-size 1000)


;;; Set the fringe a little wider to ensure the text isn’t too close to the window border
;; (fringe-mode 16 . nil)

;; Strip iccc encoding when paste from clipboard
                                      ;(defun fix-rus-letter ()
                                      ;  (interactive)
                                      ;  (goto-char (point-min))
                                      ;  (while (search-forward-regexp ".%/1..koi8-r." nil t)
                                      ;    (replace-match ""))
                                      ;)

;;; Показывает пробелы и табы в конце строк
(setopt show-trailing-whitespace t)

;;; Prevent horizontal window splitting for Emacs 23
;; (setopt split-width-threshold 9999)

(setopt inhibit-startup-message t)

(fset 'yes-or-no-p 'y-or-n-p)

;;; Отключить создание резервных копий
(custom-set-variables '(make-backup-files nil "Отключить создание резервных копий"))

;;; Cursor
(custom-set-variables '(cursor-type 'bar "Внешний вид курсора — вертикальная черта"))
;; Отключить мерцание курсора
(blink-cursor-mode 0)

;;; Highlight Current Line
(global-hl-line-mode 1)

;;; Warnings
;;; Disable report warnings and errors from asynchronous native compilation
(setopt native-comp-async-report-warnings-errors nil)

;;; Not to warn you about anything except problems
;;; :debug | :warning | :error | :emergency
(setopt warning-minimum-level :error)

;;; Don't pop up UI dialogs when prompting
(setopt use-dialog-box nil)

;;; Revert buffers when the underlying file has changed
(global-auto-revert-mode 1)
;;; Revert Dired and other buffers
(setopt global-auto-revert-non-file-buffers t)

;;; Make searches case insensitive
(setopt case-fold-search t)

;;; Tab completion in minibuffer: case insensitive
(setopt completion-ignore-case  t)

;;;

7.2 Разное


;;{{{ Window System

(if (null window-system)
    ()
  (progn
    (desire-conf 'window-system)
                                        ;    (desire-conf  'faces)
                                        ;    (desire-conf  'multi-frame)
    )
  )


;; (if (null window-system)
;;  ()
;;  (desire-conf 'window-system)
;; )

;; (desire-conf 'window-system)
;; (desire-conf 'test)

;; (if (eq window-system 'w32)
;;  (progn
;;    (desired 'window-system)
;;    (desired 'window-system-w32)
;;  )
;; )

;; (if (and window-system
;;	 (member window-system '(x gtk))
;;	 (x-display-color-p)
;;    )
;;    (progn
;;      (desired 'window-system)
;;      (desire-conf  'faces)
;;      (desire-conf  'multi-frame)
;;    )
;; )

;;}}}
;;{{{ Serve

;;; Gnuserv
;;(desire-conf 'gnuserv nil "gnuserv")
;; Rely on dtemacs to do this, otherwise a race condition can cause
;; dtemacs to fail.
;; (gnuserv-start)

;;; Emacs daemon
;; (desire-conf 'emacs-daemon)

;;; Emacs server
(desire 'server)

;;}}}

(desire 'general)

(desire 'exec-path-from-shell)
(desire 'compat)

(desire 'async)

7.3 Тьюнинг сборщика мусора

  • Подключение:
    (desire 'gcmh)
    
    Распечатка 13: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; The Garbage Collector Magic Hack
    ;; https://gitlab.com/koral/gcmh
    
    ;;; Code:
    
    (require 'gcmh)
    
    ;;; https://github.com/doomemacs/doomemacs/issues/3108
    (setopt gcmh-high-cons-threshold 33554432)  ; 32mb, or 64mb, or *maybe* 128mb, BUT NOT 512mb
    
    (gcmh-mode 1)
    
    ;;;
    
    Распечатка 14: packages/gcmh.ecf

8 Общие настройки мод

9 Поддержка LSP

9.1 Начало

  • Файл rc.packages.el:
    ;;; LSP mode {{{
    
    Распечатка 15: rc.packages.el

9.2 emacs-lsp-booster

  • Включаем поддержку emacs-lsp-booster:
    (desired 'emacs-lsp-booster :precondition-system-executable "emacs-lsp-booster")
    
    Распечатка 16: rc.packages.el

9.3 Eglog

9.3.1 Eglot

  • Файл rc.packages.el:
    (desire 'eglot)
    
    Распечатка 17: rc.packages.el
  • Начальная загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A client for Language Server Protocol servers
    ;;; https://github.com/joaotavora/eglot
    
    ;;;
    
    Распечатка 18: packages/eglot/loaddefs.ecf
  • Загрузка самого пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A client for Language Server Protocol servers
    ;;; https://github.com/joaotavora/eglot
    
    (require 'eglot)
    
    ;;; Control blocking of LSP connection attempts
    (setopt eglot-sync-connect nil)
    
    (setopt eglot-connect-timeout 10)
    (setopt eglot-autoshutdown t)
    (setopt eglot-send-changes-idle-time 0.5)
    
    ;;; Disable `eglot-auto-display-help-buffer` because :select t in its popup rule causes eglot to steal focus too often.
    (setopt eglot-auto-display-help-buffer nil)
    
    ;;; Disable any debug logging and may speed things up
    (setopt eglot-events-buffer-size 0)
    
    ;;;
    
    Распечатка 19: packages/eglot/desire.ecf
  • Загрузка emacs-lsp-booster:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Boost eglot using lsp-booster
    ;;; https://github.com/jdtsmith/eglot-booster
    
    (desire 'eglot-booster :recipe '(:fetcher github :repo "jdtsmith/eglot-booster" :branch "main" :files ("*.el")))
    (require 'eglot-booster)
    (eglot-booster-mode)
    
    ;;;
    
    Распечатка 20: packages/eglot/emacs-lsp-booster.ecf

9.3.2 Дополнительные пакеты

  1. LaTeX

    • Загрузим поддержку LSP для LaTeX:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; A client for Language Server Protocol servers
      ;;; https://github.com/joaotavora/eglot
      
      (require 'eglot)
      
      ;;; Switch to texlab
      (when (executable-find "texlab")
        (setf (alist-get '(latex-mode plain-tex-mode context-mode texinfo-mode bibtex-mode tex-mode)
                         eglot-server-programs
                         nil nil #'equal)
              '("texlab")))
      
      (add-hook 'tex-mode-hook #'eglot-ensure)
      (add-hook 'latex-mode-hook #'eglot-ensure)
      (add-hook 'LaTeX-mode-hook #'eglot-ensure)
      (add-hook 'bibtex-mode-hook #'eglot-ensure)
      (add-hook 'plain-tex-mode-hook #'eglot-ensure)
      (add-hook 'context-mode-hook #'eglot-ensure)
      (add-hook 'texinfo-mode-hook #'eglot-ensure)
      
      ;;;
      
      Распечатка 21: packages/auctex/eglot.ecf

9.4 Lsp-mode

9.4.1 Собственно lsp-mode

  • Подключим lsp-mode:
    ;; (desire 'lsp-mode)
    
    Распечатка 22: rc.packages.el
  • Первоначальная конфигурация:
    ;;; Language Server Protocol support for Emacs  -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; https://emacs-lsp.github.io/
    ;; https://github.com/emacs-lsp/lsp-mode
    
    ;;;
    
    Распечатка 23: packages/lsp-mode/loaddefs.ecf
  • Конфигурация:
    ;;; Language Server Protocol support for Emacs  -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; https://emacs-lsp.github.io/
    ;; https://github.com/emacs-lsp/lsp-mode
    
    (require 'lsp-mode)
    
    ;;; https://emacs-lsp.github.io/lsp-ui/
    (desire 'lsp-ui)
    
    ;;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
    (setopt lsp-keymap-prefix "C-l")
    
    ;;;
    
    Распечатка 24: packages/lsp-mode/desire.ecf

9.4.2 Дополнительные пакеты

  1. LaTeX (texlab)

    • Загрузим поддержку LSP для LaTeX:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs lsp-mode client for LaTeX, on texlab
      ;; https://github.com/ROCKTAKEY/lsp-latex
      
      ;;; Code:
      
      (require 'lsp-mode)
      (desire 'lsp-latex :precondition-system-executable "texlab")
      
      ;;;
      
      Распечатка 25: packages/auctex/lsp-mode.ecf
    • Загрузка lsp-latex:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs lsp-mode client for LaTeX, on texlab
      ;; https://github.com/ROCKTAKEY/lsp-latex
      
      ;;; Code:
      
      (require 'lsp-latex)
      
      ;;;; "texlab" executable must be located at a directory contained in `exec-path'.
      ;;;; If you want to put "texlab" somewhere else, you can specify the path to "texlab" as follows:
      ;; (setopt lsp-latex-texlab-executable "/path/to/texlab")
      
      ;;;
      
      Распечатка 26: packages/lsp-latex/loaddefs.ecf
    • Настройка lsp-latex:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs lsp-mode client for LaTeX, on texlab
      ;;; https://github.com/ROCKTAKEY/lsp-latex
      
      ;;; Code:
      
      (add-hook 'tex-mode-hook #'lsp)
      (add-hook 'latex-mode-hook #'lsp)
      (add-hook 'LaTeX-mode-hook #'lsp)
      (add-hook 'LaTeX-mode-hook #'lsp)
      
      ;;;; For YaTeX
      (with-eval-after-load "yatex"
        (add-hook 'yatex-mode-hook #'lsp))
      
      ;;;; For bibtex
      (with-eval-after-load "bibtex"
        (add-hook 'bibtex-mode-hook #'lsp))
      
      ;;;
      
      Распечатка 27: packages/lsp-latex/desire.ecf
  1. lsp-treemacs

    • Подключение интеграции treemacs и lsp-mode:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; lsp-mode ❤️ treemacs
      ;;; https://github.com/emacs-lsp/lsp-treemacs
      
      ;;; Code:
      
      (require 'lsp-mode)
      
      (desire 'lsp-treemacs)
      (require 'lsp-treemacs)
      
      ;;; Enable bidirectional synchronization of lsp workspace folders and treemacs projects
      (lsp-treemacs-sync-mode 1)
      
      ;;;
      
      Распечатка 28: packages/treemacs/lsp-mode.ecf
  1. which-key

    • Подключение интеграции treemacs и lsp-mode:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; lsp which-key integration
      ;; https://emacs-lsp.github.io/lsp-mode/page/keybindings/
      
      ;;; Code:
      
      (with-eval-after-load 'lsp-mode
        (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration))
      
      ;;;
      
      Распечатка 29: packages/which-key/lsp-mode.ecf

10 Сессии

;;{{{ Session Management

(desire 'savehist)

;;}}}

11 Утилиты

(desire 'uniquify)

(desire-conf 'keys)
(desire-conf 'dialog)
(desire-conf 'mouse)

11.1 xclip

  • Emacs. xclip
  • Подключение:
    (desire 'xclip)
    
    Распечатка 30: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Copy&paste GUI clipboard from text terminal
    ;; https://elpa.gnu.org/packages/xclip.html
    
    ;;; Code:
    
    (require 'xclip)
    
    Распечатка 31: packages/xclip.ecf
  • Какие-то шаманства:
    ;; (when (getenv "WAYLAND_DISPLAY")
    ;;   ;; Without this, copy and pasting from other wayland apps into
    ;;   ;; emacs-pgtk doesn't work.
    ;;   ;; https://www.emacswiki.org/emacs/CopyAndPaste#h5o-4
    ;;   (setopt wl-copy-process nil)
    ;;   (defun wl-copy (text)
    ;;     (setopt wl-copy-process (make-process :name "wl-copy"
    ;;                                         :buffer nil
    ;;                                    :command '("wl-copy" "-f" "-n")
    ;;                                    :connection-type 'pipe
    ;;                                    :noquery t))
    ;;     (process-send-string wl-copy-process text)
    ;;     (process-send-eof wl-copy-process))
    
    ;;   (defun wl-paste ()
    ;;     (if (and wl-copy-process (process-live-p wl-copy-process))
    ;;         nil ; should return nil if we're the current paste owner
    ;;       (shell-command-to-string "wl-paste -n | tr -d \r")))
    ;;   (setopt interprogram-cut-function 'wl-copy)
    ;;   (setopt interprogram-paste-function 'wl-paste))
    
    Распечатка 32: packages/xclip.ecf
  • Явное включение для оконного режима (https://github.com/doomemacs/doomemacs/issues/5219):
    (add-hook 'window-setup-hook #'xclip-mode)
    
    Распечатка 33: packages/xclip.ecf
  • Необходима строчка 'text/plain\;charset=utf-8 в x-select-request-type (https://github.com/doomemacs/doomemacs/issues/5219):
    (setopt x-select-request-type nil)
    
    ;;;
    
    Распечатка 34: packages/xclip.ecf

11.2 which-key

  • Подключение:
    (desire 'which-key)
    
    Распечатка 35: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs package that displays available keybindings in popup
    ;;; https://github.com/justbur/emacs-which-key
    
    (require 'which-key)
    
    ;;;
    
    Распечатка 36: packages/which-key/loaddefs.ecf
  • Конфигурация:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs package that displays available keybindings in popup
    ;; https://github.com/justbur/emacs-which-key
    
    ;;; Code:
    
    ;;;; Key-Based replacement
    (which-key-add-key-based-replacements "C-x C-f" "find files")
    (which-key-add-major-mode-key-based-replacements
     'org-mode
     "C-c C-c" "Org C-c C-c"
     "C-c C-a" "Org Attach")
    
    ;;;; Key and Description replacement
    (add-to-list 'which-key-replacement-alist '(("TAB" . nil) . ("↹" . nil)))
    (add-to-list 'which-key-replacement-alist '(("RET" . nil) . ("⏎" . nil)))
    (add-to-list 'which-key-replacement-alist '(("DEL" . nil) . ("⇤" . nil)))
    (add-to-list 'which-key-replacement-alist '(("SPC" . nil) . ("␣" . nil)))
    
    ;; Set the special keys. These are automatically truncated to one character and
    ;; have which-key-special-key-face applied. Disabled by default. An example
    ;; setting is
    ;; (setopt which-key-special-keys '("SPC" "TAB" "RET" "ESC" "DEL"))
    (setopt which-key-special-keys nil)
    
    
    ;;;; Sorting Options
    ;;;;; Default
    (setopt which-key-sort-order 'which-key-key-order)
    ;;;;; Same as default, except single characters are sorted alphabetically
    ;; (setopt which-key-sort-order 'which-key-key-order-alpha)
    ;;;;; Same as default, except all prefix keys are grouped together at the end
    ;; (setopt which-key-sort-order 'which-key-prefix-then-key-order)
    ;;;;; Same as default, except all keys from local maps shown first
    ;; (setopt which-key-sort-order 'which-key-local-then-key-order)
    ;;;;; Sort based on the key description ignoring case
    ;; (setopt which-key-sort-order 'which-key-description-order)
    
    ;;;; Popup Type Options
    ;;;; minibuffer | side-window | frame | custom
    (setopt which-key-popup-type 'minibuffer)
    
    ;;;;; Set the time delay (in seconds) for the which-key popup to appear
    (setopt which-key-idle-delay 1.0)
    (setopt which-key-idle-secondary-delay 0.05)
    
    ;;;; Set the maximum length (in characters) for key descriptions (commands or prefixes)
    (setopt which-key-max-description-length 27)
    
    ;;;; Use additional padding between columns of keys
    (setopt which-key-add-column-padding 0)
    
    ;;;; The maximum number of columns to display in the which-key buffer
    (setopt which-key-max-display-columns nil)
    
    
    ;;;; Use unicode
    (setopt which-key-dont-use-unicode nil)
    
    ;;;; Set the separator used between keys and descriptions
    (setopt which-key-separator " → " )
    (setopt which-key-unicode-correction 3)
    
    ;;;; Set the prefix string that will be inserted in front of prefix commands
    (setopt which-key-prefix-prefix "+" )
    
    ;;;; Show the key prefix on the left, top, or bottom (nil means hide the prefix)
    (setopt which-key-show-prefix 'left)
    
    ;;;; Set to t to show the count of keys shown vs. total keys in the mode line
    (setopt which-key-show-remaining-keys nil)
    
    ;;;; Show actual combinations
    (setopt which-key-computer-remaps t)
    
    ;;;; Like [C-h m]
    (setopt which-key-show-major-mode t)
    
    ;;;; Enable globally
    (which-key-mode)
    
    ;;;
    
    Распечатка 37: packages/which-key/desire.ecf

11.3 Разное

;; (desire 'keycast)

;; ----------------------------------------------------------------------

(desire 'pcache)
(desire 'persistent-soft)

(desire 'alert)

(desire 'rg :precondition-system-executable "rg")
  • В файле используется фолдинг по тройной скобке.

12 Оформление интерфейса

  • Файл rc.packages.el:
;;;; User interface
Распечатка 38: rc.packages.el

12.1 Шрифты

12.1.1 Идентификатор раздела

  • Файл: rc.packages.el
    ;;;;; Fonts
    

12.1.2 Шрифт Iosevka

  1. Подключение

    • Файл: rc.packages.el
      (desired 'iosevka)
      
  1. Интеграция: fontset

    • Файл: packages/fontset/iosevka.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set Iosevka font
      ;; https://be5invis.github.io/Iosevka/
      
      ;;; Code:
      
      (add-to-list 'default-frame-alist '(font . "Iosevka Nerd Font-12" ))
      (add-to-list 'initial-frame-alist '(font . "Iosevka Nerd Font-12" ))
      
      (set-face-attribute 'default nil
                          :font "Iosevka Nerd Font"
                          :height 120)
      
      (set-face-attribute 'fixed-pitch nil
                          :font "Iosevka Nerd Font"
                          :height 120)
      
      (set-face-attribute 'variable-pitch nil
                          :font "Iosevka Aile"
                          :height 120)
      
      (dolist (charset '(latin cyrillic greek))
        (set-fontset-font 't charset
                          (font-spec :family "Iosevka Nerd Font" :size 12.0)))
      
      ;;;
      
  1. Интеграция: fontaine

    • Файл: packages/fontaine/iosevka.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set Iosevka font
      ;; https://be5invis.github.io/Iosevka/
      
      ;;; Code:
      
      (setopt fontaine-presets
              '((regular-editing
                 :default-family "Iosevka Nerd Font"
                 :default-weight normal
                 :default-height 120
                 :fixed-pitch-family "Iosevka Nerd Font"
                 :fixed-pitch-height 1.0
                 :variable-pitch-family "Iosevka Aile"
                 :variable-pitch-height 1.0
                 :bold-weight bold
                 :italic-slant italic
                 :line-spacing 1)
      
                (presentation
                 :inherit regular-editing
                 :default-height 180)
      
                (compact
                 :inherit regular-editing
                 :default-height 90
                 :line-spacing 0)))
      
      ;;;; Apply
      (fontaine-set-preset 'regular-editing)
      (fontaine-mode 1)
      
      ;;;
      
  1. Интеграция: ligature

    • Файл: packages/ligature/iosevka.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set Iosevka font
      ;; https://be5invis.github.io/Iosevka/
      
      ;;; Code:
      
      (ligature-set-ligatures
       '(prog-mode org-mode)
       '("<---" "<--"  "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
         "<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
         "<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
         ":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
      
      ;;; Enables ligature checks globally in all buffers. You can also do it per mode with `ligature-mode'.
      (global-ligature-mode t)
      
      ;; (global-ligature-mode -1)  ; отключить
      ;; (global-ligature-mode 1)   ; включить заново
      
      ;;;
      
  1. Интеграция: org-modern

    • Файл: packages/org-modern/iosevka.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set Iosevka font
      ;; https://be5invis.github.io/Iosevka/
      
      ;;; Code:
      
      ;;;; Choose fonts
      
      (set-face-attribute 'org-modern-symbol nil
                          :family "Iosevka Nerd Font")
      
      ;;;
      

12.1.3 Лигатуры

  1. Подключение

    • Файл: rc.packages.el
      (desire 'ligature)
      
  1. Загрузка

    • Файл: packages/ligature/loaddefs.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Display typographical ligatures in Emacs
      ;; https://github.com/mickeynp/ligature.el
      
      ;;; Code:
      
      (require 'ligature)
      
      ;;;; For every mode
      (ligature-set-ligatures
       't
       '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\"
         "{-" "::" ":::" ":=" "!!" "!=" "!==" "-}"
         "-->"
         <!-- ... -->
         ))
      
      ;;; Enable traditional ligature support in eww-mode, if the `variable-pitch' face supports it
      (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
      
      (ligature-set-ligatures '(prog-mode org-mode) '("->" "=>" "!=" "==" ">=" "<="))
      
      ;;; Enables ligature checks globally in all buffers. You can also do it per mode with `ligature-mode'.
      ;; (global-ligature-mode t)
      
      ;;;
      

12.1.4 Разное

;; (desire-conf 'font-lock)
;; (desire-conf 'font-lock-jit)
;; (desire-conf 'font-lock-lazy)
;; (desire-conf 'font-lock-fast)
;; (desire-conf 'faces)
;; (desire-conf 'color-theme nil "color-theme")
;; (desire-conf 'fira-code-mode nil "fira-code-mode" t) ;; Simple minor mode for Fira Code ligatures

12.1.5 unicode-fonts

(desire 'unicode-fonts)
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Configure Unicode fonts for Emacs
    ;; https://github.com/rolandwalker/unicode-fonts
    
    ;;; Code:
    
    ;;;; Requires font-utils
    (desire 'font-utils)
    
    ;;;; Requires ucs-utils
    (desire 'ucs-utils)
    
    ;;;; Uses if present
    (desire 'persistent-soft)
    
    ;;;; Load package
    (require 'unicode-fonts)
    
    ;;;
    
    Распечатка 39: packages/unicode-fonts/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Configure Unicode fonts for Emacs
    ;; https://github.com/rolandwalker/unicode-fonts
    
    ;;; Code:
    
    ;;; ligature support
    (setopt unicode-fonts-enable-ligatures t)
    
    ;;; By default ligatures will be enabled in all programing modes.
    (setopt unicode-fonts-ligature-modes '(prog-mode))
    
    ;;; You can enable ligatures for specific modes.
    ;; (setopt unicode-fonts-ligature-modes '(php-mode js-mode))
    
    ;;; To enable only for text modes you can use text-mode
    ;; (setopt unicode-fonts-ligature-modes '(text-mode))
    
    ;;; Configure the ligature set
    ;; (setopt unicode-fonts-ligature-set '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
    ;; 				   ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
    ;; 				   "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
    ;; 				   "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
    ;; 				   "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
    ;; 				   "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
    ;; 				   "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
    ;; 				   "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
    ;; 				   ">=" ">>" ">-" "-~" "-|" "->" "-<" "<~" "<*" "<|" "<:" "<$"
    ;; 				   "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!" "##"
    ;; 				   "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:" "?="
    ;; 				   "?." "??" ";;" "/*" "/**" "/=" "/>" "__" "~~" "(*" "*)"
    ;; 				   "://"))
    
    ;; (setopt ecf-unicode-font (font-spec :family "Iosevka" :size 12))
    
    ;; (when ecf-unicode-font
    ;;   (let ((ecf-unicode-font-family (plist-get (font-face-attributes ecf-unicode-font) :family)))
    ;;     (dolist (unicode-block unicode-fonts-block-font-mapping)
    ;;       (push ecf-unicode-font-family (cadr unicode-block)))))
    
    (unicode-fonts-setup)
    
    ;;;
    
    Распечатка 40: packages/unicode-fonts/desire.ecf

12.2 Наборы иконок

;;;;; Icons
Распечатка 41: rc.packages.el

12.2.1 all-the-icons

;; (desire 'all-the-icons)
  1. Интеграция

    1. treemacs

      • Файл: packages/treemacs/all-the-icons.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; all-the-icons integration for treemacs
      
      ;;; Code:
      
      (desire 'treemacs-all-the-icons)
      (require 'treemacs-all-the-icons)
      
      ;;;
      

12.2.2 nerd-icons

  • Загрузка пакета:
    (desire 'nerd-icons)
    
    Распечатка 42: rc.packages.el
  1. Интеграция

    1. tab-line

      • Emacs. Пакет tab-line
      • Поддержка nerd-icons в tab-line:
      • Пакет применяет иконки из nerd-icons к вкладкам tab-line.
      • Минорный режим tab-line-nerd-icons-global-mode добавляет к функции по умолчанию tab-line-tab-name-format-default иконки для форматирования имён вкладок.
        ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        ;;; Emacs package that uses the nerd-icons package to apply appropriate icons to tab-line tabs
        ;;;; https://github.com/lucius-martius/tab-line-nerd-icons
        
        ;;; Code:
        
        (desire 'tab-line-nerd-icons)
        (require 'tab-line-nerd-icons)
        
        ;;;; Enable
        (tab-line-nerd-icons-global-mode)
        
        ;;;
        
        Распечатка 43: packages/tab-line/nerd-icons.ecf
    1. corfu

      • Nerd-icon для corfu
      • https://github.com/LuigiPiucco/nerd-icons-corfu
        ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        ;;; Icons for corfu via nerd-icons
        ;;;; https://github.com/LuigiPiucco/nerd-icons-corfu
        
        ;;; Code:
        
        (desire 'nerd-icons-corfu)
        (require 'nerd-icons-corfu)
        
        (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)
        
        ;;;; Tuning
        (setopt nerd-icons-corfu-mapping
              '((array :style "cod" :icon "symbol_array" :face font-lock-type-face)
                (boolean :style "cod" :icon "symbol_boolean" :face font-lock-builtin-face)
             ;; Remember to add an entry for `t', the library uses that as default.
                (t :style "cod" :icon "code" :face font-lock-warning-face)))
        
        ;;;
        
        Распечатка 44: packages/corfu/nerd-icons.ecf
    1. marginalia

      • Nerd-icon для дополнения
      • https://github.com/LuigiPiucco/nerd-icons-corfu
        ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        ;;; Use nerd-icons for completion
        ;;;; https://github.com/rainstormstudio/nerd-icons-completion
        
        ;;; Code:
        
        (desire 'nerd-icons-completion)
        (require 'nerd-icons-completion)
        
        (nerd-icons-completion-mode)
        (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)
        
        ;;;
        
        Распечатка 45: packages/marginalia/nerd-icons.ecf
    1. dired

      • Nerd-icon для dired
      • https://github.com/rainstormstudio/nerd-icons-dired
        ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        ;;; Use nerd-icons for Dired
        ;;;; https://github.com/rainstormstudio/nerd-icons-dired
        
        (desire 'nerd-icons-dired)
        (require 'nerd-icons-dired)
        
        (add-hook 'dired-mode-hook 'nerd-icons-dired-mode)
        
        ;;;
        
        Распечатка 46: packages/dired/nerd-icons.ecf
    1. treemacs

      • Файл: packages/treemacs/nerd-icons.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Nerd-icons theme for treemacs
      ;;; https://github.com/rainstormstudio/treemacs-nerd-icons
      
      ;;; Code:
      
      (desire 'treemacs-nerd-icons)
      (require 'treemacs-nerd-icons)
      (treemacs-load-theme "nerd-icons")
      
      ;;;
      

12.3 Табы

;;; Tabs
Распечатка 47: rc.packages.el

12.3.1 centaur-tabs

12.3.2 tab-bar

  1. Подключение

    • Файл: rc.packages.el
      (desire 'tab-bar)
      
  1. Загрузка

    • Файл: packages/tab-bar/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs Tab Bar
    
    ;;; Code:
    
    (require 'tab-bar)
    
    ;;;
    
  1. Настройка

    1. Основная

      • Файл: packages/tab-bar/desire.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs Tab Bar
      
      ;;; Code:
      
      (tab-bar-mode 1)
      (setopt tab-bar-show 1)
      
      (setopt tab-bar-new-tab-to 'right)
      
      ;; (setopt tab-bar-new-tab-choice "*dashboard*")
      ;; (setopt tab-bar-new-tab-choice #'ibuffer)
      
      (setopt tab-bar-tab-hints t)
      ;; (setq tab-bar-select-tab-modifiers "super") ;; FIXME
      
      (setopt tab-bar-format '(tab-bar-format-history tab-bar-format-tabs tab-bar-separator))
      
      ;;;
      
    1. Заголовки

      • Файл: packages/tab-bar/desire.ecd/title.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs Tab Bar
      
      ;;; Code:
      
      (setopt tab-bar-close-button-show t)
      
      (setopt tab-bar-tab-hints t)
      
      (defvar ecf/circle-numbers-alist
        '((0 . "⓪")
          (1 . "①")
          (2 . "②")
          (3 . "③")
          (4 . "④")
          (5 . "⑤")
          (6 . "⑥")
          (7 . "⑦")
          (8 . "⑧")
          (9 . "⑨"))
        "Alist of integers to strings of circled unicode numbers.")
      
      (defun ecf/tab-bar-tab-name-format-default (tab i)
        (let ((current-p (eq (car tab) 'current-tab))
              (tab-num (if (and tab-bar-tab-hints (< i 10))
                           (alist-get i ecf/circle-numbers-alist) "")))
          (propertize
           (concat tab-num
                   " "
                   (alist-get 'name tab)
                   (or (and tab-bar-close-button-show
                            (not (eq tab-bar-close-button-show
                                     (if current-p 'non-selected 'selected)))
                            tab-bar-close-button)
                       "")
                   " ")
           'face (funcall tab-bar-tab-face-function tab))))
      (setopt tab-bar-tab-name-format-function #'ecf/tab-bar-tab-name-format-default)
      
      ;;;
      
  1. Клавиатурные сочетания

    • Файл: packages/tab-bar/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs Tab Bar key bindings
    
    ;;; Code:
    
    (general-define-key
     ;;;; Select the previous available tab
     ;; "C-{"  'tab-bar-switch-to-prev-tab
     "s-{" 'tab-bar-switch-to-prev-tab
    ;;;; Select the next available tab
     ;; "C-}" 'tab-bar-switch-to-next-tab
     "s-}" 'tab-bar-switch-to-next-tab)
    
     ;; "s-t" 'tab-bar-new-tab
     ;; "s-w" 'tab-bar-close-tab
    
    ;;;
    
  1. Интеграция

    1. tab-bar-lost-commands

      • Emacs. tab-bar. Пакет tab-bar-lost-commands
      • Файл: packages/tab-bar/desire.ecd/tab-bar-lost-commands.ecf
        ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
        ;;; The "lost commands" of the tab bar
        ;; https://github.com/fritzgrabo/tab-bar-lost-commands
        
        ;;; Code:
        
        (general-define-key
         "M-s-{" 'tab-bar-lost-commands-switch-to-first-tab
         "M-s-}" 'tab-bar-lost-commands-switch-to-last-tab
         "C-s-{" 'tab-bar-lost-commands-move-tab-backward
         "C-s-}" 'tab-bar-lost-commands-move-tab-forward
         "C-M-s-{" 'tab-bar-lost-commands-move-tab-first
         "C-M-s-}" 'tab-bar-lost-commands-move-tab-last)
        
        (general-define-key
         :keymaps 'tab-prefix-map
         "<return>" 'tab-bar-lost-commands-switch-to-or-create-tab)
        
        ;;;
        
    1. vim-tab-bar

      • Файл: packages/tab-bar/desire.ecd/vim-tab-bar.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; A Vim-Inspired Tab-Bar That Automatically Adapts to Any Emacs Theme
      ;; https://github.com/jamescherti/vim-tab-bar.el
      
      ;;; Code
      
      (desire 'vim-tab-bar)
      (vim-tab-bar-mode)
      
      ;;;; Show the tab groups
      (setq vim-tab-bar-show-groups t)
      
      ;;;
      

12.3.3 tab-line

  1. Подключение

    • Файл: rc.packages.el
      (desire 'tab-line)
      
  1. Загрузка

    • Файл: packages/tab-line/loaddefs.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs Tab Line
      
      ;;; Code:
      
      (require 'tab-line)
      
      ;;;
      
  1. Настройка

    • Файл: packages/tab-line/desire.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs Tab Line
      
      ;;; Code:
      
      ;;; Show the tabline in the top of the frame
      (global-tab-line-mode t)
      
      ;;; Do not show add-new button
      (setopt tab-line-new-button-show nil)
      
      ;;; Do not show close button
      (setopt tab-line-close-button-show nil)
      
      ;;; Change the separator between tabs
      (setopt tab-line-separator "")
      
      ;;;
      
  1. Клавиатурные сочетания

    • Файл: packages/tab-line/desire.ecd/keybinding.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs Tab Line
      
      ;;; Code
      
      (general-define-key
       "C-<prior>" 'tab-line-switch-to-prev-tab
       "C-<iso-lefttab>" 'tab-line-switch-to-prev-tab
       "s-[" 'tab-line-switch-to-prev-tab
       "C-<next>" 'tab-line-switch-to-next-tab
       "C-<tab>" 'tab-line-switch-to-next-tab
       "s-]" 'tab-line-switch-to-next-tab)
      
       ;;;
      
  1. Intuitive Tabs in Emacs

    • Emacs. tab-line. Пакет intuitive-tab-line-mode
    • Файл: packages/tab-line/desire.ecd/intuitive-tab-line.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Intuitive Tabs in Emacs
      ;; https://github.com/thread314/intuitive-tab-line-mode
      
      ;;; Code:
      
      (desire 'intuitive-tab-line :recipe '(:fetcher github :repo "thread314/intuitive-tab-line-mode" :branch "master"))
      (require 'intuitive-tab-line)
      
      ;;;; Show all user-created buffers as tabs
      ;; (setopt tab-line-tabs-function 'intuitive-tab-line-buffers-list)
      
      (setopt tab-line-switch-cycling t)
      
      (general-define-key
       ;; "C-S-<prior>" 'intuitive-tab-line-shift-tab-left
       ;; "C-S-<next>" 'intuitive-tab-line-shift-tab-right
       "C-s-[" 'intuitive-tab-line-shift-tab-left
       "C-s-]" 'intuitive-tab-line-shift-tab-right
       )
      
      (recentf-mode 1)
      (general-define-key
       "C-S-t" 'recentf-open-most-recent-file)
      
      ;;;;
      

12.4 Нумерация строк

12.4.1 display-line-numbers

  • Подключаем моду:
    (desire 'display-line-numbers)
    
    Распечатка 49: rc.packages.el
  • Файл настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Interface for display-line-numbers
    
    Распечатка 50: packages/display-line-numbers.ecf
  • Глобальная настройка:
    ;;; Global
    ;; (global-display-line-numbers-mode 1)
    
    Распечатка 51: packages/display-line-numbers.ecf
  • Глобальная настройка:
    ;;; Per mode
    (add-hook 'prog-mode-hook #'display-line-numbers-mode)
    (add-hook 'text-mode-hook #'display-line-numbers-mode)
    
    Распечатка 52: packages/display-line-numbers.ecf
  • Завершение:
    ;;;
    
    Распечатка 53: packages/display-line-numbers.ecf

12.4.2 nlinum

  • Подключаем моду:
    ;; (desire 'nlinum)
    
    Распечатка 54: rc.packages.el
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Show line numbers in the margin
    ;;; https://elpa.gnu.org/packages/nlinum.html
    
    (require 'nlinum)
    
    Распечатка 55: packages/nlinum.ecf
  • Глобальная настройка:
    ;;; Global settings
    ;; (global-nlinum-mode 1)
    
    Распечатка 56: packages/nlinum.ecf
  • Настройка по модам:
    ;;; Per mode configuration
    (add-hook 'prog-mode-hook #'nlinum-mode)
    (add-hook 'text-mode-hook #'nlinum-mode)
    
    Распечатка 57: packages/nlinum.ecf
  • Завершение:
    ;;;
    
    Распечатка 58: packages/nlinum.ecf

12.5 shr-tag-pre-highlight : раскрашивание eww

  • Загрузка.
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Syntax highlighting code block in HTML for shr/eww
    ;; https://github.com/xuchunyang/shr-tag-pre-highlight.el
    
    ;;; Code:
    
    (require 'shr-tag-pre-highlight)
    
    (add-to-list 'shr-external-rendering-functions '(pre . shr-tag-pre-highlight))
    
    ;;;
    
    Распечатка 59: packages/shr-tag-pre-highlight.ecf

12.6 shrface : функциональность Org-mode для eww

12.6.1 Основной пакет : shrface

  • Подключение.

    (desire 'shrface)
    
    Распечатка 60: rc.packages.el
  • Объявления.

    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    ;;;
    
    Распечатка 61: packages/shrface/loaddefs.ecf
  • Загрузка.

    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    ;;;
    
    Распечатка 62: packages/shrface/desire.ecf
  • Настройка.

    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (defvar shrface-general-rendering-functions
      (append '((title . eww-tag-title)
                (form . eww-tag-form)
                (input . eww-tag-input)
                (button . eww-form-submit)
                (textarea . eww-tag-textarea)
                (select . eww-tag-select)
                (link . eww-tag-link)
                (meta . eww-tag-meta)
                (code . shrface-tag-code)
                (pre . shrface-shr-tag-pre-highlight))
              shrface-supported-faces-alist))
    
    (defvar shrface-nov-rendering-functions
      (append '((img . nov-render-img)
                (svg . nov-render-svg)
                (title . nov-render-title)
                (pre . shrface-shr-tag-pre-highlight)
                (code . shrface-tag-code)
                (form . eww-tag-form)
                (input . eww-tag-input)
                (button . eww-form-submit)
                (textarea . eww-tag-textarea)
                (select . eww-tag-select)
                (link . eww-tag-link)
                (meta . eww-tag-meta))
              shrface-supported-faces-alist))
    
    (defvar shrface-anki-rendering-functions
      (append '((img . anki-render-img)
                (pre . shrface-shr-tag-pre-highlight)
                (code . shrface-tag-code)
                (form . eww-tag-form)
                (input . eww-tag-input)
                (button . eww-form-submit)
                (textarea . eww-tag-textarea)
                (select . eww-tag-select)
                (link . eww-tag-link)
                (meta . eww-tag-meta))
              shrface-supported-faces-alist))
    
    (setq shr-cookie-policy nil)
    (if (string-equal system-type "android")
        (setq shrface-bullets-bullet-list '("▼" "▽" "▿" "▾"))
      (setq shrface-bullets-bullet-list '("▼" "▽" "▿" "▾")))
    (add-hook 'outline-view-change-hook 'shrface-outline-visibility-changed)
    
    (desire 'shr-tag-pre-highlight)
    (require 'shr-tag-pre-highlight)
    
    (setq shr-tag-pre-highlight-lang-modes
          '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
            ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
            ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++" . c++)
            ("screen" . shell-script) ("shell" . sh) ("bash" . sh)
            ("rust" . rustic)
            ("rust" . rustic)
            ("awk" . bash)
            ("json" . "js")
            ;; Used by language-detection.el
            ("emacslisp" . emacs-lisp)
            ;; Used by Google Code Prettify
            ("el" . emacs-lisp)))
    
    ;;;
    
    Распечатка 63: packages/shrface/desire.ecd/config.ecf
  • Функции.

    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (defun shrface-eww-setup ()
      (unless shrface-toggle-bullets
        (shrface-regexp)
        (setq-local imenu-create-index-function #'shrface-imenu-get-tree))
      ;; workaround to show annotations in eww
      (shrface-show-all-annotations))
    
    (defun shrface-anki-setup ()
      (unless shrface-toggle-bullets
        (shrface-regexp)
        (setq-local imenu-create-index-function #'shrface-imenu-get-tree)))
    
    (defun shrface-anki-advice (orig-fun &rest args)
      (require 'eww)
      (let ((shrface-org nil)
            (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
            (shr-table-vertical-line "")
            (shr-width 90)
            (shr-indentation 3)
            (anki-shr-rendering-functions shrface-anki-rendering-functions)
            (shrface-toggle-bullets nil)
            (shrface-href-versatile t))
        (apply orig-fun args)))
    
    (defun shrface-shr-tag-pre-highlight (pre)
      "Highlighting code in PRE."
      (let* ((shr-folding-mode 'none)
             (shr-current-font 'default)
             (code (with-temp-buffer
                     (shr-generic pre)
                     ;; (indent-rigidly (point-min) (point-max) 2)
                     (buffer-string)))
             (lang (or (shr-tag-pre-highlight-guess-language-attr pre)
                       (let ((sym (language-detection-string code)))
                         (and sym (symbol-name sym)))))
             (mode (and lang
                        (shr-tag-pre-highlight--get-lang-mode lang))))
        (shr-ensure-newline)
        (shr-ensure-newline)
        (setq start (point))
        (insert
         ;; (propertize (concat "#+BEGIN_SRC " lang "\n") 'face 'org-block-begin-line)
         (or (and (fboundp mode)
                  (with-demoted-errors "Error while fontifying: %S"
                    (shr-tag-pre-highlight-fontify code mode)))
             code)
         ;; (propertize "#+END_SRC" 'face 'org-block-end-line )
         )
        (shr-ensure-newline)
        (setq end (point))
        (pcase (frame-parameter nil 'background-mode)
          ('light
           (add-face-text-property start end '(:background "#D8DEE9" :extend t)))
          ('dark
           (add-face-text-property start end '(:background "#292b2e" :extend t))))
        (shr-ensure-newline)
        (insert "\n")))
    
    (defun shrface-nov-render-html ()
      (require 'eww)
      (let ((shrface-org nil)
            (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
            (shr-table-vertical-line "|")
            (shr-width 7000) ;; make it large enough, it would not fill the column (use visual-line-mode/writeroom-mode instead)
            (shr-indentation 0) ;; remove all unnecessary indentation
            (tab-width 8)
            (shr-external-rendering-functions shrface-nov-rendering-functions)
            (shrface-toggle-bullets nil)
            (shrface-href-versatile t)
            (shr-use-fonts nil)           ; nil to use default font
            (shr-map nov-mode-map))
    
        ;; HACK: `shr-external-rendering-functions' doesn't cover
        ;; every usage of `shr-tag-img'
        (cl-letf (((symbol-function 'shr-tag-img) 'nov-render-img))
          (shr-render-region (point-min) (point-max)))
        ;; workaround, need a delay to update the header line
        (run-with-timer 0.01 nil 'shrface-update-header-line)
        ;; workaround, show annotations when document updates
        (shrface-show-all-annotations)))
    
    (defun shrface-remove-blank-lines-at-the-end (start end)
      "A fix for `shr--remove-blank-lines-at-the-end' which will remove image at the end of the document."
      (save-restriction
        (save-excursion
          (narrow-to-region start end)
          (goto-char end)
          (when (and (re-search-backward "[^ \n]" nil t)
                     (not (eobp)))
            (forward-line 1)
            (delete-region (point) (min (1+ (point)) (point-max)))))))
    
    (defun shrface-nov-setup ()
      (unless shrface-toggle-bullets
        (shrface-regexp))
      (set-visited-file-name nil t)
      (setq tab-width 8)
      (if (string-equal system-type "android")
          (setq-local touch-screen-enable-hscroll nil)))
    
    (defun shrface-wallabag-setup ()
      (unless shrface-toggle-bullets
        (shrface-regexp)
        (setq-local imenu-create-index-function #'shrface-imenu-get-tree))
      (if (string-equal system-type "android")
          (setq-local touch-screen-enable-hscroll nil)))
    
    (defun shrface-wallabag-render-html (beg end)
      ;; workaround, show annotations when document updates
      (shrface-render-region beg end)
      (shrface-update-header-line)
      (paw-annotation-mode 1)
      (visual-line-mode 1))
    
    (defun shrface-render-region (beg end)
      (require 'eww)
      (let ((shrface-org nil)
            (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
            ;; make it large enough, it would not fill the column
            ;; I uses visual-line-mode, writeroom-mode for improving the reading experience instead
            (shr-width 7000)
            (shr-indentation (if (string-equal system-type "android") 0 0))
            (shr-table-vertical-line "|")
            (shr-external-rendering-functions shrface-general-rendering-functions)
            (shrface-toggle-bullets nil)
            (shrface-href-versatile t)
            (shr-use-fonts nil))
        (shr-render-region beg end)))
    
    (defun shrface-render-advice (orig-fun &rest args)
      (require 'eww)
      (let ((shrface-org nil)
            (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
            (shr-table-vertical-line "|")
            (shr-width 65)
            (shr-indentation 0)
            (shr-external-rendering-functions shrface-general-rendering-functions)
            (shrface-toggle-bullets nil)
            (shrface-href-versatile t)
            (shr-use-fonts nil))
        ;; workaround, need a delay to update the header line
        (run-with-timer 0.01 nil 'shrface-update-header-line)
        (apply orig-fun args)))
    
    (defun shrface-elfeed-advice (orig-fun &rest args)
      (require 'eww)
      (let ((shrface-org nil)
            (shr-bullet (concat (char-to-string shrface-item-bullet) " "))
            ;; make it large enough, it would not fill the column
            ;; I uses visual-line-mode, writeroom-mode for improving the reading experience instead
            (shr-width 7000)
            (shr-indentation 0)
            (shr-table-vertical-line "|")
            (shr-external-rendering-functions shrface-general-rendering-functions)
            (shrface-toggle-bullets nil)
            (shrface-href-versatile t)
            (shr-use-fonts nil))
        (apply orig-fun args)
        (with-current-buffer "*elfeed-entry*"
          (shrface-show-all-annotations))))
    
    (defun shrface-show-all-annotations()
      (when (bound-and-true-p paw-annotation-mode)
        (paw-clear-annotation-overlay)
        (paw-show-all-annotations)
        (if paw-annotation-show-wordlists-words-p
            (paw-focus-find-words :wordlist t))
        (if paw-annotation-show-unknown-words-p
            (paw-focus-find-words))))
    
    ;;;
    
    Распечатка 64: packages/shrface/desire.ecd/advice.ecf

12.6.2 Поддержка nov

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (add-hook 'nov-mode-hook #'eldoc-mode)
    (add-hook 'nov-mode-hook #'org-indent-mode)
    (add-hook 'nov-mode-hook #'eldoc-box-hover-mode)
    (add-hook 'nov-mode-hook #'shrface-nov-setup)
    
    (setopt nov-render-html-function #'shrface-nov-render-html)
    (advice-add 'shr--remove-blank-lines-at-the-end :override #'shrface-remove-blank-lines-at-the-end)
    
    (define-key nov-mode-map (kbd "<tab>") 'shrface-outline-cycle)
    (define-key nov-mode-map (kbd "S-<tab>") 'shrface-outline-cycle-buffer)
    (define-key nov-mode-map (kbd "C-t") 'shrface-toggle-bullets)
    (define-key nov-mode-map (kbd "C-j") 'shrface-next-headline)
    (define-key nov-mode-map (kbd "C-k") 'shrface-previous-headline)
    (define-key nov-mode-map (kbd "M-l") 'shrface-links-consult) ; or 'shrface-links-helm or 'shrface-links-counsel
    (define-key nov-mode-map (kbd "M-h") 'shrface-headline-consult) ; or 'shrface-headline-helm or 'shrface-headline-counsel
    
    ;;;
    
    Распечатка 65: packages/nov/shrface.ecf

12.6.3 Поддержка eww

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (advice-add 'eww-display-html :around #'shrface-render-advice)
    (add-hook 'eww-after-render-hook #'org-indent-mode)
    (add-hook 'eww-after-render-hook #'eldoc-mode)
    (add-hook 'eww-after-render-hook #'eldoc-box-hover-mode)
    (add-hook 'eww-after-render-hook #'shrface-eww-setup)
    
    (define-key eww-mode-map (kbd "<tab>") 'shrface-outline-cycle)
    (define-key eww-mode-map (kbd "S-<tab>") 'shrface-outline-cycle-buffer)
    (define-key eww-mode-map (kbd "C-t") 'shrface-toggle-bullets)
    (define-key eww-mode-map (kbd "C-j") 'shrface-next-headline)
    (define-key eww-mode-map (kbd "C-k") 'shrface-previous-headline)
    (define-key eww-mode-map (kbd "M-l") 'shrface-links-consult) ; or 'shrface-links-helm or 'shrface-links-counsel
    (define-key eww-mode-map (kbd "M-h") 'shrface-headline-consult) ; or 'shrface-headline-helm or 'shrface-headline-counsel
    
    ;;;
    
    Распечатка 66: packages/eww/shrface.ecf

12.6.4 Поддержка anki

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (add-hook 'anki-mode-hook #'org-indent-mode)
    (advice-add 'anki-render-html :around #'shrface-anki-advice)
    (advice-add 'anki-render-region :around #'shrface-anki-advice)
    (add-hook 'anki-mode-hook #'eldoc-mode)
    (add-hook 'anki-mode-hook #'eldoc-box-hover-mode)
    (add-hook 'anki-mode-hook #'shrface-anki-setup)
    
    ;;;
    
    Распечатка 67: packages/anki/shrface.ecf

12.6.5 Поддержка calibredb

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (advice-add 'calibredb-show-entry :around #'shrface-render-advice)
    
    ;;;
    
    Распечатка 68: packages/calibredb/shrface.ecf

12.6.6 Поддержка wallabag

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    ;; (add-hook 'wallabag-entry-mode-hook #'org-indent-mode)
    (add-hook 'wallabag-entry-mode-hook #'eldoc-mode)
    (add-hook 'wallabag-entry-mode-hook #'eldoc-box-hover-mode)
    (add-hook 'wallabag-entry-mode-hook #'shrface-wallabag-setup)
    (advice-add 'wallabag-entry-quit :after #'(lambda (&rest args)
                                                (interactive)
                                                (if (get-buffer "*Ilist*")
                                                    (kill-buffer "*Ilist*"))))
    
    (setq wallabag-render-html-function #'shrface-wallabag-render-html)
    
    ;;;
    
    Распечатка 69: packages/wallabag/shrface.ecf

12.6.7 Поддержка mu4e

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (advice-add 'mu4e-shr2text :around #'shrface-render-advice)
    
    (define-key mu4e-view-mode-map (kbd "<tab>") 'shrface-outline-cycle)
    (define-key mu4e-view-mode-map (kbd "S-<tab>") 'shrface-outline-cycle-buffer)
    (define-key mu4e-view-mode-map (kbd "C-t") 'shrface-toggle-bullets)
    (define-key mu4e-view-mode-map (kbd "C-j") 'shrface-next-headline)
    (define-key mu4e-view-mode-map (kbd "C-k") 'shrface-previous-headline)
    (define-key mu4e-view-mode-map (kbd "M-l") 'shrface-links-consult) ; or 'shrface-links-helm or 'shrface-links-counsel
    (define-key mu4e-view-mode-map (kbd "M-h") 'shrface-headline-consult) ; or 'shrface-headline-helm or 'shrface-headline-counsel
    
    ;;;
    
    Распечатка 70: packages/mu4e/shrface.ecf

12.6.8 Поддержка elfeed

  • Настройка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Extend eww/nov with org-mode features, archive web pages to org files with shr
    ;; https://github.com/chenyanming/shrface
    
    ;;; Code:
    
    (require 'shrface)
    
    (add-hook 'elfeed-show-mode-hook #'org-indent-mode)
    (add-hook 'elfeed-show-mode-hook #'eldoc-mode)
    (add-hook 'elfeed-show-mode-hook #'eldoc-box-hover-mode)
    (add-hook 'elfeed-show-mode-hook #'shrface-wallabag-setup)
    (advice-add 'elfeed-insert-html :around #'shrface-elfeed-advice)
    
    ;;;
    
    Распечатка 71: packages/elfeed/shrface.ecf

12.7 Universal Sidecar

12.7.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'universal-sidecar)
    

12.7.2 Загрузка

  • Файл: packages/universal-sidecar/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A universal "sidecar" buffer for emacs, inspired by the `org-roam-mode` buffer
    ;; https://git.sr.ht/~swflint/emacs-universal-sidecar
    
    ;;; Code:
    
    (require 'universal-sidecar)
    
    ;;;
    

12.7.3 Конфигурация

  • Файл: packages/universal-sidecar/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A universal "sidecar" buffer for emacs, inspired by the `org-roam-mode` buffer
    ;; https://git.sr.ht/~swflint/emacs-universal-sidecar
    
    ;;; Code:
    
    ;;;; Enable universal-sidecar globally or in specific modes
    ;; (universal-sidecar-global-mode t)
    
    ;;;; Enable universal-sidecar in specific modes
    (add-hook 'prog-mode-hook #'universal-sidecar-mode)
    
    ;;;; Configure the sections to display in the sidecar
    (setopt universal-sidecar-sections
          '(
            buffer-git-status ; Shows Git status for the current buffer
            buffer-info-section ; Displays basic buffer information
            ;; Add other sections as needed, e.g.,
            ;; org-cite-overlay-sidecar ; For Org-cite citations if using org-cite-overlay
            ))
    
    ;;;; Insinuate universal-sidecar to automatically refresh
    ;;;; This advises relevant functions to update the sidecar
     (universal-sidecar-insinuate)
    
    ;;;; Optionally, configure refresh behavior
    ;; (setopt universal-sidecar-enable-timer t) ; Enable idle timer for refreshing
    ;; (setopt universal-sidecar-refresh-time 5) ; Set refresh time in seconds
    
    ;;;
    

13 Автодополнение

  • Файл rc.packages.el:
    ;;;; Completion
    
    ;; (desire 'company)
    (desire 'corfu)
    

14 Автодополнение в минибуфере

14.1 Начало

  • Файл rc.packages.el:
    ;;;; Minibuffer completion
    

14.2 Ido

  • Файл rc.packages.el:
    ;; (desire 'ido)
    

14.3 Helm

  • Файл rc.packages.el:
    ;; (desire 'helm-posframe)
    ;; (desire 'helm)
    

14.4 Ivy

  • Файл rc.packages.el:
    ;; (desire 'ivy)
    

14.5 Selectrum

  • Файл rc.packages.el:
    ;; (desire 'selectrum)
    

14.6 Vertico

  • Файл rc.packages.el:
    (desire 'vertico)
    

15 Transient

15.1 transient

  • Emacs. Пакет transient
  • Подключение:
    ;;;;; Transient
    (desire 'transient)
    
    Распечатка 72: rc.packages.el
  • Дополнительные объявления:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Transient command menus
    ;; https://github.com/magit/transient
    
    ;;; Code:
    
    ;;;
    
    Распечатка 73: packages/transient/loaddefs.ecf
  • Загрузка:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Transient command menus
    ;; https://github.com/magit/transient
    
    ;;; Code:
    
    (require 'transient)
    
    ;;;
    
    Распечатка 74: packages/transient/desire.ecf

15.2 Casual Suite

15.2.1 Начало

  • Подключение:
    ;;;;; Casual Suite
    (desire 'casual)
    
    Распечатка 75: rc.packages.el

15.2.2 Основная библиотека

  • Файл packages/casual/loaddefs.ecf:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
    ;;; https://github.com/kickingvegas/casual
    
    (require 'casual)
    
    ;;;
    
    Распечатка 76: packages/casual/loaddefs.ecf
  • Файл packages/casual/desire.ecf:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
    ;; https://github.com/kickingvegas/casual
    
    ;;; Code:
    
    (require 'casual-calc)
    (keymap-set calc-mode-map "C-o" #'casual-calc-tmenu)
    (keymap-set calc-alg-map "C-o" #'casual-calc-tmenu)
    
    (require 'casual-dired)
    (keymap-set dired-mode-map "C-o" #'casual-dired-tmenu)
    (keymap-set dired-mode-map "s" #'casual-dired-sort-by-tmenu) ; optional
    (keymap-set dired-mode-map "/" #'casual-dired-search-replace-tmenu) ; optional
    
    (require 'casual-isearch)
    (keymap-set isearch-mode-map "C-o" #'casual-isearch-tmenu)
    
    (require 'casual-ibuffer)
    (keymap-set ibuffer-mode-map "C-o" #'casual-ibuffer-tmenu)
    (keymap-set ibuffer-mode-map "F" #'casual-ibuffer-filter-tmenu)
    (keymap-set ibuffer-mode-map "s" #'casual-ibuffer-sortby-tmenu)
    
    (require 'casual-image)
    (keymap-set image-mode-map "C-o" #'casual-image-tmenu)
    
    (require 'casual-info)
    (keymap-set Info-mode-map "C-o" #'casual-info-tmenu)
    
    (require 'casual-re-builder)
    (keymap-set reb-mode-map "C-o" #'casual-re-builder-tmenu)
    (keymap-set reb-lisp-mode-map "C-o" #'casual-re-builder-tmenu)
    
    (require 'casual-bookmarks)
    (keymap-set bookmark-bmenu-mode-map "C-o" #'casual-bookmarks-tmenu)
    
    (require 'casual-editkit)
    (keymap-global-set "C-o" #'casual-editkit-main-tmenu)
    
    (require 'casual-make)
    (keymap-set makefile-mode-map "M-m" #'casual-make-tmenu)
    
    ;;;; Use Unicode symbols whenever appropriate for labels
    (setopt casual-lib-use-unicode t)
    
    ;;;
    
    Распечатка 77: packages/casual/desire.ecf
  • Файл сделан под все элементы пакета.
  • Необходимо будет разделить всё это по разным пакетам.

15.2.3 Поддержка Avy

  • Файл packages/avy/casual.ecf:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An opinionated Transient menu for Avy.
    ;;; https://github.com/kickingvegas/casual-avy
    
    (desire 'casual-avy)
    (require 'casual-avy)
    
    (keymap-global-set "M-g" #'casual-avy-tmenu)
    
    ;;; Imenu (index) Support
    (add-hook 'markdown-mode-hook #'imenu-add-menubar-index)
    (add-hook 'makefile-mode-hook #'imenu-add-menubar-index)
    (add-hook 'prog-mode-hook #'imenu-add-menubar-index)
    (add-hook 'org-mode-hook #'imenu-add-menubar-index)
    
    ;;;
    
    Распечатка 78: packages/avy/casual.ecf

15.2.4 Поддержка Symbol Overlay

  • Файл packages/casual/symbol-overlay.ecf:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An opinionated Transient user interface for the Emacs package Symbol Overlay.
    ;;; https://github.com/kickingvegas/casual-symbol-overlay
    
    (desire 'casual-symbol-overlay)
    (require 'casual-symbol-overlay)
    
    (keymap-set symbol-overlay-map "C-o" #'casual-symbol-overlay-tmenu)
    
    ;;;
    
    Распечатка 79: packages/casual/symbol-overlay.ecf

15.2.5 Поддержка Org-agenda

  • Файл packages/org/casual.ecf:
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes
    ;; https://github.com/kickingvegas/casual
    
    ;;; Code:
    
    (require 'casual-agenda)
    
    ;;;; Load menu
    (keymap-set org-agenda-mode-map "C-o" #'casual-agenda-tmenu)
    
    ;;;; Configure Org Agenda to be consistent with bindings used by Casual Agenda
    (keymap-set org-agenda-mode-map "M-j" #'org-agenda-clock-goto)
    (keymap-set org-agenda-mode-map "J" #'bookmark-jump)
    
    ;;;
    
    Распечатка 80: packages/org/casual.ecf

16 Разное

  • Файл rc.packages.el:
;;

(desire 'hydra)

(desire-conf 'show-paren)
;; (desire-conf 'folding)
;;

(desire 'imenu)

(desire 'ace-window)


;; (desire-conf 'toolbar)

;; Parentesis
(desire 'smartparens)

17 Навигация

  • Заголовок:
    ;;;; Navigation
    
    Распечатка 81: rc.packages.el

17.1 Avy

  • Подключение:
    (desire 'avy)
    
    Распечатка 82: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Jump to things in Emacs tree-style
    ;; https://github.com/abo-abo/avy
    
    ;;; Code:
    
    (require 'avy)
    
    ;;;
    
    Распечатка 83: packages/avy/loaddefs.ecf
  • Настройка клавиатуры:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Jump to things in Emacs tree-style
    ;; https://github.com/abo-abo/avy
    
    ;;; Code:
    
    
    ;;;; Input one char, jump to it with a tree
    (global-set-key (kbd "C-:") 'avy-goto-char)
    
    ;;;; Input two consecutive chars, jump to the first one with a tree
    (global-set-key (kbd "C-'") 'avy-goto-char-2)
    
    ;;;; Input zero chars, jump to a line start with a tree
    (global-set-key (kbd "M-g f") 'avy-goto-line)
    
    ;;;; Input one char at word start, jump to a word start with a tree
    (global-set-key (kbd "M-g w") 'avy-goto-word-1)
    
    ;;;; Input zero chars, jump to a word start with a tree
    (global-set-key (kbd "M-g e") 'avy-goto-word-0)
    
    ;;;; You add this to your config to bind some stuff
    (avy-setup-default)
    (global-set-key (kbd "C-c C-j") 'avy-resume)
    
    ;;;
    
    Распечатка 84: packages/avy/desire.ecd/keybinding.ecf

18 Навигация по окнам

18.1 Начало

  • Файл rc.packages.el:
    ;;; Window navigation {{{
    
    Распечатка 85: rc.packages.el

18.2 Windmove

  • Emacs. Окна. Windmove

  • Файл rc.packages.el:

    (desire 'windmove)
    
    Распечатка 86: rc.packages.el
  • Настройка пакета:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Directional window-selection routinesdirectional window-selection routines
    ;;; https://www.emacswiki.org/emacs/WindMove
    
    Распечатка 87: packages/windmove.ecf
  • По умолчанию используется комбинация Shift + стрелки. Но это конфликтует с org-mode:

    ;;; Shifted arrow keys
    ;; (windmove-default-keybindings)
    
    Распечатка 88: packages/windmove.ecf
  • Будем использовать Ctrl + стрелки:

    ;;; Ctrl + arrow keys
    (windmove-default-keybindings 'ctrl)
    
    Распечатка 89: packages/windmove.ecf
  • Что-то делает:

    ;;; Wrap around at edges
    (setopt windmove-wrap-around t)
    
    Распечатка 90: packages/windmove.ecf
  • Завершим файл:

    ;;;
    
    Распечатка 91: packages/windmove.ecf

18.3 Конец

  • Файл rc.packages.el:
    ;;;}}}
    
    Распечатка 92: rc.packages.el

19 Форматирование

19.1 Apheleia

19.1.1 Подключение

  • Файл: rc.packages.el
    (desire 'apheleia)
    

19.1.2 Загрузка

  • Файл: packages/apheleia/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Run code formatter on buffer contents without moving point
    ;; https://github.com/radian-software/apheleia
    
    ;;; Code:
    
    (require 'apheleia)
    
    ;;;
    

19.1.3 Конфигурация

  • Файл: packages/apheleia/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Run code formatter on buffer contents without moving point
    ;; https://github.com/radian-software/apheleia
    
    ;;; Code:
    
    (apheleia-global-mode +1)
    
    ;;;
    

19.1.4 Форматер latex

  • Форматирование. LaTeX. tex-fmt
  • Файл: packages/apheleia/desire.ecd/latex.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An extremely fast LaTeX formatter written in Rust
    ;; https://github.com/WGUNDERWOOD/tex-fmt
    
    ;;; Code:
    
    ;;;; Define tex-fmt as an Apheleia formatter
    (add-to-list 'apheleia-formatters '(tex-fmt "tex-fmt" "--stdin"))
    
    ;;;; Associate tex-fmt with LaTeX modes
    (if (executable-find "tex-fmt")
        (progn
          (setf (alist-get 'latex-mode apheleia-mode-alist) 'tex-fmt)
          (setf (alist-get 'LaTeX-mode apheleia-mode-alist) 'tex-fmt)
             (setf (alist-get 'TeX-latex-mode apheleia-mode-alist) 'tex-fmt)
             (setf (alist-get 'TeX-mode apheleia-mode-alist) 'tex-fmt))
      nil)
    
    ;;;
    

19.1.5 Форматер markdown

  • Файл: packages/apheleia/desire.ecd/markdown.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern Markdown formatter with smart typography and paragraph wrapping
    ;; https://github.com/jlevy/flowmark
    
    ;;; Code:
    
    ;;;; Define flowmark as an Apheleia formatter
    (add-to-list 'apheleia-formatters '(flowmark "flowmark" "--semantic" "--cleanups" "--smartquotes" "--ellipses" "--output" "-" "-"))
    
    ;;;; Associate flowmark with markdown
    ;; (if (executable-find "flowmark")
    ;;     (setf (alist-get 'markdown-mode apheleia-mode-alist) 'flowmark)
    ;;   nil)
    
    ;;;
    

19.2 Tree-sitter

19.2.1 Подключение

  • Файл: rc.packages.el
    (desire 'tree-sitter)
    

19.2.2 Загрузка

  • Файл: packages/tree-sitter/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Tree-sitter bindings for Emacs Lisp
    ;; https://github.com/emacs-tree-sitter/elisp-tree-sitter
    
    (require 'tree-sitter)
    
    ;;;
    

19.2.3 Конфигурация

  • Файл: packages/tree-sitter/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Tree-sitter bindings for Emacs Lisp
    ;; https://github.com/emacs-tree-sitter/elisp-tree-sitter
    
    (desire 'tree-sitter-langs)
    (require 'tree-sitter-langs)
    
    (desire 'tree-sitter-hl)
    (require 'tree-sitter-hl)
    
    (desire 'tree-sitter-debug)
    (require 'tree-sitter-debug)
    
    (desire 'tree-sitter-query)
    (require 'tree-sitter-query)
    
    (setopt tree-sitter-syntax-highlight-enable t)
    (setopt tree-sitter-fold-enable t)
    (setopt tree-sitter-fold-indicators-enable t)
    
    (global-tree-sitter-mode)
    
    (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
    
    ;;;
    

19.2.4 treesit-auto

  • Файл: packages/tree-sitter/desire.ecd/treesit-auto.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatic installation, usage, and fallback for tree-sitter major modes
    ;;; https://github.com/renzmann/treesit-auto
    
    (desire 'treesit-auto)
    (require 'treesit-auto)
    
    (setopt treesit-auto-install 'prompt)
    (treesit-auto-add-to-auto-mode-alist 'all)
    
    (customize-set-variable 'treesit-font-lock-level 3)
    
    (global-treesit-auto-mode)
    
    ;;;
    

19.3 Пробелы

19.3.1 stripspace

  • Подключение:
    (desire 'stripspace)
    
    Распечатка 94: rc.packages.el
  • Подключение:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatically removes trailing whitespace before saving a buffer
    ;; https://github.com/jamescherti/stripspace.el
    
    ;;; Code:
    
    ;;;; Enable for prog-mode-hook, text-mode-hook, conf-mode-hook
    (add-hook 'prog-mode-hook 'stripspace-local-mode)
    (add-hook 'text-mode-hook 'stripspace-local-mode)
    (add-hook 'conf-mode-hook 'stripspace-local-mode)
    
    ;;;; The `stripspace-only-if-initially-clean' option:
    ;;;; - nil to always delete trailing whitespace.
    ;;;; - Non-nil to only delete whitespace when the buffer is clean initially.
    ;;;; (The initial cleanliness check is performed when `stripspace-local-mode' is enabled.)
    (custom-set-variables '(stripspace-only-if-initially-clean nil))
    
    ;;;; Enabling `stripspace-restore-column' preserves the cursor's column position
    ;;;; even after stripping spaces. This is useful in scenarios where you add
    ;;;; extra spaces and then save the file. Although the spaces are removed in the
    ;;;; saved file, the cursor remains in the same position, ensuring a consistent editing experience without affecting cursor placement.
    (custom-set-variables '(stripspace-restore-column t))
    
    ;;;
    
    Распечатка 95: packages/stripspace.ecf

19.4 julia-formatter

19.4.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'julia-formatter)
    

19.4.2 Загрузка

  • Файл: packages/julia-formatter/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Use JuliaFormatter.jl to format julia code in Emacs
    ;; https://codeberg.org/FelipeLema/julia-formatter.el
    
    ;;; Code:
    
    
    ;;;
    

19.4.3 Конфигурация

  • Файл: packages/julia-formatter/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Use JuliaFormatter.jl to format julia code in Emacs
    ;; https://codeberg.org/FelipeLema/julia-formatter.el
    
    ;;; Code:
    
    (require 'julia-formatter)
    
    ;;;; Julia Image compilation prompt
    (setopt julia-formatter-should-compile-julia-image 'always-compile)
    
    (add-hook 'julia-mode-hook #'julia-formatter-mode)
    
    ;;;
    

19.4.4 Интеграция с aggressive-indent

  • Файл: packages/julia-formatter/aggressive-indent.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Use JuliaFormatter.jl to format julia code in Emacs
    ;; https://codeberg.org/FelipeLema/julia-formatter.el
    
    ;;; Code:
    
    (add-hook 'julia-formatter-mode-hook #'aggressive-indent)
    
    ;;;
    

19.4.5 Интеграция с julia-mode

  • Файл: packages/julia-mode/julia-formatter.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Use JuliaFormatter.jl to format julia code in Emacs
    ;; https://codeberg.org/FelipeLema/julia-formatter.el
    
    ;;; Code:
    
    (require 'julia-formatter)
    
    ;;;
    

20 Сворачивание

20.1 outline

20.1.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'outline)
    

20.1.2 Загрузка

  • Файл: packages/outline/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    (require 'outline)
    
    ;;;
    

20.1.3 Конфигурация

  • Файл: packages/outline/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;
    

20.1.4 Хуки

  • Файл: packages/outline/desire.ecd/hook.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;; Автоматическое включение для режимов программирования
    ;; (defun ecf/turn-on-outline-minor-mode ()
    ;;   "Включить outline-minor-mode для режимов программирования."
    ;;   (when (derived-mode-p 'prog-mode)
    ;;     (outline-minor-mode 1)))
    
    ;; (add-hook 'prog-mode-hook 'ecf/turn-on-outline-minor-mode)
    
    ;;;; Или для конкретных режимов
    (add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
    (add-hook 'python-mode-hook 'outline-minor-mode)
    (add-hook 'js-mode-hook 'outline-minor-mode)
    (add-hook 'java-mode-hook 'outline-minor-mode)
    (add-hook 'c-mode-hook 'outline-minor-mode)
    (add-hook 'c++-mode-hook 'outline-minor-mode)
    (add-hook 'web-mode-hook 'outline-minor-mode)
    
    ;;;
    

20.1.5 Настройка outline-regexp для разных языков

  • Файл: packages/outline/desire.ecd/regexp.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;; Универсальная настройка outline-regexp
    (defun ecf/set-outline-regexp ()
      "Установить outline-regexp в зависимости от режима."
      (cond
       ;; Emacs Lisp
       ((derived-mode-p 'emacs-lisp-mode 'lisp-mode 'lisp-interaction-mode)
        (setq-local outline-regexp ";;;+ \\|(def\\(un\\|subst\\|macro\\|advice\\|struct\\|class\\|method\\|generic\\)"))
    
       ;; Python
       ((derived-mode-p 'python-mode)
        (setq-local outline-regexp "def \\|class \\|# "))
    
       ;; JavaScript/TypeScript
       ((derived-mode-p 'js-mode 'js2-mode 'javascript-mode 'typescript-mode)
        (setq-local outline-regexp "function\\|class\\|const\\|let\\|var\\|// "))
    
       ;; Java
       ((derived-mode-p 'java-mode)
        (setq-local outline-regexp "class\\|interface\\|enum\\|@interface\\|public\\|protected\\|private\\|// "))
    
       ;; C/C++
       ((derived-mode-p 'c-mode 'c++-mode)
        (setq-local outline-regexp "^[ \t]*#[ \t]*\\(if\\|else\\|elif\\|endif\\|define\\|include\\)\\|// "))
    
       ;; Web (HTML/CSS)
       ((derived-mode-p 'web-mode)
        (setq-local outline-regexp "</?[a-z]+\\|^[ \t]*//\\|^[ \t]*/\\*\\|^[ \t]*\\*"))
    
       ;; Ruby
       ((derived-mode-p 'ruby-mode)
        (setq-local outline-regexp "def \\|class \\|module \\|# "))
    
       ;; Go
       ((derived-mode-p 'go-mode)
        (setq-local outline-regexp "func \\|type \\|struct \\|interface \\|// "))
    
       ;; Rust
       ((derived-mode-p 'rust-mode)
        (setq-local outline-regexp "fn \\|struct \\|enum \\|impl \\|trait \\|mod \\|// "))
    
       ;; PHP
       ((derived-mode-p 'php-mode)
        (setq-local outline-regexp "function\\|class\\|trait\\|interface\\|//\\|/\\*"))
    
       ;; Shell script
       ((derived-mode-p 'sh-mode 'bash-mode)
        (setq-local outline-regexp "function\\|# "))
    
       ;; Общий случай для других языков
       (t
        (setq-local outline-regexp "^[ \t]*[A-Za-z0-9]"))))
    
    ;; Хук для установки regexp при включении outline-minor-mode
    (add-hook 'outline-minor-mode-hook 'ecf/set-outline-regexp)
    
    ;;;
    

20.1.6 Сочетания клавиш

  • Файл: packages/outline/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;; Глобальные привязки клавиш
    (global-set-key (kbd "C-c @ C-o") 'outline-minor-mode)
    (global-set-key (kbd "C-c @ C-t") 'outline-toggle-children)
    
    ;;;; Локальные привязки при включении outline-minor-mode
    (defun ecf/outline-minor-mode-keys ()
      "Установить ключи для outline-minor-mode."
      (when outline-minor-mode
        ;;;; Навигация
        (local-set-key (kbd "C-c @ C-n") 'outline-next-visible-heading)
        (local-set-key (kbd "C-c @ C-p") 'outline-previous-visible-heading)
        (local-set-key (kbd "C-c @ C-f") 'outline-forward-same-level)
        (local-set-key (kbd "C-c @ C-b") 'outline-backward-same-level)
        (local-set-key (kbd "C-c @ C-u") 'outline-up-heading)
    
        ;;;; Скрытие/показ
        (local-set-key (kbd "C-c @ C-t") 'outline-hide-body)
        (local-set-key (kbd "C-c @ C-a") 'outline-show-all)
        (local-set-key (kbd "C-c @ C-q") 'outline-hide-sublevels)
        (local-set-key (kbd "C-c @ C-e") 'outline-hide-entry)
        (local-set-key (kbd "C-c @ C-i") 'outline-show-entry)
        (local-set-key (kbd "C-c @ C-k") 'outline-show-branches)
        (local-set-key (kbd "C-c @ C-l") 'outline-hide-leaves)
        (local-set-key (kbd "C-c @ C-s") 'outline-show-subtree)
        (local-set-key (kbd "C-c @ C-d") 'outline-hide-subtree)
    
        ;;;; Использование стандартных Org-mode клавиш (если Org не используется)
        ;; (local-set-key (kbd "TAB") 'outline-cycle)
        ;; (local-set-key (kbd "<S-TAB>") 'outline-cycle-buffer)
        ;; (local-set-key (kbd "C-c C-n") 'outline-next-visible-heading)
        ;; (local-set-key (kbd "C-c C-p") 'outline-previous-visible-heading)
        (local-set-key (kbd "C-c C-f") 'outline-forward-same-level)
        (local-set-key (kbd "C-c C-b") 'outline-backward-same-level)
        (local-set-key (kbd "C-c C-u") 'outline-up-heading)
        (local-set-key (kbd "C-c C-t") 'outline-toggle-children)))
    
    (add-hook 'outline-minor-mode-hook 'ecf/outline-minor-mode-keys)
    
    ;;;
    

20.1.7 Настройка outline-level

  • Файл: packages/outline/desire.ecd/level.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;; Функция для определения уровня заголовка
    (defun ecf/outline-level ()
      "Определить уровень заголовка для текущего режима."
      (save-excursion
        (cond
         ;;;; Для Emacs Lisp: уровень определяется количеством точек ввода
         ((derived-mode-p 'emacs-lisp-mode)
          (let ((count 0))
            (while (re-search-forward "[(]" nil t)
              (setq count (1+ count)))
            count))
    
         ;;;; Для языков с отступами (Python)
         ((derived-mode-p 'python-mode)
          (/ (current-indentation) python-indent-offset))
    
         ;;;; Общий случай: уровень по отступам
         (t
          (1+ (/ (current-indentation) tab-width))))))
    
    ;; Установка outline-level
    (defun ecf/set-outline-level ()
      "Установить outline-level функцию."
      (setq-local outline-level 'ecf/outline-level))
    
    (add-hook 'outline-minor-mode-hook 'ecf/set-outline-level)
    
    ;;;
    

20.1.8 Интеграция с imenu

  • Файл: packages/outline/imenu.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Outline mode commands for Emacs
    
    ;;; Code:
    
    ;;;; Использовать outline для навигации через imenu
    (defun ecf/outline-imenu-setup ()
      "Настроить imenu для использования outline."
      (when outline-minor-mode
        (setq-local imenu-create-index-function
                    'imenu-default-create-index-function)
        (setq-local imenu-generic-expression
                    (list
                     (list nil outline-regexp 0)))))
    
    (add-hook 'outline-minor-mode-hook 'ecf/outline-imenu-setup)
    
    ;;;; Автоматическое обновление imenu при изменениях
    (defadvice outline-minor-mode (after update-imenu activate)
      "Обновить imenu при включении/выключении outline-minor-mode."
      (when (featurep 'imenu)
        (imenu-update-menubar)))
    
    ;;;
    

20.2 origami

  • Emacs. Сворачивание (folding)
  • Подключение:
    ;; (desire 'origami)
    
    Распечатка 96: rc.packages.el
  • Подключение:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A folding minor mode for Emacs
    ;;; https://github.com/gregsexton/origami.el
    
    (require 'origami)
    
    (define-prefix-command 'origami-mode-map)
    (define-key ctl-x-map (kbd "z") 'origami-mode-map)
    (define-key origami-mode-map "o" 'origami-open-node)
    (define-key origami-mode-map "O" 'origami-open-node-recursively)
    (define-key origami-mode-map "c" 'origami-close-node)
    (define-key origami-mode-map "C" 'origami-close-node-recursively)
    (define-key origami-mode-map "a" 'origami-toggle-node)
    (define-key origami-mode-map "A" 'origami-recursively-toggle-node)
    (define-key origami-mode-map "R" 'origami-open-all-nodes)
    (define-key origami-mode-map "M" 'origami-close-all-nodes)
    (define-key origami-mode-map "v" 'origami-show-only-node)
    (define-key origami-mode-map "k" 'origami-previous-fold)
    (define-key origami-mode-map "j" 'origami-forward-fold)
    (define-key origami-mode-map "x" 'origami-reset)
    
    (global-origami-mode)
    
    ;;;
    
    Распечатка 97: packages/origami.ecf

20.3 outli

  • Emacs. Пакет outli
  • Подключение:
    (desire 'outli :recipe '(:fetcher github :repo "jdtsmith/outli" :branch "main"))
    
    Распечатка 98: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Simple comment-based outline folding for Emacs
    ;;; https://github.com/jdtsmith/outli
    
    (require 'outli)
    
    ;;;
    
    Распечатка 99: packages/outli/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Simple comment-based outline folding for Emacs
    ;;; https://github.com/jdtsmith/outli
    
    (general-define-key
     :keymaps 'outli-mode-map
     ;; convenience key to get back to containing heading
     "C-c C-p"  '(lambda () (interactive) (outline-back-to-heading)))
    
    (add-hook 'prog-mode-hook #'outli-mode)
    (add-hook 'text-mode-hook #'outli-mode)
    
    ;;;
    
    Распечатка 100: packages/outli/desire.ecf

20.4 hideshow

20.4.1 Подключение

(desire 'hideshow)
Распечатка 101: rc.packages.el

20.4.2 Загрузка

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Hideshow minor mode
;;;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html
;;;; https://www.emacswiki.org/emacs/HideShow

;;; Code:

(require 'hideshow)

;;;
Распечатка 102: packages/hideshow/loaddefs.ecf

20.4.3 Настройка

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Hideshow minor mode
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html
;; https://www.emacswiki.org/emacs/HideShow

;;; Code:

(add-hook 'prog-mode-hook #'hs-minor-mode)
(add-hook 'c-mode-common-hook #'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook #'hs-minor-mode)
(add-hook 'java-mode-hook #'hs-minor-mode)
(add-hook 'lisp-mode-hook #'hs-minor-mode)
(add-hook 'perl-mode-hook #'hs-minor-mode)
(add-hook 'sh-mode-hook #'hs-minor-mode)

;;;; Hide the comments too when you do a 'hs-hide-all'
(setopt hs-hide-comments nil)
;;;; Set whether isearch opens folded comments, code, or both code, comments, t (both), or nil (neither)
(setopt hs-isearch-open 'code)

;;;
Распечатка 103: packages/hideshow/desire.ecf

20.4.4 Интеграция с outline

  • Файл: packages/hideshow/outline.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Hideshow minor mode
    ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html
    ;; https://www.emacswiki.org/emacs/HideShow
    
    ;;; Code:
    
    (defun ecf/outline-hideshow-integration ()
      "Интеграция outline-minor-mode и hideshow."
      (when outline-minor-mode
        ;; Использовать outline для навигации, hideshow для сворачивания блоков
        (hs-minor-mode 1)
        (local-set-key (kbd "C-c @ C-h") 'hs-hide-block)
        (local-set-key (kbd "C-c @ C-s") 'hs-show-block)
        (local-set-key (kbd "C-c @ C-c") 'hs-toggle-hiding)))
    
    (add-hook 'outline-minor-mode-hook 'ecf/outline-hideshow-integration)
    
    ;;;
    

20.5 bicycle

  • Переключение режима структуры.
  • https://github.com/tarsius/bicycle
  • Подключение:
    (desire 'bicycle)
    
    Распечатка 104: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Cycle outline and code visibility
    ;;;; https://github.com/tarsius/bicycle
    
    ;;; Code:
    
    (require 'bicycle)
    
    ;;;
    
    Распечатка 105: packages/bicycle/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Cycle outline and code visibility
    ;;;; https://github.com/tarsius/bicycle
    
    ;;; Code:
    
    (require 'outline)
    (require 'bicycle)
    
    (general-define-key
     :keymaps 'outline-minor-mode-map
     [C-tab] 'bicycle-cycle
     [S-tab] 'bicycle-cycle-global)
     ;; (define-key outline-minor-mode-map (kbd "<backtab>") #'bicycle-cycle-global)
    
    (add-hook 'prog-mode-hook #'outline-minor-mode)
    (add-hook 'markdown-mode-hook #'outline-minor-mode)
    (add-hook 'TeX-mode-hook #'outline-minor-mode)
    (add-hook 'LaTeX-mode-hook #'outline-minor-mode)
    (add-hook 'rst-mode-hook #'outline-minor-mode)
    (add-hook 'prog-mode-hook #'outline-minor-mode)
    (add-hook 'prog-mode-hook #'hs-minor-mode)
    
    ;;;
    
    Распечатка 106: packages/bicycle/desire.ecf

20.6 indent-bars

20.6.1 Подключение

  • Файл: rc.packages.el
    (desire 'indent-bars)
    

20.6.2 Загрузка

  • Файл: packages/indent-bars/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    (require 'indent-bars)
    
    ;;;
    

20.6.3 Конфигурация

  • Файл: packages/indent-bars/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    (setq indent-bars-width 1)              ;; Толщина линий
    (setq indent-bars-color "gray50")       ;; Цвет линий
    (setq indent-bars-pad-frac 0.1)         ;; Отступ от текста
    (setq indent-bars-pattern "..")         ;; Паттерн для терминала
    (setq indent-bars-display-on-blank-lines nil)  ;; Не показывать на пустых строках
    (setq indent-bars-zigzag nil)           ;; Без зигзагов
    (setq indent-bars-first-indent t)       ;; Показывать первую линию
    (setq indent-bars-auto-update-delay 0.2) ;; Задержка обновления
    
    ;;;
    

20.6.4 Хуки

  • Файл: packages/indent-bars/desire.ecd/hook.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    ;;;; Включить для всех языков программирования
    ;; (add-hook 'prog-mode-hook 'indent-bars-mode)
    
    ;;;; Черный список режимов
    ;; (defun my-disable-indent-bars ()
    ;;   (indent-bars-mode -1))
    
    ;; (add-hook 'org-mode-hook 'my-disable-indent-bars)
    ;; (add-hook 'markdown-mode-hook 'my-disable-indent-bars)
    ;; (add-hook 'text-mode-hook 'my-disable-indent-bars)
    ;; (add-hook 'fundamental-mode-hook 'my-disable-indent-bars)
    
    ;;;; Для конкретных режимов
    (add-hook 'python-mode-hook 'indent-bars-mode)
    (add-hook 'js-mode-hook 'indent-bars-mode)
    (add-hook 'web-mode-hook 'indent-bars-mode)
    (add-hook 'java-mode-hook 'indent-bars-mode)
    (add-hook 'c-mode-hook 'indent-bars-mode)
    (add-hook 'c++-mode-hook 'indent-bars-mode)
    (add-hook 'ruby-mode-hook 'indent-bars-mode)
    (add-hook 'go-mode-hook 'indent-bars-mode)
    
    ;;;
    

20.6.5 Цвет

  • Файл: packages/indent-bars/desire.ecd/color.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    ;;;; Автоматический подбор цвета под тему
    ;; (setq indent-bars-color '(highlight :face-bg t :blend 0.2))
    
    ;;;; Или установить цвета вручную
    ;; (defun my-set-indent-bars-colors ()
    ;;   "Установить цвета indent-bars в зависимости от темы."
    ;;   (cond
    ;;    ((eq (frame-parameter nil 'background-mode) 'dark)
    ;;     (setq indent-bars-color "gray40"))
    ;;    (t
    ;;     (setq indent-bars-color "gray60"))))
    
    ;; (add-hook 'after-init-hook 'my-set-indent-bars-colors)
    ;; (add-hook 'enable-theme-functions
    ;;           (lambda (_theme) (my-set-indent-bars-colors)))
    
    ;;;
    

20.6.6 Производительность

  • Файл: packages/indent-bars/desire.ecd/performance.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    ;;;; Не рисовать внутри строк и комментариев
    ;; (setq indent-bars-no-draw-line-func
    ;;       (lambda (beg end)
    ;;         (or (nth 4 (syntax-ppss))      ;; Внутри строк
    ;;             (nth 3 (syntax-ppss)))))   ;; Внутри комментариев
    
    ;; ;;;; Отключить для больших файлов
    ;; (defun ecf/indent-bars-maybe ()
    ;;   "Включить indent-bars только для файлов разумного размера."
    ;;   (when (< (buffer-size) 100000)  ;; 100KB
    ;;     (indent-bars-mode 1)))
    
    ;; (add-hook 'prog-mode-hook 'ecf/indent-bars-maybe)
    
    ;;;
    

20.6.7 Интеграция с tree-sitter

  • Файл: packages/indent-bars/tree-sitter.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fast, configurable indentation guide-bars for Emacs
    ;; https://github.com/jdtsmith/indent-bars
    
    ;;; Code:
    
    ;;;; Для лучшей поддержки tree-sitter
    (when (boundp 'tree-sitter-indent)
      (setq indent-bars-tree-sitter-support t))
    
    ;;;
    

20.7 outline-indent

  • Сворачивание и разворачивание разделов кода в зависимости от уровня отступа.
  • Emacs. Пакет outline-indent

20.7.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'outline-indent)
    

20.7.2 Загрузка

  • Файл: packages/outline-indent/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    (require 'outline-indent)
    
    ;;;
    

20.7.3 Конфигурация

  • Файл: packages/outline-indent/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;; Основные настройки
    ;; (setopt outline-indent-alist
    ;;       '((emacs-lisp-mode . 2)
    ;;         (lisp-mode . 2)
    ;;         (lisp-interaction-mode . 2)
    ;;         (scheme-mode . 2)
    ;;         (clojure-mode . 2)
    ;;         (common-lisp-mode . 2)
    ;;         (python-mode . 4)
    ;;         (ruby-mode . 2)
    ;;         (js-mode . 2)
    ;;         (js2-mode . 2)
    ;;         (javascript-mode . 2)
    ;;         (typescript-mode . 2)
    ;;         (c-mode . 2)
    ;;         (c++-mode . 2)
    ;;         (java-mode . 4)
    ;;         (php-mode . 4)
    ;;         (perl-mode . 4)
    ;;         (cperl-mode . 4)
    ;;         (tcl-mode . 4)
    ;;         (sh-mode . 2)
    ;;         (bash-mode . 2)
    ;;         (css-mode . 2)
    ;;         (scss-mode . 2)
    ;;         (yaml-mode . 2)
    ;;         (json-mode . 2)
    ;;         (go-mode . 4)
    ;;         (rust-mode . 4)
    ;;         (swift-mode . 4)
    ;;         (kotlin-mode . 4)
    ;;         (scala-mode . 2)
    ;;         (haskell-mode . 2)
    ;;         (ocaml-mode . 2)
    ;;         (erlang-mode . 2)
    ;;         (elixir-mode . 2)))
    
    (setopt outline-indent-ellipsis " ▼")
    
    ;;;; Maintaining blank lines between folded sections
    (setopt outline-blank-line t)
    
    ;;;; Prevent Emacs from Searching Folded Sections
    ;; (setopt search-invisible nil)
    
    ;;;
    

20.7.4 Хуки

  • Файл: packages/outline-indent/desire.ecd/hook.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;;;; Включить для всех режимов программирования
    ;; (defun ecf/turn-on-outline-indent ()
    ;;   "Включить outline-indent для режимов программирования."
    ;;   (when (and (derived-mode-p 'prog-mode)
    ;;              (< (buffer-size) 100000))  ;; 100KB
    ;;     (outline-indent-mode 1)))
    
    ;; (add-hook 'prog-mode-hook 'ecf/turn-on-outline-indent)
    
    ;;;; Или для конкретных режимов
    ;; (add-hook 'emacs-lisp-mode-hook 'outline-indent-mode)
    ;; (add-hook 'python-mode-hook 'outline-indent-mode)
    ;; (add-hook 'js-mode-hook 'outline-indent-mode)
    ;; (add-hook 'java-mode-hook 'outline-indent-mode)
    ;; (add-hook 'c-mode-hook 'outline-indent-mode)
    
    ;;;; Черный список режимов
    ;; (defun ecf/disable-outline-indent ()
    ;;   "Отключить outline-indent для определенных режимов."
    ;;   (when (or (derived-mode-p 'org-mode)
    ;;             (derived-mode-p 'markdown-mode)
    ;;             (derived-mode-p 'text-mode)
    ;;             (derived-mode-p 'fundamental-mode))
    ;;     (outline-indent-mode -1)))
    
    ;; (add-hook 'outline-indent-mode-hook 'ecf/disable-outline-indent)
    
    ;;;; Python
    (add-hook 'python-mode-hook #'outline-indent-minor-mode)
    (add-hook 'python-ts-mode-hook #'outline-indent-minor-mode)
    
    ;;;; YAML
    (add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
    (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)
    
    ;;;; Automatically Folding All Folds on Mode Activation
    (add-hook 'outline-indent-minor-mode-hook
              #'(lambda()
                  (outline-indent-close-folds)))
    
    ;;;
    

20.7.5 Производительность

  • Файл: packages/outline-indent/desire.ecd/performance.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;;;; Оптимизация перерисовки
    (setopt outline-indent-delay 0.1)  ;; Задержка перед обновлением
    
    ;;;; Не показывать на пустых строках
    (setopt outline-indent-blank-lines nil)
    
    ;;;; Минимальная ширина отступа
    (setopt outline-indent-min-width 2)
    
    ;;;
    

20.7.6 Сочетания клавиш

  • Файл: packages/outline-indent/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;;;; Глобальные клавиши для управления outline-indent
    ;; (global-set-key (kbd "C-c o i") 'outline-indent-mode)
    ;; (global-set-key (kbd "C-c o +") 'outline-indent-increase)
    ;; (global-set-key (kbd "C-c o -") 'outline-indent-decrease)
    ;; (global-set-key (kbd "C-c o r") 'outline-indent-refresh)
    ;; (global-set-key (kbd "C-c o c") 'outline-indent-cycle)
    
    ;;;; Локальные команды для работы с outline
    ;; (defun ecf/outline-indent-commands ()
    ;;   "Установить локальные команды для outline-indent."
    ;;   (when outline-indent-mode
    ;;     (local-set-key (kbd "TAB") 'outline-indent-cycle)
    ;;     (local-set-key (kbd "<backtab>") 'outline-indent-shift-left)
    ;;     (local-set-key (kbd "C-c TAB") 'outline-indent-refresh)))
    
    ;; (add-hook 'outline-indent-mode-hook 'ecf/outline-indent-commands)
    
    ;;;; Fold management
    (define-key outline-indent-minor-mode-map (kbd "C-c o o") 'outline-indent-open-fold)     ; Open fold at point
    (define-key outline-indent-minor-mode-map (kbd "C-c o c") 'outline-indent-close-fold)    ; Close fold at point
    (define-key outline-indent-minor-mode-map (kbd "C-c o m") 'outline-indent-close-folds)   ; Close all folds
    (define-key outline-indent-minor-mode-map (kbd "C-c o r") 'outline-indent-open-folds)    ; Open all folds
    (define-key outline-indent-minor-mode-map (kbd "C-c o O") 'outline-indent-open-fold-rec) ; Open fold recursively
    (define-key outline-indent-minor-mode-map (kbd "C-c o TAB") 'outline-indent-toggle-fold) ; Toggle fold at point
    (define-key outline-indent-minor-mode-map (kbd "C-c o t") 'outline-indent-toggle-level-at-point) ; Toggle level at point
    
    ;;;; Selection
    (define-key outline-indent-minor-mode-map (kbd "C-c o v") 'outline-indent-select) ; Select current indented block
    
    ;;;; Navigation at same indentation level
    (define-key outline-indent-minor-mode-map (kbd "C-c o n") 'outline-indent-forward-same-level) ; Next heading at same level
    (define-key outline-indent-minor-mode-map (kbd "C-c o p") 'outline-indent-backward-same-level) ; Previous heading at same level
    
    ;;;; Shift left or right
    (define-key outline-indent-minor-mode-map (kbd "C-c o <right>") 'outline-indent-shift-right)
    (define-key outline-indent-minor-mode-map (kbd "C-c o <left>") 'outline-indent-shift-left)
    
    ;;;; Insert heading
    (define-key outline-indent-minor-mode-map (kbd "C-c o i") 'outline-indent-insert-heading)
    
    ;;;
    

20.7.7 Оформление

  • Файл: packages/outline-indent/desire.ecd/decor.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;;;; Символы для разных уровней отступа
    ;; (setopt outline-indent-chars
    ;;       '(?│ ?┃ ?┆ ?┇ ?┊ ?┋ ?╎ ?╏ ?┌ ?┐ ?└ ?┘ ?├ ?┤ ?┬ ?┴ ?┼))
    
    ;;;; Или простые символы
    ;; (setopt outline-indent-chars '(?| ?| ?| ?| ?|))  ;; Все одинаковые
    
    ;;;; Специальные символы для терминала
    ;; (setq outline-indent-chars '(?\u2502 ?\u2503 ?\u2506 ?\u2507))
    
    ;;;; Цвета для разных уровней отступов
    ;; (setq outline-indent-colors
    ;;       '("gray50" "gray55" "gray60" "gray65" "gray70" "gray75"))
    
    ;;;
    

20.7.8 Интеграция с outline-minor-mode

  • Файл: packages/outline-indent/outline.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    ;;;; Автоматическое включение outline-minor-mode с outline-indent
    (defun my-outline-minor-with-indent ()
      "Включить outline-minor-mode и outline-indent-mode вместе."
      (outline-minor-mode 1)
      (when (derived-mode-p 'prog-mode)
        (outline-indent-mode 1)))
    
    ;;;; Настройка outline-regexp для разных языков
    (defun ecf/set-outline-regexp ()
      "Установить outline-regexp для текущего режима."
      (cond
       ((derived-mode-p 'emacs-lisp-mode 'lisp-mode)
        (setq-local outline-regexp ";;;+ "))
       ((derived-mode-p 'python-mode)
        (setq-local outline-regexp "def \\|class \\|# "))
       ((derived-mode-p 'js-mode 'typescript-mode)
        (setq-local outline-regexp "function \\|class \\|const \\|let \\|var \\|// "))
       (t
        (setq-local outline-regexp "^[ \t]*[A-Za-z0-9]"))))
    
    (add-hook 'outline-minor-mode-hook 'ecf/set-outline-regexp)
    
    ;;;
    

20.7.9 Интеграция с indent-bars

  • Файл: packages/outline-indent/indent-bars.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Folding text based on indentation
    ;; https://github.com/jamescherti/outline-indent.el
    
    ;;; Code:
    
    (require 'indent-bars)
    
    ;;;; Setting this to nil is not reliable enough
    ;; https://github.com/jdtsmith/indent-bars?tab=readme-ov-file#stipples
    (setopt indent-bars-prefer-character t)
    
    ;;;; When `indent-bars-prefer-character' is set to t, displaying indent bars on
    ;;;; blank lines causes cursor movement issues when moving downward, resulting
    ;;;; in abrupt shifts of the window start or cursor position.
    (setopt indent-bars-display-on-blank-lines nil)
    
    ;;;
    

21 Проверка правописания

;;; Spell {{{

;; (desire-conf 'spell)
(desire 'ispell)
;; (desire 'flyspell)
;;(desire-conf 'speck)
;;(desire-conf 'wcheck)

21.1 jinx

  • https://github.com/minad/jinx
  • Подключение:
    (desire 'jinx)
    
    Распечатка 107: rc.packages.el
  • Начальная загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Enchanted Spell Checker
    ;;; https://github.com/minad/jinx
    
    (require 'jinx)
    
    ;;; Alternative 1: Enable Jinx globally
    ;; (add-hook 'emacs-startup-hook #'global-jinx-mode)
    
    ;;; Alternative 2: Enable Jinx per mode
    (dolist (hook '(text-mode-hook prog-mode-hook conf-mode-hook))
      (add-hook hook #'jinx-mode))
    
    ;;;
    
    Распечатка 108: packages/jinx/loaddefs.ecf
  • Настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Enchanted Spell Checker
    ;;; https://github.com/minad/jinx
    
    
    ;;; M-$ triggers correction for the misspelled word before point.
    ;;; C-u M-$ triggers correction for the entire buffer.
    ;;; C-u C-u M-$ forces correction of the word at point, even if it is not misspelled.
    (keymap-global-set "M-$" #'jinx-correct)
    (keymap-global-set "C-M-$" #'jinx-languages)
    
    ;;;
    
    Распечатка 109: packages/jinx/desire.ecf
  • Поддержка vertico:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Enchanted Spell Checker
    ;;; https://github.com/minad/jinx
    
    (require 'vertico-multiform)
    (add-to-list 'vertico-multiform-categories
                 '(jinx grid (vertico-grid-annotate . 20)))
    
    (vertico-multiform-mode 1)
    
    ;;;
    
    Распечатка 110: packages/jinx/vertico.ecf

21.2 Langtool

;; (desire 'langtool)
;; (desire 'flycheck-languagetool)
;; (desire 'lsp-ltex :recipe '(:fetcher github :repo "emacs-languagetool/lsp-ltex" :branch "master" :files ("*.el")))
;; (desire 'eglot-ltex :recipe '(:fetcher github :repo "emacs-languagetool/eglot-ltex" :branch "master" :files ("*.el")))

21.3 Завершение

;;;}}}

22 Адресная книга

;;; Adress book {{{

(desired 'vcard)
(desire 'khardel :precondition-system-executable "khard")
(desire 'khalel :precondition-system-executable "khal")
;; (desire 'org-vcard)
;; (desire 'vdirel)
;; (desire 'bbdb)

;;;}}}

23 Библиография

23.1 Начало

;;; Bibliography {{{

23.2 Доступ к библиографическим базам данных

  • Пакет biblio.
  • Подключение:
    (desire 'biblio)
    
    Распечатка 111: rc.packages.el
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Browse and import bibliographic references from CrossRef, DBLP, HAL, arXiv, Dissemin, and doi.org from Emacs
    ;; https://github.com/cpitclaudel/biblio.el
    
    (require 'biblio)
    
    ;;; To get better response times from CrossRef
    ;;; https://github.com/CrossRef/rest-api-doc#etiquette
    (setopt biblio-crossref-user-email-address user-mail-address)
    
    ;;; Which header to use for BibTeX entries generated from arXiv metadata
    (setopt biblio-arxiv-bibtex-header "misc")
    
    ;;;
    
    Распечатка 112: packages/biblio.ecf

23.3 Настройки bibtex

  • Подключение:
    (desire 'bibtex)
    
    Распечатка 113: rc.packages.el

23.3.1 Расположение файлов

  • Персональные настройки расположения файлов.
  • Организация рабочего каталога
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;;
    
    Распечатка 114: packages/bibtex/personal.ecf
  • Основной файл библиографии:
    ;;; Where bibliographies can be found
    (setq personal-bibliography '("~/work/bib/bib/main.bib"))
    
    Распечатка 115: packages/bibtex/personal.ecf
  • Файлы книг и статей:
    ;;; Where PDFs can be found
    ;; (setopt bibtex-completion-library-path (directory-files-recursively "~/data/bib/pdf" "\\`[^.]*\\'" 't))
    (setq personal-library-path '("~/work/bib/data/pdf"))
    
    Распечатка 116: packages/bibtex/personal.ecf
  • Расположение литературных заметок:
    ;;; Notes
    ;;; Store all notes in one file
    ;; (setopt personal-notes-path "/path/to/notes.org")
    ;;; Store notes in multiple files, one file per publication
    ;; (setopt personal-notes-path (expand-file-name "~/work/org/notes/literature"))
    (setq personal-notes-path '())
    (add-to-list 'personal-notes-path (expand-file-name "~/work/org/notes/literature"))
    
    ;;;
    
    Распечатка 117: packages/bibtex/personal.ecf

23.4 Завершение

;;;}}}

24 Сниппеты


;;(desire-conf 'yasnippet)

25 Текстовые режимы

  • Декларация секции:
    ;;;; Work with text
    
    Распечатка 118: rc.packages.el

25.1 Таблицы

  • Декларация секции:
    ;;;;; Tables
    
    Распечатка 119: rc.packages.el

25.1.1 lte.el

  • Large Table Edition in Org and Markdown buffers
  • https://github.com/fredericgiquel/lte.el
  • Подключение:
    (desire 'lte)
    
    Распечатка 120: rc.packages.el
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Large Table Edition in Org and Markdown buffers for Emacs
    ;;; https://github.com/fredericgiquel/lte.el
    
    ;;;
    
    Распечатка 121: packages/lte.ecf
  • Поддержка markdown-mode:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Large Table Edition in Org and Markdown buffers for Emacs
    ;;; https://github.com/fredericgiquel/lte.el
    
    (require 'lte)
    (add-hook 'markdown-mode-hook #'lte-truncate-table-mode)
    
    ;;;
    
    Распечатка 122: packages/markdown-mode/lte.ecf
  • Поддержка org-mode:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Large Table Edition in Org and Markdown buffers for Emacs
    ;;; https://github.com/fredericgiquel/lte.el
    
    (require 'lte)
    (add-hook 'org-mode-hook #'lte-truncate-table-mode)
    
    ;;;
    
    Распечатка 123: packages/org/lte.ecf

25.2 Отображение текста

  • Декларация секции:
    ;;;;; Text view
    
    Распечатка 124: rc.packages.el
(desire 'texfrag)

;; (desire 'adaptive-wrap)
(desired 'visual-line-mode)

;; (desired 'prettify-symbols-mode)
;; (desire 'pretty-mode)
;; (desire 'prettify-math)
;; (desire 'math-preview)
(desire-conf 'text)

25.3 move-text

  • Emacs. Работа с текстом
  • Позволяет перемещать строки текста.
  • Подключение:
    (desire 'move-text)
    
    Распечатка 125: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Move current line or region up or down
    ;;; https://github.com/emacsfodder/move-text
    
    (require 'move-text)
    
    ;;;
    
    Распечатка 126: packages/move-text/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Move current line or region up or down
    ;;; https://github.com/emacsfodder/move-text
    
    ;;; Use the default bindings
    (move-text-default-bindings)
    
    ;;;
    
    Распечатка 127: packages/move-text/desire.ecf
  • Перестройка отступов:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Move current line or region up or down
    ;;; https://github.com/emacsfodder/move-text
    
    ;;; Indent after moving
    
    (defun indent-region-advice (&rest ignored)
      (let ((deactivate deactivate-mark))
        (if (region-active-p)
            (indent-region (region-beginning) (region-end))
          (indent-region (line-beginning-position) (line-end-position)))
        (setopt deactivate-mark deactivate)))
    
    (advice-add 'move-text-up :after 'indent-region-advice)
    (advice-add 'move-text-down :after 'indent-region-advice)
    
    ;;;
    
    Распечатка 128: packages/move-text/desire.ecd/reindent.ecf

25.4 delsel

  • В дереве emacs.
  • При вставке текста в выделенную область вставленный текст заменяет исходный.
  • Подключение:
    (desire 'delsel)
    
    Распечатка 129: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Delete the selected text upon text insertion
    
    ;;; Code:
    
    (require 'delsel)
    (add-hook 'after-init-hook 'delete-selection-mode)
    
    ;;;
    
    Распечатка 130: packages/delsel.ecf

25.5 pandoc

(desire 'pandoc-mode)

25.6 markdown

25.6.1 Подключение

  • Файл: rc.packages.el
    (desire 'markdown-mode)
    

25.6.2 Интеграция

  1. lsp-mode

    • Emacs. LSP для Markdown
    • Файл: packages/markdown-mode/lsp-mode.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs lsp-mode client for markdown
      ;; https://emacs-lsp.github.io/lsp-mode/page/lsp-marksman/
      
      ;;; Code:
      
      (require 'lsp-mode)
      (add-hook 'markdown-mode #'lsp)
      
      ;;;; Marksman
      (require 'lsp-marksman)
      
      ;;;
      
  1. eglot

    • Emacs. LSP для Markdown
    • Файл: packages/markdown-mode/eglot.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; A client for Language Server Protocol servers
      ;; https://github.com/joaotavora/eglot
      
      ;;; Code
      
      (require 'eglot)
      
      (add-hook 'markdown-mode-hook #'eglot-ensure)
      
      ;;;
      

25.7 Форматы документов

25.7.1 Оглавление pdf

  • Emacs. Пакет doc-toc
  • Подключение:
    (desire 'doc-toc)
    
    Распечатка 131: rc.packages.el
  • Предварительные настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create, cleanup, add and manage Table Of Contents (TOC) of pdf and djvu documents with Emacs
    ;; https://github.com/dalanicolai/doc-tools-toc
    
    ;;; Code:
    
    (desire 'pdf-tools)
    (desire 'djvu)
    
    ;;;
    
    Распечатка 132: packages/doc-toc/loaddefs.ecf
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create, cleanup, add and manage Table Of Contents (TOC) of pdf and djvu documents with Emacs
    ;; https://github.com/dalanicolai/doc-tools-toc
    
    ;;; Code:
    
    (require 'doc-toc)
    
    ;;;
    
    Распечатка 133: packages/doc-toc/desire.ecf

25.7.2 Метаданные pdf

  • Emacs. Пакет pdf-meta-edit
  • Подключение:
    (desire 'pdf-meta-edit)
    
    Распечатка 134: rc.packages.el
  • Предварительные настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs code for editing a PDF's metadata, labels, and bookmarks
    ;; https://github.com/krisbalintona/pdf-meta-edit
    
    ;;; Code:
    
    ;;;
    
    Распечатка 135: packages/pdf-meta-edit/loaddefs.ecf
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs code for editing a PDF's metadata, labels, and bookmarks
    ;; https://github.com/krisbalintona/pdf-meta-edit
    
    ;;; Code:
    
    (require 'pdf-meta-edit)
    
    ;;;
    
    Распечатка 136: packages/pdf-meta-edit/desire.ecf

25.7.3 Формат pdf

  • Подключение:

    (desire 'pdf-tools)
    
    Распечатка 137: rc.packages.el
  • Подключение doc-toc:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create, cleanup, add and manage Table Of Contents (TOC) of pdf and djvu documents with Emacs
    ;; https://github.com/dalanicolai/doc-tools-toc
    
    ;;; Code:
    
    (require 'doc-toc)
    
    ;;;
    
    Распечатка 138: packages/pdf-tools/doc-toc.ecf

25.7.4 Формат epub

(desire 'nov)

25.7.5 Формат fb2

(desire 'fb2-reader)

;; (desire 'valign)

25.8 quarto

  • Поддержка quarto.

25.8.1 Подключение

  • Файл: rc.packages.el
    ;;;; Quarto mode
    (desire 'quarto-mode)
    

25.8.2 Загрузка

  • Файл: packages/quarto-mode/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An emacs mode for quarto
    ;; https://github.com/quarto-dev/quarto-emacs
    
    ;;; Code:
    
    (desire' polymode)
    (desire 'poly-markdown)
    
    (require 'quarto-mode)
    
    ;;;
    

25.8.3 Интеграция

  1. lsp-mode

    • Emacs. LSP для Markdown
    • Файл: packages/quarto-mode/lsp-mode.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Emacs lsp-mode client for markdown
      ;; https://emacs-lsp.github.io/lsp-mode/page/lsp-marksman/
      
      ;;; Code:
      
      (require 'lsp-mode)
      (add-hook 'quarto-mode #'lsp)
      
      ;;;; Marksman
      (require 'lsp-marksman)
      
      ;;;
      
  1. eglot

    • Emacs. LSP для Markdown
    • Файл: packages/markdown-mode/eglot.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; A client for Language Server Protocol servers
      ;; https://github.com/joaotavora/eglot
      
      ;;; Code
      
      (require 'eglot)
      
      (add-hook 'quarto-mode-hook #'eglot-ensure)
      
      ;;;
      

25.9 calibredb

  • Клиент для Calibre (см. Каталогизатор книг Calibre).
  • https://github.com/chenyanming/calibredb.el
  • Подключение:
    (desire 'calibredb)
    
    Распечатка 139: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; Emacs calibre client - A Document Management Solution in Emacs
    ;; https://github.com/chenyanming/calibredb.el
    
    ;;; Code:
    
    ;;;
    
    Распечатка 140: packages/calibredb/loaddefs.ecf
  • Конфигурация:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; Emacs calibre client - A Document Management Solution in Emacs
    ;; https://github.com/chenyanming/calibredb.el
    
    ;;; Code:
    
    (require 'calibredb)
    
    ;;;; Size indicator
    (setopt calibredb-size-show t)
    
    ;;;
    
    Распечатка 141: packages/calibredb/desire.ecf
  • Персональные настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; Emacs calibre client - A Document Management Solution in Emacs
    ;; https://github.com/chenyanming/calibredb.el
    
    ;;; Code:
    
    (setq calibredb-root-dir "/data/book/calibre")
    ;;;; for folder driver metadata: it should be .metadata.calibre
    (setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
    (setq calibredb-library-alist '(("/data/book/calibre" (name . "Calibre")) ;; with name
                                    ;; ("/Users/damonchan/Documents/Books Library") ;; no name
                                    ;; ("/Users/damonchan/Documents/HELLO")
                                    ;; ("/Users/damonchan/Documents/Books")
                                    ;; ("/Users/damonchan/Documents/World"))
          ))
    
    ;;;
    
    Распечатка 142: packages/calibredb/personal.ecf
  • Поддержка nerd-icons:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; Emacs calibre client - A Document Management Solution in Emacs
    ;; https://github.com/chenyanming/calibredb.el
    
    ;;; Code:
    
    (setopt calibredb-format-nerd-icons t)
    
    ;;;
    
    Распечатка 143: packages/calibredb/nerd-icons.ecf
  • Поддержка all-the-icons:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;; Emacs calibre client - A Document Management Solution in Emacs
    ;; https://github.com/chenyanming/calibredb.el
    
    ;;; Code:
    
    (setopt calibredb-format-all-the-icons t)
    
    ;;;
    
    Распечатка 144: packages/calibredb/all-the-icons.ecf

26 Управление временем

  • Разделитель:
    ;;;; Time management
    
    Распечатка 145: rc.packages.el

26.1 pomm

26.1.1 Подключение

  • Файл: rc.packages.el
    (desire 'pomm)
    

26.1.2 Загрузка

  • Файл: packages/pomm/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Implementation of Pomodoro and Third Time techniques for Emacs
    ;; https://github.com/SqrtMinusOne/pomm.el
    
    ;;; Code:
    
    (require 'pomm)
    
    ;;;
    

26.1.3 Настройка

  • Файл: packages/pomm/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Implementation of Pomodoro and Third Time techniques for Emacs
    ;; https://github.com/SqrtMinusOne/pomm.el
    
    ;;; Code:
    
    ;;;; If you want an actual notification
    (setopt alert-default-style 'libnotify)
    
    ;;;; Display in the modeline
    (pomm-mode-line-mode)
    
    ;;;; By default sounds are disabled
    (setopt pomm-audio-enabled t)
    
    ;;;; Ticking sound
    ;; (setopt pomm-audio-tick-enabled t)
    
    ;;;
    

26.1.4 Интерфейс к polybar (разным реализациям)

  • Файл: packages/pomm/desire.ecd/polybar.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Implementation of Pomodoro and Third Time techniques for Emacs
    ;; https://github.com/SqrtMinusOne/pomm.el
    
    ;;; Code:
    
    (add-hook 'pomm-on-tick-hook 'pomm-update-mode-line-string)
    (add-hook 'pomm-on-status-changed-hook 'pomm-update-mode-line-string)
    
    ;;;
    

26.1.5 Сохранение истории

  • Файл: packages/pomm/desire.ecd/history.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Log history in CSV format
    ;; https://github.com/SqrtMinusOne/pomm.el
    
    
    ;;; Code:
    
    ;;;; Save timer history in a CSV format
    (setopt pomm-csv-history-file (expand-file-name "pomm.csv" user-emacs-directory))
    
    ;;;; Customize timestamp (for traditional YYYY-MM-DD HH:mm:ss)
    (setopt pomm-csv-history-file-timestamp-format "%F %T")
    
    ;;;
    

26.1.6 pomm-dwim

  • https://github.com/SqrtMinusOne/pomm.el/issues/18
  • Файл: packages/pomm/desire.ecd/pomm-dwim.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; pomm-dwim: Like pomm-start but pauses if running
    ;; https://github.com/SqrtMinusOne/pomm.el/issues/18
    
    ;;; Code:
    
    (defun pomm-dwim (arg)
      "Like `pomm-start' but will also pause the timer if it is already running.
    Alternatively if prefixed with \\[universal-argument], the timer state will be reset."
      (interactive "p")
      (if (eq arg 4)
          (pomm--do-reset)
        (if (eq 'running (alist-get 'status pomm--state))
            (pomm-pause)
          (pomm-start))))
    
    ;;;
    

26.1.7 Интеграция org-mode

  • Файл: packages/org/pomm.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Log history in CSV format
    ;; https://github.com/SqrtMinusOne/pomm.el
    
    ;;; Code:
    
    (require 'pomm)
    
    (add-hook 'pomm-on-status-changed-hook #'pomm--sync-org-clock)
    (add-hook 'pomm-third-time-on-status-changed-hook #'pomm-third-time--sync-org-clock)
    
    ;;;
    

26.2 org-pomodoro

(desire 'org-pomodoro)
;; (desire 'hammy)

27 LaTeX

;;; LaTeX

(desire 'xenops)

(desire 'cdlatex)

(desire-conf 'xdvi nil "xdvi-search")
(desired 'reftex)
;; (desire-conf 'tex)
(desired 'preview-latex)

27.1 Auctex

  • Подключение
    (desire 'auctex)
    
    Распечатка 146: rc.packages.el

27.1.1 Парсинг файлов TeX

  • Заголовок:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatic Parsing of TeX Files
    ;; http://www.gnu.org/software/auctex/
    
    ;;; Code:
    
    Распечатка 147: packages/auctex/desire.ecd/parsing.ecf
  • Автопарсинг:
    ;;;; Automatic Parsing of TeX Files
    (setopt TeX-parse-self t)                 ; Enable parse on load
    (setopt TeX-auto-save t)                  ; Enable parse on save
    
    Распечатка 148: packages/auctex/desire.ecd/parsing.ecf
  • Убрать символы табуляции:
    ;;;; Automatically remove all tabs from a file before saving it
    (setopt TeX-auto-untabify t)
    
    Распечатка 149: packages/auctex/desire.ecd/parsing.ecf
  • Финал:
    ;;;
    
    Распечатка 150: packages/auctex/desire.ecd/parsing.ecf

28 Инфраструктура Org-mode

  • Org-mode
  • Конфигурация для org-mode:
    ;;;; Org-mode
    
    Распечатка 151: rc.packages.el

28.1 Babel

  • Emacs. Org Babel
  • Общие настройки babel:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Org-Babel
    
    ;;; Code:
    
    Распечатка 152: packages/org/desire.ecd/babel.ecf
  • Сохраняем отступы:
    ;;;; Keep the indentation on org-babel-tangle
    ;; (setopt org-src-preserve-indentation t)
    
    Распечатка 153: packages/org/desire.ecd/babel.ecf
  • Отключим подтверждение запутывания:
    ;;;; Org-babel confirm before evaluation
    (setopt org-confirm-babel-evaluate nil)
    
    Распечатка 154: packages/org/desire.ecd/babel.ecf

28.1.1 org-auto-tangle

  • Репозиторий: https://github.com/yilkalargaw/org-auto-tangle/
  • Подключим org-auto-tangle:
    ;;;; A simple emacs package to allow org file tangling upon save
    ;;;; https://github.com/yilkalargaw/org-auto-tangle/
    (desire 'org-auto-tangle)
    (require 'org-auto-tangle)
    (add-hook 'org-mode-hook 'org-auto-tangle-mode)
    
    ;;;; Auto-tangle as the default behavior for all org buffers
    ;; (setopt org-auto-tangle-default t)
    
    Распечатка 155: packages/org/desire.ecd/babel.ecf

28.1.2 Поддержка языков

  • Включим поддержку разных языков программирования:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    
    ;;; Scripts
    (require 'ob-awk)
    (require 'ob-eshell)
    (require 'ob-sed)
    (require 'ob-shell)
    
    ;;; Diagrams
    (require 'ob-ditaa)
    (require 'ob-dot)
    (require 'ob-plantuml)
    
    ;;; Programming languages
    (require 'ob-calc)
    (require 'ob-C)
    (require 'ob-clojure)
    (require 'ob-comint)
    (require 'ob-core)
    (require 'ob-css)
    (require 'ob-emacs-lisp)
    (require 'ob-eval)
    (require 'ob-exp)
    (require 'ob-forth)
    (require 'ob-fortran)
    (require 'ob-gnuplot)
    (require 'ob-groovy)
    (require 'ob-haskell)
    (require 'ob-java)
    (require 'ob-js)
    (require 'ob-julia)
    (require 'ob-latex)
    (require 'ob-lilypond)
    (require 'ob-lisp)
    (require 'ob-lob)
    (require 'ob-lua)
    (require 'ob-makefile)
    (require 'ob-matlab)
    (require 'ob-maxima)
    (require 'ob-ocaml)
    (require 'ob-octave)
    (require 'ob-org)
    (require 'ob-perl)
    (require 'ob-processing)
    (require 'ob-python)
    (require 'ob-ref)
    (require 'ob-R)
    (require 'ob-ruby)
    (require 'ob-sass)
    (require 'ob-scheme)
    (require 'ob-screen)
    (require 'ob-sql)
    (require 'ob-sqlite)
    (require 'ob-table)
    (require 'ob-tangle)
    
    ;;;
    
    Распечатка 156: packages/org/desire.ecd/ob.ecf

28.1.3 Конец

;;;
Распечатка 157: packages/org/desire.ecd/babel.ecf

28.2 Оформление

28.2.1 org-superstar

  1. Подключение

    • Файл: rc.packages.el
      ;; (desire 'org-superstar)
      
  1. Загрузка
  1. Настройка
  1. Интеграция с org

28.3 Разное

;; (desire 'org-ql)

(desire 'org-appear)
(desire 'org-fragtog)
(desire 'org-custom-cookies)
;; (desire 'svg-tag-mode)
;; (desire 'org-modern-indent :recipe '(:fetcher github :repo "jdtsmith/org-modern-indent" :branch "main" :files ("*.el")))
(desire 'org-modern)
;; (desire 'org-contacts)
;; (desire 'google-contacts)
(desire 'org-edna)
(desire 'org-ref)
(desire 'org-tree-slide)
Распечатка 158: rc.packages.el

28.4 org-transclusion

28.4.1 Подключение

  • Файл: rc.packages.el
(desire 'org-transclusion)

28.4.2 Загрузка

  • Файл: packages/org-transclusion/loaddefs.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Emacs package to enable transclusion with Org Mode
;; https://github.com/nobiot/org-transclusion

;;; Code:

;;;

28.4.3 Настройка

  • Файл: packages/org-transclusion/desire.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Emacs package to enable transclusion with Org Mode
;; https://github.com/nobiot/org-transclusion

;;; Code:

(require 'org-transclusion)

;; (define-key global-map (kbd "<f12>") #'org-transclusion-add)
(define-key global-map (kbd "C-c n T") #'org-transclusion-mode)

;;; Ignore tags when export
(with-eval-after-load 'ox-hugo
  (add-to-list 'ecf/tags-categories-to-be-removed "transclude"))

;;;

28.4.4 org-transclusion-power-pack

  • Файл: packages/org-transclusion/desire.ecd/org-transclusion-power-pack.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Enhancements for org-transclusion
;; https://github.com/incandescentman/org-transclusion-power-pack

;;; Code:

;; (desire 'org-transclusion-power-pack :recipe '(:fetcher github :repo "incandescentman/org-transclusion-power-pack" :branch "main"))
;; (require 'org-transclusion-power-pack)

;;;

28.4.5 Интеграция

  • Файл: packages/org/org-transclusion.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Emacs package to enable transclusion with Org Mode
;; https://github.com/nobiot/org-transclusion

 (require 'org-transclusion)

28.5 Повестка дня

  • Конфигурация повестки дня:
;;; Agenda
(desire 'org-super-agenda)

;;(if (desiredp 'org-ql)
;; (desire 'org-agenda-files-track-ql)
(desire 'org-agenda-files-track)
;;)

;;(if (desiredp 'org-ql)
;; (desire 'org-agenda-files-track-ql :recipe '(:fetcher github :repo "nicolas-graves/org-agenda-files-track" :branch "master" :files ("org-agenda-files-track-ql.el")))
;; (desire 'org-agenda-files-track :recipe '(:fetcher github :repo "nicolas-graves/org-agenda-files-track" :branch "master" :files ("org-agenda-files-track.el")))
;;)

;;; Literate
(desire 'org-tanglesync)

;; (desire 'org-gcal)
(desire 'org-journal)

(desire 'org-noter)
;; (desire 'org-noter :recipe '(:fetcher github :repo "org-noter/org-noter" :branch "feature/org-roam-integration" :files ("*.el" "modules/*.el")))

;; (desire 'org-transclusion)
Распечатка 159: rc.packages.el

28.6 org-node

  • Подключение:

    ;; (desire 'org-node)
    
    Распечатка 160: rc.packages.el
  • Загрузка:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A notetaking system like Roam using Emacs Org-mode
    ;; https://github.com/meedstrom/org-node
    
    ;;; Code:
    
    ;;;
    
    Распечатка 161: packages/org-node/loaddefs.ecf
  • Загрузка:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A notetaking system like Roam using Emacs Org-mode
    ;; https://github.com/meedstrom/org-node
    
    ;;; Code:
    
    (desire 'org-mem)
    
    (require 'org-node)
    
    (setopt org-mem-do-sync-with-org-id t)
    (setopt org-mem-watch-dirs (list org-roam-directory))
    (org-mem-updater-mode)
    (org-node-cache-mode)
    (org-node-roam-accelerator-mode)
    
    ;;;; Node seqs
    (require 'org-node-seq)
    (org-node-seq-mode)
    
    (setopt org-node-creation-fn #'org-node-new-via-roam-capture)
    (setopt org-node-file-slug-fn #'org-node-slugify-like-roam-default)
    (setopt org-node-file-timestamp-format "%Y%m%dT%H%M%S--")
    
    ;;;
    
    Распечатка 162: packages/org-node/desire.ecf
  • Клавиатурные сочетания:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A notetaking system like Roam using Emacs Org-mode
    ;; https://github.com/meedstrom/org-node
    
    ;;; Code:
    
    (keymap-global-set "C-c N" org-node-global-prefix-map)
    (with-eval-after-load 'org
      (keymap-set org-mode-map "C-c N" org-node-org-prefix-map))
    
    ;;;
    
    Распечатка 163: packages/org-node/desire.ecd/key.ecf

28.6.1 Интеграция с org-roam

  • Используем не отдельно, а как надстройку над org-roam:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A notetaking system like Roam using Emacs Org-mode
    ;; https://github.com/meedstrom/org-node
    
    ;;; Code:
    
    (require 'org-node)
    
    ;;;
    
    Распечатка 164: packages/org-roam/org-node.ecf

28.7 org-habit-ng

28.7.1 Подключение

  • Файл: rc.packages.el
    (desire 'org-habit-ng)
    

28.7.2 Загрузка

  • Файл: packages/org-habit-ng/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Org-habit-ng lets you schedule habits that org-mode's standard repeaters can't express
    ;; https://codeberg.org/Trevoke/org-habit-ng
    
    ;;; Code:
    
    (desire 'transient)
    
    ;;;
    

28.7.3 Настройка

  • Файл: packages/org-habit-ng/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Org-habit-ng lets you schedule habits that org-mode's standard repeaters can't express
    ;; https://codeberg.org/Trevoke/org-habit-ng
    
    ;;; Code:
    
    (require 'transient)
    (require 'org-habit-ng)
    (org-habit-ng-mode 1)
    
    ;;;
    

28.7.4 Интеграция с org-mode

  • Файл: packages/org/org-habit-ng.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Org-habit-ng lets you schedule habits that org-mode's standard repeaters can't express
    ;; https://codeberg.org/Trevoke/org-habit-ng
    
    ;;; Code:
    
    (require 'transient)
    (require 'org-habit-ng)
    (add-to-list 'org-modules 'org-habit)
    
    (with-eval-after-load 'org-habit-ng
      (define-key org-mode-map (kbd "C-c h r") #'org-habit-ng-set-recurrence)
      (define-key org-mode-map (kbd "C-c h s") #'org-habit-ng-skip)
      (define-key org-mode-map (kbd "C-c h c") #'org-habit-ng-show-score))
    
    ;;;
    

28.8 org-window-habit

28.8.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'org-window-habit)
    

28.8.2 Загрузка

  • Файл: packages/org-window-habit/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Window-based habit tracking
    ;; https://github.com/colonelpanic8/org-window-habit
    
    ;;; Code:
    
    ;;;
    

28.8.3 Настройка

  • Файл: packages/org-window-habit/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Window-based habit tracking
    ;; https://github.com/colonelpanic8/org-window-habit
    
    ;;; Code:
    
    (require 'org-window-habit)
    (org-window-habit-mode +1)
    
    ;;;
    

28.8.4 Интеграция с org-mode

  • Файл: packages/org/org-window-habit.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Window-based habit tracking
    ;; https://github.com/colonelpanic8/org-window-habit
    
    ;;; Code:
    
    (require 'org-window-habit)
    
    ;;;
    

28.9 org-gtd

28.9.1 Подключение

  • Файл: rc.packages.el
    ;;;; GTD
    (desire 'org-gtd)
    

28.9.2 Загрузка

  • Файл: packages/org-gtd/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    ;;;; Suppress upgrade warnings (set BEFORE org-gtd loads)
    (setq org-gtd-update-ack "4.0.0")
    
    ;;;
    

28.9.3 Настройка

  • Файл: packages/org-gtd/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    ;;;; Enable org-edna for project dependencies
    (desire 'org-edna)
    (require 'org-edna)
    (setopt org-edna-use-inheritance t)
    (org-edna-mode 1)
    
    ;;;; Show properties in the agenda
    ;; (desire 'org-agenda-property)
    ;; (require 'org-agenda-property)
    
    (setopt org-gtd-agenda-property-list '("LOCATION" "DELEGATED_TO"))
    (setopt org-gtd-agenda-property-position 'where-it-fits)
    (setopt org-gtd-agenda-property-column 60)
    (setopt org-gtd-agenda-property-separator "|")
    
    ;;;; Load org-gtd
    (require 'org-gtd)
    
    ;;;; Set GTD directory (defaults to ~/gtd/)
    (setopt org-gtd-directory org-directory-todo)
    ;;;; Add org-gtd files to your agenda
    ;; (add-to-list 'org-agenda-files org-gtd-directory)
    
    ;;;; Make org-gtd prompt for refile target instead of auto-refiling
    (setopt org-gtd-refile-to-any-target nil)
    ;;;; These types prompt for refile target
    (setopt org-gtd-refile-prompt-for-types
            '(single-action
              project-heading
              project-task
              calendar
              someday
              delegated
              tickler
              habit
              knowledge
              quick-action
              trash
              ))
    
    ;;;
    

28.9.4 Клавиатурные сочетания

  • Файл: packages/org-gtd/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;;; Key bindings
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    ;;;; Global keybindings (work anywhere in Emacs)
    (general-define-key
     :prefix "C-c d"
     "c" #'("Capture" . org-gtd-capture)
     "e" #'("Engage" . org-gtd-engage)
     "p" #'("Process inbox" . org-gtd-process-inbox)
     "n" #'("Show all next". org-gtd-show-all-next)
     "s" #'("Stuck projects" . org-gtd-reflect-stuck-projects)
     "." #'("Command Center" . org-gtd-command-center))
    
    
    ;;;; Keybinding for organizing items (only works in clarify buffers)
    (with-eval-after-load 'org-gtd
      (general-define-key
       :keymaps 'org-gtd-clarify-map
       :prefix "C-c"
       "c" #'("Organize this item" . org-gtd-organize)))
    
    ;;;; Quick actions on tasks in agenda views (optional but recommended)
    (with-eval-after-load 'org-agenda
      (general-define-key
       :keymaps 'org-agenda-mode-map
       :prefix "C-c"
       "." #'("GTD quick actions" . org-gtd-agenda-transient)))
    
    ;;;
    

28.9.5 Представления

  • Файл: packages/org-gtd/desire.ecd/view.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;;; Views
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    (defun org-gtd-engage-view-spec ()
      "Return GTD view specification for the engage view.
    Shows:
    ​- Calendar day view (Calendar + Habit items with timestamps for today)
    ​- Tickler items due today
    ​- Delegated items with check-ins due today
    ​- All next actions
    ​+ Other"
      `((name . "GTD Engage View")
        ;; (prefix . (project area-of-focus "—"))
        (prefix-width . ,org-gtd-prefix-width)
        (blocks . (
                   ((name . "Weekly Agenda")
                    (view-type . agenda)
                    (agenda-span . 1))
                   ;; ((name . "Today's Schedule")
                   ;;  (block-type . calendar-day))
                   ((name . "Overdue events")
                    (type . calendar)
                    (when . past))
                   ((name . "Overdue habits")
                    (type . habit)
                    (when . past))
                   ;; ((name . "Past")
                   ;;	(type . next-action)
                   ;;	(scheduled . past)
                   ;;	(deadline . past))
                   ;; ((name . "Daily Agenda")
                   ;;	(view-type . agenda)
                   ;;	(agenda-span . 1))
                   ;; ((name . "Future Habits")
                   ;;	(type . habit)
                   ;;	(when . future))
                   ;; ((name . "High Priority")
                   ;;	(type . next-action)
                   ;;	(priority . A))
                   ((name . "Important Tasks")
                    (type . next-action)
                    (priority . (>= B)))
                   ((name . "Quick Work")
                    (type . next-action)
                    (effort . (<= "30min")))
                   ((name . "Science")
                    (type . next-action)
                    (area-of-focus . "Science"))
                   ((name . "Sciadmin")
                    (type . next-action)
                    (area-of-focus . "Sciadmin"))
                   ((name . "Teaching")
                    (type . next-action)
                    (area-of-focus . "Teaching"))
                   ((name . "Sysadmin")
                    (type . next-action)
                    (area-of-focus . "Sysadmin"))
                   ((name . "All actions ready to be executed")
                    (type . next-action)
                    (not-habit . t))
                   ((name . "Read")
                    (type . next-action)
                    (area-of-focus . "Read"))
                   ((name . "Deep in Progress")
                    (type . next-action)
                    (clocked . (> "1:00")))
                   ((name . "Tickler items ready for today")
                    (type . tickler)
                    (when . today))
                   ((name . "Delegated items to check in on today")
                    (type . delegated)
                    (when . today))
                   ((name . "Missed Delegated")
                    (type . delegated)
                    (when . past))
                   ((name . "Active Projects")
                    (type . project))
                   ((name . "Overdue Projects")
                    (type . project)
                    (deadline . past))
                   ((name . "Incubated Projects")
                    (type . incubated-project))
                   ((name . "Stuck Projects")
                    (type . stuck-project))
                   ((name . "Someday/Maybe")
                    (type . someday))
                   ((name . "Completed This Week")
                    (done . past-week))
                   ((name . "Weekly Agenda")
                    (view-type . agenda)
                    (agenda-span . 7))
                    ))))
    
    ;;;
    

28.9.6 Хуки

  • Файл: packages/org-gtd/desire.ecd/hook.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;;; Custom hooks for org-gtd
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    (defun ecf/add-effort ()
      "Prompt for effort on single actions and projects."
      (when (org-gtd-organize-type-member-p '(single-action project-heading))
        (call-interactively #'org-set-effort)))
    
    (defun ecf/add-priority ()
      "Prompt for priority on single actions."
      (when (org-gtd-organize-type-member-p '(single-action))
        (call-interactively #'org-priority)))
    
    (defun ecf/auto-tag-contexts ()
      "Automatically suggest context tags based on heading keywords."
      (when (org-gtd-organize-type-member-p '(single-action))
        (let* ((heading (downcase (org-get-heading t t t t)))
               (suggested-tags '()))
          (when (string-match-p "\\(phone\\|call\\)" heading)
            (push "@phone" suggested-tags))
          (when (string-match-p "\\(computer\\|code\\|write\\)" heading)
            (push "@computer" suggested-tags))
          (when (string-match-p "\\(store\\|buy\\|shop\\)" heading)
            (push "@errands" suggested-tags))
          (when suggested-tags
            (message "Suggested contexts: %s" (string-join suggested-tags ", "))))))
    
    (defun ecf/track-creation-date ()
      "Add CREATED property with current timestamp."
      (unless (org-gtd-organize-type-member-p '(trash quick-action))
        (org-set-property "CREATED"
                          (format-time-string "[%Y-%m-%d %a %H:%M]"))))
    
    ;; Install hooks
    (setopt org-gtd-organize-hooks
            '(org-gtd-set-area-of-focus    ;; set area first
              org-set-tags-command         ;; then tags
              ecf/auto-tag-contexts        ;; suggest context tags
              ecf/add-effort               ;; estimate effort
              ;; ecf/add-priority             ;; set priority if needed
              ecf/track-creation-date))    ;; track when created
    
    ;;;
    

28.9.7 Персональные настройки

  • Файл: packages/org-gtd/personal.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A package for using GTD with org-mode
    ;; https://github.com/Trevoke/org-gtd.el
    
    ;;; Code:
    
    ;;;; Configure org-mode TODO keywords
    ;; All GTD keywords must be in the same sequence
    ;; Standard options like "TODO(t)" or "DONE(d!)" are fine - org-gtd ignores them
    (setopt org-todo-keywords
          '((sequence "TODO(t)" "NEXT(n)" "WAIT(w)" "|" "DONE(d)" "CNCL(c)")))
    
    ;;;; Map GTD semantic states to your keywords
    (setopt org-gtd-keyword-mapping
          '((todo . "TODO")      ; tasks not ready to act on
            (next . "NEXT")      ; tasks ready to act on immediately
            (wait . "WAIT")      ; tasks blocked or delegated
            (canceled . "CNCL"))) ; tasks that won't be completed
    
    ;;;; List of strings representing your areas of focus (horizon 2 in GTD)
    (add-to-list 'org-gtd-areas-of-focus "Science" t)
    (add-to-list 'org-gtd-areas-of-focus "Sciadmin" t)
    (add-to-list 'org-gtd-areas-of-focus "Teaching" t)
    (add-to-list 'org-gtd-areas-of-focus "Study" t)
    (add-to-list 'org-gtd-areas-of-focus "Sysadmin" t)
    (add-to-list 'org-gtd-areas-of-focus "Read" t)
    
    ;;;
    

28.10 mobileorg

(desired 'mobileorg)
Распечатка 165: rc.packages.el

28.11 org-download

  • Emacs. Пакет org-download
  • Объявление пакета:
    (desire 'org-download)
    
    Распечатка 166: rc.packages.el
  • Подключение пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Drag and drop images to Emacs org-mode
    ;; https://github.com/abo-abo/org-download
    
    ;;; Code:
    
    ;;;
    
    Распечатка 167: packages/org-download/loaddefs.ecf
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Drag and drop images to Emacs org-mode
    ;; https://github.com/abo-abo/org-download
    
    ;;; Code:
    
    (require 'org-download)
    
    (setopt org-download-timestamp "%Y%m%dT%H%M%S--")
    (setopt org-download-heading-lvl nil)
    (setopt org-download-link-format "[[download:%s]]\n")
    (setopt org-download-annotate-function (lambda (_link) ""))
    (setopt org-download-image-html-width 500)
    
    (setopt org-download-abbreviate-filename-function
            (lambda (path)
              (if (file-in-directory-p path org-download-image-dir)
                  (file-relative-name path org-download-image-dir)
                path)))
    
    (setopt org-download-method 'attach)
    (setopt org-download-link-format-function
            (lambda (filename)
              (if (eq org-download-method 'attach)
                  (format "[[attachment:%s]]\n"
                          (org-link-escape
                           (file-relative-name filename (org-attach-dir))))
                ;; Handle non-image files a little differently. Images should be
                ;; inserted as normal with previews. Other files, like pdfs or zips,
                ;; should be linked to, with an icon indicating the type of file.
                (format (concat (unless (image-type-from-file-name filename)
                                  (concat (+org-attach-icon-for filename)
                                          " "))
                                org-download-link-format)
                        (org-link-escape
                         (funcall org-download-abbreviate-filename-function filename))))))
    
    ;;;
    
    Распечатка 168: packages/org-download/desire.ecf
  • Настройка для скриншотов:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Drag and drop images to Emacs org-mode
    ;; https://github.com/abo-abo/org-download
    
    ;;; Code:
    
    (setopt org-download-screenshot-method
            (cond (IS-MAC "screencapture -i %s")
                  (IS-LINUX
                   (cond ((executable-find "grim") "grim -g \"$(slurp)\" %s")
                         ((executable-find "flameshot") "flameshot gui --raw > %s")
                         ((executable-find "maim") "maim -s %s")
                         ((executable-find "scrot") "scrot -s %s")
                         ((executable-find "gnome-screenshot") "gnome-screenshot -a -f %s")))))
    
    ;;;
    
    Распечатка 169: packages/org-download/desire.ecd/screenshot.ecf

28.11.1 Org-mode

  • Настройки для org-mode:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Drag and drop images to Emacs org-mode
    ;; https://github.com/abo-abo/org-download
    
    ;;; Code:
    
    (add-hook 'org-mode-hook 'org-download-enable)
    
    ;;;
    
    Распечатка 170: packages/org/org-download.ecf

28.11.2 Dired

  • Настройки для dired:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Drag and drop images to Emacs org-mode
    ;; https://github.com/abo-abo/org-download
    
    ;;; Code:
    
    ;;;; Drag-and-drop to `dired`
    (add-hook 'dired-mode-hook 'org-download-enable)
    
    ;;;
    
    Распечатка 171: packages/dired/org-download.ecf

28.12 org-mode

28.12.1 Подключение

(desire 'org)

;;; For messaging
;; (desire 'org-msg)

;;;}}}
Распечатка 172: rc.packages.el

28.12.2 Загрузка

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Org mode

;;; Code:
Распечатка 173: packages/org/loaddefs.ecf
  • Список расширений для моды:

    (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
    
    Распечатка 174: packages/org/loaddefs.ecf
  • Клавиатурные комбинации:

    (global-set-key (kbd "C-c a") #'("Agenda" . org-agenda))
    (global-set-key (kbd "C-c d e") #'("Engage" . org-gtd-engage))
    
    Распечатка 175: packages/org/loaddefs.ecf
  • Завершение файла:

    ;;;
    
    Распечатка 176: packages/org/loaddefs.ecf

28.12.3 Экспорт

  • Экспорт из org-mode.
  • Файл: packages/org/desire.ecd/ox.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-


;;; Code:

;;;; Publishing and Exporting

(setopt org-alphabetical-lists t)

                                        ; Allow binding variables on export without confirmation
(setopt org-export-allow-bind t)
(setopt org-export-allow-bind-keywords t)

;;;; Set the default export scope to subtree
(setf org-export-initial-scope 'subtree)

;;;; Toggle TeX-like syntax for sub- and superscripts
(setopt org-export-with-sub-superscripts '{})

;; Explicitly load required exporters

;; HTML
(desire 'htmlize)
(require 'ox-html)
                                        ; Export HTML without XML header
(setopt org-html-xml-declaration (quote (("html" . "")
                                         ("was-html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
                                         ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))))

;;
(require 'ox)
(require 'ox-ascii)
(require 'ox-md)
                                        ;(require 'ox-man)
(require 'ox-odt)
(require 'ox-publish)

;;;; Allow exporting with 'allegedly' broken links
(setopt org-export-with-broken-links t)

;;(setopt org-export-with-entities nil)


;;;; Set export directory
;; (setopt exported-org-files-dir (concat org-directory "/export/"))
;; (if (not (file-directory-p exported-org-files-dir))
;;     (make-directory exported-org-files-dir t))

;; (defun org-export-output-file-name-modified (orig-fun extension &optional subtreep pub-dir)
;;   (unless pub-dir
;;     (setopt pub-dir exported-org-files-dir)
;;     (unless (file-directory-p pub-dir)
;;       (make-directory pub-dir)))
;;   (apply orig-fun extension subtreep pub-dir nil))
;; (advice-add 'org-export-output-file-name :around #'org-export-output-file-name-modified)
;;;; Export macros
(setq org-export-global-macros
      '(
        ("youtube" . "(eval (cond ((org-export-derived-backend-p org-export-current-backend 'hugo) (concat \"@@hugo:{{< youtube \" $1 \" >}}@@\")) ((org-export-derived-backend-p org-export-current-backend (or 'md 'markdown 'gfm)) (concat \"@@html:[![Youtube](http://img.youtube.com/vi/\" $1 \"/0.jpg){width=560px}](http://www.youtube.com/watch?v=\" $1 \")@@\"))))")
        ("rutube" . "(eval (cond ((org-export-derived-backend-p org-export-current-backend 'hugo) (concat \"@@hugo:{{< rutube \" $1 \" >}}@@\")) ((org-export-derived-backend-p org-export-current-backend (or 'md 'markdown 'gfm)) (concat \"@@html:[![RuTube](\" $2 \"){width=560px}](https://rutube.ru/video/\" $1 \"/)@@\"))))")
        ("plvideo" . "(eval (cond ((org-export-derived-backend-p org-export-current-backend 'hugo) (concat \"@@hugo:{{< plvideo \" $1 \" >}}@@\")) ((org-export-derived-backend-p org-export-current-backend (or 'md 'markdown 'gfm)) (concat \"@@html:[![Платформа](\" $2 \"){width=560px}](https://plvideo.ru/watch?v=\" $1 \")@@\"))))")
        ("vkvideo" . "(eval (cond ((org-export-derived-backend-p org-export-current-backend 'hugo) (concat \"@@hugo:{{< vkvideo oid=\" $1 \" id=\" $2 \" hd=2 >}}@@\")) ((org-export-derived-backend-p org-export-current-backend (or 'md 'markdown 'gfm)) (concat \"@@html:[![VKvideo](\" $3 \"){width=560px}](https://vkvideo.ru/video\" $1 \"_\" $2 \")@@\"))))")
        ("begin_tabs" . "@@hugo:{{< tabs $1 >}}@@")
        ("end_tabs" . "@@hugo:{{< /tabs >}}@@")
        ("youtube-tab" . "@@hugo:{{< tab \"Youtube\" >}}@@{{{youtube($1)}}}@@hugo:{{< /tab >}}@@")
        ("rutube-tab" . "@@hugo:{{< tab \"RuTube\" >}}@@{{{rutube($1,$2)}}}@@hugo:{{< /tab >}}@@")
        ("plvideo-tab" . "@@hugo:{{< tab \"Платформа\" >}}@@{{{plvideo($1,$2)}}}@@hugo:{{< /tab >}}@@")
        ("vkvideo-tab" . "@@hugo:{{< tab \"VKvideo\" >}}@@{{{vkvideo($1,$2,$3)}}}@@hugo:{{< /tab >}}@@")))

;;;

28.12.4 org-imgtog

  • https://github.com/gaoDean/org-imgtog
  • Отключение предпромотра избражения.
  • Файл: packages/org/desire.ecd/org-imgtog.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatic inline image toggling as the cursor enters and exits them
    ;; https://github.com/gaoDean/org-imgtog
    
    ;;; Code:
    
    (desire 'org-imgtog :recipe '(:fetcher github :repo "gaoDean/org-imgtog" :branch "main"))
    
    ;;;; Wait 0.5 seconds before toggling
    (setopt org-imgtog-preview-delay 0.5)
    ;;;; Only delay for remote images
    (setopt org-imgtog-preview-delay-only-remote t)
    
    (add-hook 'org-mode-hook 'org-imgtog-mode)
    
    ;;;
    

28.12.5 org-remoteimg

  • https://github.com/gaoDean/org-remoteimg
  • Отображение удаленных встроенных изображений в org-режиме с автоматическим кэшированием.
  • Файл: packages/org/desire.ecd/org-remoteimg.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Display remote inline images in org-mode with automatic caching
    ;; https://github.com/gaoDean/org-remoteimg
    
    ;;; Code
    
    (desire 'org-remoteimg :recipe '(:fetcher github :repo "gaoDean/org-remoteimg" :branch "main"))
    
    ;;;; Enable caching
    (setopt org-display-remote-inline-images 'cache)
    ;;;; or this if you don't want caching
    ;; (setopt org-display-remote-inline-images 'download)
    ;;;; or this if you want to disable this plugin
    ;; (setopt org-display-remote-inline-images 'skip)
    
    ;;;
    

28.12.6 Логирование

  • Файл: packages/org/desire.ecd/log.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Configuring Progress Logging
    
    ;;; Code:
    
    ;;;; Record a timestamp when a task is completed
    (setopt org-log-done 'time)
    
    ;;;; Automatically leave a note when changing states
    (setopt org-log-state-notes-insert-after-states t)
    
    ;;;; Define what shows up in Log Mode (options can include 'clock, 'state, 'done)
    (setq org-agenda-log-mode-items '(clock state))
    
    ;;;; Where state changes, clock times, and note-taking logs are stored
    ;;;; `t` : inside a folded :LOGBOOK: drawer
    (setopt org-log-into-drawer t)
    
    ;;;; `t` : notes are inserted after the headline, any properties/drawers, and schedule/deadline lines
    ;;;; `nil` : notes are potentially placing above existing drawers
    (setopt org-log-state-notes-insert-after-drawers nil)
    
    ;;;
    

28.12.7 Предпросмотр LaTeX

  • Org-mode. Предпросмотр TeX
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Previewing LaTeX fragments
    ;;; https://orgmode.org/manual/Previewing-LaTeX-fragments.html
    
    Распечатка 177: packages/org/desire.ecd/preview-latex.ecf
  • Зададим каталог для создаваемых изображений (по умолчанию они создаются в рабочем каталоге):
    ;;; LaTeX image directory
    (setopt org-preview-latex-image-directory (concat home-cache-path "org-latex/"))
    
    Распечатка 178: packages/org/desire.ecd/preview-latex.ecf
  • Зададим опции создания изображений:
    ;;; Output format
    (setopt org-format-latex-options (plist-put org-format-latex-options :scale 1.0))
    (setopt org-format-latex-options (plist-put org-format-latex-options :density 600))
    (setopt org-format-latex-options (plist-put org-format-latex-options :background "Transparent"))
    
    Распечатка 179: packages/org/desire.ecd/preview-latex.ecf
  • Зададим формат изображений. В данном случае это формат svg:
    (setopt org-latex-create-formula-image-program 'dvisvgm)
    
    (setopt org-preview-latex-process-alist
            '((dvipng :programs ("latex" "dvipng") :description "dvi > png"
                      :message
                      "you need to install the programs: latex and dvipng."
                      :image-input-type "dvi" :image-output-type "png"
                      :image-size-adjust (1.0 . 1.0) :latex-compiler
                      ("latex -interaction nonstopmode -output-directory %o %f")
                      :image-converter ("dvipng -D %D -T tight -o %O %f")
                      :transparent-image-converter
                      ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
              (dvisvgm :programs ("xelatex" "dvisvgm") :description "xdv > svg"
                       :message
                       "you need to install the programs: latex and dvisvgm."
                       :image-input-type "xdv" :image-output-type "svg"
                       :image-size-adjust (1.7 . 1.5) :latex-compiler
                       ("xelatex --no-pdf -interaction nonstopmode -output-directory %o %f")
                       :image-converter
                       ("dvisvgm %f --no-fonts --exact-bbox --scale=%S --output=%O"))
              (imagemagick :programs ("xelatex" "convert") :description "pdf > png"
                           :message
                           "you need to install the programs: latex and imagemagick."
                           :image-input-type "pdf" :image-output-type "png"
                           :image-size-adjust (1.0 . 1.0) :latex-compiler
                           ("xelatex -interaction nonstopmode -output-directory %o %f")
                           :image-converter
                           ("convert -density %D -trim -antialias %f -quality 100 %O"))))
    
    Распечатка 180: packages/org/desire.ecd/preview-latex.ecf
  • Теперь зададим настройки для LaTeX:
    ;;; Configure latex
    (setopt org-latex-inputenc-alist '(("utf8" . "utf8x")))
    ;;; Default position for LaTeX figures
    (setopt org-latex-default-figure-position "!htbp")
    
    Распечатка 181: packages/org/desire.ecd/preview-latex.ecf
  • Опишем используемые пакеты:
    ;;; Unicode fonts
    (add-to-list 'org-latex-packages-alist '("" "unicode-math") t)
    ;;; Physics2 package
    ;; (add-to-list 'org-latex-packages-alist '("" "physics2") t)
    ;;; Math
    (add-to-list 'org-latex-packages-alist '("" "amsmath") t)
    (add-to-list 'org-latex-packages-alist '("" "mathtools") t)
    ;;; Local definitions
    ;; (add-to-list 'org-latex-packages-alist '("" "local-define") t)
    
    ;;;
    
    Распечатка 182: packages/org/desire.ecd/preview-latex.ecf

28.12.8 Преобразование markdown ←→ org через буфер обмена

  • Emacs. Markdown в Org с помощью буфера обмена
  • Файл: packages/org/desire.ecd/markdown-org-clipboard.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Import Markdown to Org with the Clipboard
    
    ;;; Code:
    
    (defun ecf/yank-markdown-as-org ()
      "Yank Markdown text as Org.
    
    This command will convert Markdown text in the top of the `kill-ring'
    and convert it to Org using the pandoc utility."
      (interactive)
      (save-excursion
        (with-temp-buffer
          (yank)
          (shell-command-on-region
           (point-min) (point-max)
           "pandoc -f gfm -t org --wrap=preserve" t t)
          (kill-region (point-min) (point-max)))
        (yank)))
    
    (defun ecf/org-copy-region-as-markdown ()
      "Copy the region (in Org) to the system clipboard as Markdown."
      (interactive)
      (if (use-region-p)
          (let* ((region
                  (buffer-substring-no-properties
                          (region-beginning)
                          (region-end)))
                 (markdown
                  (org-export-string-as region 'md t '(:with-toc nil))))
            (gui-set-selection 'CLIPBOARD markdown))))
    
    ;;;
    

29 Инфраструктура Vulpea

29.1 vulpea-journal

29.1.1 Подключение

  • Файл: rc.packages.el
    (desire 'vulpea-journal)
    

29.1.2 Загрузка

  • Файл: packages/vulpea/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern daily journaling interface for Emacs with reactive sidebar widgets, built on vulpea
    ;; https://github.com/d12frosted/vulpea-journal
    
    ;;; Code:
    
    (desire 'vulpea)
    (desire 'vulpea-ui)
    
    ;; (setopt org-directory-journal (concat org-directory "journal/"))
    ;; (if (not (file-directory-p org-directory-journal))
    ;;     (make-directory org-directory-journal t))
    
    ;; (add-to-list 'vulpea-db-sync-directories org-directory-journal t)
    
    ;;;
    

29.1.3 Настройка

  • Файл: packages/vulpea-journal/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern daily journaling interface for Emacs with reactive sidebar widgets, built on vulpea
    ;; https://github.com/d12frosted/vulpea-journal
    
    ;;; Code:
    
    (vulpea-journal-setup)
    
    ;;;; Start week on Sunday (0) or Monday (1, default)
    (setopt vulpea-journal-ui-calendar-week-start 1)
    
    ;;;; Include journal notes in the "created today" list
    (setq vulpea-journal-ui-created-today-exclude-journal t)  ; default: t
    
    ;;;; How many years to look back
    (setq vulpea-journal-ui-previous-years-count 10)  ; default: 5
    
    ;;;; Characters to show in preview
    (setq vulpea-journal-ui-previous-years-preview-chars 256)
    
    ;;;; Hide org drawers in preview
    (setq vulpea-journal-ui-previous-years-hide-drawers t)  ; default: t
    
    ;;;; Start with previews expanded
    (setq vulpea-journal-ui-previous-years-expanded t)  ; default: t
    
    ;;;
    

29.1.4 Клавиатурные сочетания

  • Файл: packages/vulpea-journal/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern daily journaling interface for Emacs with reactive sidebar widgets, built on vulpea
    ;; https://github.com/d12frosted/vulpea-journal
    
    ;;; Code:
    
    (general-define-key
     :prefix "C-c v d"
     ;;;;; Go to a note for today (C-c v d n)
     "d" #'("Go to today" . vulpea-journal-today)
     ;;;;; Capture a note for a specific date (C-c v d v)
     "v" #'("Capture for a date" . vulpea-journal-date)
     ;;;;; Go back one existing date (C-c v d b)
     "b" #'("Go back one date" . vulpea-journal-previous)
     ;;;;; Go forward one existing date (C-c v d f)
     "f" #'("Go forward one date" . vulpea-journal-next))
    
    ;;;
    

29.1.5 Персональные настройки

  • Файл: packages/vulpea-journal/personal.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern daily journaling interface for Emacs with reactive sidebar widgets, built on vulpea
    ;; https://github.com/d12frosted/vulpea-journal
    
    ;;; Code:
    
    ;;;; Daily (one file per day, default)
    ;; (setopt vulpea-journal-default-template
    ;; 	(vulpea-journal-template-daily))
    
    ;;;; Monthly (one file per month)
    ;; (setopt vulpea-journal-default-template
    ;; 	(vulpea-journal-template-monthly))
    
    ;;;; Custom tempate
    (setopt vulpea-journal-default-template
            '(:file-name "daily/%Y/%Y-%m-%d.org"
             :title "%Y-%m-%d"
             :tags ("journal" "daily")
             :head "#+created: %<[%Y-%m-%d]>"
             :body ":SETUP_LOCAL:\n#+startup: overview num inlineimages latexpreview\n#+options: ^:{} num:t tex:t\n:END:\n\n"))
    
    ;;;
    

29.1.6 Интеграция с vulpea

  • Файл: packages/vulpea/vulpea-journal.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Modern daily journaling interface for Emacs with reactive sidebar widgets, built on vulpea
    ;; https://github.com/d12frosted/vulpea-journal
    
    ;;; Code:
    
    (require 'vulpea-journal)
    
    ;;;
    

29.2 vulpea

29.2.1 Подключение

  • Файл: rc.packages.el
    (desire 'vulpea)
    

29.2.2 Загрузка

  • Файл: packages/vulpea/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Database layer for org-mode notes with async indexing, rich queries, backlink discovery, and external change detection
    ;; https://github.com/d12frosted/vulpea
    
    ;;; Code:
    
    (setopt org-roam-directory (file-truename "~/work/org/notes"))
    
    (if (not (file-directory-p org-roam-directory))
        (make-directory org-roam-directory t))
    
    ;;;; Directories to index
    (setopt vulpea-db-sync-directories (list org-roam-directory))
    
    ;;;; Extra file extensions
    (setopt vulpea-db-extra-extensions '(".org.age" ".org.gpg"))
    
    ;;;
    

29.2.3 Настройка

  • Файл: packages/vulpea/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Database layer for org-mode notes with async indexing, rich queries, backlink discovery, and external change detection
    ;; https://github.com/d12frosted/vulpea
    
    ;;; Code:
    
    ;;;; Build database (first time only)
    (vulpea-db-sync-full-scan)
    
    ;;;; Enable auto-sync
    (vulpea-db-autosync-mode +1)
    
    ;;;; Parse and write in a background process
    (setopt vulpea-db-async-extraction 'full)
    
    ;;;; Skip org-mode-hook during indexing
    (setopt vulpea-db-parse-method 'single-temp-buffer)
    
    ;;;; Index only [[bracketed]] links
    (setopt vulpea-db-index-plain-links nil)
    
    ;;;; Excluding Notes
    (setopt vulpea-db-exclude-property "ROAM_EXCLUDE")
    
    ;;;; Parse Method
    ;; (setopt vulpea-db-parse-method 'single-temp-buffer)  ; Fastest
    ;; (setopt vulpea-db-parse-method 'temp-buffer)         ; Default, honors org-mode-hook
    ;; (setopt vulpea-db-parse-method 'find-file)           ; Slowest, most compatible
    
    ;;;; Detection Method
    ;;;;; Auto-detect best method (recommended)
    (setopt vulpea-db-sync-external-method 'auto)
    ;;;;; Use fswatch (requires fswatch binary)
    ;; (setopt vulpea-db-sync-external-method 'fswatch)
    ;;;;; Use polling (no dependencies, works everywhere)
    ;; (setopt vulpea-db-sync-external-method 'poll)
    ;;;;; Disable external detection (only detect Emacs changes)
    ;; (setopt vulpea-db-sync-external-method nil)
    
    ;;;; Use "ROAM_ALIASES" for org-roam compatibility
    (setopt vulpea-buffer-alias-property "ROAM_ALIASES")
    
    ;;;
    

29.2.4 Клавиатурные сочетания

  • Файл: packages/vulpea/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Keybindings
    
    (general-define-key
     :prefix "C-c v"
     "f" '("Find node" . vulpea-find)
     "i" '("Insert link" . vulpea-insert)
     "c" '("Capture" . vulpea-capture)
     "l" '("Toggle buffer" . vulpea-buffer-toggle)
     "g" '("Graph" . vulpea-graph))
    
    ;;;
    

29.2.5 Интеграция: vulpea-ui

  • Файл: packages/vulpea/desire.ecd/vulpea-ui.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A widget-based sidebar for Emacs that displays contextual information for vulpea notes
    ;; https://github.com/d12frosted/vulpea-ui
    
    ;;; Code:
    
    (desire 'vulpea-ui)
    
    (require 'vulpea-ui)
    
    ;;;; Open sidebar
    (vulpea-ui-sidebar-open)
    
    ;;;; Or toggle with a keybinding
    (global-set-key (kbd "C-c v s") #'("Toggle sidebar" . vulpea-ui-sidebar-toggle))
    
    ;;;; Automatic sidebar
    ;; (add-hook 'org-mode-hook #'vulpea-ui-sidebar-open)
    
    ;;;; Position: 'right (default), 'left, 'top, 'bottom
    (setopt vulpea-ui-sidebar-position 'right)
    
    ;;;; Size of the sidebar
    (setopt vulpea-ui-sidebar-size 0.33)
    
    ;;;; Maximum heading depth (nil = unlimited)
    (setopt vulpea-ui-outline-max-depth 3)
    
    ;;;
    

29.2.6 Интеграция: consult

  • Файл: packages/vulpea/consult.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Use Consult in tandem with Vulpea
    ;; https://github.com/fabcontigiani/consult-vulpea
    
    ;;; Code:
    
    (desire 'consult-vulpea)
    
    (require 'consult-vulpea)
    
    (consult-vulpea-mode 1)
    
    ;;;
    

29.2.7 Интеграция: embark

  • Файл: packages/vulpea/embark.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Embark actions and export for Vulpea notes
    ;; https://github.com/fabcontigiani/embark-vulpea
    
    ;;; Code:
    
    (desire 'embark-vulpea :recipe '(:fetcher github :repo "fabcontigiani/embark-vulpea" :branch "main"))
    
    (require 'embark-vulpea)
    
    ;;;
    

29.2.8 Интеграция с org-roam

  • Файл: packages/org-roam/vulpea.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Database layer for org-mode notes with async indexing, rich queries, backlink discovery, and external change detection
    ;; https://github.com/d12frosted/vulpea
    
    ;;; Code:
    
    (require 'vulpea)
    
    ;;;
    

30 Инфраструктура Org-roam

;;;;; Org-roam

(desire 'emacsql)

;; (desire 'delve :recipe '(:fetcher github :repo "publicimageltd/delve" :branch "main"))

30.1 org-workbench

30.1.1 Подключение

  • Файл: rc.packages.el
    (desire 'org-workbench :recipe '(:fetcher github :repo "yibie/org-workbench" :branch "main"))
    

30.1.2 Загрузка

  • Файл: packages/org-workbench/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A digital card workbench system for org-mode
    ;; https://github.com/yibie/org-workbench
    
    ;;; Code:
    
    ;;;
    

30.1.3 Настройка

  • Файл: packages/org-workbench/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A digital card workbench system for org-mode
    ;; https://github.com/yibie/org-workbench
    
    ;;; Code:
    
    (require 'org-workbench)
    (org-workbench-setup)
    
    ;;;
    

30.1.4 Клавиатурные сочетания

  • Файл: packages/org-workbench/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A digital card workbench system for org-mode
    ;; https://github.com/yibie/org-workbench
    
    ;;; Code:
    
    ;;;; Recommended Key Bindings
    (general-define-key
     :keymaps 'org-mode-map
     :prefix "C-c w"
     "a" #'("Add entire subtree" . org-workbench-add-subtree)
     "h" #'("Add only the current heading" . org-workbench-add-heading)
     "f" #'("Add entire file as card" . org-workbench-add-file)
     "m" #'("Managing workbenches" . org-workbench-manage)
     "s" #'("Show workbenches" . org-workbench-show))
    
    ;;;
    

30.1.5 Интеграция с org-roam

  • Файл: packages/org-roam/org-workbench.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A digital card workbench system for org-mode
    ;; https://github.com/yibie/org-workbench
    
    ;;; Code:
    
    (require 'org-workbench)
    
    ;;;
    

30.2 Zetteldesk

30.2.1 Подключение

  • Файл: rc.packages.el
(desire 'zetteldesk)

30.2.2 Включение

  • Файл: packages/zetteldesk/loaddefs.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Zetteldesk.el is an emacs library built on top of org-roam with the purpose of easier revision on various subjects and a better outliner tool for emacs
;; https://github.com/Vidianos-Giannitsis/zetteldesk.el

;;; Code:

(desire 'zetteldesk-kb)
(desire 'zetteldesk-info)
(desire 'zetteldesk-ref)
(desire 'zetteldesk-kb)
(desire 'zetteldesk-remark)

;;;

30.2.3 Загрузка

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Zetteldesk.el is an emacs library built on top of org-roam with the purpose of easier revision on various subjects and a better outliner tool for emacs
;; https://github.com/Vidianos-Giannitsis/zetteldesk.el

;;; Code:

(require 'zetteldesk)

(setopt zetteldesk-kb-hydra-prefix (kbd "C-c z"))

(zetteldesk-mode 1)

(require 'zetteldesk-ref)
(require 'zetteldesk-info)
(require 'zetteldesk-remark)

;;;

30.2.4 Интеграция с org-roam

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Zetteldesk.el is an emacs library built on top of org-roam with the purpose of easier revision on various subjects and a better outliner tool for emacs
;; https://github.com/Vidianos-Giannitsis/zetteldesk.el

;;; Code:

(require 'zetteldesk)

;;;

30.3 Org-roam-ui

30.3.1 Подключение

  • Файл: rc.packages.el
(desire 'org-roam-ui :recipe '(:fetcher github :repo "lkarp-744/org-roam-ui"))
;; (desire 'org-roam-ui :recipe '(:fetcher github :repo "lkarp-744/org-roam-ui" :files ("*.el" "public")))
;; (desire 'org-roam-ui)

30.4 Org-roam

30.4.1 Подключение

  • Файл: rc.packages.el
    (desire 'magit-section)
    (desire 'org-roam)
    

30.4.2 Клавиатурные сочетания

  • Файл: packages/org-roam/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Keybindings
    
    (general-define-key
     :prefix "C-c n"
     "f" '("Find note" . org-roam-node-find)
     "i" '("Insert link" . org-roam-node-insert)
     "l" '("Toggle buffer" . org-roam-buffer-toggle)
     "c" '("Capture" . org-roam-capture)
     "g" '("Graph" . org-roam-graph)
     "o" '("Create ID" . org-id-get-create)
     "t" '("Add tag" . org-roam-tag-add)
     "a" '("Add alias" . org-roam-alias-add))
    
    ;; (global-set-key (kbd "C-c n l") #'org-roam-buffer-toggle)
    ;; (global-set-key (kbd "C-c n f") #'org-roam-node-find)
    ;; (global-set-key (kbd "C-c n g") #'org-roam-graph)
    ;; (global-set-key (kbd "C-c n i") #'org-roam-node-insert)
    ;; (global-set-key (kbd "C-c n c") #'org-roam-capture)
    ;; (global-set-key (kbd "C-c n o") #'org-id-get-create)
    ;; (global-set-key (kbd "C-c n t") #'org-roam-tag-add)
    ;; (global-set-key (kbd "C-c n a") #'org-roam-alias-add)
    
    (define-key org-mode-map (kbd "C-M-i") #'completion-at-point)
    
    ;;;
    

30.4.3 Дополнительные пакеты

  1. nursery

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Small org-roam packages
    ;; https://github.com/chrisbarrett/nursery
    
    ;;; Code:
    
    • org-roam-review
    ;;;; Extends org-roam with spaced-repetition review of nodes
    ;; https://github.com/chrisbarrett/nursery/blob/main/lisp/org-roam-review.el
    
    (desire 'org-drill)
    
    ;;;;; Provides commands to categorise and review org-roam nodes for Evergreen note-taking
    (desire 'org-roam-review :pkgman 'straight :recipe '(:type git :host github :repo "chrisbarrett/nursery" :branch "main" :files ("lisp/org-roam-review.el" "lisp/org-tags-filter.el" "lisp/plisty.el")))
    
    (require 'org-roam-review)
    
    ;;;;; Tag all newly-created notes as seedlings
    ;;;;; https://github.com/chrisbarrett/nursery/issues/7
    (defun ecf/org-roam-review-set-seedling ()
      (with-current-buffer (org-capture-get :buffer)
        (org-roam-review-set-seedling)))
    (add-hook 'org-capture-after-finalize-hook #'ecf/org-roam-review-set-seedling)
    
    ;;;;; Keybindings for applying Evergreen note properties
    (general-define-key
     :prefix "C-c r"
     "r" #'("accept" . org-roam-review-accept)
     "f" #'("forgot" . org-roam-review-forgot)
     "u" #'("bury" . org-roam-review-bury)
     "m" #'("set memorise" . org-roam-review-set-memorise)
     "x" #'("set excluded" . org-roam-review-set-excluded)
     "b" #'("set budding" . org-roam-review-set-budding)
     "s" #'("set seedling" . org-roam-review-set-seedling)
     "e" #'("set evergreen" . org-roam-review-set-evergreen))
    
    ;;;;; Ignore tags when export
    (with-eval-after-load 'ox-hugo
      (add-to-list 'ecf/tags-categories-to-be-removed "seedling")
      (add-to-list 'ecf/tags-categories-to-be-removed "evergreen")
      (add-to-list 'ecf/tags-categories-to-be-removed "budding"))
    
    • Разные пакеты:
      ;;;;; Renaming nodes, rewriting links and deleting nodes with redirection
      (desire 'org-transclusion)
      
      (desire 'org-roam-rewrite :pkgman 'straight :recipe '(:type git :host github :repo "chrisbarrett/nursery" :branch "main" :files ("lisp/org-roam-rewrite.el" "lisp/plisty.el")))
      (require 'org-roam-rewrite)
      
      ;;;; Display a tree of backlinks and forward links up to a configurable depth
      (desire 'org-roam-links :pkgman 'straight :recipe '(:type git :host github :repo "chrisbarrett/nursery" :branch "main" :files ("lisp/org-roam-links.el" "lisp/plisty.el")))
      (require 'org-roam-links)
      
      ;;;; Make previews in org-roam buffer lazy for better performance
      (desire 'org-roam-lazy-previews :pkgman 'straight :recipe '(:type git :host github :repo "chrisbarrett/nursery" :branch "main" :files ("lisp/org-roam-lazy-previews.el")))
      (require 'org-roam-lazy-previews)
      
      ;;;; Refill org-roam backlink previews
      (desire 'org-roam-refill-previews :pkgman 'straight :recipe '(:type git :host github :repo "chrisbarrett/nursery" :branch "main" :files ("lisp/org-roam-refill-previews.el")))
      (require 'org-roam-refill-previews)
      
      (add-hook 'org-roam-preview-postprocess-functions #'org-roam-refill-previews)
      
      ;;;
      

30.5 Org-roam-dailies

  • Org-roam. Daily notes
  • Загрузка.
  • Файл: packages/org-roam/desire.ecd/dailies.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Daily-notes
    
    ;;; Code:
    
    (require 'org-roam-dailies)
    
    ;;;; Excluding Nodes and Edges
    (setopt org-roam-graph-exclude-matcher '("private" "dailies"))
    
  • Каталог для записей:
    ;;;; Path to daily-notes
    (setopt org-roam-dailies-directory "daily/")
    (unless (file-directory-p (concat org-roam-directory "/" org-roam-dailies-directory))
      (make-directory (concat org-roam-directory "/" org-roam-dailies-directory) t))
    
  • Шаблон записи:
    ;;;; Capture templates for daily-notes in Org-roam
    (setopt org-roam-dailies-capture-templates
          '(("d" "default" entry
             "* %?"
             :target (file+head "%<%Y>/%<%Y-%m-%d>.org"
                                "#+title: %<%Y-%m-%d>
    :SETUP_LOCAL:
    #+startup: overview num inlineimages latexpreview
    #+options: ^:{} num:t tex:t
    :END:
    
    "))))
    
  • Сочетания клавиш:
    ;;;; Define key bindings
    
    (general-define-key
     :keymaps 'org-roam-dailies-map
    ;;;;; Go to a note for today (C-c n d d)
     "d" #'("Go to today" . org-roam-dailies-goto-today)
    ;;;;; Capture a note for today (C-c n d n)
     "n" #'("Capture for today" . org-roam-dailies-capture-today)
    ;;;;; Capture a note for yesterday (C-c n d Y)
     "Y" #'("Capture for yesterday" . org-roam-dailies-capture-yesterday)
    ;;;;; Capture a note for tomorrow (C-c n d T)
     "T" #'("Capture for tomorrow" . org-roam-dailies-capture-tomorrow)
    ;;;;; Go to the file for yesterday (C-c n d y)
     "y" #'("Go to yesterday" . org-roam-dailies-goto-yesterday)
    ;;;;; Go to the file for tomorrow (C-c n d t)
     "t" #'("Go to tomorrow" . org-roam-dailies-goto-tomorrow)
    ;;;;; Capture a note for a specific date (C-c n d v)
     "v" #'("Capture for a date" . org-roam-dailies-capture-date)
    ;;;;; Go to the file for a specific date (C-c n d c)
     "c" #'("Go to a date" . org-roam-dailies-goto-date)
    ;;;;; Go back one existing date (C-c n d b)
     "b" #'("Go back one date" . org-roam-dailies-goto-previous-note)
    ;;;;; Go forward one existing date (C-c n d f)
     "f" #'("Go forward one date" . org-roam-dailies-goto-next-note))
    
    (fset 'org-roam-dailies-map org-roam-dailies-map)
    (global-set-key (kbd "C-c n d") #'org-roam-dailies-map)
    
    ;; (global-set-key (kbd "C-c n d") #'org-roam-dailies-capture-today)
    
    ;;;
    

30.6 org-daily-reflection

  • Emacs. Пакет org-daily-reflection
  • Загрузка.
    ;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Reflect on your org-roam daily entries, comparing N org-roam dailies at M intervals
    ;; https://github.com/emacsomancer/org-daily-reflection
    
    ;;; Code:
    
    (desire 'org-daily-reflection)
    (require 'org-daily-reflection)
    
    ;;;
    
    Распечатка 183: packages/org-roam/desire.ecd/org-daily-reflection.ecf

31 Заметочники

31.1 Denote


;; (desire 'deft)
;; (desire-conf 'zetteldeft nil "zetteldeft" t)

;; (desire 'denote)

;;}}}

32 Диаграммы

32.1 Диаграммы Ганта

32.1.1 org-gantt-mode

  • Добавим пакет:
    ;; (desire 'org-gantt-mode :recipe '(:fetcher gitlab :repo "joukeHijlkema/org-gantt-mode" :branch "master"))
    
    Распечатка 185: rc.packages.el
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create SVG gantt charts from an org-mode subtree
    ;;; https://gitlab.com/joukeHijlkema/org-gantt-mode
    
    (desire 'ts)
    
    (autoload 'org-gantt-mode "org-gantt-mode" "Create SVG gantt charts" t)
    
    ;;;
    
    Распечатка 186: packages/org-gantt-mode.ecf

32.1.2 elgantt

  • Добавим пакет:
    (desire 'elgantt :recipe '(:fetcher github :repo "legalnonsense/elgantt" :branch "master"))
    
    Распечатка 187: rc.packages.el
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;;  A Gantt Chart (Calendar) for Org Mode
    ;;; https://github.com/legalnonsense/elgantt
    
    (require 'elgantt)
    
    ;;;
    
    Распечатка 188: packages/elgantt/loaddefs.ecf

32.1.3 taskjuggler

  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;;  Exporting Gantt charts with Taskjuggler
    ;; https://github.com/h-oll/ox-taskjuggler
    
    ;;; Code:
    
    ;; (desire 'ox-taskjuggler :recipe '(:fetcher github :repo "h-oll/ox-taskjuggler" :branch "master"))
    (desire 'ox-taskjuggler :pkgman 'straight :recipe '(:type git :host github :repo "h-oll/ox-taskjuggler" :branch "master" :files ("lisp/*")))
    (require 'ox-taskjuggler)
    
    ;;;; Report width
    
    (setopt org-taskjuggler-default-reports
      '("textreport report \"Plan\" {
      formats html
      header '== %title =='
    
      center -8<-
        [#Plan Plan] | [#Resource_Allocation Resource Allocation]
        ----
        === Plan ===
        <[report id=\"plan\"]>
        ----
        === Resource Allocation ===
        <[report id=\"resourceGraph\"]>
      ->8-
    }
    
    # A traditional Gantt chart with a project overview.
    taskreport plan \"\" {
      headline \"Project Plan\"
      columns bsi, name, start, end, effort, chart { width 1000 }
      loadunit shortauto
      hideresource 1
    }
    
    # A graph showing resource allocation. It identifies whether each
    # resource is under- or over-allocated for.
    resourcereport resourceGraph \"\" {
      headline \"Resource Allocation Graph\"
      columns no, name, effort, weekly { width 1000 }
      loadunit shortauto
      hidetask ~(isleaf() & isleaf_())
      sorttasks plan.start.up
    }"))
    
    ;;;; Some tweaks
    (setopt org-taskjuggler-default-project-duration 999)
    (setopt org-taskjuggler-valid-task-attributes
            '(account start note duration endbuffer endcredit end
                      flags journalentry length limits maxend maxstart minend
                      minstart period reference responsible scheduling
                      startbuffer startcredit statusnote chargeset charge booking))
    
    
    
    ;;;; precedes
    (defun org-taskjuggler-resolve-precedes (task info)
      "Return a list of all tasks TASK precedes on.
    TASK is a headline.  INFO is a plist used as a communication
    channel."
      (let ((precs-ids
             ;; Get all dependencies specified in BLOCKER and PRECEDES task
             ;; properties.  Clean options from them.
             (let ((precs (concat (org-element-property :BLOCKER task)
                                 (org-element-property :PRECEDES task))))
               (and precs
                    (split-string (replace-regexp-in-string "{.*?}" "" precs)
                                  "[ ,]* +"))))
            precedes)
        (when precs-ids
          ;; Find tasks with :task_id: property matching id in PRECS-IDS.
          ;; Add them to PRECEDES.
          (let* ((project (org-taskjuggler-get-project info))
                 (tasks (if org-taskjuggler-keep-project-as-task project
                          (org-element-contents project))))
            (setq precedes
                  (org-element-map tasks 'headline
                    (lambda (task)
                      (let ((task-id (or (org-element-property :TASK_ID task)
                                         (org-element-property :ID task))))
                        (and task-id (member task-id precs-ids) task)))
                    info)))
          ;; Check BLOCKER and PRECEDES properties.  If "previous-sibling"
          ;; belongs to PRECS-ID, add it to PRECEDES.
          ;; (when (and (member-ignore-case "previous-sibling" precs-ids)
          ;;            (not (org-export-first-sibling-p task info)))
          ;;   (let ((prev (org-export-get-previous-element task info)))
          ;;     (and (not (memq prev precedes)) (push prev precedes))))
          )
        ;; Check ORDERED status of parent.
        ;; (let ((parent (org-export-get-parent task)))
        ;;   (when (and parent
        ;;              (org-element-property :ORDERED parent)
        ;;              (not (org-export-first-sibling-p task info)))
        ;;     (push (org-export-get-previous-element task info) precedes)))
        ;; Return dependencies.
        precedes))
    
    (defun org-taskjuggler-format-precedes (precedes task info)
      "Format PRECEDES to match TaskJuggler syntax.
    PRECEDES is list of precedes for TASK, as returned by
    `org-taskjuggler-resolve-depedencies'.  TASK is a headline.
    INFO is a plist used as a communication channel.  Return value
    doesn't include leading \"precedes\"."
      (let* ((dep-str (concat (org-element-property :BLOCKER task)
                              " "
                              (org-element-property :PRECEDES task)))
             (get-path
              (lambda (dep)
                ;; Return path to DEP relatively to TASK.
                (let ((parent (org-export-get-parent task))
                      (exclamations 1)
                      (option
                       (let ((id (org-element-property :TASK_ID dep)))
                         (and id
                              (string-match (concat id " +\\({.*?}\\)") dep-str)
                              (match-string-no-properties 1 dep-str))))
                      path)
                  ;; Compute number of exclamation marks by looking for the
                  ;; common ancestor between TASK and DEP.
                  (while (not (org-element-map parent 'headline
                              (lambda (hl) (eq hl dep))))
                    (cl-incf exclamations)
                    (setq parent (org-export-get-parent parent)))
                  ;; Build path from DEP to PARENT.
                  (while (not (eq parent dep))
                    (push (org-taskjuggler-get-id dep info) path)
                    (setq dep (org-export-get-parent dep)))
                  ;; Return full path.  Add dependency options, if any.
                  (concat (make-string exclamations ?!)
                          (mapconcat 'identity path ".")
                          (and option (concat " " option)))))))
        ;; Return precedes string, without the leading "precedes".
        (mapconcat (lambda (dep) (funcall get-path dep)) precedes ", ")))
    
    (defun org-taskjuggler--build-task (task info)
      "Return a task declaration.
    
    TASK is a headline.  INFO is a plist used as a communication
    channel.
    
    All valid attributes from TASK are inserted.  If TASK defines
    a property \"task_id\" it will be used as the id for this task.
    Otherwise it will use the ID property.  If neither is defined
    a unique id will be associated to it."
      (let* ((allocate (org-element-property :ALLOCATE task))
             (complete
              (if (eq (org-element-property :todo-type task) 'done) "100"
                (org-element-property :COMPLETE task)))
             (depends (org-taskjuggler-resolve-dependencies task info))
             (precedes (org-taskjuggler-resolve-precedes task info))
             (effort (let ((property
                            (intern (concat ":" (upcase org-effort-property)))))
                       (org-element-property property task)))
             (milestone
              (or (org-element-property :MILESTONE task)
                  (not (or (org-element-map (org-element-contents task) 'headline
                             'identity info t)  ; Has task any child?
                           effort
                           (org-element-property :LENGTH task)
                           (org-element-property :DURATION task)
                           (and (org-taskjuggler-get-start task)
                                (org-taskjuggler-get-end task))
                           (org-element-property :PERIOD task)))))
             (priority
              (let ((pri (org-element-property :priority task)))
                (and pri
                     (max 1 (/ (* 1000 (- org-priority-lowest pri))
                               (- org-priority-lowest org-priority-highest)))))))
        (concat
         ;; Opening task.
         (format "task %s \"%s\" {\n"
                 (org-taskjuggler-get-id task info)
                 (org-taskjuggler-get-name task))
         ;; Add default attributes.
         (and depends
              (format "  depends %s\n"
                      (org-taskjuggler-format-dependencies depends task info)))
         (and precedes
              (format "  precedes %s\n"
                      (org-taskjuggler-format-precedes precedes task info)))
         (and allocate
              (format "  purge %s\n  allocate %s\n"
                      ;; Compatibility for previous TaskJuggler versions.
                      (if (>= org-taskjuggler-target-version 3.0) "allocate"
                        "allocations")
                      allocate))
         (and complete (format "  complete %s\n" complete))
         (and effort (format "  effort %s\n" effort))
         (and priority (format "  priority %s\n" priority))
         (and milestone "  milestone\n")
         ;; Add other valid attributes.
         (org-taskjuggler--indent-string
          (org-taskjuggler--build-attributes
           task org-taskjuggler-valid-task-attributes))
         ;; Add inner tasks.
         (org-taskjuggler--indent-string
          (mapconcat 'identity
                     (org-element-map (org-element-contents task) 'headline
                       (lambda (hl) (org-taskjuggler--build-task hl info))
                       info nil 'headline)
                     ""))
         ;; Closing task.
         "}\n")))
    
    ;;;
    
    Распечатка 189: packages/org/desire.ecd/ox-taskjuggler.ecf

32.2 Mermaid

(desire' mermaid-mode :precondition-system-executable "mmdc")

32.3 Plantuml

(desire 'plantuml-mode)

33 Разное

;; XML, XHTML, HTML {{{

;;(desire-conf 'nxml nil "rng-auto")
                                      ; (desire-conf 'psgml)

;;;}}}
;;;{{{ Palm pilot support

                                      ;(desire-conf 'palm)

;;;}}}

34 Управление сессиями

;;; Desktop {{{

35 Сохранение состояния сессий

;; (desire-conf 'desktop)
(desire-conf 'session nil "session")
(desire-conf 'saveplace nil "saveplace")

36 Организация рабочего пространства

36.1 one-tab-per-project

  • Emacs. Пакет otpp
  • Автоматическое создание вкладки для каждого проекта, обеспечивающее управление рабочим пространством на основе панели вкладок для Emacs.
  • https://github.com/abougouffa/one-tab-per-project
  • Подключение пакета:
    ;; (desire 'otpp)
    
    Распечатка 190: rc.packages.el
  • Предварительные настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
    ;;;; https://github.com/abougouffa/one-tab-per-project
    
    ;;; Code:
    
    ;;;
    
    Распечатка 191: packages/otpp/loaddefs.ecf
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
    ;;;; https://github.com/abougouffa/one-tab-per-project
    
    ;;; Code:
    
    (require 'otpp)
    
    Распечатка 192: packages/otpp/desire.ecf
  • Задание параметров:
    ;;;; If you like to define some aliases for better user experience
    (defalias 'one-tab-per-project-mode 'otpp-mode)
    (defalias 'one-tab-per-project-override-mode 'otpp-override-mode)
    
    ;;;; Keybindings
    (general-define-key
     :prefix "C-x t"
     "D" 'otpp-detach-buffer-to-tab
     "C" 'otpp-change-tab-root-dir
     "P" 'otpp-prefix)
    
    ;;;; Enable `otpp-mode` globally
    (otpp-mode 1)
    
    ;;;; If you want to advice the commands in `otpp-override-commands` to be run in the current's tab (so, current project's) root directory
    (otpp-override-mode 1)
    
    ;;;
    
    Распечатка 193: packages/otpp/desire.ecf
  • Подключение к project.el:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Automatically create a tab per project, providing a light tab-bar based workspace management for Emacs
    ;;; https://github.com/abougouffa/one-tab-per-project
    
    (require 'otpp)
    
    ;;;
    
    Распечатка 194: packages/project/otpp.ecf

36.2 iBuffer

(desire 'ibuffer)
;; (desire 'persp-mode)
;; (desire 'perspective)

36.3 tabspaces

36.3.1 Подключение

  • Файл: rc.packages.el
    (desire 'tabspaces)
    

36.3.2 Загрузка

  • Файл: packages/tabspaces/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create buffer-isolated workspaces
    ;; https://github.com/mclear-tools/tabspaces
    
    ;;; Code:
    
    (require 'tabspaces)
    
    ;;;
    

36.3.3 Настройка

  • Файл: packages/tabspaces/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create buffer-isolated workspaces
    ;; https://github.com/mclear-tools/tabspaces
    
    ;;; Code
    
    
    (setopt tabspaces-use-filtered-buffers-as-default t)
    (setopt tabspaces-default-tab "Default")
    (setopt tabspaces-remove-to-default t)
    (setopt tabspaces-include-buffers '("*scratch*"))
    (setopt tabspaces-initialize-project-with-todo t)
    (setopt tabspaces-todo-file-name "project-todo.org")
    
    ;;;; Enable automatic session saving on Emacs exit
    (setopt tabspaces-session t)
    ;;;; Auto-restore sessions on startup and when opening projects
    (setopt tabspaces-session-auto-restore t)
    
    ;;;; Save all project tabs to their individual session files
    ;; (tabspaces-save-all-project-sessions)
    ;;;; Save only non-project tabs to the global session file
    ;; (tabspaces-save-non-project-tabs)
    
    ;;; Use this only if you want the minor-mode loaded at startup
    (tabspaces-mode)
    
    ;;;; additional options
    (setopt tabspaces-fully-resolve-paths t)  ; Resolve relative project paths to absolute
    (setopt tabspaces-exclude-buffers '("*Messages*" "*Compile-Log*"))  ; Additional buffers to exclude
    (setopt tab-bar-new-tab-choice "*scratch*")
    
    ;;;
    

36.3.4 Интеграция с consult

  • Файл: packages/tabspaces/consult.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Create buffer-isolated workspaces
    ;; https://github.com/mclear-tools/tabspaces
    
    ;;; Code:
    
    ;;;; Filter Buffers for Consult-Buffer
    
    (with-eval-after-load 'consult
      ;; hide full buffer list (still available with "b" prefix)
      (plist-put consult-source-buffer :hidden t)
      (plist-put consult-source-buffer :default nil)
      ;; set consult-workspace buffer list
      (defvar consult--source-workspace
        (list :name     "Workspace Buffers"
              :narrow   ?w
              :history  'buffer-name-history
              :category 'buffer
              :state    #'consult--buffer-state
              :default  t
              :items    (lambda () (consult--buffer-query
                               :predicate #'tabspaces--local-buffer-p
                               :sort 'visibility
                               :as #'buffer-name)))
    
        "Set workspace buffer list for consult-buffer.")
      (add-to-list 'consult-buffer-sources 'consult--source-workspace))
    
    ;;;
    

36.4 bufler

36.4.1 Подключение

  • Файл: rc.packages.el
    ;; (desire 'bufler)
    

36.4.2 Объявление

  • Файл: packages/bufler/loaddefs.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Group buffers into workspaces with programmable rules
;; https://github.com/alphapapa/bufler.el

;;; Code:

(desire' burly)

(require 'bufler)

;;;

36.4.3 Настройка

  1. Основной файл

    • Файл: packages/bufler/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Group buffers into workspaces with programmable rules
    ;; https://github.com/alphapapa/bufler.el
    
    ;;; Code:
    
    (bufler-mode 1)
    
    ;;;
    
  1. Сочетания клавиш

    • Файл: packages/bufler/desire.ecd/keybinding.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Group buffers into workspaces with programmable rules
    ;; https://github.com/alphapapa/bufler.el
    
    ;;; Code:
    
    (defun ecf/bufler-one-window (&optional force-refresh)
      (interactive "P")
      (bufler-list)
      (delete-other-windows))
    
    (global-set-key (kbd "C-x C-b") #'ecf/bufler-one-window)
    
    ;;;
    
  1. Группы буферов

    • Файл: packages/bufler/desire.ecd/group.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Group buffers into workspaces with programmable rules
    ;; https://github.com/alphapapa/bufler.el
    
    ;;; Code:
    
    ;; (setopt bufler-groups
    ;;       (bufler-defgroups
    ;; 	(group
    ;; 	 ;; Subgroup collecting all named workspaces.
    ;; 	 (auto-workspace))
    ;; 	(group
    ;; 	 ;; Subgroup collecting all `help-mode' and `info-mode' buffers.
    ;; 	 (group-or "*Help/Info*"
    ;; 		   (mode-match "*Help*" (rx bos "help-"))
    ;; 		   (mode-match "*Info*" (rx bos "info-"))))
    ;; 	(group
    ;; 	 ;; Subgroup collecting all special buffers (i.e. ones that are not
    ;; 	 ;; file-backed), except `magit-status-mode' buffers (which are allowed to fall
    ;; 	 ;; through to other groups, so they end up grouped with their project buffers).
    ;; 	 (group-and "*Special*"
    ;; 		    (lambda (buffer)
    ;; 		      (unless (or (funcall (mode-match "Magit" (rx bos "magit-status"))
    ;; 					  buffer)
    ;; 				 (funcall (mode-match "Dired" (rx bos "dired"))
    ;; 					  buffer)
    ;; 				 (funcall (auto-file) buffer))
    ;; 			"*Special*")))
    ;; 	 (group
    ;; 	  ;; Subgroup collecting these "special special" buffers
    ;; 	  ;; separately for convenience.
    ;; 	  (name-match "**Special**"
    ;; 		      (rx bos "*" (or "Messages" "Warnings" "scratch" "Backtrace") "*")))
    ;; 	 (group
    ;; 	  ;; Subgroup collecting all other Magit buffers, grouped by directory.
    ;; 	  (mode-match "*Magit* (non-status)" (rx bos (or "magit" "forge") "-"))
    ;; 	  (auto-directory))
    ;; 	 ;; Subgroup for Helm buffers.
    ;; 	 (mode-match "*Helm*" (rx bos "helm-"))
    ;; 	 ;; Remaining special buffers are grouped automatically by mode.
    ;; 	 (auto-mode))
    ;; 	;; All buffers under "~/.emacs.d" (or wherever it is).
    ;; 	(dir user-emacs-directory)
    ;; 	(group
    ;; 	 ;; Subgroup collecting buffers in `org-directory' (or "~/org" if
    ;; 	 ;; `org-directory' is not yet defined).
    ;; 	 (dir (if (bound-and-true-p org-directory)
    ;; 		  org-directory
    ;; 		"~/org"))
    ;; 	 (group
    ;; 	  ;; Subgroup collecting indirect Org buffers, grouping them by file.
    ;; 	  ;; This is very useful when used with `org-tree-to-indirect-buffer'.
    ;; 	  (auto-indirect)
    ;; 	  (auto-file))
    ;; 	 ;; Group remaining buffers by whether they're file backed, then by mode.
    ;; 	 (group-not "*special*" (auto-file))
    ;; 	 (auto-mode))
    ;; 	(group
    ;; 	 ;; Subgroup collecting buffers in a projectile project.
    ;; 	 (auto-projectile))
    ;; 	(group
    ;; 	 ;; Subgroup collecting buffers in a version-control project,
    ;; 	 ;; grouping them by directory.
    ;; 	 (auto-project))
    ;; 	;; Group remaining buffers by directory, then major mode.
    ;; 	(auto-directory)
    ;; 	(auto-mode))
    ;;       )
    
    ;;;
    

36.4.4 Интеграция

  1. tab-bar

    • Файл: packages/bufler/tab-bar.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Group buffers into workspaces with programmable rules
    ;; https://github.com/alphapapa/bufler.el
    
    ;;; Code:
    
    (require 'bufler-workspace-tabs)
    
    ;;;
    
  1. helm

    • Файл: packages/bufler/helm.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Group buffers into workspaces with programmable rules
    ;; https://github.com/alphapapa/bufler.el
    
    ;;; Code
    
    (desire 'helm-bufler)
    (require 'helm-bufler)
    
    ;;;
    

37 Проекты

37.1 Начало

;;; Project management

37.2 projection

  • Projectile-подобная библиотека управления проектами для project.el
  • https://github.com/mohkale/projection
  • Подключение:
    (desire 'projection)
    
    Распечатка 195: rc.packages.el
  • Подготовка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile like project management library built on Emacs project.el
    ;;;; https://github.com/mohkale/projection
    
    ;;; Code:
    
    ;;;
    
    Распечатка 196: packages/projection/loaddefs.ecf
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile like project management library built on Emacs project.el
    ;;;; https://github.com/mohkale/projection
    
    ;;; Code:
    
    (require 'projection)
    
    ;;;; Keymap
    
    
    ;;;; Enable `projection-hook', adds the possibility to run functions in per-project basis
    (global-projection-hook-mode 1)
    
    ;;;
    
    Распечатка 197: packages/projection/desire.ecf

37.2.1 Интеграция

  • Интеграция с compile-multi:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile like project management library built on Emacs project.el
    ;;;; https://github.com/mohkale/projection
    
    ;;; Code:
    
    (desire 'projection-multi)
    (require 'projection-multi)
    
    ;;;; Allow interactively selecting available compilation targets from the current project type
    (general-define-key
     :keymaps 'project-prefix-map
     "RET" 'projection-multi-compile)
    
    ;;;
    
    Распечатка 198: packages/projection/compile-multi.ecf
  • Интеграция с ibuffer:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile like project management library built on Emacs project.el
    ;;;; https://github.com/mohkale/projection
    
    ;;; Code:
    
    (add-hook 'ibuffer-hook 'ibuffer-projection-set-filter-groups)
    ;;;; This ensures that `ibuffer-projection-set-filter-groups' takes effect
    (add-hook 'ibuffer-hook (lambda () (run-at-time 0.1 nil (lambda () (call-interactively #'ibuffer-update)))))
    
    ;;;
    
    Распечатка 199: packages/projection/ibuffer.ecf
  • Загрузка при использовании project:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile like project management library built on Emacs project.el
    ;;;; https://github.com/mohkale/projection
    
    ;;; Code:
    
    (require 'projection)
    
    ;;;; Enable `projection-hook', adds the possibility to run functions in per-project basis
    (global-projection-hook-mode 1)
    
    ;;;
    
    Распечатка 200: packages/project/projection.ecf

37.3 project

  • Подключение:
    (desire 'project)
    
    Распечатка 201: rc.packages.el

37.4 project-x

37.4.1 Подключение

  • Файл: rc.packages.el
    (desire 'project-x)
    

37.4.2 Загрузка

  • Файл: packages/project-x/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Ehancements to Emacs' built in project library and tab-bar mode
    ;; https://github.com/vmargb/project-x
    
    ;;; Code:
    
    (require 'project-x)
    
    ;;;
    

37.4.3 Настройка

  • Файл: packages/project-x/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Ehancements to Emacs' built in project library and tab-bar mode
    ;; https://github.com/vmargb/project-x
    
    ;;; Code
    
    
    (setopt project-x-auto-save-delay 5)      ; автосохранение через 5 секунд бездействия
    (setopt project-x-save-interval 60)       ; принудительное сохранение каждую минуту
    (setopt project-x-local-identifier '(".project" ".projectile")) ; файл-маркер проекта
    
    ;;;; Добавляем project-x как провайдер проектов (после встроенных)
    (add-hook 'project-find-functions #'project-x-try-local 90)
    
    ;;;; Сохраняем состояние окон при выходе из Emacs
    (add-hook 'kill-emacs-hook #'project-x--window-state-write)
    
    ;;;; Переопределяем команду переключения проекта
    (advice-add 'project-switch-project :around #'project-x--dynamic-switch-commands)
    
    ;;;; Команды сохранения и загрузки состояния
    (global-set-key (kbd "C-x p w") #'project-x-window-state-save)
    (global-set-key (kbd "C-x p j") #'project-x-window-state-load)
    
    (project-x-mode 1)
    
    ;;;; Поддержка вкладок (заменяет one-tab-per-project)
    (project-x-tabs-mode 1)
    
    ;;;
    

37.5 projectile

;; (desire 'projectile)

38 Календарь

;;; Appointments, diary, calendar {{{

;; Use "M-x calendar RET" to display the calendar and start
;; appointment warnings.

;; (desire-conf 'appt)
(desire 'calendar)
;; (desire-conf 'todo-mode)
;; (desire-conf 'diary "diary-lib")

;;;}}}

39 Интеграция с десктопом

39.1 browse-url

39.1.1 Подключение

  • Файл: rc.packages.el
    (desire 'browse-url)
    

39.1.2 Загрузка

  • Файл: packages/browse-url/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Pass a URL to a web browser
    
    ;;; Code:
    
    (require 'browse-url)
    
    ;;;
    

39.1.3 Конфигурация

  • Файл: packages/browse-url/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Pass a URL to a web browser
    
    ;;; Code:
    
    (setq browse-url-browser-function 'browse-url-default-browser)
    
    ;;;
    

40 Почта

40.1 Общие опции

;;; These provide options for the various message handling packages {{{

;; (desire 'browse-url)
;; (desire-conf 'mailcrypt)
;; (desire 'supercite)

;;;}}}

40.2 Работа с почтой

;;; Message {{{

(desire 'smtpmail)
;; (desire 'gnus)
(desire 'message)
;; (desire-conf 'vm)
;; (desire 'wl :ensurename 'wanderlust)
;; (desire-conf 'sendmail)

40.3 mu4e

  • Подключение:
    ;; (desire 'mu4e-dashboard :recipe '(:fetcher github :repo "rougier/mu4e-dashboard"))
    (desire 'mu4e :precondition-system-executable "mu")
    
    Распечатка 202: rc.packages.el
  • Использование интерфейса transient:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Mu4e mail client, a transient menu
    ;; https://www.djcbsoftware.nl/code/mu/
    
    ;;; Code:
    
    (require 'mu4e-transient)
    (global-set-key (kbd "C-c m") #'mu4e-transient-menu)
    
    ;;;
    
    Распечатка 203: packages/mu4e/transient.ecf

41 Блоги

;;; Blogs {{{

;; (desire-conf 'hexo nil "hexo")
;; (desire-conf 'blog-admin nil "blog-admin") ;; Blog admin for emacs with hexo/org-page supported
(desire-conf 'easy-hugo  nil "easy-hugo" t) ;; Emacs major mode for managing hugo

;;;}}}
;;; Miscellaneous {{{

(desire 'ebuku)
(desire-conf 'graphviz-dot-mode nil "graphviz-dot-mode")
;; (desire-conf 'abbrev)
;; (desire-conf 'bibtex)
;; (desire-conf 'calc)
;; (desire-conf 'eiffel-mode)
;; (desire-conf 'filladapt)
;; (desire-conf 'hugs-mode)
;; (desire-conf 'html-helper-mode)
;; (desire-conf 'lispdir)
;; (desire-conf 'php-mode)
;; (desire-conf 'ps-print)
;; (desire-conf 'sh-script)
;; (desire-conf 'shell)
;; (desire-conf 'sql-mode)
;; (desire-conf 'w3)
(desire 'web-mode)
(desire 'gnuplot)

(desire 'pass)


(desire 'multiple-cursors)

42 Мессенджеры

(desire 'telega)

43 Отложенное чтение

43.1 Pocket reader

(desire 'pocket-reader)

43.2 Wallabag

  • Подключение пакета:
    (desire 'wallabag :recipe '(:fetcher github :repo "chenyanming/wallabag.el" :branch "master" :files ("*.el" "*.alist" "*.css")))
    
    Распечатка 204: rc.packages.el
  • Начальные настройки:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
    ;;; https://github.com/chenyanming/wallabag.el
    
    
    ;;;
    
    Распечатка 205: packages/wallabag/loaddefs.ecf
  • Загрузка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
    ;;; https://github.com/chenyanming/wallabag.el
    
    (require 'wallabag)
    
    ;;; Retrieve new entries after `M-x wallabag`
    (add-hook 'wallabag-after-render-hook 'wallabag-search-update-and-clear-filter)
    
    ;;; Image Caching. Setting url-automatic-caching non-nil causes documents to be cached automatically
    (setopt url-automatic-caching t)
    
    ;;;
    
    Распечатка 206: packages/wallabag/desire.ecf
  • Шаблон настройки параметров для пользователя:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
    ;;; https://github.com/chenyanming/wallabag.el
    
    ;;; Wallabag server host name
    ;; (setq wallabag-host "https://xx.xx.xx")
    
    ;;; Username
    ;; (setq wallabag-username "xx")
    
    ;;; Password
    ;; (setq wallabag-password "xx")
    
    ;;; Created with API clients management
    ;; (setq wallabag-clientid "xx")
    
    ;;; Created with API clients management
    ;; (setq wallabag-secret "xx")
    
    ;;;
    
    Распечатка 207: packages/wallabag/personal.ecf

43.2.1 Интеграция с elfeed

  • Подгружаем wallabag.
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Emacs wallabag client - A Read It Later/Web Archiving Solution in Emacs
;; https://github.com/chenyanming/wallabag.el

;;; Code:

(require 'wallabag)
Распечатка 208: packages/elfeed/wallabag.ecf
  • Клавиша w добавляет просматриваемую статью в wallabag.
(general-define-key
 :keymaps 'elfeed-show-mode-map
 "w" #'("Add entry to wallabag" . wallabag-add-entry))

;;;

43.3 Elfeed

  • Emacs. Чтение rss. Elfeed Объявление:
    (desire 'elfeed)
    
    Распечатка 209: rc.packages.el
  • Подключение:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An Emacs web feeds client
    ;; https://github.com/skeeto/elfeed
    
    ;;; Code:
    
    ;;;
    
    Распечатка 210: packages/elfeed/loaddefs.ecf
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An Emacs web feeds client
    ;; https://github.com/skeeto/elfeed
    
    ;;; Code:
    
    (require 'elfeed)
    
    ;;;; Elfeed-protocol
    (desire 'elfeed-protocol)
    (require 'elfeed-protocol)
    
    ;;;
    
    Распечатка 211: packages/elfeed/desire.ecf
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; An Emacs web feeds client
    ;; https://github.com/skeeto/elfeed
    
    ;;; Code:
    
    ;;;; Mark all as read
    (defun mark-all-read-and-refresh ()
      (interactive)
      (when (y-or-n-p "Mark all items as read?")
        (elfeed-mark-all-as-read)
        (elfeed-search-fetch nil)))
    ;;;
    
    Распечатка 212: packages/elfeed/desire.ecd/utils.ecf

43.4 Elfeed-protocol

  • Поддержка серверов rss:
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
;; https://github.com/fasheng/elfeed-protocol

;;; Code:

(desire 'elfeed-protocol)
(require 'elfeed-protocol)

;;;; curl recommend
(setopt elfeed-use-curl t)
(elfeed-set-timeout 36000)
;;;;; For https without a trust certificate
(setopt elfeed-curl-extra-arguments '("--insecure"))

;;;; enable elfeed-protocol
(setq elfeed-protocol-enabled-protocols '(fever newsblur owncloud ttrss))
(elfeed-protocol-enable)
Распечатка 213: packages/elfeed-protocol/desire.ecf
  • Обновить при поиске:
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
;; https://github.com/fasheng/elfeed-protocol

;;; Code:

(add-hook 'elfeed-search-mode-hook 'elfeed-update)

;;;
Распечатка 214: packages/elfeed-protocol/desire.ecd/search.ecf

43.4.1 Fever протокол

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
;; https://github.com/fasheng/elfeed-protocol

;;; Code:
Распечатка 215: packages/elfeed-protocol/desire.ecd/fever.ecf
  • По умолчанию получайте статьи с ID записи по одной.
  • Для некоторых сервисов, которые не предоставляют действительный ID записи, например FressRSS, просто установите для elfeed-protocol-fever-update-unread-only значение t в качестве обходного пути.
(setopt elfeed-protocol-fever-update-unread-only t)
  • Получение удаленной категории в качестве тега.
(setopt elfeed-protocol-fever-fetch-category-as-tag t)
  • Скачивать только непрочитанные.
(setopt elfeed-protocol-fever-update-unread-only t)
  • Перечитать источник.
(general-define-key
 :keymaps 'elfeed-search-mode-map
 "C-c C-u" #'("Retry initial sync operation" . elfeed-protocol-fever-reinit))

  ;;;

43.4.2 Персональные настройки

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
;; https://github.com/fasheng/elfeed-protocol

;;; Code:

(setopt
 elfeed-protocol-feeds
 '(
;;;; same format with elfeed-feeds
   ;; "http://foo/"
   ;; ("http://baz/" comic)

;;;; format 1
   ;; "owncloud+https://user:pass@myhost.com"

;;;; format 2, for username or password with special characters
   ;; ("owncloud+https://user@domain.com@myhost.com"
   ;;  :password "password/with|special@characters:")

;;;; format 3, for password in file
   ;; ("owncloud+https://user@myhost.com"
   ;;  :password-file "~/.password")

;;;; format 4, for password in .authinfo,
;;;; ensure (auth-source-search :host "myhost.com" :port "443" :user "user4") exists
   ;; ("owncloud+https://user@myhost.com"
   ;;  :use-authinfo t)

;;;; format 5, for password in gnome-keyring
   ;; ("owncloud+https://user@myhost.com"
   ;;  :password (shell-command-to-string "echo -n `secret-tool lookup attribute value`"))

;;;; format 6, for password in pass(1), using password-store.el
   ;; ("owncloud+https://user@myhost.com"
   ;;  :password (password-store-get "owncloud/app-pass"))

;;;; FreshRSS
   ;; ("fever+http://username@mydomain.org"
   ;;  :api-url "http://mydomain.org/api/fever.php"
   ;;  :password "my password")

;;;; use autotags
   ;; ("owncloud+https://user@myhost.com"
   ;;  :password "password"
   ;;  :autotags (("example.com" comic)))
   ))

;;;
Распечатка 216: packages/elfeed-protocol/personal.ecf

44 Dashboard


;;;}}}

;; (desire 'grammarly)

;; (desire 'flycheck-grammarly)

(desire 'dashboard)

;; PERSONAL

;; (require 'chord-mode)  ; edit guitar music.
;; (require 'discography) ; variant of BibTeX mode for discographies.

45 Разные программные режимы

45.1 Начало

  • Файл rc.packages.el:
    ;;; Different program modes {{{
    

45.2 Пакет csv-mode

  • Emacs. cvs-mode
  • Файл rc.packages.el:
    ;;; csv-mode
    (desire 'csv-mode)
    
  • Установим вызов cvs-mode для расширения .cvs.
    • Файл packages/csv-mode/loaddefs.ecf:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Major mode for editing comma/char separated values
      ;;; https://elpa.gnu.org/packages/csv-mode.html
      
      (add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
      
      ;;;
      
  • Загружаем пакет при необходимости.
    • Файл packages/csv-mode/desire.ecf:
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Major mode for editing comma/char separated values
      ;;; https://elpa.gnu.org/packages/csv-mode.html
      
      (require 'csv-mode)
      
  • Подключим режим визуального выравнивания полей.
    • Файл packages/csv-mode/desire.ecf:
      ;;; Keeps fields visually aligned, on-the-fly
      (add-hook 'csv-mode-hook 'csv-align-mode)
      
  • Настроим визуально представление длинных строк.
    • Файл packages/csv-mode/desire.ecf:
      (add-hook 'csv-mode-hook '(lambda () (interactive) (toggle-truncate-lines nil)))
      
      ;;;
      

45.3 Поддержка ebuild-файлов

  • Сайт: https://wiki.gentoo.org/wiki/Project:Emacs
  • Файл rc.packages.el:
    ;;; Ebuild files
    (desire 'ebuild-mode :recipe '(:fetcher github :repo "emacsmirror/ebuild-mode" :branch "master"))
    
    Распечатка 217: rc.packages.el
  • Настроим загрузку:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Edit ebuild and eclass files
    ;;; https://wiki.gentoo.org/wiki/Project:Emacs
    ;;; https://github.com/emacsmirror/ebuild-mode
    
    (add-to-list 'load-path "/usr/share/emacs/site-lisp/ebuild-mode")
    (autoload 'ebuild-mode "ebuild-mode"
      "Major mode for Gentoo .ebuild files." t)
    (autoload 'ebuild-eclass-mode "ebuild-mode"
      "Major mode for Gentoo .eclass files." t)
    (autoload 'ebuild-repo-mode "ebuild-mode"
      "Minor mode for files in an ebuild repository." t)
    (autoload 'ebuild-repo-mode-maybe-enable "ebuild-mode")
    (autoload 'devbook-mode "devbook-mode"
      "Major mode for editing the Gentoo Devmanual." t)
    (autoload 'gentoo-newsitem-mode "gentoo-newsitem-mode"
      "Major mode for Gentoo GLEP 42 news items." t)
    (autoload 'glep-mode "glep-mode"
      "Major mode for Gentoo Linux Enhancement Proposals." t)
    
    (add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode))
    (add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-eclass-mode))
    (add-to-list 'auto-mode-alist '("/devmanual.*\\.xml\\'" . devbook-mode))
    (add-to-list 'auto-mode-alist
             '("/[0-9]\\{4\\}-[01][0-9]-[0-3][0-9]-.+\\.[a-z]\\{2\\}\\.txt\\'"
               . gentoo-newsitem-mode))
    (add-to-list 'auto-mode-alist '("/glep.*\\.rst\\'" . glep-mode))
    (add-to-list 'auto-mode-alist
             '("/\\(package\\.\\(mask\\|unmask\\|use\\|env\
    \\|license\\|properties\\|accept_\\(keywords\\|restrict\\)\\)\
    \\|\\(package\\.\\)?use.\\(stable\\.\\)?\\(force\\|mask\\)\\)\\'"
               . conf-space-mode))
    (add-to-list 'auto-mode-alist
             '("/make\\.\\(conf\\|defaults\\)\\'" . conf-unix-mode))
    (add-to-list 'interpreter-mode-alist '("openrc-run" . sh-mode))
    (add-to-list 'interpreter-mode-alist '("runscript" . sh-mode))
    (add-hook 'find-file-hook #'ebuild-repo-mode-maybe-enable)
    (modify-coding-system-alist 'file "\\.\\(ebuild\\|eclass\\)\\'" 'utf-8)
    
    Распечатка 218: packages/ebuild-mode/loaddefs.ecf

45.4 Asymptote

45.4.1 Редактирование файлов Asymptote

  • Поддержка редактирования файлов Asymptote.
  • Файл rc.packages.el:
    ;;; Asymptote
    (desire 'asy-mode :recipe '(:fetcher github :repo "vectorgraphics/asymptote" :branch "master" :files ("base/asy-mode.el")))
    
    Распечатка 219: rc.packages.el
  • Конфигурационный файл:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; 2D & 3D TeX-Aware Vector Graphics Language
    ;;; https://github.com/vectorgraphics/asymptote
    
    (autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
    (autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
    (autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
    (add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
    
    ;;;
    
    Распечатка 220: packages/asy-mode.ecf

45.4.2 Поддержка Asymptote в Babel

;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Org-Babel support for evaluating asymptote
;;; https://github.com/hurrja/ob-asymptote

(desire 'ob-asymptote)
(require 'ob-asymptote)

;;;
Распечатка 221: packages/org/desire.ecd/ob-asymptote.ecf

45.5 kmonad-файлы

  • Поддержка синтаксиса конфигурационных файлов kmonad.
  • Файл rc.packages.el:
    ;;; kbd-mode
    ;; (desire 'kbd-mode :recipe '(:fetcher github :repo "kmonad/kbd-mode" :branch "master"))
    
    Распечатка 222: rc.packages.el
  • Конфигурационный файл:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs mode for syntax highlighting kmonad's .kbd files.
    ;;; https://github.com/kmonad/kbd-mode
    
    (autoload 'kdb-mode "kbd-mode.el" "Kmonad's .kbd files" t)
    (add-to-list 'auto-mode-alist '("\\.kbd$" . kbd-mode))
    
    ;;;
    
    Распечатка 223: packages/kbd-mode.ecf

45.6 Julia

;;;;; Julia

(desire 'julia-snail)
;; (desire 'julia-repl)

45.6.1 julia-mode

  1. Подключение

    • Файл: rc.packages.el
    (desire 'julia-mode)
    
  1. Объявление

    • Файл: packages/julia-mode/loaddefs.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Julia support in Emacs
    ;; https://github.com/JuliaEditorSupport/julia-emacs
    
    ;;; Code:
    
    (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-mode))
    
    ;;;
    
  1. Загрузка

    • Файл: packages/julia-mode/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Julia support in Emacs
    ;; https://github.com/JuliaEditorSupport/julia-emacs
    
    ;;; Code:
    
    (require 'julia-mode)
    
    ;;;
    
  1. Fill docstring

    • Файл: packages/julia-mode/desire.ecd/fill-docstring.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Fill docstrings. This is useful if you want to use M-q on docstrings.
    
    ;;; Code:
    
    
    (defun julia-fill-string ()
      "Fill a docstring, preserving newlines before and after triple quotation marks."
      (interactive)
      (if (and transient-mark-mode mark-active)
          (fill-region (region-beginning) (region-end) nil t)
        (cl-flet ((fill-if-string ()
                                  (when (or (looking-at (rx "\"\"\""
                                                            (group
                                                             (*? (or (not (any "\\"))
                                                                     (seq "\\" anything))))
                                                            "\"\"\""))
                                            (looking-at (rx "\""
                                                            (group
                                                             (*? (or (not (any "\\"))
                                                                     (seq "\\" anything))))
                                                            "\"")))
                                    (let ((start (match-beginning 1))
                                          (end (match-end 1)))
                                      ;; (ess-blink-region start end)
                                      (fill-region start end nil nil nil)))))
          (save-excursion
            (let ((s (syntax-ppss)))
              (when (fourth s) (goto-char (ninth s))))
            (fill-if-string)))))
    
    (local-set-key (kbd "M-q") 'julia-fill-string)
    (set-fill-column 80)
    
    ;(require 'whitespace)
    ;(setopt whitespace-style '(face empty tabs lines-tail trailing))
    ;(global-whitespace-mode t)
    ;(hungry-delete-mode)
    
    ;;;
    
  1. Фонтификация

    • Файл: packages/julia-mode/desire.ecd/fontification.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Borrow matlab.el's fontification of math operators
    ;; https://web.archive.org/web/20170326183805/https://ogbe.net/emacsconfig.html
    
    ;;; Code:
    
    (dolist (mode '(julia-mode ess-julia-mode))
      (font-lock-add-keywords
       mode
       `((,(let ((OR "\\|"))
             (concat "\\("  ; stolen `matlab.el' operators first
                     ;; `:` defines a symbol in Julia and must not be highlighted
                     ;; as an operator. The only operators that start with `:` are
                     ;; `:<` and `::`. This must be defined before `<`.
                     "[:<]:" OR
                     "[<>]=?" OR
                     "\\.[/*^']" OR
                     "===" OR
                     "==" OR
                     "=>" OR
                     "\\<xor\\>" OR
                     "[-+*\\/^&|$]=?" OR  ; this has to come before next (updating operators)
                     "[-^&|*+\\/~]" OR
                     ;; Julia variables and names can have `!`. Thus, `!` must be
                     ;; highlighted as a single operator only in some
                     ;; circumstances. However, full support can only be
                     ;; implemented by a full parser. Thus, here, we will handle
                     ;; only the simple cases.
                     "[[:space:]]!=?=?" OR "^!=?=?" OR
                     ;; The other math operators that starts with `!`.
                     ;; more extra julia operators follow
                     "[%$]" OR
                     ;; bitwise operators
                     ">>>" OR ">>" OR "<<" OR
                     ">>>=" OR ">>" OR "<<" OR
                     "\\)"))
          1 font-lock-type-face))))
    
    ;;;
    
  1. Интеграция

    1. julia-repl

      • Файл: packages/julia-mode/julia-repl.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Run an inferior Julia REPL in a terminal inside Emacs
      ;; https://github.com/tpapp/julia-repl
      
      ;;; Code:
      
      (require 'julia-repl)
      (add-hook 'julia-mode-hook 'julia-repl-mode)
      
      ;;;
      
    1. julia-snail

      • Файл: packages/julia-mode/julia-snail.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; An Emacs development environment for Julia
      ;; https://github.com/gcv/julia-snail
      
      ;;; Code:
      
      (require 'julia-snail)
      (add-hook 'julia-mode-hook #'julia-snail-mode)
      
      ;;;
      
    1. lsp-mode

      • Файл: packages/julia-mode/lsp-mode.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Julia support for the lsp-mode package using the LanguageServer.jl package
      ;; https://github.com/gdkrmr/lsp-julia
      
      ;;; Code:
      
      (require 'lsp-mode)
      
      (desire 'lsp-julia)
      (require 'lsp-julia)
      
      ;;;; Linux/macOS
      ;; (setopt lsp-julia-package-dir "/usr/local/bin/julia")
      
      ;;;; Configure lsp + julia
      (add-hook 'julia-mode-hook #'lsp-mode)
      (add-hook 'julia-mode-hook #'lsp)
      
      ;;;
      
    1. apheleia

      • Файл: packages/julia-mode/apheleia.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; An opinionated code formatter for Julia
      ;; https://github.com/domluna/JuliaFormatter.jl
      
      ;;; Code:
      
      (if (executable-find "jlfmt")
          (with-eval-after-load 'apheleia
            (setf (alist-get 'jlfmt apheleia-formatters) '("jlfmt" "-o" filepath))
            (setf (alist-get 'julia-mode apheleia-mode-alist) 'jlfmt))
        nil)
      
      ;;;
      

45.7 Поддержка командной оболочки fish

  • Загрузка пакета:
    ;;; https://github.com/wwwjfy/emacs-fish
    (desire 'fish-mode)
    
    Распечатка 224: rc.packages.el
  • Настройка пакета:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; fish-mode for emacs
    ;;; https://github.com/wwwjfy/emacs-fish
    
    ;;; run fish_indent before save
    (add-hook 'fish-mode-hook (lambda ()
                            (add-hook 'before-save-hook 'fish_indent-before-save)))
    
    ;;;
    
    Распечатка 225: packages/fish-mode.ecf

45.8 Разное

(desire 'speedbar)
;; (desire-conf 'semantic nil "semantic")

;; (desire-conf 'cedet nil "cedet")
;; (desire-conf 'ecb nil "ecb")

;; (desire-conf 'php-mode nil "php-mode")
;; (desire-conf 'eiffel-mode nil "eiffel-mode")

(desire 'ebib)

(desire 'lua-mode)


(desire 'yaml-mode)
(desire 'ini-mode)
(desire 'hcl-mode)

(desire 'magit-gitflow)
(desire 'magit)

45.9 Конец

  • Файл rc.packages.el:
    ;;;}}}
    

46 Редактирование текста в броузере

46.1 Начало

  • Файл rc.packages.el:
    ;;; Edit text areas in browsers {{{
    

46.2 Edit with Emacs

  • Файл rc.packages.el:
    (desire 'edit-server)
    
  • Файл packages/edit-server.ecf:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; A Chromium/Firefox "clone" of It's All Text for spawning an editor to edit text areas in browsers. Based on David Hilley's original Chromium extension.
    ;;; https://github.com/stsquad/emacs_chrome
    
    (require 'edit-server)
    
    (setopt edit-server-new-frame nil)
    (edit-server-start)
    
    (setopt edit-server-url-major-mode-alist
          '(("github\\.com" . markdown-mode)))
    
    ;;;
    

46.3 Ghost Text

  • Файл rc.packages.el:
    ;; (desire 'atomic-chrome)
    
  • Файл packages/atomic-chrome.ecf:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Edit text area on Chrome with Emacs using Atomic Chrome
    ;;; https://github.com/alpha22jp/atomic-chrome
    
    (require 'atomic-chrome)
    (atomic-chrome-start-server)
    
    ;;; Atomic Chrome for Emacs automatically reflects modifications to the browser by default
    (setopt atomic-chrome-enable-auto-update t)
    
    ;;; The default major mode of editing buffer is `text-mode`. You can change the major mode manually
    (setopt atomic-chrome-default-major-mode 'markdown-mode)
    
    ;;; Choose the major mode for a specific website
    (setopt atomic-chrome-url-major-mode-alist
          '(("github\\.com" . gfm-mode)
            ("redmine" . textile-mode)))
    
    ;;; Select editing buffer style
    ;;; full: Open in the selected window.
    ;;; split: Open in the new window by splitting the selected window (default).
    ;;; frame: Create a new frame and window in it.
    ;; (setopt atomic-chrome-buffer-open-style split)
    
    ;;;
    

46.4 Конец

  • Файл rc.packages.el:
    ;;;}}}
    

47 Навигация по файлам

47.1 dired

47.1.1 dired

  • Файл rc.packages.el:
    ;;; Dired {{{
    
    (desire 'mouse3 :recipe '(:fetcher github :repo "emacsmirror/mouse3" :branch "master" :files ("*.el")))
    
    (desire 'dired)
    (desire 'dired+ :recipe '(:fetcher github :repo "emacsmirror/dired-plus" :branch "master" :files ("*.el")))
    
    ;; (desire 'ranger)
    ;; (desire 'efar)
    ;; (desire 'sunrise-commander :recipe '(:fetcher github :repo "sunrise-commander/sunrise-commander"))
    (desire 'dirvish)
    ;;;}}}
    

47.1.2 diredc

  • Репозиторий: https://github.com/Boruch-Baum/emacs-diredc
  • Двупанельный (как в midnight commander) режим.
  • Подключение:
    ;;; Midnight Commander features (plus) for emacs dired-mode
    ;; (desire 'diredc)
    
    Распечатка 226: rc.packages.el

47.2 Neotree

47.3 Treemacs

47.3.1 Подключение

  • Файл rc.packages.el
    (desire 'treemacs)
    

47.3.2 Объявление

  • Файл: packages/treemacs/loaddefs.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Treemacs - a tree layout file explorer for Emacs
;; https://github.com/Alexander-Miller/treemacs

;;; Code:

(require 'treemacs)

;;;

47.3.3 Загрузка

  • Файл: packages/treemacs/desire.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Treemacs - a tree layout file explorer for Emacs
    ;; https://github.com/Alexander-Miller/treemacs
    
    ;;; Code:
    
    ;;;; Set the correct python3 executable path. This is needed for treemacs-git-mode extended
    (setopt treemacs-python-executable (executable-find "python"))
    
    (setopt treemacs-collapse-dirs                 (if treemacs-python-executable 3 0)
            treemacs-deferred-git-apply-delay      0.5
            treemacs-directory-name-transformer    #'identity
            treemacs-display-in-side-window        t
            treemacs-eldoc-display                 'simple
            treemacs-file-event-delay              2000
            treemacs-file-extension-regex          treemacs-last-period-regex-value
            treemacs-file-follow-delay             0.2
            treemacs-file-name-transformer         #'identity
            treemacs-follow-after-init             t
            treemacs-find-workspace-method         'find-for-file-or-pick-first
            treemacs-git-command-pipe              ""
            treemacs-goto-tag-strategy             'refetch-index
            treemacs-header-scroll-indicators      '(nil . "^^^^^^")
            treemacs-hide-dot-git-directory        t
            treemacs-indentation                   2
            treemacs-indentation-string            " "
            treemacs-is-never-other-window         nil
            treemacs-max-git-entries               5000
            treemacs-missing-project-action        'ask
            treemacs-move-forward-on-expand        nil
            treemacs-no-png-images                 nil
            treemacs-no-delete-other-windows       t
            treemacs-project-follow-cleanup        nil
            treemacs-persist-file                  (expand-file-name "treemacs-persist" user-emacs-directory)
            treemacs-position                      'left
            treemacs-recenter-distance             0.1
            treemacs-recenter-after-file-follow    nil
            treemacs-recenter-after-tag-follow     nil
            treemacs-recenter-after-project-jump   'always
            treemacs-recenter-after-project-expand 'on-distance
            treemacs-litter-directories            '("/node_modules" "/.venv" "/.cask")
            treemacs-project-follow-into-home      nil
            treemacs-show-cursor                   nil
            treemacs-show-hidden-files             t
            treemacs-silent-filewatch              nil
            treemacs-silent-refresh                nil
            treemacs-sorting                       'alphabetic-asc
            treemacs-select-when-already-in-treemacs 'move-back
            treemacs-space-between-root-nodes      t
            treemacs-tag-follow-cleanup            t
            treemacs-tag-follow-delay              1.5
            treemacs-user-mode-line-format         nil
            treemacs-user-header-line-format       nil
            treemacs-wide-toggle-width             70
            treemacs-width                         35
            treemacs-width-increment               1
            treemacs-width-is-initially-locked     t
            treemacs-workspace-switch-cleanup      nil)
    
    ;; The default width and height of the icons is 22 pixels. If you are
    ;; using a Hi-DPI display, uncomment this to double the icon size.
    ;;(treemacs-resize-icons 44)
    
    (treemacs-follow-mode t)
    (treemacs-filewatch-mode t)
    (treemacs-fringe-indicator-mode 'always)
    (when treemacs-python-executable
       (treemacs-git-commit-diff-mode t))
    
    (pcase (cons (not (null (executable-find "git")))
                 (not (null treemacs-python-executable)))
      (`(t . t)
       (treemacs-git-mode 'deferred))
      (`(t . _)
       (treemacs-git-mode 'simple)))
    
    
    (treemacs-hide-gitignored-files-mode nil)
    
    ;;; Mouse Interface
    (define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action)
    
    ;; (treemacs-start-on-boot)
    
    
    
    ;;;
    

47.3.4 Клавиатурные сочетания

  • Файл: packages/treemacs/desire.ecd/key.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Treemacs - a tree layout file explorer for Emacs
;; https://github.com/Alexander-Miller/treemacs

;;; Code:

(general-define-key
 "M-0" 'treemacs-select-window)

(general-define-key
 :prefix "C-x t"
 "1" 'treemacs-delete-other-windows
 "t" 'treemacs
 "d" 'treemacs-select-directory
 "B" 'treemacs-bookmark
 "C-t" 'treemacs-find-file
 "M-t" 'treemacs-find-tag)

;;;

47.3.5 Исправления

  • Файл: packages/treemacs/desire.ecd/fix.ecf
;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
;;; Code:

;;; Suppress “ad-handle-definition: .. redefined” warnings during Emacs startup
(custom-set-variables '(ad-redefinition-action (quote accept)))

;;;

47.3.6 Интеграция

  1. projectile

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Projectile integration for treemacs
    
    ;;; Code:
    
    (desire 'treemacs-projectile)
    (require 'treemacs-projectile)
    
    ;;;
    
  1. magit

    • Файл: packages/treemacs/magit.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Treemacs - a tree layout file explorer for Emacs
    ;; https://github.com/Alexander-Miller/treemacs
    
    ;;; Code:
    
    (desire 'treemacs-magit)
    (require 'treemacs-magit)
    
    ;;;
    
  1. tab-bar

    • Файл: packages/treemacs/tab-bar.ecf
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Treemacs - a tree layout file explorer for Emacs
    ;; https://github.com/Alexander-Miller/treemacs
    
    ;;; Code:
    
    (desire 'treemacs-tab-bar)
    (require 'treemacs-tab-bar)
    
    (setopt treemacs-set-scope-type 'Tabs)
    
    ;;;
    

48 Навигация по тексту

48.1 Начало

  • Файл rc.packages.el:
    ;;; Text navigation {{{
    

48.2 line-reminder

  • Line annotation for changed and saved lines: https://github.com/emacs-vs/line-reminder
  • Файл rc.packages.el:
    ;;; Line annotation for changed and saved lines
    (desire 'line-reminder)
    
  • Файл rc.packages.el:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Line annotation for changed and saved lines
    ;;; https://github.com/emacs-vs/line-reminder
    
    ;;; Enable for all buffers
    (global-line-reminder-mode t)
    
    ;;; Display Annotation
    ;;; linum | indicators
    (setopt line-reminder-show-option 'linum)
    
    ;;; Display thumbnail
    (setopt line-reminder-thumbnail t)
    
    ;;;
    

48.3 Конец

  • Файл rc.packages.el:
    ;;;}}}
    

49 Перевод

49.1 gt

  • Подключаем:
    ;;; Translator on Emacs
    (desire 'gt)
    
    Распечатка 227: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    ;; https://github.com/lorniu/gt.el
    
    (require 'gt)
    
    ;;;
    
    Распечатка 228: packages/go-translate/loaddefs.ecf
  • Конфигурация:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    ;; https://github.com/lorniu/gt.el
    
    
    ;;;
    
    Распечатка 229: packages/go-translate/desire.ecf
  • Простейшая конфигурация:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on
    ;; https://github.com/lorniu/gt.el
    
    ;;; Initialize the default translator, let it translate between en and ru via Google Translate, and the result will be displayed in the Echo Area.
    (setopt gt-langs '(en ru))
    (setopt gt-default-translator (gt-translator :engines (gt-google-engine)))
    
    ;;;
    
    Распечатка 230: packages/go-translate/desire.ecd/google-simple.ecf

50 UI

  • Раздел:
    ;;;; UI
    
    Распечатка 231: rc.packages.el

50.1 Modeline

50.1.1 Начало

  • Файл rc.packages.el:
    ;;;;; Modeline
    
    Распечатка 232: rc.packages.el

50.1.2 Общие настройки modeline

  • Загрузим только конфигурационный файл:

    (desire-conf 'modeline)
    
    Распечатка 233: rc.packages.el
  • Заголовок файла:

    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Configure modeline
    
    Распечатка 234: packages/modeline.ecf
  • Показывать столбец, в котором находится курсор (https://www.gnu.org/software/emacs/manual/html_node/efaq/Displaying-the-current-line-or-column.html):

    ;;; Show column number
    (setopt column-number-mode t)
    
    Распечатка 235: packages/modeline.ecf
  • Задаём 24-часовой формат времени:

    ;;; Time in 24 hour format, plus day and date.
    (setopt display-time-day-and-date t)
    (setopt display-time-24hr-format t)
    
    Распечатка 236: packages/modeline.ecf
  • Мы можем захотеть видеть и секунды:

    ;;; Display time in seconds in the mode line
    ;;; %H is the hour on a 24-hour clock, %I is on a 12-hour clock,
    ;;; %k is like %H only blank-padded, %l is like %I blank-padded.
    ;;; %p is the locale's equivalent of either AM or PM.
    ;;; %M is the minute, %S is the second.
    (setopt display-time-format "%H:%M:%S")
    (setopt display-time-interval 1)
    
    Распечатка 237: packages/modeline.ecf
  • Разрешим показывать время в модлайн:

    ;;; Enable the display of time and CPU load average in the modeline
    (display-time-mode 1)
    
    ;;;
    
    Распечатка 238: packages/modeline.ecf

50.2 Темы

  • Подключаем темы в файле rc.packages.el:
    ;;;;; Themes
    
    ;;; Nested menu for minor modes
    (desire 'minions)
    
    ;;; Tabs and ribbons for the mode-line
    (desire 'moody)
    
    ;;; Spacemacs theme
    ;; (desire 'spacemacs-theme :precondition-lisp-library "spacemacs-theme-pkg")
    
    ;;; Doom themes
    ;; (desire 'doom-themes)
    
    ;; (desire 'zenburn-theme)
    ;; (desire 'lambda-themes :recipe '(:fetcher github :repo "Lambda-Emacs/lambda-themes" :branch "main"))
    ;; (desire 'tao-theme)
    
    ;;; N Λ N O Theme
    ;; (desire 'nano-theme)
    
    ;;; Increase the padding/spacing of frames and windows
    ;; (desire 'spacious-padding)
    

50.2.1 Modus-themes

  1. Подключение

    • Подключаем темы в файле rc.packages.el:
      (desire 'modus-themes)
      
  1. Загрузка

    • Файл: packages/modus-themes/loaddefs.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Modus Themes
      ;; https://protesilaos.com/modus-themes/
      ;; https://gitlab.com/protesilaos/modus-themes/
      ;; https://github.com/protesilaos/modus-themes/
      
      ;;; Code:
      
      (require 'modus-themes)
      
      ;;;
      
  1. Конфигурация

    • Файл: packages/modus-themes/desire.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Modus Themes
      ;; https://protesilaos.com/modus-themes/
      ;; https://gitlab.com/protesilaos/modus-themes/
      ;; https://github.com/protesilaos/modus-themes/
      
      ;;; Code:
      
      (modus-themes-include-derivatives-mode 1)
      
      ;;;; With a non-nil value (t) display several syntactic constructs in bold weight.
      (setopt modus-themes-bold-constructs t)
      
      ;;;; With a non-nil value (t) choose to render more faces in slanted text.
      (setopt modus-themes-italic-constructs t)
      
      ;;;; Toggle the use of monospaced fonts for spacing-sensitive constructs
      (setopt modus-themes-mixed-fonts t)
      (setopt modus-themes-variable-pitch-ui t)
      (setopt modus-themes-custom-auto-reload t)
      (setopt modus-themes-common-palette-overrides nil)
      (setopt modus-themes-to-rotate modus-themes-items)
      
      (setopt modus-themes-italic-constructs t)
      (setopt modus-themes-bold-constructs t)
      
      ;;;; Control the style of command prompts
      (setopt modus-themes-prompts '(bold))
      
      ;;;; Set the overall style of completion framework interfaces
      (setopt modus-themes-completions '((t . (bold))))
      
      ;;;; Optionally add a key binding for the toggle between the themes:
      ;; (define-key global-map (kbd "<f5>") #'modus-themes-toggle)
      
      ;;;
      
  1. Персональные настройки

    • Файл: packages/modus-themes/personal.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;;; Modus Themes
      ;; https://protesilaos.com/modus-themes/
      ;; https://gitlab.com/protesilaos/modus-themes/
      ;; https://github.com/protesilaos/modus-themes/
      
      ;;; Main themes
      ;;; modus-operandi is the project's main light theme, while modus-vivendi is its dark counterpart
      ;;; Light theme
      ;; (modus-themes-load-theme 'modus-operandi)
      ;;; Dark theme
      ;; (modus-themes-load-theme 'modus-vivendi)
      ;;; Switch themes
      ;; (setopt modus-themes-to-toggle '(modus-operandi modus-vivendi))
      
      ;;; Tinted themes
      ;;; modus-operandi-tinted and modus-vivendi-tinted are variants of the two main themes
      ;;; Light theme
      (modus-themes-load-theme 'modus-operandi-tinted)
      ;;; Dark theme
      ;; (modus-themes-load-theme 'modus-vivendi-tinted)
      ;;; Switch themes
      (setopt modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted))
      
      ;;; Deuteranopia themes
      ;;; modus-operandi-deuteranopia and its companion modus-vivendi-deuteranopia are optimized for users with red-green color deficiency
      ;;; Light theme
      ;; (modus-themes-load-theme 'modus-operandi-deuteranopia)
      ;;; Dark theme
      ;; (modus-themes-load-theme 'modus-vivendi-deuteranopia)
      ;;; Switch themes
      ;; (setopt modus-themes-to-toggle '(modus-operandi-deuteranopia modus-vivendi-deuteranopia))
      
      ;;; Tritanopia themes
      ;;; modus-operandi-tritanopia and its companion modus-vivendi-tritanopia are optimized for users with red-green color deficiency
      ;;; Light theme
      ;; (modus-themes-load-theme 'modus-operandi-tritanopia)
      ;;; Dark theme
      ;; (modus-themes-load-theme 'modus-vivendi-tritanopia)
      ;;; Switch themes
      ;; (setopt modus-themes-to-toggle '(modus-operandi-tritanopia modus-vivendi-tritanopia))
      
      ;;;
      

50.2.2 Ef-themes

50.2.3 Doric-themes

  • Подключаем темы в файле rc.packages.el:
    ;; (desire 'doric-themes)
    
  • Загружаем темы:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Doric themes for GNU Emacs
    ;; https://github.com/protesilaos/doric-themes
    
    ;;; Code:
    
    (require 'doric-themes)
    
    ;;;
    
    Распечатка 239: packages/doric-themes/loaddefs.ecf
  • Конфигурация:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Doric themes for GNU Emacs
    ;; https://github.com/protesilaos/doric-themes
    
    ;;; Code:
    
    ;;;
    
    Распечатка 240: packages/doric-themes/desire.ecf
  • Поддержка Moody:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Tabs and ribbons for the mode-line
    ;; https://github.com/tarsius/moody
    
    ;;; Code:
    
    (require 'moody)
    
    ;;;
    
    Распечатка 241: packages/doric-themes/moody.ecf
  • Выбор темы:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Doric themes for GNU Emacs
    ;; https://github.com/protesilaos/doric-themes
    
    ;;; Code:
    
    ;;;; light + dark
    ;; (setopt doric-themes-to-toggle '(doric-light doric-dark))
    ;; (doric-themes-select 'doric-light)
    
    ;;;; marble + obsidian
    ;; (setopt doric-themes-to-toggle '(doric-marble doric-obsidian))
    ;; (doric-themes-select 'doric-marble)
    
    ;;;; earth + fire
    ;; (setopt doric-themes-to-toggle '(doric-earth doric-fire))
    ;; (doric-themes-select 'doric-earth)
    
    ;;;; wind + water
    ;; (setopt doric-themes-to-toggle '(doric-wind doric-water))
    ;; (doric-themes-select 'doric-wind)
    
    ;;;; cherry + plum
    ;; (setopt doric-themes-to-toggle '(doric-cherry doric-plum))
    ;; (doric-themes-select 'doric-cherry)
    
    ;;;; oak + pine
    (setopt doric-themes-to-toggle '(doric-oak doric-pine))
    (doric-themes-select 'doric-oak)
    
    
    ;;;; Rotate themes
    (setopt doric-themes-to-rotate doric-themes-collection)
    
    ;;;; To load a random theme instead, use something like one of these:
    ;; (doric-themes-load-random)
    ;; (doric-themes-load-random 'light)
    ;; (doric-themes-load-random 'dark)
    
    ;;;
    
    Распечатка 242: packages/doric-themes/personal.ecf

50.3 Шрифты

50.3.1 Идентификатор раздела

  • Файл: rc.packages.el
    ;;;;; Fonts
    

50.3.2 Fontset

  1. Подключение

    • Файл: rc.packages.el
      (desire 'fontset)
      
  1. Загрузка

    • Файл: packages/fontset/loaddefs.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set fontset
      ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifying-Fontsets.html
      
      ;;; Code:
      
      ;;; Set default font
      ;; (cl-loop for font in '("SF Mono" "Hack" "Source Code Pro" "Fira Code"
      ;; 		       "Menlo" "Monaco" "DejaVu Sans Mono" "Consolas")
      ;; 	 when (font-installed-p font)
      ;; 	 return (set-face-attribute 'default nil
      ;; 				    :font font
      ;; 				    :height (cond (sys/mac-x-p 130)
      ;; 						  (sys/win32p 110)
      ;; 						  (t 100))))
      
      ;; ;;; Specify font for all unicode characters
      ;; (cl-loop for font in '("Apple Color Emoji" "Segoe UI Symbol" "Symbola" "Symbol")
      ;; 	 when (font-installed-p font)
      ;; 	 return (set-fontset-font t 'unicode font nil 'prepend))
      
      ;;; Specify font for Chinese characters
      ;; (cl-loop for font in '("WenQuanYi Micro Hei" "Microsoft Yahei")
      ;; 	 when (font-installed-p font)
      ;; 	 return (set-fontset-font t '(#x4e00 . #x9fff) font)))
      
      ;; (cond
      ;;  ((find-font (font-spec :name "Iosevka"))
      ;;   (add-to-list 'default-frame-alist '(font . "Iosevka-12" ))
      ;;   (set-face-attribute 'default t :font "Iosevka-12" ))
      ;;  ((find-font (font-spec :name "Hack"))
      ;;   (add-to-list 'default-frame-alist '(font . "Hack-12" ))
      ;;   (set-face-attribute 'default t :font "Hack-12" ))
      ;;  ((find-font (font-spec :name "IBM Plex Mono"))
      ;;   (add-to-list 'default-frame-alist '(font . "IBM Plex Mono-12" ))
      ;;   (set-face-attribute 'default t :font "IBM Plex Mono-12" ))
      ;;  ((find-font (font-spec :name "Source Code Pro"))
      ;;   (add-to-list 'default-frame-alist '(font . "Source Code Pro-12" ))
      ;;   (set-face-attribute 'default t :font "Source Code Pro-12" ))
      ;;  ((find-font (font-spec :name "AnonymousPro"))
      ;;   (add-to-list 'default-frame-alist '(font . "AnonymousPro-12" ))
      ;;   (set-face-attribute 'default t :font "AnonymousPro-12" ))
      ;;  ((find-font (font-spec :name "Victor Mono"))
      ;;   (add-to-list 'default-frame-alist '(font . "Victor Mono-12" ))
      ;;   (set-face-attribute 'default t :font "Victor Mono-12" ))
      ;;  ((find-font (font-spec :name "Hermit"))
      ;;   (add-to-list 'default-frame-alist '(font . "Hermit-12" ))
      ;;   (set-face-attribute 'default t :font "Hermit-12" ))
      ;;  ((find-font (font-spec :name "Fira Code"))
      ;;   (add-to-list 'default-frame-alist '(font . "Fira Code-12" ))
      ;;   (set-face-attribute 'default t :font "Fira Code-12" ))
      ;;  ((find-font (font-spec :name "Inconsolata"))
      ;;   (add-to-list 'default-frame-alist '(font . "Inconsolata-12" ))
      ;;   (set-face-attribute 'default t :font "Inconsolata-12" ))
      ;;  ((find-font (font-spec :name "DejaVu Sans Mono"))
      ;;   (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12" ))
      ;;   (set-face-attribute 'default t :font "DejaVu Sans Mono-12" ))
      ;;  ((find-font (font-spec :name "Lucida Console"))
      ;;   (add-to-list 'default-frame-alist '(font . "Lucida Console-12" ))
      ;;   (set-face-attribute 'default t :font "Lucida Console-12" ))
      ;;  ((find-font (font-spec :name "Courier"))
      ;;   (add-to-list 'default-frame-alist '(font . "Courier-12" ))
      ;;   (set-face-attribute 'default t :font "Courier-12" ))
      ;;  )
      
      ;;;
      
  1. Эмодзи

    • Файл: packages/fontset/desire.ecd/emoji.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set emoji
      
      ;;; Code:
      
      (set-fontset-font
       t
       'emoji
       (cond
        ((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji")
        ((member "Noto Emoji" (font-family-list)) "Noto Emoji")
        ((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji")
        ((member "Symbola" (font-family-list)) "Symbola")
        ((member "Apple Color Emoji" (font-family-list)) "Apple Color Emoji")
        nil 'append))
      
      (set-fontset-font
       t
       'symbol
       (cond
        ((member "Symbola" (font-family-list)) "Symbola")
        ((member "Segoe UI Symbol" (font-family-list)) "Segoe UI Symbol")
        ((member "Apple Symbols" (font-family-list)) "Apple Symbols")
        nil 'append))
      
      ;;;
      
  1. Unicode

    • Файл: packages/fontset/desire.ecd/unicode.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Font for all unicode characters
      
      ;;; Code:
      
      ;;;; Китайский, японский, корейский (CJK)
      ;;;; Linux: "Noto Sans CJK SC" или "WenQuanYi Micro Hei"
      ;;;; macOS: "PingFang SC" или "Hiragino Sans"
      ;;;; Windows: "Microsoft YaHei" или "Segoe UI Emoji"
      
      (set-fontset-font
       t
       '(#x4E00 . #x9FFF)   ; основной блок CJK
       (cond
        ((member "Noto Sans CJK SC" (font-family-list)) "Noto Sans CJK SC")
        ((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji")
        nil 'append))
      
      (set-fontset-font
       t
       '(#x3040 . #x30FF)   ; хирагана и катакана
       (cond
        ((member "Noto Sans CJK SC" (font-family-list)) "Noto Sans CJK SC")
        ((member "Segoe UI Emoji" (font-family-list)) "Segoe UI Emoji")
        nil 'append))
      
      ;;;; set font for cuneiform
      (set-fontset-font
       t
       'cuneiform
       (cond
        ((eq system-type 'windows-nt)
         (cond
          ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic")))
        ((eq system-type 'darwin)
         (cond
          ((member "Noto Sans Cuneiform Regular" (font-family-list)) "Noto Sans Cuneiform Regular")))
        ((eq system-type 'gnu/linux)
         (cond
          ((member "Noto Sans Cuneiform Regular" (font-family-list)) "Noto Sans Cuneiform Regular")))))
      
      (set-fontset-font
       t
       'phoenician
       (cond
        ((eq system-type 'windows-nt)
         (cond
          ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic")))
        ((eq system-type 'darwin)
         (cond
          ((member "Noto Sans Phoenician Regular" (font-family-list)) "Noto Sans Phoenician Regular")))
        ((eq system-type 'gnu/linux)
         (cond
          ((member "Noto Sans Phoenician Regular" (font-family-list)) "Noto Sans Phoenician Regular")))))
      
      (set-fontset-font
       t
       'deseret
       (cond
        ((eq system-type 'windows-nt)
         (cond
          ((member "Segoe UI Symbol" (font-family-list)) "Segoe UI Symbol")))
        ((eq system-type 'darwin)
         (cond
          ((member "Apple Symbols" (font-family-list)) "Apple Symbols")))
        ((eq system-type 'gnu/linux)
         (cond
          ((member "Noto Sans Deseret" (font-family-list)) "Noto Sans Deseret")))))
      
      (set-fontset-font
       t
       'shavian
       (cond
        ((eq system-type 'windows-nt)
         (cond
          ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic")))
        ((eq system-type 'darwin)
         (cond
          ((member "Apple Symbols" (font-family-list)) "Apple Symbols")))
        ((eq system-type 'gnu/linux)
         (cond
          ((member "Noto Sans Shavian Regular" (font-family-list)) "Noto Sans Shavian Regular")))))
      
      (set-fontset-font
       t
       'egyptian
       (cond
        ((eq system-type 'windows-nt)
         (cond
          ((member "Segoe UI Historic" (font-family-list)) "Segoe UI Historic")))
        ((eq system-type 'darwin)
         (cond
          ((member "Noto Sans Egyptian Hieroglyphs" (font-family-list)) "Noto Sans Egyptian Hieroglyphs")))
        ((eq system-type 'gnu/linux)
         (cond
          ((member "Aegyptus" (font-family-list)) "Aegyptus")))))
      
      ;;;
      

50.3.3 mixed-pitch

  1. Подключение

    • Файл: rc.packages.el
      ;; (desire 'mixed-pitch)
      
  1. Загрузка

    • Файл: packages/mixed-pitch.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Mix fixed-pitch and variable-pitch fonts in Emacs
      ;; https://gitlab.com/jabranham/mixed-pitch
      
      ;;; Code:
      
      (require 'mixed-pitch)
      
      ;;;; Fixed pitch
      (setopt mixed-pitch-fixed-pitch-faces
              (append mixed-pitch-fixed-pitch-faces
                      '(
                        org-code
                        org-verbatim
                        org-block
                        font-lock-comment-face
                        )))
      
      ;;;; Apply mixed-pitch-mode in all text modes
      (add-hook 'text-mode-hook #'mixed-pitch-mode)
      (add-hook 'org-mode-hook #'mixed-pitch-mode)
      
      ;;;; Apply everywhere
      ;; (mixed-pitch-mode)
      
      ;;;
      

50.3.4 Fontaine

  1. Подключение

    • Файл: rc.packages.el
      (desire 'fontaine)
      
  1. Загрузка

    • Файл: packages/fontaine/loaddefs.ecf
      ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
      ;;; Set Emacs font configurations using presets
      ;; https://github.com/protesilaos/fontaine
      
      ;;; Code:
      
      (require 'fontaine)
      
      (add-hook 'enable-theme-functions #'fontaine-apply-current-preset)
      
      ;;;
      

50.4 Внешний вид

50.4.1 Posframe

  • Дочерний фрейм в точке.
  • https://github.com/tumashu/posframe
  • Подключение:
    ;; (desire 'posframe)
    
    Распечатка 243: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Pop a posframe (just a child-frame) at point
    ;; https://github.com/tumashu/posframe
    
    ;;; Code:
    
    (require 'posframe)
    
    ;;;
    
    Распечатка 244: packages/posframe/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Pop a posframe (just a child-frame) at point
    ;; https://github.com/tumashu/posframe
    
    ;;;
    
    Распечатка 245: packages/posframe/desire.ecf
  • Поддержка vertico:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Vertico-posframe is an vertico extension, which lets vertico use posframe to show its candidate menu
    ;; https://github.com/tumashu/vertico-posframe
    
    (desire 'vertico-posframe)
    
    (require 'vertico-posframe)
    ;; (vertico-posframe-mode 1)
    
    (setopt vertico-multiform-commands
          '((consult-line
             posframe
             (vertico-posframe-poshandler . posframe-poshandler-frame-top-center)
             (vertico-posframe-border-width . 10)
             ;; NOTE: This is useful when emacs is used in both in X and
             ;; terminal, for posframe do not work well in terminal, so
             ;; vertico-buffer-mode will be used as fallback at the
             ;; moment.
             (vertico-posframe-fallback-mode . vertico-buffer-mode))
            (t posframe)))
    (vertico-multiform-mode 1)
    
    ;;;
    
    Распечатка 246: packages/posframe/vertico.ecf

50.4.2 Nova

  • Репозиторий: https://github.com/thisisran/nova
  • Прорисовка дочерних фреймов с помощью SVG.
  • Подключение:
    (desire 'eldoc-box)
    ;; (desire 'nova :recipe '(:fetcher github :repo "thisisran/nova" :branch "main"))
    
    Распечатка 247: rc.packages.el
  • Загрузка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs SVG Child Frames
    ;;;; https://github.com/thisisran/nova
    
    (require 'nova)
    
    ;;;
    
    Распечатка 248: packages/nova/loaddefs.ecf
  • Настройка:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs SVG Child Frames
    ;;;; https://github.com/thisisran/nova
    
    ;;;
    
    Распечатка 249: packages/nova/desire.ecf
  • Поддержка vertico:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs SVG Child Frames
    ;;;; https://github.com/thisisran/nova
    
    (require 'nova-vertico)
    (nova-vertico-mode 1)
    
    ;;;
    
    Распечатка 250: packages/nova/vertico.ecf
  • Поддержка corfu:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs SVG Child Frames
    ;;;; https://github.com/thisisran/nova
    
    (require 'nova-corfu)
    (require 'nova-corfu-popupinfo)
    
    (nova-corfu-mode 1)
    (nova-corfu-popupinfo-mode 1)
    
    ;;;
    
    Распечатка 251: packages/nova/corfu.ecf
  • Поддержка eldoc-box:
    ;;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-unix; -*-
    ;;; Emacs SVG Child Frames
    ;;;; https://github.com/thisisran/nova
    
    ;; (require 'nova-eldoc)
    ;; (nova-eldoc-mode 1)
    
    ;;;
    
    Распечатка 252: packages/nova/eldoc-box.ecf

50.4.3 Zoom

;; (desire 'zoom)

51 Финализирование

  • Финализируем файл rc.packages.el:
    ;;; rc.packages.el ends here
    
Дмитрий Сергеевич Кулябов
Authors
Профессор кафедры теории вероятностей и кибербезопасности
Работаю профессором на кафедре теории вероятностей и кибербезопасности Российского университета дружбы народов им. Патриса Лумумбы. Научные интересы относятся к области теоретической физики и математического моделирования.