Skip to content

Commit

Permalink
orgmode add the org-babel module, so add connection between different
Browse files Browse the repository at this point in the history
language,such as perl,python,c,graphviz etc.(C-c s i) insert souce
code. Also add the finnacial.org to remember the expense by me.
  • Loading branch information
jueqingsizhe66 committed Oct 7, 2017
1 parent 663fadb commit 484b329
Show file tree
Hide file tree
Showing 319 changed files with 76,986 additions and 13 deletions.
58 changes: 56 additions & 2 deletions .orgConf.el
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Captured %<%Y-%m-%d %H:%M>
("c" "Clipboard" entry (file+datetree "~/.emacs.d/GTD/orgBoss/Clipboard/clipboard.org")
"** %^{Head Line} %U %^g\n%c\n%?"
:immediate-finish t)
("R" "Receipt" entry (file+datetree "~/.emacs.d/GTD/orgBoss/Financial/finances.org" )
("R" "Finance" entry (file+datetree "~/.emacs.d/GTD/orgBoss/Financial/finances.org" )
"** %^{BriefDesc} %U %^g\n%?" )
("b" "Book" entry (file+datetree "~/.emacs.d/GTD/orgBoss/Book/book.org")
"** %^{Enter the Book Name} %t :BOOK: \n%[~/.emacs.d/GTD/orgTemplate/.book_template.txt]\n")
Expand Down Expand Up @@ -703,4 +703,58 @@ Captured %<%Y-%m-%d %H:%M>




;;http://wenshanren.org/?p=327
;;; custom source block
(defun org-insert-src-block (src-code-type)
"Insert a `SRC-CODE-TYPE' type source code block in org-mode."
(interactive
(let ((src-code-types
'("emacs-lisp" "python" "C" "sh" "java" "js" "clojure" "C++" "css"
"calc" "asymptote" "dot" "gnuplot" "ledger" "lilypond" "mscgen"
"octave" "oz" "plantuml" "R" "sass" "screen" "sql" "awk" "ditaa"
"haskell" "latex" "lisp" "matlab" "ocaml" "org" "perl" "ruby"
"scheme" "sqlite")))
(list (ido-completing-read "Source code type: " src-code-types))))
(progn
(newline-and-indent)
(insert (format "#+BEGIN_SRC %s\n" src-code-type))
(newline-and-indent)
(insert "#+END_SRC\n")
(previous-line 2)
(org-edit-src-code)))


;;bind key `C-c s i’ to the function org-inser-src-block
(add-hook 'org-mode-hook '(lambda ()
;; turn on flyspell-mode by default
(flyspell-mode 1)
;; C-TAB for expanding
(local-set-key (kbd "C-<tab>")
'yas/expand-from-trigger-key)
;; keybinding for editing source code blocks
(local-set-key (kbd "C-c s e")
'org-edit-src-code)
;; keybinding for inserting code blocks
(local-set-key (kbd "C-c s i")
'org-insert-src-block)
))

;;source code syntax highlight
(setq org-src-fontify-natively t)


;;you need to set the language for running the souce code block
(org-babel-do-load-languages
'org-babel-load-languages
'(
(sh . t)
(python . t)
(R . t)
(ruby . t)
(ditaa . t)
(dot . t)
(octave . t)
(sqlite . t)
(perl . t)
(C . t)
))
26 changes: 25 additions & 1 deletion GTD/newgtd.org
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ DEADLINE: <2017-10-22
1. [ ]�����13��滮��
2. [ ]��2006-2016���װ��������չ��
3. [ ]��2016���ȫ���籨�桷 4%ռȫ���ܷ�����
4. [ ] �������ȶ���
2. [X] ��̬ƫ��
3. [-] ��̬ƫ��
1. [X] ��̬������
Expand All @@ -140,6 +141,29 @@ DEADLINE: <2017-10-22
** TODO Most important thing that you have to do :graduation:������Ҫ:
** TODO Second most important thing that you have to do
You can also take notes underneath each heading, like this
** TODO Etc.
** TODO ����(expense)

That's your gtd

| Date | Category | Money | People |
|-------------------+----------+--------+--------|
| <2017-10-07 ����> | Book | 30.6 | |
| <2017-10-09 ��һ> | Film | 70.6 | |
| <2017-11-10 ����> | Bus | 50.2 | |
| <2017-11-11 ����> | Bus | 60.2 | xinran |
| <2017-11-12 ����> | Eating | 1000 | Ye |
|-------------------+----------+--------+--------|
| | Total: | 1211.6 | |
#+TBLFM: @>$3=vsum(@2..@-1)


#+BEGIN_EXAMPLE
@> The @ specifies a row, and this refers to the last row in a table.
$3 The $ specifies a column, so this refers to the third column.
vsum A vertical sum function with parameters given in parenthesis
@2 The second row. Notice that it the Amount header is @1 and the dashes separating the header from the body is ignored.
@-1 The next to the last row. Using these relative references mean that we can add rows to our table, and still have the sum formula work.


http://www.howardism.org/Technical/Emacs/spreadsheet.html
#+END_EXAMPLE
24 changes: 24 additions & 0 deletions GTD/newgtd.org_archive
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Archived entries from file c:/Users/YeZhao/AppData/Roaming/.emacs.d/GTD/newgtd.org


* TODO Etc.
:PROPERTIES:
:ARCHIVE_TIME: 2017-10-07 ���� 15:34
:ARCHIVE_FILE: ~/.emacs.d/GTD/newgtd.org
:ARCHIVE_OLPATH: Tasks
:ARCHIVE_CATEGORY: newgtd
:ARCHIVE_TODO: TODO
:END:

That's your gtd

| Date | Category | Money |
|-------------------+----------+-------|
| <2017-10-07 ����> | Book | 30.6 |
| <2017-10-09 ��һ> | Film | 70.6 |
| | | |
| | | |
|-------------------+----------+-------|
| | Total: | 101.2 |
#+TBLFM: @>$3=vsum(@2..@-1)
2 changes: 2 additions & 0 deletions GTD/orgBoss/Book/book.org
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@
:Publisher:
:END:
Comments:
** 2017-10 ʮ��
*** 2017-10-07 ������
4 changes: 4 additions & 0 deletions GTD/orgBoss/Clipboard/clipboard.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

* 2017
** 2017-10 ʮ��
*** 2017-10-07 ������
30 changes: 28 additions & 2 deletions GTD/orgBoss/Financial/finances.org
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
** [2015-05-04 Mon 00:46] %^g
%?
* 2017
** 2017-10 ʮ��
*** 2017-10-07 ������
**** �򽭻��� [2017-10-07 ���� 16:04] :laptop:

| Date | Category | Money | People |
|-------------------+----------+--------+--------|
| <2017-10-07 ����> | Book | 30.6 | |
| <2017-10-09 ��һ> | Film | 70.6 | |
| <2017-11-10 ����> | Bus | 50.2 | |
| <2017-11-11 ����> | Bus | 60.2 | xinran |
| <2017-11-12 ����> | Eating | 1000 | Ye |
|-------------------+----------+--------+--------|
| | Total: | 1211.6 | |
#+TBLFM: @>$3=vsum(@2..@-1)


#+BEGIN_EXAMPLE
@> The @ specifies a row, and this refers to the last row in a table.
$3 The $ specifies a column, so this refers to the third column.
vsum A vertical sum function with parameters given in parenthesis
@2 The second row. Notice that it the Amount header is @1 and the dashes separating the header from the body is ignored.
@-1 The next to the last row. Using these relative references mean that we can add rows to our table, and still have the sum formula work.


http://www.howardism.org/Technical/Emacs/spreadsheet.html
#+END_EXAMPLE

Binary file added GTD/orgBoss/Journal/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions GTD/orgBoss/Journal/journal.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

* 2017
** 2017-10 ʮ��
*** 2017-10-07 ������
**** testOrgmore[#B]
�����ڣ� [2017-10-07 ���� 16:07]

[[file:~/.emacs.d/.orgConf.el::%25?]]

;; In the emacs-lisp , you don't need to set the orgconf, to load the language for running source code

#+BEGIN_SRC emacs-lisp
(+ 1 2 3 4)
#+END_SRC

#+RESULTS:
: 10


;you need to set the language for running the python source code

#+BEGIN_SRC python
a=1+1
print a
#+END_SRC

#+RESULTS:
: None


;; you need to set the language for running the perl source code
#+BEGIN_SRC perl
my $hello="df";
print "$hello \n perl \n";
print "5\n";
#+END_SRC

#+RESULTS:
: 1


;; You need to set the language for running the c++ source code
#+BEGIN_SRC C++
int a=1;
int b=1;
printf("%d\n", a+b);
#+END_SRC

#+RESULTS:

#+BEGIN_SRC dot :file a.png
digraph colla_schema {
UserA -> UserB[label = "Liked", color = green];
UserB -> UserA[label = "Liked_By", color = red];
}
#+END_SRC

#+RESULTS:
[[file:a.png]]
31 changes: 29 additions & 2 deletions GTD/orgBoss/Private/privnotes.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,32 @@
* 2017
** 2017-09 ����
*** 2017-09-13 ������
**** file <2017-09-13 ���� 00:55>

**** file <2017-09-13 ���� 00:55>
** 2017-10 ʮ��
*** 2017-10-07 ������
**** Expense [#A] <2017-10-07 ���� 15:42>
That's your gtd

| Date | Category | Money | People |
|-------------------+----------+--------+--------|
| <2017-10-07 ����> | Book | 30.6 | |
| <2017-10-09 ��һ> | Film | 70.6 | |
| <2017-11-10 ����> | Bus | 50.2 | |
| <2017-11-11 ����> | Bus | 60.2 | xinran |
| <2017-11-12 ����> | Eating | 1000 | Ye |
|-------------------+----------+--------+--------|
| | Total: | 1211.6 | |
#+TBLFM: @>$3=vsum(@2..@-1)


#+BEGIN_EXAMPLE
@> The @ specifies a row, and this refers to the last row in a table.
$3 The $ specifies a column, so this refers to the third column.
vsum A vertical sum function with parameters given in parenthesis
@2 The second row. Notice that it the Amount header is @1 and the dashes separating the header from the body is ignored.
@-1 The next to the last row. Using these relative references mean that we can add rows to our table, and still have the sum formula work.


http://www.howardism.org/Technical/Emacs/spreadsheet.html
#+END_EXAMPLE

16 changes: 16 additions & 0 deletions GTD/orgBoss/Site/www.site.org
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,19 @@ Many todos are too much,so don't worry ,make the Most important taks(MIP)
�߽��ת��
** http://en.wikipedia.org/wiki/Flow_separation
Flow separation
** https://github.com/LightTable/LightTable
the-next code generation editor
** https://www.clojure-toolbox.com/
clojure Toolbox
** https://github.com/trending?l=clojure
clojure github ��Ŀ����
** http://wiki.fnil.net/
ׯ���ε� lendcloud
http://blog.fnil.net/blog/archives/
** https://github.com/functional-koans/clojure-koans
A set of exercises for learning Clojure
The Clojure Koans are a fun way to get started with Clojure - no experience assumed or required.
Follow the instructions below to start making tests pass!
** https://github.com/trending/python
python��С����Ŀ
http://wenshanren.org/?p=924 �������ѧ��̣��һ���ô��
99 changes: 98 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,99 @@ writing can be seen from your organization and simplication.
orgmode计时,
在todo.org中,移到一个条目上,按`Ctrl-c Ctrl-x Ctrl-i`即可对该条目开始计时,`Ctrl-c Ctrl-x Ctrl-o`停止当前计时。
如果在Agenda中,移到条目按I(大写)即可对该条目开始计时,O(大写)即可停止计时。


### 51. custome code block

when you need to memorize the source code in the .org file, one way you can use
`<s tab` , the other way you can refer to [wenshanren][88]

```
(defun org-insert-src-block (src-code-type)
"Insert a `SRC-CODE-TYPE' type source code block in org-mode."
(interactive
(let ((src-code-types
'("emacs-lisp" "python" "C" "sh" "java" "js" "clojure" "C++" "css"
"calc" "asymptote" "dot" "gnuplot" "ledger" "lilypond" "mscgen"
"octave" "oz" "plantuml" "R" "sass" "screen" "sql" "awk" "ditaa"
"haskell" "latex" "lisp" "matlab" "ocaml" "org" "perl" "ruby"
"scheme" "sqlite")))
(list (ido-completing-read "Source code type: " src-code-types))))
(progn
(newline-and-indent)
(insert (format "#+BEGIN_SRC %s\n" src-code-type))
(newline-and-indent)
(insert "#+END_SRC\n")
(previous-line 2)
(org-edit-src-code)))
```

通过`M-x org-insert-src-block`,然后输入代码类型,也不错。

除了emacs-lisp不需要设置org-babel-load-language外,其他都得设置loading language true.

1. [org-babel语言配置][90]
2. [org-babel介绍][89]
3. [org-babel支持的语言][91]
4. [安装graphviz][92]
先安装,并添加到path中,然后执行代码块, 所有的配置可以参考.orgConf.el。

```
#+BEGIN_SRC emacs-lisp
(+ 1 2 3 4)
#+END_SRC
#+RESULTS:
: 10
;you need to set the language for running the python source code
#+BEGIN_SRC python
a=1+1
print a
#+END_SRC
#+RESULTS:
: None
;; you need to set the language for running the perl source code
#+BEGIN_SRC perl
my $hello="df";
print "$hello \n perl \n";
#+END_SRC
#+RESULTS:
: 1
;; You need to set the language for running the c++ source code
#+BEGIN_SRC C++
int a=1;
int b=1;
printf("%d\n", a+b);
#+END_SRC
#+RESULTS:
#+BEGIN_SRC dot :file a.png
digraph colla_schema {
UserA -> UserB[label = "Liked", color = green];
UserB -> UserA[label = "Liked_By", color = red];
}
#+END_SRC
#+RESULTS:
[[file:a.png]]
```

在每一个代码块执行`C-c C-c`即可看到结果(在windows配置完path之后,得重启系统,有些命令才有效)。
很有意思的文学编程。


<hr/>
<hr/>

Expand Down Expand Up @@ -1246,4 +1339,8 @@ orgmode计时,
[85]:http://members.optusnet.com.au/~charles57/GTD/remember.html
[86]:https://github.com/jueqingsizhe66/zhaoEmacs.d
[87]:http://www.fuzihao.org/blog/2015/02/19/org-mode%E6%95%99%E7%A8%8B/#%E5%88%97%E8%A1%A8

[88]:http://wenshanren.org/?p=327
[89]:http://www.3zso.com/archives/orgmode-babel.html
[90]:http://www.fuzihao.org/blog/2015/02/19/org-mode%E6%95%99%E7%A8%8B/#%E6%8F%92%E5%85%A5%E6%BA%90%E4%BB%A3%E7%A0%81
[91]:http://orgmode.org/worg/org-contrib/babel/languages.html
[92]:http://www.graphviz.org/Download_windows.php
Loading

0 comments on commit 484b329

Please sign in to comment.