Skip to content

Commit

Permalink
autolaod
Browse files Browse the repository at this point in the history
  • Loading branch information
semenInRussia committed Jun 20, 2024
1 parent e410e39 commit d2a3e9b
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 476 deletions.
9 changes: 0 additions & 9 deletions lisp/languages/my-bib.el
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
;;; my-bib.el --- My configuration for bibliography management -*- lexical-binding: t; -*-

;; Copyright (C) 2022-2023 semenInRussia

;; Author: semenInRussia <hrams205@gmail.com>

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; My configuration for bibliography management.

;;; Code:

(require 'my-leaf)

(require 'dash)


(leaf bibtex
:custom ((bibtex-align-at-equal-sign . t)
(bibtex-user-optional-fields .
Expand Down
2 changes: 0 additions & 2 deletions lisp/languages/my-calc.el
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
;;; my-calc.el --- My configuration of `calc' -*- lexical-binding: t; -*-

;; Copyright (C) 2022-23 semenInRussia

;;; Commentary:

;; My configuration of `calc'. For main configuration of the `calc' visit
;; the file ~/.emacs.d/calc.el created automatically by `calc'

Expand Down
2 changes: 1 addition & 1 deletion lisp/languages/my-docker.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(require 'my-leaf)

(leaf dockerfile-mode
:ensure (dockerfile-mode :repo "spotify/dockerfile-mode" :host github))
:ensure t)

(provide 'my-docker)
;;; my-docker.el ends here
1 change: 0 additions & 1 deletion lisp/languages/my-elixir.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
:after elixir-mode eglot
:defvar eglot-server-programs
:config
(require 'eglot)
(add-to-list 'eglot-server-programs '(elixir-mode "~/temp/language_server.sh"))
(add-hook 'elixir-mode-hook 'my-lsp-ensure))

Expand Down
2 changes: 1 addition & 1 deletion lisp/languages/my-elm.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(require 'my-leaf)

(leaf elm-mode
:ensure (elm-mode :repo "jcollard/elm-mode" :host github)
:ensure t
:hook (elm-mode-hook . my-lsp-ensure)
:bind (:elm-mode-map
([remap my-format-expression] . elm-format)))
Expand Down
4 changes: 2 additions & 2 deletions lisp/languages/my-go.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; my-go.el --- My configuration of the `go'

;; Copyright (C) 2022 semenInRussia
;; Copyright (C) 2022-2024 semenInRussia

;; Author: semenInRussia <hrams205@gmail.com>
;; Version: 0.1
Expand Down Expand Up @@ -33,7 +33,7 @@


(leaf go-mode
:ensure (go-mode :repo "dominikh/go-mode.el" :host github)
:ensure t
:hook (go-mode-hook . my-lsp-ensure))

(provide 'my-go)
Expand Down
5 changes: 1 addition & 4 deletions lisp/languages/my-haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
(require 'my-leaf)


(defvar flymake-allowed-file-name-masks)

(leaf haskell-mode
:ensure (haskell-mode :repo "haskell/haskell-mode" :host github)
:defvar flymake-allowed-file-name-masks
:ensure t
;; :ensure-system-package (("hoogle" . "cabal install hoogle"))
:hook ((haskell-mode-hook . haskell-indent-mode)
(haskell-mode-hook . interactive-haskell-mode)
Expand Down
8 changes: 4 additions & 4 deletions lisp/languages/my-html.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
(leaf mhtml-mode
:mode "\\.html$"
:hook (mhtml-mode-hook . my-lsp-ensure)
:config ;nofmt
:config
(leaf auto-rename-tag
:ensure (auto-rename-tag :repo "jcs-elpa/auto-rename-tag" :host github))

(leaf tagedit
:ensure (tagedit :repo "magnars/tagedit" :host github))
;; (leaf tagedit
;; :ensure (tagedit :repo "magnars/tagedit" :host github))

(leaf emmet-mode
:ensure (emmet-mode :repo "smihica/emmet-mode" :host github)
:ensure t
:hook mhtml-mode-hook)

;;; DEPRECATED: I don't use it
Expand Down
2 changes: 1 addition & 1 deletion lisp/languages/my-js.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
(leaf js
:defvar lsp-bridge-single-lang-server-mode-list
:hook (js-mode-hook . my-lsp-ensure)
:defvar lsp-bridge-multi-lang-server-mode-list
;; :defvar lsp-bridge-multi-lang-server-mode-list
:mode "\\.js$"
:config
;; (if (not (require 'lsp-bridge nil :noerror))
Expand Down
10 changes: 2 additions & 8 deletions lisp/languages/my-json.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@
:ensure (json-mode :repo "joshwnj/json-mode" :host github)
:bind (:json-mode-map
([:remap my-format-expression] . json-pretty-print-buffer))

:setq-default (js-indent-level . 2)
:hook (json-mode-hook . my-json-fix-indent-funcs)

:config
(leaf json-snatcher
:ensure (json-snatcher :repo "Sterlingg/json-snatcher" :host github)
:bind (:json-mode-map
:package json-mode
("C-c M-w" . jsons-print-path)))

(defun my-json-fix-indent-funcs ()
"Fix the functions that changes indent in JSON files."
(interactive)
(setq-local js-indent-level 2)))
("C-c M-w" . jsons-print-path))))

(provide 'my-json)
;;; my-json.el ends here
32 changes: 8 additions & 24 deletions lisp/languages/my-latex.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
(require 'smartparens)


(defvar latex-documentclasses
'("article"
"reoport"
"book"
"proc"
"minimal"
"slides"
"memoir"
"letter"
"beamer")
"List of the names for built-in LaTeX documentclasses.")

(add-hook 'LaTeX-mode-hook 'my-latex-disable-auto-fill)

(leaf auctex
:ensure (auctex :repo "emacs-straight/auctex" :host github)
:mode ("\\.tex$" . latex-mode))
Expand All @@ -46,13 +32,12 @@
("C-c C-w" . my-latex-kill-section))
:config
(leaf xenops
:ensure (xenops :repo "dandavison/xenops")
:ensure t
:hook LaTeX-mode-hook
:custom (xenops-math-image-scale-factor . 2))

(leaf my-latex-insert
:load-path* "lisp/languages/latex/"
:hook (LaTeX-mode-hook . my-latex-expansion-mode))
;; (leaf my-latex-insert
;; :hook (LaTeX-mode-hook . my-latex-expansion-mode))

(leaf laas
:ensure (laas :repo "tecosaur/LaTeX-auto-activating-snippets" :host github)
Expand Down Expand Up @@ -113,12 +98,11 @@
;; ("C-c M-n" . 'latex-r-cycle-math-parens)
;; ("C-c C-s" . 'latex-r-split-environment)))

(defun my-latex-disable-auto-fill ()
"Disable `auto-fill-mode'."
(interactive)
(auto-fill-mode 0))

(setopt TeX-fold-macro-spec-list '(("{1}" ("emph")))))
;; (defun my-latex-disable-auto-fill ()
;; "Disable `auto-fill-mode'."
;; (interactive)
;; (auto-fill-mode 0))
)

(provide 'my-latex)
;;; my-latex.el ends here
10 changes: 6 additions & 4 deletions lisp/languages/my-typst.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

(require 'my-autoformat)
(declare-function my-autoformat-bind-for-major-mode "my-autoformat")
(my-autoformat-bind-for-major-mode 'typst-ts-mode
'autoformat-typst-capitalize-heading-line
'autoformat-typst-capitalize-list-item
'my-autoformat-sentence-capitalization)
(my-autoformat-bind-for-major-mode
'typst-ts-mode
;; --
'autoformat-typst-capitalize-heading-line
'autoformat-typst-capitalize-list-item
'my-autoformat-sentence-capitalization)

(with-eval-after-load 'eglot
(defvar eglot-server-programs)
Expand Down
3 changes: 1 addition & 2 deletions lisp/languages/my-yaml.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
;; My configuration of yaml: markup language

;;; Code:

(require 'leaf)
(require 'my-leaf)

(leaf yaml-mode
:ensure t)
Expand Down
72 changes: 71 additions & 1 deletion lisp/local-projects/my-config-funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@

;;; Code:
(require 'f)
(require 'my-lib)

(defvar my-local-project-was-updated nil
"Variable is non-nil if one of my \"local-project\" was edited.
If before exit Emacs this variable is non-nil byte-compile
local-projects autoloads.
Will be changed automatically if you use
`my-do-autoload-for-local-projects-files'")

(defun my-maybe-byte-compile-local-projects-autoloads ()
(when my-local-project-was-updated
(my-byte-compile-local-projects-autoloads)))

;;;###autoload
(define-minor-mode my-autoautoload-local-mode
"A minor mode which update autoloads for local-projects on save.
After before kill try to byte-compile this autoloads"
:group 'me
(if my-autoautoload-local-mode
(progn (add-hook 'after-save-hook #'my-do-autoload-for-local-projects-files nil 'local)
(add-hook 'kill-emacs-hook #'my-maybe-byte-compile-local-projects-autoloads))
(progn (remove-hook 'after-save-hook #'my-do-autoload-for-local-projects-files)
(remove-hook 'kill-emacs-hook #'my-maybe-byte-compile-local-projects-autoloads))))

;;;###autoload
(defun my-do-autoload-for-local-projects-files ()
Expand Down Expand Up @@ -104,7 +130,7 @@
(or (not byte-native-compiling)
(and byte-native-compiling byte+native-compile)))
(goto-char (point-max))
(insert "\n") ; aaah, unix.
(insert "\n") ; aaah, unix.
(cond
((and (file-writable-p target-file)
;; We attempt to create a temporary file in the
Expand Down Expand Up @@ -159,5 +185,49 @@
(write-region (point-min) (point-max) dynvar-file)))))
t)))

(declare-function my-build-config "my-build-config")

;;;###autoload
(defun my-restart-build ()
"Restart Emacs with rebuild the config before."
(interactive)
(my-build-config)
(restart-emacs))

;;;###autoload
(defun my-new-config-module (module-name &optional directory)
"Create a new configuration file named MODULE-NAME in the DIRECTORY.
DIRECTORY defaults to ~/.emacs.d/lisp/"
(interactive "sName of the configuration module: \nDDirectory: ")
(setq directory (or directory user-emacs-directory))
(->> module-name
(s-append ".el")
(s-prepend "my-")
(s-prepend directory)
find-file)
(insert
(s-replace
"writing-config"
module-name
(format
";;; my-writing-config.el --- My configuration of writing-config -*- lexical-binding: t; -*-
;; Copyright (C) %s semenInRussia
;; Author: semenInRussia <hrams205@gmail.com>
;;; Commentary:
;; My configuration of writing-config.
;;; Code:
(require 'my-leaf)
(leaf writing-config)
(provide 'my-writing-config)
;;; my-writing-config.el ends here"
(my-current-year))))
(search-backward "(leaf "))

(provide 'my-config-funcs)
;;; my-config-funcs.el ends here
29 changes: 0 additions & 29 deletions lisp/misc/my-annotate.el

This file was deleted.

9 changes: 1 addition & 8 deletions lisp/misc/my-eshell.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@
([remap beginning-of-line-text] . 'eshell-begin-on-new-line))))

(leaf eshell-git-prompt
:ensure t
:hook (ehsell-mode-hook . my-disable-hl-line-mode)
:config
(defun my-disable-hl-line-mode ()
"Don't highlight the line at point, if this mode is enabled.
This mode is called `hl-line-mode'."
(hl-line-mode 0)))
:ensure t)

(provide 'my-eshell)
;;; my-eshell.el ends here
Loading

0 comments on commit d2a3e9b

Please sign in to comment.