From: Peng Li Date: Sat, 16 Jul 2016 14:40:08 +0000 (+0800) Subject: emacs - templates for org-mode and elisp file X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;ds=sidebyside;h=5503edad08a20069348451970e798a274c6ac503;p=dotfiles.git emacs - templates for org-mode and elisp file --- diff --git a/emacs.d/config.org b/emacs.d/config.org index adeba50..94d6e11 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -2024,9 +2024,10 @@ Emacs lisp auto-insert, based on the default module in =autoinsert.el=, but repl ";;; " (file-name-nondirectory (buffer-file-name)) " --- " str (make-string (max 2 (- 80 (current-column) 27)) ?\s) "-*- lexical-binding: t; -*-" '(setq lexical-binding t) - " + "\n ;; Copyright (C) " (format-time-string "%Y") " " (getenv "ORGANIZATION") | (progn user-full-name) " + ;; Author: " (user-full-name) '(if (search-backward "&" (line-beginning-position) t) (replace-match (capitalize (user-login-name)) t t)) @@ -2042,25 +2043,47 @@ Emacs lisp auto-insert, based on the default module in =autoinsert.el=, but repl ((let ((minibuffer-help-form v2)) (completing-read-ido-ubiquitous "Keyword, C-h: " v1 nil t)) str ", ") & -2 " + \;; 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 . + \;;; Commentary: + \;; " _ " + \;;; Code: + + \(provide '" (file-name-base) ") \;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))) #+END_SRC +*** Org file template +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (eval-after-load 'autoinsert + '(define-auto-insert '("\\.\\(org\\)\\'" . "Org-mode skeleton") + '( + "title: " + "#+TITLE: " str (make-string 30 ?\s) > \n + "#+AUTHOR: Peng Li\n" + "#+EMAIL: seudut@gmail.com\n" + "#+DATE: " (shell-command-to-string "echo -n $(date +%Y-%m-%d)") > \n + > \n + > _))) +#+END_SRC + ** Completion company mode