199 lines
6.1 KiB
EmacsLisp
199 lines
6.1 KiB
EmacsLisp
;;; obsolete.el --- code I don't use anymore -*- lexical-binding: t; -*-
|
|
|
|
;; Copyright (C) 2023 mitch
|
|
|
|
;; Author: mitch <mitch@mitchmarq42.xyz>
|
|
;; Keywords:local,maint
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
;; it under the terms of the GNU General Public License as published by
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
;; (at your option) any later version.
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
;; GNU General Public License for more details.
|
|
|
|
;; 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:
|
|
|
|
;; All the code here is taken from my other files. This is never meant to be
|
|
;; loaded.
|
|
|
|
;;; Code:
|
|
|
|
;; scribble SVGs in org buffers like it's 2005 (idk I was a baby then)
|
|
(use-package edraw
|
|
:elpaca (:repo "https://github.com/misohena/el-easydraw")
|
|
:after org
|
|
:config
|
|
(require 'edraw-org)
|
|
(edraw-org-setup-default)
|
|
;; following function taken from https://github.com/wn/doom.d/blob/46ca46f2ef21e933fb76b1568be1a62b262ed288/config.el#L47
|
|
(defun org-mode-open-edraw (&optional filename)
|
|
(interactive)
|
|
(let ((filename (or filename
|
|
(concat "./"
|
|
(file-relative-name
|
|
(read-file-name (edraw-msg "Write svg file: ")
|
|
default-directory)
|
|
default-directory)))))
|
|
(insert (format "[[edraw:file=%s]]" filename))
|
|
(backward-char)
|
|
(org-return))))
|
|
|
|
|
|
(use-package yascroll
|
|
:diminish
|
|
:defer 1
|
|
;; :if (not (display-graphic-p))
|
|
:custom (yascroll:delay-to-hide nil)
|
|
;; :custom-face
|
|
;; (yascroll:thumb-fringe
|
|
;; ((t (:background "green3"))))
|
|
:config
|
|
(defun yascroll:make-thumb-overlay-fringe (left-or-right)
|
|
"Make thumb overlay on the LEFT-OR-RIGHT fringe."
|
|
(let* ((pos (point))
|
|
;; If `pos' is at the beginning of line, overlay of the
|
|
;; fringe will be on the previous visual line.
|
|
(pos (if (= (line-end-position) pos) pos (1+ pos)))
|
|
;; below originally said `filled-rectangle' instead of `empty-line'.
|
|
;; Changed to fix transparency.
|
|
(display-string `(,left-or-right empty-line yascroll:thumb-fringe))
|
|
(after-string (propertize "." 'display display-string))
|
|
(overlay (make-overlay pos pos)))
|
|
(overlay-put overlay 'after-string after-string)
|
|
(overlay-put overlay 'fringe-helper t)
|
|
(overlay-put overlay 'window (selected-window))
|
|
(overlay-put overlay 'priority yascroll:priority)
|
|
overlay))
|
|
(add-to-list 'yascroll:disabled-modes 'org-mode)
|
|
;; (global-yascroll-bar-mode 1)
|
|
)
|
|
|
|
(remove '(?< . ?>) electric-pair-pairs)
|
|
(electric-pair-mode -1)
|
|
(defvar org-electric-pairs '((?_ . ?_)
|
|
(?/ . ?/)
|
|
(?* . ?*)
|
|
(?+ . ?+)
|
|
(?~ . ?~)
|
|
(?= . ?=))
|
|
"Electric pairs for org-mode.
|
|
|
|
See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode-specific-pairs-for-electric-pair-mode")
|
|
(defun org-add-electric-pairs ()
|
|
(setq-local electric-pair-pairs (append electric-pair-pairs org-electric-pairs))
|
|
(setq-local electric-pair-text-pairs electric-pair-pairs))
|
|
(add-hook 'org-mode-hook 'org-add-electric-pairs)
|
|
(require 'mitch-orgstuff)
|
|
(general-define-key
|
|
:states '(normal visual insert)
|
|
:keymaps 'org-mode-map
|
|
"_" 'mitch/org-dwim-char
|
|
"/" 'mitch/org-dwim-char
|
|
"*" 'mitch/org-dwim-char
|
|
"+" 'mitch/org-dwim-char
|
|
"~" 'mitch/org-dwim-char
|
|
"=" 'mitch/org-dwim-char)
|
|
(use-package org-modern-indent
|
|
:elpaca (:host github :repo "jdtsmith/org-modern-indent")
|
|
:diminish org-indent-mode
|
|
:hook (org-mode . org-indent-mode)
|
|
:config (add-hook 'org-mode-hook #'org-modern-indent-mode 90))
|
|
(use-package org-block-capf
|
|
:elpaca (org-block-capf
|
|
:host github
|
|
:repo "xenodium/org-block-capf")
|
|
:after org
|
|
:init (add-hook 'org-mode-hook
|
|
#'org-block-capf-add-to-completion-at-point-functions))
|
|
|
|
(use-package org-pretty-table
|
|
:elpaca (org-pretty-table
|
|
:host github
|
|
:repo "Fuco1/org-pretty-table")
|
|
:diminish
|
|
:hook (org-mode . org-pretty-table-mode))
|
|
;; Tree-sitter (disabled because broken?)
|
|
(use-package treesit-auto
|
|
:elpaca (treesit-auto
|
|
:host github
|
|
:repo "renzmann/treesit-auto")
|
|
:custom (treesit-auto-install 'prompt)
|
|
;; :init (add-to-list 'treesit-auto-fallback-alist '(bash-ts-mode . sh-mode))
|
|
)
|
|
;; see https://www.reddit.com/r/emacs/comments/xyo2fo/orgmode_vterm_tmux/
|
|
(use-package ob-tmux
|
|
:after (org dash)
|
|
:config
|
|
(setq org-src-lang-modes (-replace
|
|
'("tmux" . sh)
|
|
'("tmux" . powershell)
|
|
org-src-lang-modes))
|
|
:custom
|
|
(org-babel-default-header-args:tmux
|
|
'((:results . "display")
|
|
(:session . "default")
|
|
(:socket . nil)))
|
|
(org-babel-tmux-session-prefix "ob-")
|
|
(org-babel-tmux-terminal "/home/mitch/.local/bin/emacs-term-shim.sh")
|
|
(org-babel-tmux-terminal-opts))
|
|
|
|
(use-package org-modern
|
|
:after org
|
|
:custom
|
|
(org-modern-tag nil)
|
|
(org-modern-todo nil)
|
|
(org-modern-block-name nil)
|
|
(org-modern-table nil)
|
|
(org-modern-hide-stars nil)
|
|
(org-modern-star nil)
|
|
;; (org-modern-block-fringe 16)
|
|
:hook (org-mode . org-modern-mode)
|
|
:config
|
|
)
|
|
|
|
|
|
|
|
;; svg-tags; disabled because reasons
|
|
(use-package svg-tag-mode
|
|
:elpaca (svg-tag-mode
|
|
:host github
|
|
:repo "rougier/svg-tag-mode")
|
|
;; :after org-modern
|
|
:hook (org-modern-mode . svg-tag-mode)
|
|
:custom (svg-tag-tags
|
|
`((,(rx blank (group (= 4 upper)) blank) .
|
|
((lambda (tag)
|
|
(svg-tag-make tag
|
|
:inverse t
|
|
:face (intern
|
|
(format "org-%s" (downcase tag)))))))
|
|
(,(rx (group "#+" (or "begin" "end") "_src")) .
|
|
((lambda (tag)
|
|
(let* ((begend (string-trim tag "#\\+" "_src"))
|
|
(upcased (upcase begend)))
|
|
(svg-tag-make upcased
|
|
:face 'org-block-begin-line)))))))
|
|
)
|
|
|
|
;; disabled because error and useless
|
|
(use-package aggressive-indent
|
|
:after paredit
|
|
:commands aggressive-indent-mode
|
|
:hook (emacs-lisp-mode . aggresssive-indent-mode))
|
|
|
|
|
|
|
|
(error "Please don't load `obsolete.el', it's obsolete.")
|
|
|
|
(provide 'obsolete)
|
|
;;; obsolete.el ends here
|
|
|
|
|