aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/.dir-locals.el3
-rw-r--r--.emacs.d/.gitignore5
-rw-r--r--.emacs.d/README.org2
-rw-r--r--.emacs.d/init.el35
-rw-r--r--.emacs.d/init.org20
-rw-r--r--.emacs.d/lisp/g.el36
-rwxr-xr-x.emacs.d/test-emacs.sh51
-rwxr-xr-x.emacs.d/test-startup.sh22
8 files changed, 126 insertions, 48 deletions
diff --git a/.emacs.d/.dir-locals.el b/.emacs.d/.dir-locals.el
new file mode 100644
index 0000000..9c03a44
--- /dev/null
+++ b/.emacs.d/.dir-locals.el
@@ -0,0 +1,3 @@
+((emacs-lisp-mode
+ (fill-column . 100)
+ (indent-tabs-mode . nil)))
diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore
index 3406897..e286c90 100644
--- a/.emacs.d/.gitignore
+++ b/.emacs.d/.gitignore
@@ -1,5 +1,10 @@
*.html
+*.elc
+*~
+*autoloads.el*
lisp/*.elc
+lisp/*autoloads.el*
+vendor
org-templates/*.pdf
org-templates/*.tex
org-templates/auto \ No newline at end of file
diff --git a/.emacs.d/README.org b/.emacs.d/README.org
index 3cb3ccb..70ccec8 100644
--- a/.emacs.d/README.org
+++ b/.emacs.d/README.org
@@ -17,7 +17,7 @@ instructs =emacsclient= to spawn a new server if there isn't one already. This
means that the first time around it will take some time, but in the next time
everything will be alright.
-=Supported versions=: GNU Emacs 25.x and 26.x.
+=Supported versions=: GNU Emacs 25.3 and 26.x.
* Dependencies
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 4129a5c..ccb4c35 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1,7 +1,36 @@
+;;; init.el --- Init file -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2016-2019 Miquel Sabaté Solà <mikisabate@gmail.com>
+;;
+;; Author: Miquel Sabaté Solà <mikisabate@gmail.com>
+;; Version: 0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: local, maint, mail, tools, vc
+;; URL: https://github.com/mssola/dotfiles/.emacs.d/init.el
+;;
+;; This file is not part of GNU Emacs.
+;;
+;; 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 <http://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+;;
;; This file replaces itself with the actual configuration at first run.
;; Idea and file taken from https://github.com/larstvei/dot-emacs.
;;
-;; NOTE DO NOT MODIFY THIS FILE. All changes should go into init.org
+;; NOTE DO NOT MODIFY THIS FILE. All changes should go into init.org.
+
+;;; Code:
;; We can't tangle without org!
(require 'org)
@@ -20,3 +49,7 @@
;; Finally byte-compile it
(byte-compile-file (concat user-emacs-directory "init.el"))
+
+(provide 'init)
+
+;;; init.el ends here
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 13298c0..20552e9 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -68,7 +68,7 @@ are some exceptions to this (e.g. webkit support), but these cases are
individually handled.
#+BEGIN_SRC elisp
-(let ((minver "25.1")
+(let ((minver "25.3")
(recver "26.1"))
(when (version< emacs-version minver)
(error "Don't be a cheap bastard and upgrade to at least GNU Emacs v%s" minver))
@@ -1294,9 +1294,7 @@ As of 0.9.18 and GNU Emacs 25, the =mu4e-action-with-xwidget= can be used to
render an HTML message with Webkit.
#+BEGIN_SRC elisp
- (if (>= emacs-major-version 25)
- (add-to-list 'mu4e-view-actions
- '("webkit" . mu4e-action-view-with-xwidget)))
+(add-to-list 'mu4e-view-actions '("webkit" . mu4e-action-view-with-xwidget))
#+END_SRC
Look for =mu4e-msg2pdf= in the exec path. The reason for this is that the OBS
@@ -2321,11 +2319,13 @@ too many things into my leader and these shortcuts look sensible to me).
** Screencast
Some utilities when recording my GNU Emacs adventures. First of all, =keycast=
-shows the keys being pressed in the mode line.
+shows the keys being pressed in the mode line (it requires GNU Emacs 25.3
+minimum):
#+BEGIN_SRC elisp
(use-package keycast
- :ensure t)
+ :ensure t
+ :unless (version< emacs-version "25.3"))
#+END_SRC
Second of all, we have =gif-screencast=, which allows you to record your GNU
@@ -2334,6 +2334,7 @@ Emacs activity and saves it into a gif (unless you have specified the
#+BEGIN_SRC elisp
(use-package gif-screencast
+ :unless (version< emacs-version "25.3")
:ensure t
:config
(with-eval-after-load 'gif-screencast
@@ -2349,8 +2350,11 @@ And last but not least, I use a wrapper to start a screencast:
(defun mssola-screencast ()
"Start keycast-mode and then start a gif screencast."
- (keycast)
- (gif-screencast))
+ (if (version< emacs-version "25.3")
+ (message "Requires 25.3 or later.")
+ (progn
+ (keycast)
+ (gif-screencast))))
#+END_SRC
** Emojis
diff --git a/.emacs.d/lisp/g.el b/.emacs.d/lisp/g.el
index 3a4660a..fe842d8 100644
--- a/.emacs.d/lisp/g.el
+++ b/.emacs.d/lisp/g.el
@@ -1,7 +1,15 @@
-;;; g.el --- Adding shortcuts to GNU Emacs
-
+;;; g.el --- Adding shortcuts -*- lexical-binding: t; -*-
+;;
;; Copyright (C) 2016-2019 Miquel Sabaté Solà <mikisabate@gmail.com>
;;
+;; Author: Miquel Sabaté Solà <mikisabate@gmail.com>
+;; Version: 0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: abbrev, convenience
+;; URL: https://github.com/mssola/dotfiles/.emacs.d/lisp/g.el
+;;
+;; This file is not part of GNU Emacs.
+;;
;; 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
@@ -14,11 +22,7 @@
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;; Author: Miquel Sabaté Solà <mikisabate@gmail.com>
-;; Version: 0.1
-;; URL: https://github.com/mssola/dotfiles/emacs/site-lisp/g.el
-
+;;
;;; Commentary:
;;
;; This is a GNU Emacs port of my g.sh bash script that can be found here:
@@ -33,15 +37,15 @@
(defvar g-file "~/.gfile"
"The path to the gfile.")
-;; Utils
+;;; Utils
(defun g-read-file (file)
"Read the given FILE and return it as a list of lines."
(if (file-exists-p file)
- (with-temp-buffer
- (insert-file-contents file)
- (split-string (buffer-string) "\n" t))
+ (with-temp-buffer
+ (insert-file-contents file)
+ (split-string (buffer-string) "\n" t))
""))
(defun g-write (shortcuts)
@@ -61,18 +65,18 @@ The returned object is a hash table."
(let ((shortcuts (make-hash-table :test 'equal))
(list (g-read-file g-file)))
- ; The format of the file is a bit special because it was meant to be easily
- ; parseable by Bash. It consists of pairs of lines, where n is the key, and
- ; n+1 is the value.
+ ;; The format of the file is a bit special because it was meant to be easily
+ ;; parseable by Bash. It consists of pairs of lines, where n is the key, and
+ ;; n+1 is the value.
(dotimes (i (/ (length list) 2))
(let ((n (* i 2)))
(puthash
(nth n list)
(nth (+ n 1) list)
shortcuts)))
- shortcuts))
+ shortcuts))
-;; Interactive functions
+;;; Interactive functions
(defun g ()
"Go to the given directory with the supplied alias."
diff --git a/.emacs.d/test-emacs.sh b/.emacs.d/test-emacs.sh
new file mode 100755
index 0000000..14e47da
--- /dev/null
+++ b/.emacs.d/test-emacs.sh
@@ -0,0 +1,51 @@
+#!/bin/bash -ex
+# Some parts kindly taken from: https://github.com/purcell/emacs.d
+
+if [ -n "$TRAVIS" ]; then
+ # We still need to have an .emacs.d directory, so emacs-async (dependency of
+ # some other package) is happy.
+ export HOME=$PWD/..
+ ln -s emacs ../.emacs.d
+fi
+
+##
+# Linters.
+
+mkdir -p vendor
+wget -q -O vendor/elisp-lint.el https://raw.githubusercontent.com/gonewest818/elisp-lint/master/elisp-lint.el
+wget -q -O vendor/package-lint.el https://raw.githubusercontent.com/purcell/package-lint/master/package-lint.el
+LOAD_PATH="-L $(readlink -f -- vendor)"
+
+# shellcheck disable=SC2039
+pushd .
+for i in . lisp; do
+ cd "$i"
+ # shellcheck disable=SC2010
+ # shellcheck disable=SC2035
+ files="$(ls *.el | grep -v 'custom.el' | grep -v 'lisp-autoloads.el' | grep -v '.emacs.d-autoloads.el' | grep -v 'soria-theme.el' | xargs)"
+
+ # shellcheck disable=SC2086
+ ${EMACS:=emacs} -Q --batch ${LOAD_PATH} -l elisp-lint.el -f elisp-lint-files-batch $files
+ # shellcheck disable=SC2086
+ ${EMACS:=emacs} -Q --batch ${LOAD_PATH} -l package-lint.el -f package-lint-batch-and-exit $files
+done
+
+# shellcheck disable=SC2039
+popd
+rm -r vendor
+
+##
+# Startup.
+
+echo "Attempting startup..."
+
+${EMACS:=emacs} -nw --batch \
+ --eval '(let ((debug-on-error t)
+ (url-show-status nil)
+ (user-emacs-directory default-directory)
+ (package-user-dir (expand-file-name (concat "elpa-" emacs-version)))
+ (custom-theme-directory default-directory)
+ (user-init-file (expand-file-name "init.el")))
+ (load-file user-init-file)
+ (run-hooks (quote after-init-hook)))'
+echo "Startup successful"
diff --git a/.emacs.d/test-startup.sh b/.emacs.d/test-startup.sh
deleted file mode 100755
index d8f3547..0000000
--- a/.emacs.d/test-startup.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -ex
-# Kindly taken from: https://github.com/purcell/emacs.d
-
-if [ -n "$TRAVIS" ]; then
- # We still need to have an .emacs.d directory, so emacs-async (dependency of
- # some other package) is happy.
- export HOME=$PWD/..
- ln -s emacs ../.emacs.d
-fi
-
-echo "Attempting startup..."
-
-${EMACS:=emacs} -nw --batch \
- --eval '(let ((debug-on-error t)
- (url-show-status nil)
- (user-emacs-directory default-directory)
- (package-user-dir (expand-file-name (concat "elpa-" emacs-version)))
- (custom-theme-directory default-directory)
- (user-init-file (expand-file-name "init.el")))
- (load-file user-init-file)
- (run-hooks (quote after-init-hook)))'
-echo "Startup successful"