org-mode

Extract the second level headline

為{幸葍}努か 提交于 2019-12-22 12:21:38
问题 For my global TODO list, I am showing breadcrumbs as suggested here : (concat \"[ \"(org-format-outline-path (org-get-outline-path)) \" ]\") ") to produce following: I would like to show only the second level of project breadcrumb. So in this case, I would only display [Project A] . I think if I can make a function that can extract the second level, I just need to prepend with %? so that [Tasks] does not appear for Tasks, but only project names would appear for Projects. What would be an

Emacs force org-mode capture buffer to open in a new window

十年热恋 提交于 2019-12-22 08:39:52
问题 How do I force org-mode's capture buffer to open in a new window? I tried (setq special-display-regexps '("^\\*Capture\\*$")) but it did not work - I see a new window momentarily and then org-mode makes two vertical splits (I'm using 3 vertical splits), and put the capture buffer into the right split. When I'm done by either C-c C-c or C-c C-k , the original split setting is restored. 回答1: I, too, like to use many side-by-side splits (usually 4 -- I'm spread across multiple monitors), so org

lazy loading of only the first N lines in emacs org-mode

微笑、不失礼 提交于 2019-12-22 05:42:07
问题 Is there a way to tell org-mode to load only the first N lines of a long text file? I would like to keep the whole file open to be able to search through it, but have org-mode display on the first N lines of my file, which is where I edit new content. 回答1: If you have a structured outline in org-mode, you can set the global file visibility with the #+STARTUP markup, or the visibility of any heading with the VISIBILITY property, see Visibility Cycling for details. The benefit of using the

How to set a buffer locally face attribute for a particular buffer?

老子叫甜甜 提交于 2019-12-22 04:34:07
问题 I want to change the face attribute in Org-Agenda buffer only. So I need to change Org-Agenda face attribute buffer locally . Here is my code: (which is globally) (defun my-org-agenda-hl-line () (hl-line-mode) (set-face-attribute 'hl-line nil :box '(:color "deep pink" :line-width 2)) ) (add-hook 'org-agenda-mode-hook 'my-org-agenda-hl-line) Please to help me make this buffer locally. Thanks 回答1: Here is what you need to do: ;; First create new face which is a copy of hl-line-face (copy-face

Emacs initialization as org file: how can I get the right version of org-mode?

荒凉一梦 提交于 2019-12-21 07:43:09
问题 I've been experimenting with the org-babel tutorial that describes how to put the bulk of your emacs init.el file into an org file. However, I would like to use org-mode 8 (mainly for the new exporter) and I'm on gnu emacs 24.3.1 (for windows) which comes with org-mode 7.9 built-in, so I have org-mode installed from the elpa package manager instead of using the built-in version. My problem is that emacs loads the org-mode that comes with emacs rather than the one I have installed in elpa. Is

Emacs initialization as org file: how can I get the right version of org-mode?

☆樱花仙子☆ 提交于 2019-12-21 07:41:33
问题 I've been experimenting with the org-babel tutorial that describes how to put the bulk of your emacs init.el file into an org file. However, I would like to use org-mode 8 (mainly for the new exporter) and I'm on gnu emacs 24.3.1 (for windows) which comes with org-mode 7.9 built-in, so I have org-mode installed from the elpa package manager instead of using the built-in version. My problem is that emacs loads the org-mode that comes with emacs rather than the one I have installed in elpa. Is

Hiding markup elements in org-mode

前提是你 提交于 2019-12-21 06:47:50
问题 There are plenty structural markup elements in org-mode like *bold* or /italic/ , but they are visible in the org-mode text, which is good, if the file is intended for export, and bad, if it is intended for semi-WYSIWYG editing. I want to hide these markup symbols, so the *bold* becomes bold , just like links hide their square brackets. Is that possible in org-mode out of the box? If not, then please suggest an elisp code, that can solve this problem. 回答1: Try: (setq org-hide-emphasis-markers

org--agenda-prefix-format %? does not work

ぐ巨炮叔叔 提交于 2019-12-21 06:04:11
问题 Currently, I have my global TODO list shown as follows thanks to erikstokes: (org-agenda-prefix-format " %i %?-12(concat \"[ \"(org-format-outline-path (list (nth 1 (org-get-outline-path)))) \" ]\") "))) which outputs: for org layout: However, as you can see, for Task A, even though there is nothing in the project, it still shows up on the list. describe-variable for org-agenda-prefix-format says : If the first character after `%' is a question mark, the entire field will only be included if

Export code block names in cweb or noweb style?

笑着哭i 提交于 2019-12-21 05:45:12
问题 When writing a literate program in Org mode, exporting is analogous to weaving in earlier literate programming tools such as cweb or noweb. Those tools would add a code block name to the woven (exported) output. In Org mode, it would look something like this: Org file: #+NAME: mycodeblock #+BEGIN_SRC language [Source code here] #+END_SRC Exported output: <mycodeblock>= [Source code here] I am wondering if there is any support in Org mode for exporting names of code blocks in this style. If

Emacs org-mode python blocks have 5 space tabs, but I want 4 space tabs

ε祈祈猫儿з 提交于 2019-12-21 05:01:02
问题 I'm writing python code inside source blocks within an org-mode file; I'm editing the code-block in a sub-buffer, in python mode using the emacs command C-c ' Example: #+begin_src python def function(x): hitting_tab_inserts_5_spaces=x*2 if x<0: hitting_tab_inserts_5_spaces=-x return x and I'm getting 5 space tabs everywhere, instead of the 4 space tabs that I want. Note: I have viper (vim emulation) on. Where in the configuration are the parameters that affect tabination inside codeblocks in