Browse Source

Speed up first launch, fix issue with failing daemon

master
Peter J. Jones 10 months ago
parent
commit
0996b2ab58
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
7 changed files with 23 additions and 71 deletions
  1. 4
    2
      bin/e
  2. 0
    8
      bin/eterm
  3. 3
    30
      lisp/interactive.el
  4. 1
    19
      lisp/themes.el
  5. 2
    2
      modes/dired-conf.el
  6. 11
    8
      modes/org-conf.el
  7. 2
    2
      nix/packages.nix

+ 4
- 2
bin/e View File

@@ -52,8 +52,10 @@ shift $((OPTIND-1))
################################################################################
if [ "$option_fresh" -eq 1 ]; then
export EMACSLOADPATH=""
exec @emacspath@/emacs -q --load @out@/dot.emacs.el \
--eval "(run-hooks 'after-init-hook)" "$@"
exec @emacspath@/emacs -q \
--eval "(toggle-debug-on-error)" \
--load @out@/dot.emacs.el \
--eval "(run-hooks 'after-init-hook)" "$@"
fi

################################################################################

+ 0
- 8
bin/eterm View File

@@ -1,8 +0,0 @@
#!/bin/bash

################################################################################
# Create a new Emacs frame running a terminal.
set -e

################################################################################
e -c -- --eval '(pjones:start-term)'

+ 3
- 30
lisp/interactive.el View File

@@ -3,15 +3,6 @@
;;; Commentary:
;;
;;; Code:
(require 'etags)
(require 'flyspell)
(require 'ispell)
(require 'server)
(require 'subword)
(require 'term)
(require 'hydra)
(require 'mu4e)

(eval-when-compile
(require 'cl)) ; for plusp (need to replace it)

@@ -33,6 +24,7 @@ the kill ring in a similar manner to `kill-region'. If there
isn't a region, the word before point will be deleted (without
placing it in the kill ring)."
(interactive "p")
(require 'subword)
(let ((forward
(if (and (boundp 'subword-mode)
(or subword-mode global-subword-mode))
@@ -103,6 +95,7 @@ When LOCAL-ONLY is non-nil, only connect to Bitlbee."
"Start a new terminal buffer in the current project.
If DONT-ASK is non-nil, don't prompt for a project."
(interactive "P")
(require 'term)
(let* ((default-directory (pjones:projectile-project-root dont-ask))
(short (directory-file-name (file-relative-name default-directory "~/")))
(name (generate-new-buffer-name (concat "term:" short)))
@@ -131,32 +124,12 @@ If DONT-ASK is non-nil, don't prompt for a project."
(defvar pjones:last-dictionary nil
"The last non-English dictionary used by `pjones:toggle-dictionary'.")

(defun pjones:auto-correct-previous-word ()
"Use flyspell to automatically correct the previous word
without going past the current line."
(interactive)
(let ((start (save-excursion
(beginning-of-line)
(point)))
(end (save-excursion
(end-of-line)
(point))))
(save-restriction
;; Keep flyspell from trying to correct a previous word outside
;; of the region. It does this when there is no incorrect word
;; within the current region :(
(when (and flyspell-auto-correct-previous-pos
(or (> flyspell-auto-correct-previous-pos end)
(< flyspell-auto-correct-previous-pos start)))
(setq flyspell-auto-correct-previous-pos nil))
(narrow-to-region start end)
(flyspell-auto-correct-previous-word (point)))))

(defun pjones:toggle-dictionary (&optional reset)
"Switch between English and another language easily. Switches
the current input method and dictionary. With a prefix argument
prompts for the foreign language to use."
(interactive "P")
(require 'ispell)
(let* ((en "english")
;; Human Dict Input Method
(langs '(("Italian" . ("italian" "italian-postfix"))

+ 1
- 19
lisp/themes.el View File

@@ -5,25 +5,7 @@
;; Code to activate my preferred themes.
;;
;;; Code:

;; Load default theme and update settings:
;; https://github.com/alezost/alect-themes
(require 'alect-themes)

(custom-set-variables
'(alect-overriding-faces
(quote ((mode-line ((t :foreground fg+1
:background bg-1
:box (:line-width 2 :color fg+1 :style nil))))
(font-lock-string-face ((t :foreground yellow+2)))
(font-lock-comment-face ((t :foreground "#9396c4")))
(font-lock-comment-delimiter-face ((t :foreground bg
:weight bold)))))))

(alect-set-color 'dark 'bg-1 "#333333")
(alect-set-color 'light 'bg-1 "#ffffff")
(alect-set-color 'light 'yellow-1 "#b58900")
(load-theme 'alect-dark t)
(load-theme 'doom-city-lights t)

;; Stolen from: https://github.com/alezost/emacs-config
(defun pjones:load-theme (theme)

+ 2
- 2
modes/dired-conf.el View File

@@ -6,13 +6,11 @@

;;; Code:
(require 'dired)
(require 'org)
(require 'dired-x)
(require 'dired-aux)
(require 'dired-filter)
(require 'dired-narrow)
(require 'dired-subtree)
(require 'evil-collection)

;; Always run commands asynchronously:
(autoload 'dired-async-mode "dired-async.el" nil t)
@@ -38,6 +36,7 @@ current dired buffer. Otherwise visit the file under point."
(interactive)
(let ((name (dired-get-file-for-visit)))
(if (file-directory-p name) (dired-subtree-insert)
(require 'org)
(org-open-file name))))

(defun pjones:dired-remove-total-lines ()
@@ -104,6 +103,7 @@ current dired buffer. Otherwise visit the file under point."
(dired-hide-details-mode) ;; Hide details by default
(setq dired-subtree-line-prefix pjones:dired-subtree-line-prefix)

(require 'evil-collection)
(evil-collection-define-key 'normal 'dired-mode-map
(kbd "<return>") #'pjones:dired-insert-or-visit
"gq" #'dired-do-query-replace-regexp

+ 11
- 8
modes/org-conf.el View File

@@ -11,14 +11,6 @@
(require 'org-id)
(require 'org-clock-csv)

(require 'evil-org)
(add-hook 'org-mode-hook 'evil-org-mode)
(evil-org-set-key-theme '(navigation insert textobjects additional calendar))
(evil-define-key 'normal evil-org-mode-map "gk" #'outline-up-heading)
(evil-define-key 'motion evil-org-mode-map "gk" #'outline-up-heading)

(require 'evil-org-agenda)
(evil-org-agenda-set-keys)

(require 'org-bullets)
(add-hook 'org-mode-hook #'org-bullets-mode)
@@ -187,6 +179,17 @@


(defun pjones:org-mode-hook ()
"Hook to hack `org-mode'."
;; Evil:
(require 'evil-org)
(add-hook 'org-mode-hook 'evil-org-mode)
(evil-org-set-key-theme '(navigation insert textobjects additional calendar))
(evil-define-key 'normal evil-org-mode-map "gk" #'outline-up-heading)
(evil-define-key 'motion evil-org-mode-map "gk" #'outline-up-heading)

(require 'evil-org-agenda)
(evil-org-agenda-set-keys)

;; Extra Bindings
(org-defkey org-mode-map "\C-\M-f" 'org-metaright)
(org-defkey org-mode-map "\C-\M-b" 'org-metaleft)

+ 2
- 2
nix/packages.nix View File

@@ -36,7 +36,6 @@ in
# Emacs package list:
overrides.emacsWithPackages (epkgs: with epkgs; [
adaptive-wrap
alect-themes
async
beginend
company
@@ -51,7 +50,7 @@ overrides.emacsWithPackages (epkgs: with epkgs; [
dired-filter
dired-narrow
dired-subtree
eyebrowse
doom-themes
edit-server
eimp
evil
@@ -64,6 +63,7 @@ overrides.emacsWithPackages (epkgs: with epkgs; [
evil-surround
exwm
exwm-nw
eyebrowse
flycheck
git-annex
graphviz-dot-mode

Loading…
Cancel
Save