X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=143695a7ad781cb6c339f20a6c3ea327190f5d21;hb=973b1d20436fa3a75bf55e094481ee89a241f22a;hp=127173dadecc23e1afe09bad57f20822be9c3084;hpb=8feef873199db15c54953611643bf6db78b4c027;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 127173d..143695a 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -736,10 +736,31 @@ Always indents header, and hide header leading starts so that no need type =#+ST (setq org-habit-graph-column 50) (setq org-hide-emphasis-markers t) (setq org-html-validation-link nil)) +#+END_SRC + +** Org babel +#+BEGIN_SRC emacs-lisp :tangle yes :results silent (el-get-bundle hasu/emacs-ob-racket :features ob-racket) + ;; Lua support + (use-package ob-lua + :ensure t) + + ;; use current window for org source buffer editting + + (setq org-src-window-setup 'current-window ) + (define-key org-mode-map (kbd "C-'") nil) + ;; C-M-i is mapped to imenu globally + (define-key org-mode-map (kbd "C-M-i") nil) + ;; set the ditta.jar path + + (setq org-ditaa-jar-path "/usr/local/Cellar/ditaa/0.9/libexec/ditaa0_9.jar") + (unless + (file-exists-p org-ditaa-jar-path) + (error "seudut: ditaa.jar not found at %s " org-ditaa-jar-path)) + (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (C . t) @@ -759,24 +780,17 @@ Always indents header, and hide header leading starts so that no need type =#+ST (ditaa . t) (plantuml . t))) - ;; use current window for org source buffer editting - (setq org-src-window-setup 'current-window ) - (define-key org-mode-map (kbd "C-'") nil) - ;; C-M-i is mapped to imenu globally - (define-key org-mode-map (kbd "C-M-i") nil) + ;; toggle image preview + (add-hook 'org-babel-after-execute-hook 'sd/display-inline-images 'append) - ;; set the ditta.jar path - (setq org-ditaa-jar-path "/usr/local/Cellar/ditaa/0.9/libexec/ditaa0_9.jar") - (unless - (file-exists-p org-ditaa-jar-path) - (error "seudut: ditaa.jar not found at %s " org-ditaa-jar-path)) + (defun sd/display-inline-images () + (condition-case nil + (org-display-inline-images) + (error nil))) - ;; Lua support - (use-package ob-lua - :ensure t) -#+END_SRC +#+END_SRC *** plantUML [[http://eschulte.github.io/babel-dev/DONE-integrate-plantuml-support.html][DONE-integrate-plantuml-support]] #+BEGIN_SRC sh @@ -809,6 +823,13 @@ use [[https://github.com/sabof/org-bullets][org-bullets]] package to show utf-8 ;; increase font size when enter org-src-mode ;; (add-hook 'org-src-mode-hook (lambda () (text-scale-increase 2))) + + ;; define a face for org-bullets + (defface org-bullet-face + '((t (:foreground "green yellow"))) + "Face used for the org-bullets.") + (setq org-bullets-face-name (quote org-bullet-face)) + (set-face-attribute 'org-bullet-face t :foreground "burlywood" :weight 'normal :height 1.6) #+END_SRC ** Worf Mode @@ -1749,11 +1770,24 @@ as a http download client tool #+END_SRC #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (defun sd/dired-new-file () + (defun sd/dired-new-file-and-open () "Create a new file in dired mode" (interactive) (call-interactively 'find-file)) + (defun sd/dired-new-file (file) + "Create a new file called FILE. + If FILE already exists, signal an error." + (interactive + (list (read-file-name "Create file: " (dired-current-directory)))) + (let* ((expanded (expand-file-name file))) + (if (file-exists-p expanded) + (error "Cannot create file %s: file exists" expanded)) + (write-region "" nil expanded t) + (when expanded + (dired-add-file expanded) + (dired-move-to-filename)))) + ;; copied from abo-abo's config (defun sd/dired-get-size () (interactive) @@ -1803,6 +1837,7 @@ Disalble =ido= when new a directory or file in =dired= mode #+BEGIN_SRC emacs-lisp :tangle yes :results silent ;; call the function which you want to disable ido (mk-disable-ido 'dired-create-directory) + (mk-disable-ido 'sd/dired-new-file-and-open) (mk-disable-ido 'sd/dired-new-file) (mk-disable-ido-no-completing 'dired-goto-file) #+END_SRC @@ -3429,7 +3464,8 @@ search music on some music web site ** Need separate the Key-bindings and package-initialization - +* Note ** Check if emacs is in terminal of graphic mode Use =display-graphic-p= instead of =window-system= [[info:elisp#Window%20Systems][Window Systems]] +** =Interactive=