Yes, you certainly can, you can use org-babel-load-file to do this.
In your init.el, put the following:
(I'm using ~/.emacs.d/settings.org but that is personal preference). In the settings.org file you can arrange it however you would like, ...
If all you want is selective showing of sections and navigation between headings, you don't need Org mode. All you need is Outline mode. Outline mode is basically the header level and section visibility management of Org mode. In fact, Org mode was originally the author's extensions to Outline mode, and grew, and grew, and grew… Even today, org-mode is ...
Literate programming takes you the most way there, org-mode supports it via org-babel. Two possible solutions are explained on @malabarba's blog:
The simplest way is loading org-mode, then using its untangling feature to load a literate Emacs configuration:
C-c C-u runs the command outline-up-heading, which moves up to the parent heading. C-c C-f runs the command org-forward-same-level, which moves forward to the next heading at the same level. You can mix and match as you like to get what you need.
C-c C-j runs the command org-goto, which provides a general interface for quickly navigating through all ...
One more vote for outline-mode. For example for organaizing .emacs I use the following syntax:
the important parts are ;;; and :\n
(setq outline-regexp "^;;; ")
Outline mode and the AUCTeX folding facilities are two different beasts that are meant to do broadly the same thing: hide and show selected parts of the buffer. Personally, I find the AUCTeX facilities to be rather jarring and rarely use them, but your mileage may vary. I use the outlining functionality all the time, however.
A key ...
I believe the relevant Emacs function is indent-according-to-mode, which delegates to a mode-specific function registered with the variable indent-line-function.
Looking at the source for verilog mode, I see that it sets indent-line-function to verilog-indent-line-relative.
One option is to advise verilog-indent-line-relative to check for your special ...
This can be done by creating a custom function that checks to see whether it's on an org-heading.
'((heading . always)
(plain-list-item . nil)))
(defun call-rebinding-org-blank-behaviour (fn)
Q: "However, what I'd like to do is customize the ellipsis so that it takes the same face as the outline header it is on. How would one do that?"
A: This cannot be done using the buffer-display-table. It's an all or nothing type of deal -- i.e., a change to the buffer-display-table affects everything in the buffer, not merely a particular heading. It ...
I had the same problem with outline-minor-mode and the following line in my init.el was the culprit:
(setq outline-minor-mode-prefix "C-c C-o")
Seems like that was interpreting the first "C" as Shift-C instead of Control.
There's a simple way to test whether a heading or list item is
folded: the text within it will be invisible. As such, you can use:
(defun org-folded-p ()
"Returns non-nil if point is on a folded headline or plain list
(and (or (org-at-heading-p)
Note that, if you'd like to use it ...
As the other answer on that post points out, org-mode is built on top of outline-mode, so you have access to all of the outline motion commands. According to the manual, you can use:
Move point to the next visible heading line at the same level as the one point is on (outline-forward-same-level).
Move point to the previous ...
org-mode is built on top of outline-mode, so you can use all the outline navigation commands. The one most relevant to your question will be outline-previous-visible-heading. You should probably find a comfortable keybinding if you plan to use it a lot.
Note that there is also a non-interactive org-back-to-heading that you could wrap in a command, if you ...
On the following SO answer you will see how to do it, example projects using one single org file or many, what's the benefit of using Cask and links to documentation.
I turned my config to org a few months ago, and I ...
Since the change was made as part of the Outline rewrite between Emacs 19 and Emacs 20 to use overlays (or close thereto), I had a look at the differences between hide-other from Emacs 19.34 and from Emacs 20.7. The change is easy enough to spot: in the Emacs 20+ definition, the body of the loop that traverses the headings upwards shows the heading it ...
As @kaushalmodi explained, you can do this with the customize interface. For the safe of completion, the answer to your original question is that "loading" a library always refers to calling load or require on it. So, in you case, the setq needs to come before the require (that's what the docstring is telling you).
(setq outline-minor-mode-prefix "\M-#")
Showing just a visible summary of the buffer is one of the
features of org-mode, which is, in turn, built on top
The idea is to get a lot of the details out of the way so you can
get an overview of the buffer contents, and then drill down into
the relevant sections by unfolding/showing the contents while
leaving everything else folded/...
The following code (lightly tested) takes advantage of the fact
that org-mode is derived from outline-mode, which allows you
to use the latter's functions. It simply jumps up headlines
until it can't go any further, and then hides the subtree.
(defun foldup ()
"Hide the entire subtree from root headline at point."
(while (ignore-errors (...
As Jauncho points out, this is supported directly, as the function help shows:
(org-shifttab &optional ARG)
Global visibility cycling or move to previous table field.
Call ‘org-table-previous-field’ within a table.
When ARG is nil, cycle globally through visibility states.
When ARG is a numeric prefix, show contents of this level.
Drew already gave you the link to Outline Format in his answer. There follows a simple application example. You can copy the stuff into the *scratch*-buffer and call M-x eval-buffer RET.
(defcustom my-outline-regexp "\\([0-9]+\\)"
"Regular expression to match the beginning of a heading with numbered level."
Edited in response to first comment
Not quite sure if this is what you want, but here's a function that will show the current subtree (and its children) and fold all other headings to their top level:
(defun ess/org-show-just-me (&rest _)
"Fold all other trees, then show entire current subtree."
Since you mentioned in your PPS, you can set org-ellipsis to a face. Looking at org-ellipsis docstring in org.el, it says org-ellipsis can be set to a face:
(defcustom org-ellipsis nil
"The ellipsis to use in the Org-mode outline.
When nil, just use the standard three dots.
When a string, use that string instead.
When a face, use the standard 3 dots, but ...
As wasamasa already pointed out word-wrapping only a part of the buffer requires most probably some re-plumping.
The following demonstrates an idea. It works with truncated lines and puts a newline with indent before the word reaching fill-column.
I am aware that this is not perfect. Some things that are not handled:
word wrapping does not adapt to window-...
Not a direct answer to your indentation question - @glucas has provided that. But some info that might also help.
The lines in question are apparently comment lines. You can use Lisp macro with-comments-hidden to ignore comments. The comments are temporarily hidden for the duration of the macro body (though you do not see any visible change).
So you could,...
The following command hides parentless subtrees, and leaves text
before the first header visible:
(defun outline-hide-parentless-subtrees ()
"Hide subtrees below parentless headings."
;; edge case: is the first line a header?
This functionality is already built in to org mode. You just need to set the following option in your init file:
(setq org-cycle-emulate-tab nil)
With that setting the TAB key should always call org-cycle on the current subtree, wherever your cursor happens to be. There are other possible values for this variable, which give more fine-grained control ...