Reorganize, change cp-set-keys to bind-keys

Change use-package calls to non-package libraries, to support
use-package-always-ensure
This commit is contained in:
contrapunctus 2022-01-13 23:00:23 +05:30
parent b3bd77ae53
commit 8a42f22b59
1 changed files with 87 additions and 101 deletions

188
init.org
View File

@ -304,8 +304,9 @@ Doesn't work in my current main browser (Tor Browser), and thus barely used of l
load-prefer-newer t
;; disable the disabled commands behavior
disabled-command-function nil
custom-file "~/.emacs.d/custom.el"
edebug-print-length nil)
custom-file "~/.emacs.d/custom.el"
edebug-print-length nil
ispell-dictionary "en")
(setq-default undo-limit (* 80 1000))
(load custom-file))
#+END_SRC
@ -333,7 +334,6 @@ Doesn't work in my current main browser (Tor Browser), and thus barely used of l
("<f2> P" . ag-project-regexp)
:config
(setq ag-highlight-search t))
#+END_SRC
** Swiper
@ -764,7 +764,7 @@ choice.el is required by =chronometrist-key-values=
*** goal
#+BEGIN_SRC emacs-lisp
(use-package chronometrist-goal
:load-path "/media/data/anon/Documents/programming/elisp/chronometrist/elisp/"
:load-path "~/.emacs.d/contrapunctus/chronometrist-goal/"
:hook (chronometrist-mode . chronometrist-goal-minor-mode)
:config
(setq chronometrist-goal-list
@ -1323,7 +1323,7 @@ FIXME -
#+BEGIN_SRC emacs-lisp
(use-package request)
(use-package esxml-query)
(use-package esxml)
(defun my-get-changeset-comment (changeset)
(->> (esxml-query "[k=comment]" changeset)
@ -1594,17 +1594,36 @@ An example of querying the Chronometrist file data - finding out how much time I
#+BEGIN_SRC emacs-lisp
(use-package emms
:after hydra
:init (setq emms-info-functions '(emms-info-tinytag))
:bind
("<f2> e" . #'contrapunctus-emms-hydra/body)
("<f2> E" . #'emms)
(:map dired-mode-map
("E" . #'contrapunctus-emms-hydra/body))
(:map emms-playlist-mode-map
("0" . #'emms-volume-raise)
("9" . #'emms-volume-lower)
("<up>" . #'emms-volume-raise)
("<down>" . #'emms-volume-lower)
("<left>" . #'emms-seek-backward)
("<right>" . #'emms-seek-forward)
("r" . #'next-line)
("c" . #'previous-line)
("R" . #'emms-next)
("C" . #'emms-previous)
("C-r" . #'emms-toggle-random-playlist)
("M-r" . #'emms-random)
("C-c" . #'emms-playlist-mode-center-current)
("SPC" . #'emms-pause)
("K" . #'emms-playlist-clear))
:commands
(emms-minimalistic emms emms-play-dired emms-add-dired)
:config
(emms-minimalistic)
(emms-default-players)
(setq emms-player-mpv-parameters #'my-emms-mpv-parameters)
(setq emms-player-mpv-parameters #'my-emms-mpv-parameters
emms-playlist-buffer-name "EMMS Playlist"
emms-info-tinytag-python-name "python3")
;; ;; This won't work for `emms-random', because it runs in a `save-excursion'
;; (add-to-list 'emms-playlist-selection-changed-hook 'emms-playlist-mode-center-current)
;; (--map (add-to-list 'emms-player-mpv-parameters it)
@ -1650,35 +1669,8 @@ An example of querying the Chronometrist file data - finding out how much time I
(append '("--sub-files="))
(apply #'concat)
(list)))))
(use-package emms-playlist-mode
:bind
(:map emms-playlist-mode-map
("0" . #'emms-volume-raise)
("9" . #'emms-volume-lower)
("<up>" . #'emms-volume-raise)
("<down>" . #'emms-volume-lower)
("<left>" . #'emms-seek-backward)
("<right>" . #'emms-seek-forward)
("r" . #'next-line)
("c" . #'previous-line)
("R" . #'emms-next)
("C" . #'emms-previous)
("C-r" . #'emms-toggle-random-playlist)
("M-r" . #'emms-random)
("C-c" . #'emms-playlist-mode-center-current)
("SPC" . #'emms-pause)
("K" . #'emms-playlist-clear))
:config
(setq emms-playlist-buffer-name "EMMS Playlist"))
(use-package emms-info-tinytag
:init
(setq emms-info-functions '(emms-info-tinytag))
:config
(setq emms-info-tinytag-python-name "python3"))
#+END_SRC
** Internet
*** eww
#+BEGIN_SRC emacs-lisp
@ -1724,8 +1716,8 @@ Ask for confirmation before saving cookies. I'd rather just disallow them all th
(use-package url-cookie
:config
(setq url-cookie-confirmation t))
#+END_SRC
*** elpher
#+BEGIN_SRC emacs-lisp
(use-package elpher
@ -1774,15 +1766,7 @@ Ask for confirmation before saving cookies. I'd rather just disallow them all th
("I" . sxiv)))
#+END_SRC
**
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "~/.emacs.d/contrapunctus/")
;; (load "cp-evil")
(require 'cp-sfz)
(require 'cp-lisp)
;; (ispell-change-dictionary "en")
(setq ispell-dictionary "en")
#+END_SRC
** TODO emacsshot
@ -2087,11 +2071,8 @@ PR ideas
:bind ("M-x" . counsel-M-x)
:config
(setq counsel-find-file-ignore-regexp "\\`\\."))
;; (use-package elsa
;; :commands flycheck-elsa-setup)
#+END_SRC
** Ivy
#+BEGIN_SRC emacs-lisp
(use-package ivy
@ -2795,14 +2776,13 @@ Don't try to check if there are files with a certain extension...it will lead to
(interactive)
(find-tag (find-tag-default)))
(cp-set-keys
:bindings
`((,(kbd "M-t M-t") find-tag-no-prompt-other-window)
(,(kbd "M-t M-g") find-tag-no-prompt)
(,(kbd "M-t M-p") pop-tag-mark)
(,(kbd "M-t M-f") find-tag)
(,(kbd "M-t M-s") tags-search)
(,(kbd "M-t M-c") tags-loop-continue)))
(bind-keys
("M-t M-t" . find-tag-no-prompt-other-window)
("M-t M-g" . find-tag-no-prompt)
("M-t M-p" . pop-tag-mark)
("M-t M-f" . find-tag)
("M-t M-s" . tags-search)
("M-t M-c" . tags-loop-continue))
;; (require 'view)
;; (cp-set-keys
@ -2819,23 +2799,22 @@ Don't try to check if there are files with a certain extension...it will lead to
;;;; mark ring
;;;; Other custom keys
(cp-set-keys
:bindings
`((,(kbd "C-x C-1") delete-other-windows)
(,(kbd "C-x C-2") split-window-below)
(,(kbd "C-x C-3") split-window-right)
(,(kbd "C-x C-0") delete-window)
(,(kbd "C-x C-4 C-f") find-file-other-window)
;; (,(kbd "C-`") point-to-register)
;; (,(kbd "C-'") jump-to-register)
(,(kbd "C-x C-d") dired-jump)
;; I usually keep Super for the window manager and global hotkeys...
(,(kbd "s-i") imenu)
;; keypad
(bind-keys
("C-x C-1" . delete-other-windows)
("C-x C-2" . split-window-below)
("C-x C-3" . split-window-right)
("C-x C-0" . delete-window)
("C-x C-4 C-f" . find-file-other-window)
;; ("C-`" . point-to-register)
;; ("C-'" . jump-to-register)
("C-x C-d" . dired-jump)
;; I usually keep Super for the window manager and global hotkeys...
("s-i" . imenu)
;; keypad
;; set this to run whatever command is bound to C-c C-c, or maybe just C-c
;; see (info "(elisp)Translation Keymaps")
))
;; set this to run whatever command is bound to C-c C-c, or maybe just C-c
;; see (info "(elisp)Translation Keymaps")
)
(with-eval-after-load 'dired
(define-key dired-mode-map (kbd "b") 'dired-up-directory)
@ -3666,14 +3645,13 @@ whole-line-or-region-kill-ring-save instead."
(forward-char -1)
(forward-sexp)
(copy-region-as-kill point-a (- (point) 1))))))
(cp-set-keys
:keymap markdown-mode-map
:bindings
`((,(kbd "M-w") cp/copy-md-link)
(,(kbd "TAB") markdown-cycle)
(,(kbd "C-c C-.") markdown-demote)
(,(kbd "C-c C-,") markdown-promote)
(,(kbd "C-c C-l") markdown-insert-link))))
(bind-keys
(:map markdown-mode-map
("M-w" . cp/copy-md-link)
("TAB" . markdown-cycle)
("C-c C-." . markdown-demote)
("C-c C-," . markdown-promote)
("C-c C-l" . markdown-insert-link))))
(defun cp/copy-bus-entry ()
"For personal use, when working between Markdown and the OSM wiki."
@ -4124,28 +4102,6 @@ Create advice for =lispy-pair= - if =lispy--in-string-or-comment-p= is true, sel
:CREATED: 2022-01-13T21:03:15+0530
:END:
#+BEGIN_SRC emacs-lisp
(setq scheme-program-name "csi -:c")
(setq comint-prompt-read-only t)
(use-package geiser
:mode ("\\.scm\\'" . geiser-mode)
:commands (run-chicken run-guile geiser-mode)
:custom (geiser-active-implementations '(chicken))
:config (setq geiser-scheme-implementation 'chicken))
;; (with-eval-after-load 'geiser-mode
;; (setq geiser-mode-smart-tab-p t)
;; (define-key geiser-mode-map (kbd "C-.") nil)
;; ;; (cp-set-keys
;; ;; :unset t
;; ;; :keymap geiser-mode-map
;; ;; :bindings
;; ;; `((,(kbd "C-."))))
;; )
(use-package scheme-mode
:mode ("\\.scm\\'" . scheme-mode)
:interpreter "csi")
(defun contrapunctus-lisp-copy (arg)
"Run `whole-line-or-region-copy-region-as-kill' if region is
active, else `sp-copy-sexp'."
@ -4193,6 +4149,12 @@ active, else `sp-copy-sexp'."
:bind (:map ielm-map
("M-'" . sp-indent-defun)))
#+END_SRC
#+BEGIN_SRC emacs-lisp
;; (use-package elsa
;; :commands flycheck-elsa-setup)
#+END_SRC
*** literate-elisp
#+BEGIN_SRC emacs-lisp
(use-package literate-elisp
@ -4344,6 +4306,30 @@ All COMMAND-SPECS should be a list in the form
(add-hook 'lisp-mode-hook 'set-cl-repl-keys)
#+END_SRC
** Scheme
#+BEGIN_SRC emacs-lisp
(setq scheme-program-name "csi -:c")
(setq comint-prompt-read-only t)
(use-package geiser
:mode ("\\.scm\\'" . geiser-mode)
:commands (run-chicken run-guile geiser-mode)
:custom (geiser-active-implementations '(chicken))
:config (setq geiser-scheme-implementation 'chicken))
;; (with-eval-after-load 'geiser-mode
;; (setq geiser-mode-smart-tab-p t)
;; (define-key geiser-mode-map (kbd "C-.") nil)
;; ;; (cp-set-keys
;; ;; :unset t
;; ;; :keymap geiser-mode-map
;; ;; :bindings
;; ;; `((,(kbd "C-."))))
;; )
(use-package scheme-mode
:mode ("\\.scm\\'" . scheme-mode)
:interpreter "csi")
#+END_SRC
*** CHICKEN Scheme
*** Guile
** Lilypond