org-mode

M-RET behave differently in org mode 8.0.3

拈花ヽ惹草 提交于 2019-12-10 22:14:43
问题 My emacs version is GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN. If I start emacs with '-q' option, I'll use the built-in org-mode 7.9.3f, and for following text * Level 1 ** Level 2 Some text for level2. if I press M-RET at the end of the last line, I'll get a new heading in a new line. * Level 1 ** Level 2 Some text for level2. ** However, in org mode 8.0.3(from ELPA), it makes the last line a new heading instead of inserting a new one. * Level 1 ** Level 2 ** Some text

How to pipe input to a src_block as stdin ?

♀尐吖头ヾ 提交于 2019-12-10 14:48:56
问题 Consider the following snippet of perl in org-babel, which uses <STDIN> . ** Ans 2 #+begin_src perl :results output use Math::Trig; $rad = <STDIN>; $circumference = 2*pi*$rad; print "Circumference of circle is $circumference"; #+end_src Is it possible to pipe the input to this block from another block ? Say : #+begin_src text :name test-input 12.5 #+end_src 回答1: You can pass $rad directly to the perl script from a #+results block : see passing arguments to code blocks in the manual. That

org-mode can't edit C source code

♀尐吖头ヾ 提交于 2019-12-10 14:16:49
问题 When I use emacs's org-mode to edit a C program, that is when I edit the below segment: #+begin_src c #define MAX 100 #+end_src and after I call the function 'org-edit-src-code' to edit the C code in a new buffer, there is an error: Language mode `c-mode' fails with: stringp and I can neither save to nor return to the original buffer after I edit the code in the new buffer. Every other languages can work without any problem, including C++, elisp, sh. How can I fix this problem? My org-mode

Org Agenda regexp search Categories

99封情书 提交于 2019-12-10 13:26:16
问题 I like to structure my org-mode projects using the :CATEGORY: property, however categories seem not to be recognised by org-agenda-filter-by-regexp (bound to = ). When viewing a rather large list of TODO items, it would be helpful to be able to narrow the list to matching categories. I know that I can use org-agenda-filter-by-category ( < ), but this command must be executed on the category entry. Is there a way to regexp filter the Org Agenda including categories? The function below performs

emacs org-odt-export-as-odf-and-open odt outside emacs

依然范特西╮ 提交于 2019-12-10 11:35:43
问题 The intuitive use for the orgmode option to export and view and odt file should be to view it in an libre/open office. However, I've so far had no luck in getting it to work; it always opens as a compressed archive in emacs. By inserting into my .emacs (add-to-list 'org-file-apps '("\\.odt\\'" . "xdg-open %s")) I open them properly when accessing links to files in org files, but it doesn't seem to effect the export-and-view option. I've looked into changing org-odt-export-as-odf-and-open but

How can I use specific protocol (in my case : txmt) with Org mode?

放肆的年华 提交于 2019-12-10 10:57:19
问题 I have TextMate running on Mac, and it has txmt protocol, that I can use as on web browser such as txmt://open/?url=file:///Users/smcho/smcho/bin/rst2html . I can use TextMate for editing rst2html. However, when I tried to use this protocol with Org-mode as [txmt://open/?url=file:///Users/smcho/smcho/bin/rst2html] , instead of opening TextMate, the rst2html binary is running. I tried (setq org-link-abbrev-alist '( ("edit" . "txmt://open/?url=file://%s") )) to use [edit:/Users/smcho/smcho/bin

how to specify a property value of a variable in emacs lisp

≯℡__Kan透↙ 提交于 2019-12-10 10:04:41
问题 I use the following code in .emacs file to set default publish behavior. I put the org base directory in difference locations for difference computers: ;; define machine specific directories storing my org files (cond ((system-name-is-home) (setq org-dir "/data/org")) ((system-name-is-work) (setq org-dir "~/org"))) Thus I'd like to use a variable to specify :base-directory to org-dir instead of hard-coding it as "~/org" . How can I do that? (require 'org-publish) (setq org-publish-project

How to align the calendar with week number as the intermonth-text

孤人 提交于 2019-12-10 03:26:27
问题 When I use Emacs calendar/diary with org-mode(however I do not think this is the reason of the problem), I encounter the following problem. The default calendar is like this: I add the following codes to display week number: (copy-face font-lock-constant-face 'calendar-iso-week-face) (set-face-attribute 'calendar-iso-week-face nil :height 1) (setq calendar-intermonth-text '(propertize (format "%2d" (car (calendar-iso-from-absolute (calendar-absolute-from-gregorian (list month day year)))))

How do you copy just the visible text from the folded state in an org-mode buffer?

可紊 提交于 2019-12-10 02:08:27
问题 How to copy org file to other buffer, if source is: ** TODO task #1 - some text for task #1 ** TODO task #2 - some text for task #2 but when you collapse all tasks it will look like ** TODO task #1 ... ** TODO task #2 ... I want to mark all tasks and copy to another buffer and it must look like a second variant. Don't include texts for tasks which stored inside every task. How i can to do it ? 回答1: As per Hendy's comment, in current versions of org-mode you use org-copy-visible ( C-c C-x v )

Make the source code from one code block the input to another code block in Emacs org-mode

扶醉桌前 提交于 2019-12-10 01:56:48
问题 I'm getting started with org-mode and there's something I'd like to do that seems like it should be possible, but I'm having trouble figuring out. Let me describe the scenario: I have some SQL code that I want to execute on a remote server. I currently have a python script that takes SQL code as a string and does this for me. Without org-mode, my work flow would be to start with a file like so: echo "SELECT name, grade FROM students" >> basic_query.sql and then I'd run: $ python run_query.py