diff options
author | Alan Pearce | 2015-11-11 14:52:25 +0100 |
---|---|---|
committer | Alan Pearce | 2015-11-11 14:52:25 +0100 |
commit | 20e56f1995e9bbf01c099d3d80e852aebe6aff8b (patch) | |
tree | df9a0f3c163a26276f9d817533d213fb04465504 /tag-emacs/emacs.d/init.org | |
parent | 095a891232b8742584855dc449335f69089d8286 (diff) | |
download | nixfiles-20e56f1995e9bbf01c099d3d80e852aebe6aff8b.tar.lz nixfiles-20e56f1995e9bbf01c099d3d80e852aebe6aff8b.tar.zst nixfiles-20e56f1995e9bbf01c099d3d80e852aebe6aff8b.zip |
Emacs: Move ap-functions into init file
Diffstat (limited to 'tag-emacs/emacs.d/init.org')
-rw-r--r-- | tag-emacs/emacs.d/init.org | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 319ca7b3..ce1a1f66 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -29,14 +29,6 @@ the buffer to be empty. * Packaging -I still use a couple of [[file:elisp/][elisp files]] that don’t appear to be in any package -archives. -#+BEGIN_SRC emacs-lisp -(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory)) -#+END_SRC - -** TODO Move [[file:elisp/ap-functions.el][=ap-functions=]] into this file and delete above - ** Cask For most packages, I use [[https://github.com/cask/cask][cask]] @@ -338,7 +330,7 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource ((eq window-system 'w32) (ap/set-fonts "Consolas" "Segoe UI" 10)) ((eq system-type 'darwin) - (ap/set-fonts "Input Mono Narrow" "Input Sans Condensed" 12)))) + (ap/set-fonts "Input Mono" "Input Sans Condensed" 13)))) #+END_SRC Allow font-lock-mode to do background parsing. I’m not really sure if @@ -1162,10 +1154,40 @@ Option/alt, then Control. indentation::space indentation::tabs))) - (req-package ap-functions - :commands (ap/remove-extra-cr) - :bind (("C-x r M-w" . copy-rectangle) - ("M-!" . shell-execute))) + (defun ap/remove-extra-cr () + "Remove extraneous CR codes from a file" + (interactive) + (save-excursion + (goto-char (point-min)) + (while (search-forward " + " nil t) + (replace-match "")))) + + (req-package rect + :init (defun copy-rectangle (start end) + "Copy the region-rectangle." + (interactive "r") + (setq killed-rectangle (extract-rectangle start end)))) + + (defun shell-execute (to-current-buffer) + (interactive "P") + (let ((file-buffer (if (buffer-file-name) + (file-name-nondirectory (buffer-file-name)) + "")) + (command (read-shell-command "Shell command: " nil nil nil))) + (shell-command (replace-regexp-in-string "%" file-buffer command) to-current-buffer))) + + (defun narrow-to-region-indirect (start end) + "Restrict editing in this buffer to the current region, indirectly." + (interactive "r") + (deactivate-mark) + (let ((buf (clone-indirect-buffer nil nil))) + (with-current-buffer buf + (narrow-to-region start end)) + (switch-to-buffer buf))) + + (bind-key* "M-!" #'shell-execute) + (bind-key* "C-x r M-w" #'copy-rectangle) #+END_SRC #+END_SRC @@ -1539,7 +1561,8 @@ Org is wünderbar. org-reverse-note-order t org-modules '(org-habit - org-checklist) + org-checklist + org-protocol) ;; Add time done to ‘done’ tasks org-log-done 'time |