Browse Source

Cleanup the hosts/ directory

master
Nicolas Petton 3 years ago
parent
commit
d7fc157663
Signed by: nico GPG Key ID: 233587A47C207910
19 changed files with 120 additions and 315 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -0
      .gitmodules
  3. +0
    -4
      hosts/blueberry/init-blueberry-appearance.el
  4. +0
    -6
      hosts/blueberry/init-blueberry-package.el
  5. +0
    -10
      hosts/blueberry/init-blueberry.el
  6. +0
    -7
      hosts/blueberry/init-epg.el
  7. +0
    -28
      hosts/blueberry/init-latex.el
  8. +0
    -43
      hosts/blueberry/init-ledger.el
  9. +0
    -139
      hosts/blueberry/init-mu4e.el
  10. +0
    -36
      hosts/blueberry/init-prodigy.el
  11. +0
    -4
      hosts/blueberry/init-strawberry-appearance.el
  12. +0
    -10
      hosts/blueberry/init-strawberry.el
  13. +94
    -0
      hosts/blueberry/init.el
  14. +0
    -4
      hosts/losedows/init-losedows.el
  15. +0
    -9
      hosts/losedows/init-omnisharp.el
  16. +0
    -4
      hosts/losedows/init-win-appearance.el
  17. +9
    -0
      hosts/losedows/init.el
  18. +12
    -11
      init.el
  19. +1
    -0
      lib/auctex

+ 1
- 0
.gitignore View File

@ -8,3 +8,4 @@ recentf
/eshell/history
places
.org-id-locations
/url/cookies

+ 3
- 0
.gitmodules View File

@ -16,6 +16,9 @@
[submodule "anzu"]
path = lib/anzu
url = git@github.com:syohex/emacs-anzu.git
[submodule "auctex"]
path = lib/auctex
url = git@github.com:emacsmirror/auctex.git
[submodule "auth-password-store"]
path = lib/auth-password-store
url = git@github.com:DamienCassou/auth-password-store.git


+ 0
- 4
hosts/blueberry/init-blueberry-appearance.el View File

@ -1,4 +0,0 @@
(when (window-system)
(set-face-attribute 'default nil :height 115 :family "Fira Mono"))
(provide 'init-blueberry-appearance)

+ 0
- 6
hosts/blueberry/init-blueberry-package.el View File

@ -1,6 +0,0 @@
(let ((packages-to-load '(notmuch alert org-gnome)))
(dolist (package packages-to-load)
(when (not (package-installed-p package))
(package-install package))))
(provide 'init-blueberry-package)

+ 0
- 10
hosts/blueberry/init-blueberry.el View File

@ -1,10 +0,0 @@
(require 'init-notmuch)
(require 'init-org)
(require 'init-org-publish)
(require 'init-latex)
(require 'init-prodigy)
(require 'init-ledger)
(require 'init-blueberry-appearance)
(require 'init-epg)
(provide 'init-blueberry)

+ 0
- 7
hosts/blueberry/init-epg.el View File

@ -1,7 +0,0 @@
(require 'epg)
(require 'magit)
(setq epg-gpg-program "gpg2")
(setq magit-commit-arguments (quote ("--gpg-sign=233587A47C207910")))
(provide 'init-epg)

+ 0
- 28
hosts/blueberry/init-latex.el View File

@ -1,28 +0,0 @@
(require 'reftex)
;; (require 'auctex-evince-sync)
(add-hook 'LaTeX-mode-hook 'tex-pdf-mode)
(eval-after-load "LaTeX"
'(progn
;; synctex
(TeX-source-correlate-mode)
(add-to-list 'TeX-expand-list
'("%q" skim-make-url))))
(defun skim-make-url () (concat
(TeX-current-line)
" "
(expand-file-name (funcall file (TeX-output-extension) t)
(file-name-directory (TeX-master-file)))
" "
(buffer-file-name)))
(setq TeX-view-program-list
'(("evince" "evince %o")))
(setq TeX-view-program-selection '((output-pdf "evince")))
(provide 'init-latex)

+ 0
- 43
hosts/blueberry/init-ledger.el View File

@ -1,43 +0,0 @@
(require 'ledger-mode)
(require 'company)
(require 'map)
(add-hook 'ledger-mode-hook #'company-mode)
(defvar nico-ledger-imports nil)
(defun nico-ledger-autosync ()
(interactive)
(switch-to-buffer (get-buffer-create "*ledger sync*"))
(erase-buffer)
(ledger-mode)
(shell-command "ledger-autosync -l ~/org/reference/ledger/ledger.dat ~/Downloads/\\ telechargement.ofx -a Assets:Checking:CE --fid 10" (current-buffer)))
(defun nico-ledger-convert-transaction ()
(interactive)
(save-excursion
(back-to-indentation)
(let* ((match (map-some (lambda (k v)
(when (search-forward k (line-end-position) t)
k))
nico-ledger-imports))
(replacement (if match
(map-elt nico-ledger-imports match)
(read-string "Import as: " "Expenses:Misc"))))
(search-forward "Expenses:Misc")
(delete-backward-char 13)
(insert replacement)
(ledger-post-align-xact (point)))
(goto-char (point-min))
(while (re-search-forward "\\bEUR\\b" nil t)
(replace-match "" nil t)))
(ledger-navigate-next-xact-or-directive))
(defun nico-ledger-convert-all-transactions ()
(interactive)
(while (not (eobp))
(nico-ledger-convert-transaction)))
(define-key ledger-mode-map (kbd "C-c M-i") #'nico-ledger-convert-transaction)
(provide 'init-ledger)

+ 0
- 139
hosts/blueberry/init-mu4e.el View File

@ -1,139 +0,0 @@
(require 'mu4e)
(require 'alert)
(require 'smtpmail)
(require 'org-mu4e)
(require 'gnus-dired)
(define-key global-map (kbd "M-N") 'mu4e)
(setq mu4e-attachment-dir "~/Download")
;; don't keep message buffers around
(setq message-kill-buffer-on-exit t)
;; attempt to show images when viewing messages
(setq mu4e-view-show-images t
mu4e-view-image-max-width 800)
;; use imagemagick, if available
(when (fboundp 'imagemagick-register-types)
(imagemagick-register-types))
(setq mu4e-sent-messages-behavior 'sent)
(setq mu4e-msg2pdf "/usr/bin/msg2pdf"
mu4e-get-mail-command "offlineimap"
mu4e-html2text-command "w3m -T text/html"
mu4e-update-interval 600)
(defun nico/notify-new-email ()
(alert
"You have unread emails"
:title "New mail!"
:icon "/usr/share/icons/gnome/32x32/status/mail-unread.png"))
(add-hook 'mu4e-index-updated-hook #'nico/notify-new-email)
(setq message-send-mail-function 'smtpmail-send-it
user-full-name "Nicolas Petton"
mu4e-compose-signature "Nicolas Petton
http://nicolas-petton.fr"
mu4e-compose-signature-auto-include t
starttls-use-gnutls t)
(defvar nico/mu4e-account-alist
'(("nicolas@petton.fr"
(user-mail-address "nicolas@petton.fr")
(smtpmail-starttls-credentials '(("mail.messagingengine.com" 465 nil nil)))
(smtpmail-auth-credentials
'(("smtp.gmail.com" 587 "mail.messagingengine.com" nil)))
(smtpmail-default-smtp-server "mail.messagingengine.com")
(smtpmail-smtp-server "mail.messagingengine.com")
(smtpmail-smtp-service 587))
;; ("FTGP"
;; (user-mail-address "nicolas.petton@foretagsplatsen.se")
;; (smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
;; (smtpmail-auth-credentials
;; '(("smtp.gmail.com" 587 "nicolas.petton@foretagsplatsen.se" nil)))
;; (smtpmail-default-smtp-server "smtp.gmail.com")
;; (smtpmail-smtp-server "smtp.gmail.com")
;; (smtpmail-smtp-service 587))
))
(defun nico/mu4e-set-account ()
"Set the account for composing a message.
Try to match the current maildir or ask for the account name"
(interactive)
(let* ((account
(nico/select-mail-account)))
(nico/setup-mail-account account)))
(defun nico/select-mail-account ()
(interactive)
(completing-read (format "Compose with account: (%s) "
(mapconcat #'(lambda (var) (car var)) nico/mu4e-account-alist "/"))
(mapcar #'(lambda (var) (car var)) nico/mu4e-account-alist)
nil t nil nil (caar nico/mu4e-account-alist)))
(defun nico/setup-mail-account (account)
(let ((account-vars (cdr (assoc account nico/mu4e-account-alist))))
(mapc #'(lambda (var)
(set (car var) (cadr var)))
account-vars)))
(nico/setup-mail-account "nicolas@petton.fr")
(add-hook 'mu4e-compose-pre-hook #'nico/mu4e-set-account)
(add-hook 'mu4e-compose-mode-hook #'mml-secure-message-sign)
(add-to-list 'mu4e-view-actions
'("View in browser" . mu4e-action-view-in-browser) t)
;; Attach files with dired
;; make the `gnus-dired-mail-buffers' function also work on
;; message-mode derived modes, such as mu4e-compose-mode
(defun gnus-dired-mail-buffers ()
"Return a list of active message buffers."
(let (buffers)
(save-current-buffer
(dolist (buffer (buffer-list t))
(set-buffer buffer)
(when (and (derived-mode-p 'message-mode)
(null message-sent-message-via))
(push (buffer-name buffer) buffers))))
(nreverse buffers)))
(setq gnus-dired-mail-mode 'mu4e-user-agent)
(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
;; epa
(add-hook 'mu4e-view-mode-hook #'epa-mail-mode)
(add-hook 'mu4e-compose-mode-hook #'epa-mail-mode)
;; Display embedded diffs nicely
(defun mu2diff ()
(interactive)
(let ((buf "*Diff message view*")
(message-contents (buffer-string)))
(switch-to-buffer buf)
(read-only-mode 0)
(erase-buffer)
(insert message-contents)
(goto-char (point-min))
(mu2diff--skip-message-headers)
(read-only-mode 1)
(diff-mode)))
(defun mu2diff--skip-message-headers ()
(let ((message-header-regex "^[\\\s+\\\t+]+\\|^[A-Za-z0-9-]+:\\\s"))
(save-excursion
(goto-char (point-min))
(while (looking-at message-header-regex)
(forward-line))
(delete-region (point-min) (point)))))
(define-key mu4e-view-mode-map (kbd "C-c d") #'mu2diff)
(provide 'init-mu4e)

+ 0
- 36
hosts/blueberry/init-prodigy.el View File

@ -1,36 +0,0 @@
(require 'prodigy)
(prodigy-define-service
:name "nicolas-petton.fr"
:cwd "/home/nico/Public/nicolas-petton.fr"
:command "python"
:args '("-m" "SimpleHTTPServer" "6002")
:port 6002
:tags '(personal))
(prodigy-define-service
:name "aurelia.saout.fr"
:cwd "/home/nico/work/aurelia.saout.fr"
:command "jekyll"
:args '("serve" "--watch" "-P" "4002")
:port 4002
:tags '(personal))
(prodigy-define-service
:name "public/"
:cwd "/home/nico/Public/"
:command "python"
:args '("-m" "SimpleHTTPServer" "4003")
:port 4003
:tags '(personal))
(prodigy-define-service
:name "Amber documentation"
:cwd "/home/nico/work/smalltalk/amber-documentation/"
:command "jekyll"
:args '("serve" "--watch" "-P" "4001")
:port 4001
:tags '(personal))
(provide 'init-prodigy)

+ 0
- 4
hosts/blueberry/init-strawberry-appearance.el View File

@ -1,4 +0,0 @@
(when (window-system)
(set-face-attribute 'default nil :height 110 :family "Fira Mono"))
(provide 'init-strawberry-appearance)

+ 0
- 10
hosts/blueberry/init-strawberry.el View File

@ -1,10 +0,0 @@
(require 'init-notmuch)
(require 'init-org)
(require 'init-org-publish)
(require 'init-latex)
(require 'init-prodigy)
(require 'init-ledger)
(require 'init-strawberry-appearance)
(require 'init-epg)
(provide 'init-strawberry)

+ 94
- 0
hosts/blueberry/init.el View File

@ -0,0 +1,94 @@
;;; init.el --- init-file for blueberry -*- lexical-binding: t -*-
(use-package epg
:config
(setq epg-gpg-program "gpg2")
(eval-after-load 'magit
'(setq magit-commit-arguments '("--gpg-sign=233587A47C207910"))))
(use-package init-org)
(use-package init-org-publish)
(use-package init-notmuch)
(use-package ledger
:init
(defvar nico-ledger-imports nil)
(defun nico-ledger-autosync ()
(interactive)
(switch-to-buffer (get-buffer-create "*ledger sync*"))
(erase-buffer)
(ledger-mode)
(shell-command "ledger-autosync -l ~/org/reference/ledger/ledger.dat ~/Downloads/\\ telechargement.ofx -a Assets:Checking:CE --fid 10" (current-buffer)))
(defun nico-ledger-convert-transaction ()
(interactive)
(save-excursion
(back-to-indentation)
(let* ((match (map-some (lambda (k v)
(when (search-forward k (line-end-position) t)
k))
nico-ledger-imports))
(replacement (if match
(map-elt nico-ledger-imports match)
(read-string "Import as: " "Expenses:Misc"))))
(search-forward "Expenses:Misc")
(delete-backward-char 13)
(insert replacement)
(ledger-post-align-xact (point)))
(goto-char (point-min))
(while (re-search-forward "\\bEUR\\b" nil t)
(replace-match "" nil t)))
(ledger-navigate-next-xact-or-directive))
(defun nico-ledger-convert-all-transactions ()
(interactive)
(while (not (eobp))
(nico-ledger-convert-transaction)))
:bind ((:map ledger-mode-map
("C-c M-i" . nico-ledger-convert-transaction)))
:config
(add-hook 'ledger-mode-hook #'company-mode))
(use-package prodigy
:config
(prodigy-define-service
:name "nicolas-petton.fr"
:cwd "/home/nico/Public/nicolas-petton.fr"
:command "python"
:args '("-m" "SimpleHTTPServer" "6002")
:port 6002
:tags '(personal))
(prodigy-define-service
:name "aurelia.saout.fr"
:cwd "/home/nico/work/aurelia.saout.fr"
:command "jekyll"
:args '("serve" "--watch" "-P" "4002")
:port 4002
:tags '(personal))
(prodigy-define-service
:name "public/"
:cwd "/home/nico/Public/"
:command "python"
:args '("-m" "SimpleHTTPServer" "4003")
:port 4003
:tags '(personal))
(prodigy-define-service
:name "Amber documentation"
:cwd "/home/nico/work/smalltalk/amber-documentation/"
:command "jekyll"
:args '("serve" "--watch" "-P" "4001")
:port 4001
:tags '(personal)))
(when (window-system)
(set-face-attribute 'default nil :height 110 :family "Fira Mono"))
;; Local Variables:
;; indent-tabs-mode: nil
;; End:
;;; init.el ends here

+ 0
- 4
hosts/losedows/init-losedows.el View File

@ -1,4 +0,0 @@
(require 'init-win-appearance)
;; (require 'init-omnisharp)
(provide 'init-losedows)

+ 0
- 9
hosts/losedows/init-omnisharp.el View File

@ -1,9 +0,0 @@
(require 'omnisharp)
(require 'company)
(eval-after-load 'company
'(add-to-list 'company-backends 'company-omnisharp))
(add-hook 'csharp-mode-hook #'omnisharp-mode)
(provide 'init-omnisharp)

+ 0
- 4
hosts/losedows/init-win-appearance.el View File

@ -1,4 +0,0 @@
(when (window-system)
(set-face-attribute 'default nil :height 120 :family "Consolas"))
(provide 'init-win-appearance)

+ 9
- 0
hosts/losedows/init.el View File

@ -0,0 +1,9 @@
;;; init.el --- init-file for losedows vm -*- lexical-binding: t -*-
(when (window-system)
(set-face-attribute 'default nil :height 120 :family "Consolas"))
;; Local Variables:
;; indent-tabs-mode: nil
;; End:
;;; init.el ends here

+ 12
- 11
init.el View File

@ -525,13 +525,12 @@ be global."
(tab-mark 9 [9655 9] [92 9]) ; tab, ▷
)))
(use-package window
:bind ("C-;" . other-window))
(use-package winner
:bind ("C-|". winner-undo))
:bind (("C-|". winner-undo)
("C-;" . other-window)))
(use-package workflow)
(use-package workflow
:demand t)
(use-package ws-butler
:config
@ -583,12 +582,14 @@ be global."
(progn ; host-specific setup
(let* ((host (substring (shell-command-to-string "hostname") 0 -1))
(host-dir (concat "~/.emacs.d/hosts/" host)))
(add-to-list 'load-path host-dir)
(let ((default-directory host-dir))
(normal-top-level-add-subdirs-to-load-path))
(let ((init-host-feature (intern (concat "init-" host))))
(require init-host-feature nil t))))
(host-dir (concat "~/.emacs.d/hosts/" host))
(host-file (expand-file-name "init.el" host-dir)))
(when (file-exists-p host-dir)
(let ((default-directory host-dir))
(add-to-list 'load-path host-dir)
(normal-top-level-add-subdirs-to-load-path)))
(when (file-exists-p host-file)
(load host-file))))
(progn ; private modules
(let ((private-dir "~/.priv/elisp"))


+ 1
- 0
lib/auctex

@ -0,0 +1 @@
Subproject commit 50798f343089fa39b9540e6d7d2d658fa306c825

Loading…
Cancel
Save