1. Fuco
  2. .emacs.d

Commits

Fuco  committed 747a782

* Typopunct now only on autoload
* Added emacs-lisp-mode.el helper file.

  • Participants
  • Parent commits 2475950
  • Branches default

Comments (0)

Files changed (3)

File files/emacs-lisp-mode.el

View file
+(setq my-emacs-lisp-open-line-list '(
+                                    if
+                                    when
+                                    unless
+                                    defun
+                                    defmacro
+                                    defvar
+                                    defcustom
+                                    let
+                                    let*
+                                    ))
+
+(defun my-emacs-lisp-open-line ()
+  "Opens a new line if the point is at the closing parens of
+function on `my-emacs-lisp-open-line-list'."
+  (interactive)
+  (open-next-line)
+  (when (save-excursion
+          (forward-char)
+          (backward-sexp)
+          (member (car (sexp-at-point)) my-emacs-lisp-open-line-list))
+    (newline)
+    (indent-according-to-mode)
+    (previous-line)))
+
+(defun my-emacs-lisp-init ()
+  (define-key emacs-lisp-mode-map (kbd "RET") 'my-emacs-lisp-open-line)
+  )
+
+(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-init)

File files/global.el

View file
   (buffer-face-mode))
 
 (defun init-text-based-modes ()
-  (progn (my-buffer-face-mode-variable)
-         (setq cursor-type 'bar)
-         (setq indent-tabs-mode t)
-         (turn-on-visual-line-mode)
-         (require 'typopunct)
-         (typopunct-change-language 'english)
-         (typopunct-mode 1)))
+  (my-buffer-face-mode-variable)
+  (setq cursor-type 'bar)
+  (setq indent-tabs-mode t)
+  (turn-on-visual-line-mode))
 
 ;; ... but not in Org tables
 (set-face-attribute 'org-table nil :inherit 'fixed-pitch)

File init.el

View file
 (load "files/undo-tree")
 (load "files/expand-region")
 
+(load "files/emacs-lisp-mode")
+
 ;; vendor
 (vendor 'smex)
 (vendor 'yasnippet)
 (vendor 'haskell-mode)
-(vendor 'typopunct)
+(vendor 'typopunct 'typopunct-change-language 'typopunct-mode)
 (vendor 'wc-mode)
 (vendor 'ace-jump-mode)
 (vendor 'revbufs)