The Stack Overflow podcast is back! Listen to an interview with our new CEO.
46

Yes, you certainly can, you can use org-babel-load-file to do this. In your init.el, put the following: (require 'org) (org-babel-load-file (expand-file-name "settings.org" user-emacs-directory)) (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, ...


23

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 ...


14

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: (require 'org) (org-babel-load-file (expand-file-name "emacs-init.org" user-...


12

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 ...


6

One more vote for outline-mode. For example for organaizing .emacs I use the following syntax: ;;; HEADING: the important parts are ;;; and :\n (add-hook 'emacs-lisp-mode-hook (lambda () (make-local-variable 'outline-regexp) (setq outline-regexp "^;;; ") (make-local-variable 'outline-heading-end-regexp) ...


6

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. outline-minor-mode A key ...


5

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 ...


5

This can be done by creating a custom function that checks to see whether it's on an org-heading. (setq org-blank-before-new-entry '((heading . always) (plain-list-item . nil))) (defun call-rebinding-org-blank-behaviour (fn) (let ((org-blank-before-new-entry (copy-tree org-blank-before-new-entry))) (when (org-at-heading-p) ...


5

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 ...


5

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.


5

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 item." (and (or (org-at-heading-p) (org-at-item-p)) (invisible-p (point-at-eol)))) Note that, if you'd like to use it ...


4

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: C-c C-f Move point to the next visible heading line at the same level as the one point is on (outline-forward-same-level). C-c C-b Move point to the previous ...


4

latex-mode-hook is the hook for the default Emacs latex mode. You appear to be using AUCTeX, which uses the hook LaTeX-mode-hook (note capitalization). More info in the AUCTeX manual.


4

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 ...


4

You probably need (hide-sublevels 1).


3

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. https://stackoverflow.com/questions/25430029/whats-the-best-way-to-package-my-emacs-installation-packages-and-config-so-tha/25430745#25430745 I turned my config to org a few months ago, and I ...


2

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 ...


2

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-#") (...


2

You can use the M-x customize interface and set the value of outline-minor-mode-prefix to "\M-#".


2

There is binding C-c C-p which might please you. From the docstring: 'C-c C-p runs the command org-previous-visible-heading'. Also note C-c C-n for the move to the next heading.


2

Showing just a visible summary of the buffer is one of the features of org-mode, which is, in turn, built on top of outline-mode. 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/...


2

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." (interactive) (while (ignore-errors (...


2

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. thanks Jauncho!


2

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." :type 'regexp :group 'outline) (defun my-...


1

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." (interactive) (org-overview) (org-reveal) (org-...


1

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 ...


1

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-...


1

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,...


1

The following command hides parentless subtrees, and leaves text before the first header visible: (defun outline-hide-parentless-subtrees () "Hide subtrees below parentless headings." (interactive) (save-excursion (goto-char (point-min)) ;; edge case: is the first line a header? (if (outline-on-heading-p) (hide-subtree)) ;; ...


1

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 ...


Only top voted, non community-wiki answers of a minimum length are eligible