├── snippets
├── js2-mode
│ └── .yas-parents
├── rjsx-mode
│ └── .yas-parents
├── web-mode
│ └── .yas-parents
├── clojure-mode
│ ├── div
│ ├── div-class
│ ├── cljsbuild
│ └── defproject
├── sh-mode
│ ├── if
│ ├── ife
│ ├── case
│ ├── trap
│ └── getopts
├── js-mode
│ ├── sp.yasnippet
│ ├── ss.yasnippet
│ ├── r.yasnippet
│ ├── cc.yasnippet
│ ├── rr.yasnippet
│ ├── gdp.yasnippet
│ ├── gis.yasnippet
│ ├── cwm.yasnippet
│ ├── cwum.yasnippet
│ ├── cdm.yasnippet
│ ├── cwrp.yasnippet
│ ├── cwu.yasnippet
│ ├── scu.yasnippet
│ ├── cdu.yasnippet
│ ├── rcc.yasnippet
│ └── fc.yasnippet
├── emacs-lisp-mode
│ ├── autoload-cookie
│ ├── use-package
│ └── use-package-straight
└── markdown-mode
│ ├── journal
│ └── frontmatter
├── screenshot.png
├── bin
├── dark-mode-notifier
├── applescript-helper
├── install-parinfer-rust-library
├── update-emacs
├── install-utilities
├── dark-mode-notifier.swift
├── install-emacs-plus
├── build-utils
└── build-emacs
├── .gitignore
├── eshell
└── alias
├── LICENSE
├── lisp
├── log-mode.el
├── polymode-setup.el
├── buttonize.el
├── anychange.el
├── m-mail.el
├── highlight-things.el
├── tagger.el
├── exec-path-from-shell.el
├── fiat-color.el
└── ldap-mode.el
├── TODO.org
├── early-init.el
├── README.org
└── TODO.org_archive
/snippets/js2-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | js-mode
--------------------------------------------------------------------------------
/snippets/rjsx-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | js-mode
--------------------------------------------------------------------------------
/snippets/web-mode/.yas-parents:
--------------------------------------------------------------------------------
1 | js-mode
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mnewt/dotemacs/HEAD/screenshot.png
--------------------------------------------------------------------------------
/bin/dark-mode-notifier:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mnewt/dotemacs/HEAD/bin/dark-mode-notifier
--------------------------------------------------------------------------------
/snippets/clojure-mode/div:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: div
3 | # key: d
4 | # --
5 | (d/div {}
6 | $0)
--------------------------------------------------------------------------------
/snippets/sh-mode/if:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: if
3 | # key: if
4 | # --
5 | if ${1:cond}; then
6 | $0
7 | fi
--------------------------------------------------------------------------------
/snippets/clojure-mode/div-class:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: div-class
3 | # key: d.
4 | # --
5 | (d/div {:className "$1"}$0)
--------------------------------------------------------------------------------
/snippets/js-mode/sp.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#setProps
3 | # key: sp
4 | # --
5 | this.setProps({$0});
6 |
--------------------------------------------------------------------------------
/snippets/js-mode/ss.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#setState
3 | # key: ss
4 | # --
5 | this.setState({$0});
6 |
--------------------------------------------------------------------------------
/snippets/emacs-lisp-mode/autoload-cookie:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: autoload-cookie
3 | # key: alc
4 | # --
5 | ;;;###autoload
6 |
--------------------------------------------------------------------------------
/snippets/js-mode/r.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#render
3 | # key: r
4 | # --
5 | render: function() {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/emacs-lisp-mode/use-package:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: use-package
3 | # key: up
4 | # --
5 | (use-package ${1:package-name}
6 | $0)
--------------------------------------------------------------------------------
/snippets/js-mode/cc.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React.createClass
3 | # key: cc
4 | # --
5 | React.createClass({
6 | $0
7 | });
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/rr.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React.render
3 | # key: rr
4 | # --
5 | React.render(
6 | $1,
7 | $0
8 | );
9 |
--------------------------------------------------------------------------------
/snippets/sh-mode/ife:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: ife
3 | # key: ife
4 | # --
5 | if ${1:cond}; then
6 | $0
7 | else
8 |
9 | fi
10 |
--------------------------------------------------------------------------------
/snippets/js-mode/gdp.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#getDefaultProps
3 | # key: gdp
4 | # --
5 | getDefaultProps: function() {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/gis.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#getInitialState
3 | # key: gis
4 | # --
5 | getInitialState: function() {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/cwm.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentWillMount
3 | # key: cwm
4 | # --
5 | componentWillMount: function() {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/cwum.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentWillUnmount
3 | # key: cwum
4 | # --
5 | componentWillUnmount: function() {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/sh-mode/case:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: case
3 | # key: case
4 | # --
5 | case ${1:thing} in
6 | ${2:option1})
7 | ${0:thing_to_do}
8 | ;;
9 | esac
--------------------------------------------------------------------------------
/snippets/js-mode/cdm.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentDidMount
3 | # key: cdm
4 | # --
5 | componentDidMount: function(${1:rootNode}) {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/cwrp.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentWillReceiveProps
3 | # key: cwrp
4 | # --
5 | componentWillReceiveProps: function(${1:nextProps}) {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/cwu.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentWillUpdate
3 | # key: cwu
4 | # --
5 | componentWillUpdate: function(${1:nextProps}, ${2:nextState}) {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/js-mode/scu.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#shouldComponentUpdate
3 | # key: scu
4 | # --
5 | shouldComponentUpdate: function(${1:nextProps}, ${2:nextState}) {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/emacs-lisp-mode/use-package-straight:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: use-package-straight
3 | # key: ups
4 | # --
5 | :straight
6 | (:type ${1:git} :host ${2:github} :repo "${3:user/repo}")
7 | $0)
--------------------------------------------------------------------------------
/snippets/js-mode/cdu.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#componentDidUpdate
3 | # key: cdu
4 | # --
5 | componentDidUpdate: function(${1:prevProps}, ${2:prevState}, ${3:rootNode}) {
6 | $0
7 | }
8 |
--------------------------------------------------------------------------------
/snippets/sh-mode/trap:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: trap
3 | # key: trap
4 | # --
5 | ${1:touch /tmp/temp_file}
6 |
7 | function cleanup {
8 | ${0:rm -rf /tmp/temp_file}
9 | }
10 |
11 | trap cleanup EXIT
12 |
--------------------------------------------------------------------------------
/snippets/markdown-mode/journal:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: journal
3 | # key: journal
4 | # expand-env: ((journal-date (file-name-base buffer-file-name)))
5 | # --
6 | ---
7 | title: `journal-date`
8 | date: `journal-date`
9 | number: $1
10 | ---
11 | $0
--------------------------------------------------------------------------------
/snippets/sh-mode/getopts:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: getopts
3 | # key: getopts
4 | # --
5 | while getopts ":$1" opt; do
6 | case $opt in
7 | -o)
8 | $0
9 | ;;
10 | *)
11 | echo "usage: $(basename \$0) [+-f} [--] ARGS..."
12 | exit 2
13 | esac
14 | done
15 | shift $(expr $OPTIND - 1)
16 | OPTIND=1
17 |
--------------------------------------------------------------------------------
/snippets/js-mode/rcc.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#classComponent
3 | # key: rcc
4 | # expand-env: ((name (file-name-nondirectory (file-name-sans-extension (buffer-file-name)))))
5 | # --
6 | import React from 'react';
7 |
8 | export default class ${1:`name`} extends React.Component {
9 | constructor(props) {
10 | super(props);
11 | }
12 | render() {
13 | return (
14 | $0
15 | );
16 | }
17 | }
--------------------------------------------------------------------------------
/bin/applescript-helper:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # https://www.emacswiki.org/emacs/AppleScript
3 |
4 | if [ "$1" = "-d" ]; then
5 | RANDOMFILE="applescript${RANDOM}.scpt"
6 | cat /dev/stdin >"/tmp/$RANDOMFILE"
7 | osadecompile "/tmp/$RANDOMFILE"
8 | rm "/tmp/$RANDOMFILE"
9 | else
10 | RANDOMFILE="applescript${RANDOM}.scpt"
11 | osacompile -o "/tmp/$RANDOMFILE"
12 | cat "/tmp/$RANDOMFILE"
13 | rm "/tmp/$RANDOMFILE"
14 | fi
15 |
--------------------------------------------------------------------------------
/snippets/js-mode/fc.yasnippet:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: React#functionComponent
3 | # key: fc
4 | # --
5 | import React from 'react';
6 | import PropTypes from 'prop-types';
7 |
8 | const propTypes = {};
9 |
10 | const defaultProps = {};
11 |
12 | const ${1:Component} = (props) => {};
13 |
14 | ${1:Component}.propTypes = propTypes;
15 | ${1:Component}.defaultProps = defaultProps;
16 |
17 | export default ${1:Component};
18 |
--------------------------------------------------------------------------------
/bin/install-parinfer-rust-library:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Build and install parinfer-rust library.
3 |
4 | cd ~/code
5 | [[ -d parinfer-rust ]] || git clone https://github.com/eraserhd/parinfer-rust.git
6 | cd ~/code/parinfer-rust
7 | git pull
8 | brew install rust
9 | cargo build --release --features emacs
10 | mkdir -vp ~/.emacs.d/parinfer-rust
11 | cp -v target/release/libparinfer_rust.dylib ~/.emacs.d/parinfer-rust/parinfer-rust-darwin.so
12 |
--------------------------------------------------------------------------------
/snippets/clojure-mode/cljsbuild:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: cljsbuild
3 | # key: cljsbuild
4 | # --
5 | :cljsbuild {:builds [{:source-paths ["src" "dev"]
6 | :compiler {:output-to "target/classes/public/app.js"
7 | :output-dir "target/classes/public/out"
8 | :optimizations :none
9 | :recompile-dependents true
10 | :source-map true}}]}
--------------------------------------------------------------------------------
/snippets/markdown-mode/frontmatter:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: frontmatter
3 | # key: frontmatter
4 | # --
5 | ---
6 | title: `
7 | (mapconcat
8 | (lambda(s) (concat (upcase (substring s 0 1)) (downcase (substring s 1))))
9 | (split-string (file-name-base) "-")
10 | " ")`
11 | date: `
12 | (destructuring-bind (month day year) (calendar-current-date)
13 | (concat (format "%4i" year)
14 | "-"
15 | (format "%02i" month)
16 | "-"
17 | (format "%02i" day)))`
18 | ---
19 |
20 | $0
21 |
--------------------------------------------------------------------------------
/snippets/clojure-mode/defproject:
--------------------------------------------------------------------------------
1 | # -*- mode: snippet -*-
2 | # name: defproject
3 | # key: project
4 | # --
5 | (defproject ${1:`(file-name-base (f-parent (buffer-file-name)))`} "0.1.0-SNAPSHOT"
6 | :description "$2"
7 | :url "$3"
8 | :license {:name "GNU General Public License"
9 | :url "http://www.gnu.org/licenses/gpl.html"}
10 | :jvm-opts ["-XX:MaxPermSize=256m"]
11 | :dependencies [[org.clojure/clojure "1.7.0"]]
12 | :profiles {:dev {:plugins []
13 | :dependencies []
14 | :source-paths ["dev"]}})
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .lsp-session-v*
2 | /.mc-lists.el
3 | .python-environments
4 | /.cache
5 | /.persistent-scratch
6 | /bookmarks
7 | /custom.el
8 | /fiat-config
9 | /git
10 | /history
11 | /logview-cache.extmap
12 | /nov-places
13 | /org-wunderlist
14 | /packages
15 | /private.el
16 | /recentf
17 | /request
18 | /semanticdb
19 | /src
20 | /srecode-map.el
21 | /transient
22 | /undohist
23 | /url
24 | /var
25 | /.last-package-update-day
26 | /package-quickstart.el
27 | /image-dired/
28 | /thumbs/
29 | /tldr/
30 | /calc.el
31 | /projects
32 | /eln-cache/
33 | /.dap-breakpoints
34 | /org-persist/
35 | /emacs/
36 |
--------------------------------------------------------------------------------
/bin/update-emacs:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | emacs_dir="$HOME/.emacs.d"
4 |
5 | if [ -e "#$emacs_dir/.git" ] && [ -n "$(git -C "$emacs_dir" status --porcelain)" ]; then
6 | echo "Pulling changes from the current remote..."
7 | git -C "$HOME" pull
8 | else
9 | echo "Not pulling becase no clean repo was found at $emacs_dir."
10 | fi
11 |
12 | if [ -f "$emacs_dir/bin/setup" ]; then
13 | echo "Building a new version of Emacs..."
14 | "$emacs_dir/bin/setup"
15 | else
16 | echo "Emacs build script not found, skipping"
17 | fi
18 |
19 | # echo "Updating Emacs packages..."
20 | # emacs --batch --load "$emacs_dir/early-init.el" --load "$emacs_dir/init.el" \
21 | # --funcall update-emacs-packages-sync
22 |
--------------------------------------------------------------------------------
/eshell/alias:
--------------------------------------------------------------------------------
1 | alias ll ls -lh $*
2 | alias su eshell/su $*
3 | alias sudo eshell/sudo $*
4 | alias ... ../.. $*
5 | alias .... ../../.. $*
6 | alias df df -h $*
7 | alias en emacsclient -c --no-wait $*
8 | alias g git $*
9 | alias ga git add $*
10 | alias gc git commit $*
11 | alias gcm git commit -m $*
12 | alias glog git log --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit $*
13 | alias gp git push $*
14 | alias gpl git pull $*
15 | alias grep grep --color=auto $*
16 | alias gs git status $*
17 | alias hide-hidden-files defaults write com.apple.finder AppleShowAllFiles -bool false; and killall Finder $*
18 | alias ln ln -v $*
19 | alias mkdir mkdir -p $*
20 | alias show-hidden-files defaults write com.apple.finder AppleShowAllFiles -bool true; and killall Finder $*
21 | alias public-ip wget -qO- https://diagnostic.opendns.com/myip && echo
22 | alias mergepdf /System/Library/Automator/CombinePDFPages.action/Contents/Resources/join.py $*
23 | alias la ls -Alh $*
24 | alias l ls $*
25 | alias lt ls -Alhtr $*
26 | alias lsd *ls -d *
27 |
--------------------------------------------------------------------------------
/bin/install-utilities:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Install support utilities for various Emacs modes and packages.
3 | # Read init.el for every line that begins like ";; > " and prompt to run those commands.
4 |
5 | set -euo pipefail
6 |
7 | # Prompt user to confirm
8 | prompt_confirm() {
9 | local confirm
10 | while true; do
11 | read -p "$* [y/N]: " confirm
12 | case $confirm in
13 | [yY]*) return 0 ;;
14 | [nN]*) return 1 ;;
15 | esac
16 | done
17 | }
18 |
19 | # Run command and read into the specified variable.
20 | # $1: variable name
21 | # All other args are the command
22 | into_array() {
23 | local array_var="$1"
24 | shift
25 | IFS=$'\n' read -r -d '' -a "$array_var" < <($@ && printf '\0')
26 | }
27 |
28 | # Display and execute the command
29 | exe() {
30 | echo "> $*"
31 | "$@"
32 | }
33 |
34 | into_array commands awk -F'> ' '/^ *;; +>/ {print $2}' "$HOME/.emacs.d/init.el"
35 |
36 | printf "%s\n" "${commands[@]}"
37 | echo
38 | if prompt_confirm "Run the above commands?"; then
39 | echo "Running commands..."
40 | for command in "${commands[@]}"; do
41 | exe $command
42 | done
43 | fi
44 |
--------------------------------------------------------------------------------
/bin/dark-mode-notifier.swift:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env swift
2 | // Compile with:
3 | // swiftc dark-mode-notifier.swift -o dark-mode-notifier
4 |
5 | import Cocoa
6 |
7 | @discardableResult
8 | func shell(_ args: String...) -> Int32 {
9 | let task = Process()
10 | task.launchPath = "/usr/bin/env"
11 | task.arguments = args
12 | task.launch()
13 | task.waitUntilExit()
14 | return task.terminationStatus
15 | }
16 |
17 | func updateEmacsTheme() {
18 | let isDark = UserDefaults.standard.string(forKey: "AppleInterfaceStyle") == "Dark"
19 | let emacsen = NSRunningApplication.runningApplications(
20 | withBundleIdentifier: "org.gnu.Emacs")
21 |
22 | if emacsen.count > 0 {
23 | print("Notifying Emacs that macOS Dark Mode is:", isDark)
24 | shell("emacsclient", "-e", isDark ? "(fiat-nox)" : "(fiat-lux)")
25 | print()
26 | }
27 | }
28 |
29 | updateEmacsTheme()
30 |
31 | DistributedNotificationCenter.default.addObserver(
32 | forName: Notification.Name("AppleInterfaceThemeChangedNotification"),
33 | object: nil,
34 | queue: nil) { (notification) in
35 | updateEmacsTheme()
36 | }
37 |
38 | // Enter cocoa run loop and start listening for notifyd events
39 | NSApplication.shared.run()
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/bin/install-emacs-plus:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Build or rebuild an Emacs-Plus installation
3 | # https://github.com/d12frosted/homebrew-emacs-plus
4 |
5 | set -euo pipefail
6 |
7 | # Prompt user to confirm
8 | prompt_confirm() {
9 | local confirm
10 | while true; do
11 | read -p "$* [y/N]: " confirm
12 | case $confirm in
13 | [yY]*) return 0 ;;
14 | [nN]*) return 1 ;;
15 | esac
16 | done
17 | }
18 |
19 | emacs="emacs-plus@31"
20 | options=""
21 | destination="/Applications"
22 | dependencies="gcc libgccjit jq gnutls librsvg libxml2 little-cms2 tree-sitter"
23 |
24 | install-parinfer-rust-library
25 | brew install $dependencies || brew upgrade $dependencies
26 | brew tap d12frosted/emacs-plus
27 | brew uninstall $emacs || true
28 | brew install $emacs $options
29 | # If it's not a symlink, it's best that this error out and we can figure it out
30 | # manually.
31 | rm "$destination/Emacs.app" || true
32 | # Copied from the `homebrew-emacs-plus` install instructions.
33 | osascript -e "tell application \"Finder\" to make alias file to posix file \"$(brew --prefix $emacs)/Emacs.app\" at POSIX file \"$destination\" with properties {name:\"Emacs.app\"}"
34 | # ln -s "$(brew --prefix $emacs)/Emacs.app" "$destination"
35 | prompt_confirm "Remove $HOME/.emacs.d/{eln-cache,straight}?" &&
36 | rm -rf $HOME/.emacs.d/{eln-cache,straight}
37 |
38 | echo "Restart Emacs for changes to take effect"
39 |
--------------------------------------------------------------------------------
/lisp/log-mode.el:
--------------------------------------------------------------------------------
1 | ;;; log-mode.el --- Log File Mode -*- lexical-binding: t -*-
2 |
3 | ;; Author: Matthew Newton
4 | ;; Maintainer: Matthew Newton
5 | ;; Version: 0.1
6 | ;; Package-Requires: ()
7 | ;; Homepage: https://github.com/mnewt/log-mode
8 | ;; Keywords: log
9 |
10 |
11 | ;; This file is not part of GNU Emacs
12 |
13 | ;; This file is free software; you can redistribute it and/or modify
14 | ;; it under the terms of the GNU General Public License as published by
15 | ;; the Free Software Foundation; either version 3, or (at your option)
16 | ;; any later version.
17 |
18 | ;; This program is distributed in the hope that it will be useful,
19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | ;; GNU General Public License for more details.
22 |
23 | ;; For a full copy of the GNU General Public License
24 | ;; see .
25 |
26 |
27 | ;;; Commentary:
28 |
29 | ;; Major mode for viewing log files
30 |
31 | ;;; Code:
32 |
33 | (defvar log-mode-hook nil)
34 |
35 | (defvar log-mode-map
36 | (let ((map (make-sparse-keymap)))
37 | (define-key map ?k #'keep-lines)
38 | (define-key map ?f #'flush-lines)))
39 |
40 | ;;;###autoload
41 | (add-to-list 'auto-mode-alist '("\\.log\\'" . log-mode))
42 |
43 | (defconst log-font-lock-keywords-1
44 | `((,(regexp-opt '("error" "ERROR")) . '(:foreground "red"))
45 | (,(regexp-opt '("WARNING" "warn" "WARN" "warning")) . '(:foreground "yellow"))
46 | (,(regexp-opt '("info" "INFO" "information" "INFORMATION")) . '(:foreground "white"))
47 | (,(regexp-opt '("debug" "DEBUG")) . '(:foreground "cyan"))
48 | (,(regexp-opt '("trace" "TRACE")) . '(:foreground "purple"))))
49 |
50 | (defconst log-font-lock-keywords-2
51 | (append log-font-lock-keywords-1
52 | (list ("\<[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T?[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}[.0-9]*?Z\>" . font-lock-comment-face))))
53 |
54 | (defvar log-font-lock-keywords log-font-lock-keywords-2)
55 |
56 | ;;;###autoload
57 | (define-derived-mode log-mode fundamental-mode "Log"
58 | "Major mode for viewing log files."
59 | (set (make-local-variable 'font-lock-defaults '(log-font-lock-keywords))))
60 |
61 | (provide 'log-mode)
62 |
63 | ;;; log-mode.el ends here
64 |
--------------------------------------------------------------------------------
/TODO.org:
--------------------------------------------------------------------------------
1 | #+TITLE: TODO
2 |
3 | * TODO Add native Emacs 29.1 =tree-sitter= support
4 |
5 | * TODO Add mode-line `-f` for `auto-revert-tail-mode`.
6 |
7 | * TODO Try Corfu
8 |
9 | * TODO =consult-line= should start on the next matching line, in order
10 |
11 | * TODO Remove =hydra= to =/lisp=
12 |
13 | * TODO Make changes to d12frosted/emacs-plus [0/3]
14 |
15 | ** TODO Install C source files
16 | #+begin_src ruby
17 | prefix.install "src"
18 | #+end_src
19 |
20 | ** TODO Don't compress source files
21 | #+begin_src
22 | --without-compress-install
23 | #+end_src
24 |
25 | ** TODO Compile with cores
26 | #+begin_src ruby
27 | system "make", "-j", `sysctl -n hw.ncpu`
28 | #+end_src
29 |
30 | ** TODO Compiler optimization settings
31 | #+begin_src ruby
32 | ENV.append_to_cflags %w[
33 | -Ofast
34 | -march=native
35 | -pipe
36 | -falign-functions=64
37 | -fomit-frame-pointer
38 | -funit-at-a-time
39 | -fforce-addr
40 | -mfpmath=sse
41 | -fno-finite-math-only
42 | -fstack-check
43 | ].join(" ")
44 | #+end_src
45 |
46 | * TODO Create =dired-do-backup=
47 | Like =dired-do-copy= but renames the file on the other end with a timestamp.
48 |
49 | * TODO Submit patch to Org for =org-do-emphasis-faces=
50 |
51 | * TODO eshell-ls-decorated-name [1/3]
52 |
53 | ** DONE Fix it so =ls= to a different directory embeds correct links (it currently assumes files are relative to =default-directory=)
54 |
55 | ** TODO Extend =eshell-ls-decorated-name= to color output like =dired-rainbow=
56 |
57 | ** TODO Submit upstream
58 |
59 | * TODO Make =dired-rainbow-listing= into a package
60 |
61 | * TODO =counsel-term= stuff
62 |
63 | ** TODO Make =counsel-term-cd= into =counsel-dired-jump=
64 |
65 | ** TODO =counsel-term-cd=
66 | https://github.com/tautologyclub/counsel-term/pull/2
67 | [[file:git/counsel-term/counsel-term.el::(defun%20counsel-term-cd-function%20(str)][counsel-term-cd-function]]
68 |
69 | * TODO Send PR for =helpful-goto-face=
70 |
71 | * TODO Font-lock source code blocks in Info pages
72 |
73 | * TODO =flash-thing=
74 |
75 | * TODO Implement =bat= in Elisp =highlight-things.el=
76 |
77 | * DONE Fix =dired-listing-human-readable= or whatever it's called
78 |
79 | * DONE =exec-path-from-shell-setenv= should set =eshell-path-env= in each Eshell buffer
80 | Because it's a buffer local variable
81 |
--------------------------------------------------------------------------------
/early-init.el:
--------------------------------------------------------------------------------
1 | ;;; early-init.el --- Emacs early init -*- lexical-binding: t; -*-
2 |
3 | ;;; Commentary:
4 |
5 | ;; Emacs 27 introduced early-init.el, which is run before init.el, before
6 | ;; package and UI initialization happens.
7 |
8 | ;;; Code:
9 |
10 | (defconst emacs-start-time (current-time))
11 |
12 | ;; Uncomment this to debug.
13 | ;; (setq init-file-debug t)
14 | ;; (setq messages-buffer-max-lines 100000)
15 |
16 | ;; If an `.el' file is newer than its corresponding `.elc', load the `.el'.
17 | (setq load-prefer-newer t)
18 |
19 | ;; Set Garbage Collection threshold to 1GB during startup. `gcmh' will clean
20 | ;; things up later.
21 | (setq gc-cons-threshold 1073741824
22 | gc-cons-percentage 0.6)
23 |
24 | ;; Write any customizations to a temp file so they are discarded.
25 | (setq custom-file (make-temp-file "custom-" nil ".el"))
26 |
27 | ;; Faster to disable these here (before they've been initialized)
28 | (push '(menu-bar-lines . 0) default-frame-alist)
29 | (push '(tool-bar-lines . 0) default-frame-alist)
30 | (push '(vertical-scroll-bars) default-frame-alist)
31 |
32 | ;; Give the frame basic coloring while waiting for the theme to load. The main
33 | ;; purpose of this is to not blind me when it's dark by flashing a screen full
34 | ;; of white. These colors are from doom-one.
35 | (set-face-attribute 'default nil :background "#282c34" :foreground "#bbc2cf")
36 | ;; Default frame settings. This is actually maximized, not full screen.
37 | (push '(fullscreen . maximized) initial-frame-alist)
38 | (push '(ns-transparent-titlebar . t) default-frame-alist)
39 |
40 | ;; Resizing the Emacs frame can be a terribly expensive part of changing the
41 | ;; font. By inhibiting this, we easily halve startup times with fonts that are
42 | ;; larger than the system default.
43 | (setq frame-inhibit-implied-resize t
44 | frame-resize-pixelwise t)
45 |
46 | ;; Ignore X resources; its settings would be redundant with the other settings
47 | ;; in this file and can conflict with later config (particularly where the
48 | ;; cursor color is concerned).
49 | (advice-add #'x-apply-session-resources :override #'ignore)
50 |
51 | ;; These are good notes on optimizing startup performance:
52 | ;; https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast
53 |
54 | ;; Unset `file-name-handler-alist' too (temporarily). Every file opened and
55 | ;; loaded by Emacs will run through this list to check for a proper handler for
56 | ;; the file, but during startup, it won’t need any of them.
57 | (defvar file-name-handler-alist-old file-name-handler-alist)
58 | (setq file-name-handler-alist nil)
59 | (add-hook 'emacs-startup-hook
60 | (lambda ()
61 | (setq file-name-handler-alist file-name-handler-alist-old)))
62 |
63 | ;; Disable `package' in favor of `straight'.
64 | (setq package-enable-at-startup nil)
65 |
66 | (provide 'early-init)
67 |
68 | ;;; early-init.el ends here
69 |
70 |
--------------------------------------------------------------------------------
/lisp/polymode-setup.el:
--------------------------------------------------------------------------------
1 | ;;; polymode-setup.el --- Set up Polymode -*- lexical-binding: t -*-
2 |
3 | ;;; Commentary:
4 |
5 | ;; commentary
6 |
7 | ;;; Code:
8 |
9 | (use-package polymode
10 | :config
11 | (with-no-warnings
12 | ;; js
13 | (define-hostmode poly-js-hostmode
14 | :mode 'js-mode)
15 | (define-innermode poly-js-graphql-innermode
16 | :mode 'graphql-mode
17 | :head-matcher "graphql[ \t\n]*(?`"
18 | :tail-matcher "`"
19 | :head-mode 'host
20 | :tail-mode 'host)
21 | ;; FIXME: Causes bad things to happen in the `js-mode' buffer.
22 | (define-polymode poly-js-mode
23 | :hostmode 'poly-js-hostmode
24 | :innermodes '(poly-js-graphql-innermode))
25 |
26 | ;; web
27 | (define-hostmode poly-web-hostmode
28 | :mode 'web-mode)
29 | (define-innermode poly-web-svg-innermode
30 | :mode 'nxml-mode
31 | :head-matcher "