Emacs org-mode: wrong indentation and missing stars - emacs

After updating org to the latest version (configuration unchanged), I face the problem that the structure is not displayed properly.
In text mode, the structure looks like this:
* heading 1
** heading 2
*** heading 3
**** heading 4
In Org-mode, with org-indent-mode switched on, it looks different (note: switching org-indent-mode off does only change indentation, not the look):
* heading 1
* heading 2
heading 3
heading 4
It seems, that for some reason the indentation for heading 3 and subsequent headings is broken. org-current-level returns the correct level for each heading.
This behaviour is reproducable with a clean org file.
System is org 9.1.3, emacs 25.1.1 on Win10.

Related

Visual Studio Indent Using Spaces never saves the setting

So the standard setting seems to be 1 tab equals 2 spaces for indentation. I always change that to 4 spaces, you can see that here
. But that setting never seems to save. When I work with Visual Studio on the next day, its back to 2. May it be that the Prettier Extension is overwriting something?
I found the problem: The setting "Editor: Detect Indentation" has to be turned off. Also you can go to Prettier's Settings and set the Indentation to 4 Spaces too, so when autoformatting, the indentation of 4 instead of 2 spaces is kept.

M-RET to make text into same-level headline in org-mode

In org-mode < 8 M-RET at the beginning of non-headline text will make that text into a headline with the same level as the one above.
Example:
* Headline
Text
If the cursor is in the beginning of 'Text' then M-RET will produce:
* Headline
* Text
In org-mode > 8 this behavior has changed. The same action will produce:
* Headline
*
Text
What would be a way to easily make text into a headline like in the < 8 versions of org-mode?
(C-* comes close but will produce a headline one level below the above:
* Headline
** Text
)
(NB: It isn't the same as this issue which I guess has been fixed. Anyways I'm not getting that in org-mode 8.2.5h-dist)
M-RETruns org-meta-returnin my old org-mode. And according to the docs that runs org-insert-heading. You could perhaps try that command or have a look at the code for it.

in org-mode, how to begin numbering at a certain heading depth?

For HTML export, is there a way to instruct org-mode to BEGIN heading number at a certain heading depth? So that the top-level headings are NOT numbered?
So i.e. the export would look like this:
The first top-level heading
1. Heading
1.1 Heading
1.2 Heading
2. Heading
2.1 Heading
2.2 Heading
The second top-level heading
1. Heading
1.1 Heading
1.2 Heading
2. Heading
2.1 Heading
2.2 Heading
There is no default solution -- at least, currently -- to that problem.
However, you can quite easily solve this by a couple of CSS rules.

Org mode insert heading behaving stranglely

I probably have some broken config but I can't figure out what I set to break this.
If I have an outline like
* Heading
** Subheading1
** Subheading2
If I hit M-return or C-return when the cursor is at subheading1 I end up with
* Heading
** Subheading1
**
** Subheading2
It should be producing a new subheading, but instead produces something indented which is not treated as a sub heading.
Anyone know how I broke my org mode?

Organizing notes with tags in org-mode

So, I use org-mode extensively for my daily TODO requirements. I am wondering if I can also use it effectively for note keeping. What I basically want is to store notes with tags, and then want to search these notes by the tags. E.g. If I have something like this
* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
** Note 2 :tag3:
Note 2 details
* Heading 2
** Note 3
** Note 4 :tag1:
Note 4 details
and then I search for tag1, I should have something like-
* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
* Heading 2
** Note 4 :tag1:
Note 4 details
I would prefer being able to do this without adding the files to my agenda. (I may have several of these notes, and I would only want to search the current file at a time.)
Is there an easy (or not so easy) way to accomplish this org-mode?
The following function should provide the result you want.
(defun zin/org-tag-match-context (&optional todo-only match)
"Identical search to `org-match-sparse-tree', but shows the content of the matches."
(interactive "P")
(org-prepare-agenda-buffers (list (current-buffer)))
(org-overview)
(org-remove-occur-highlights)
(org-scan-tags '(progn (org-show-entry)
(org-show-context))
(cdr (org-make-tags-matcher match)) todo-only))
You can use a tag search (C-c / m tag1 <ret>). Documentation here:
http://orgmode.org/manual/Tag-searches.html
This will create a sparse tree showing only the headings containing :tag1:, but it will not automatically reveal the contents of that heading as in your example.