Move lang/org => org/*

Since lang/org has grown (and is expected to grow much, much more), it
has been given its own module category.

Concerns #129, #138
This commit is contained in:
Henrik Lissner 2017-07-05 02:33:41 +02:00
parent 576a91b66c
commit d2d4166b42
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
31 changed files with 774 additions and 721 deletions

View file

@ -0,0 +1,12 @@
;;; org/org-babel/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +org-babel/edit (arg)
"Edit the source block at point in a popup.
If ARG is non-nil (universal argument), use the current window."
(interactive "P")
(if arg
(call-interactively #'org-edit-special)
(with-popup-rules! (("^\\*Org Src" :regexp t :select t :noesc t :same t))
(call-interactively #'org-edit-special))))

View file

@ -0,0 +1,52 @@
;;; org/org-babel/config.el -*- lexical-binding: t; -*-
(add-hook 'org-load-hook #'+org-babel|init t)
(defun +org-babel|init ()
(setq org-src-fontify-natively t ; make code pretty
org-src-preserve-indentation t ; use native major-mode indentation
org-src-tab-acts-natively t
org-src-window-setup 'current-window
org-confirm-babel-evaluate nil) ; you don't need my permission
(org-babel-do-load-languages
'org-babel-load-languages
(mapcar (lambda (sym) (cons sym t))
'(calc
css
emacs-lisp
haskell
js
latex
ledger
lilypond
lisp
matlab
plantuml
python
restclient ; ob-restclient
ruby
rust ; ob-rust
sh
sqlite
sql-mode ; ob-sql-mode
translate ; ob-translate
)))
;; In a recent update, `org-babel-get-header' was removed from org-mode, which
;; is something a fair number of babel plugins use. So until those plugins
;; update, this polyfill will do:
(defun org-babel-get-header (params key &optional others)
(cl-loop with fn = (if others #'not #'identity)
for p in params
if (funcall fn (eq (car p) key))
collect p))
;; I prefer C-c C-c for confirming over the default C-c '
(map! :map org-src-mode-map "C-c C-c" #'org-edit-src-exit)
(defun +org|src-mode-remove-header ()
"Remove header-line with keybinding help; I know the keybinds."
(when header-line-format
(setq header-line-format nil)))
(add-hook 'org-src-mode-hook #'+org|src-mode-remove-header))

View file

@ -0,0 +1,10 @@
;; -*- no-byte-compile: t; -*-
;;; org/org-babel/packages.el
(package! ob-go)
(package! ob-mongo)
(package! ob-redis)
(package! ob-restclient)
(package! ob-rust :recipe (:fetcher github :repo "zweifisch/ob-rust"))
(package! ob-sql-mode)
(package! ob-translate)