3

I'm coming to emacs from Xcode. An Xcode feature I really like is the ability to type the lines

#pragma mark -
#pragma mark Section Heading Name

to mark the subsequent part of my code as belonging to a particular section. I can then jump to that section from a drop-down menu.

Does a similar ability to break up code into named sections and to jump to a section by name exist in emacs?

2 Answers 2

1

This is often called folding. There are several folding packages for Emacs.

  • A commonly used package is the simply-named folding package. It's not shipped with Emacs, you have to install it separately. Its preferred markers are {{{}}} but they can be configured.

  • You can use the built-in Outline minor mode. Set outline-regexp to "#pragma mark" and perhaps write an appropriate outline-level.

  • You may also be interested in hs-minor-mode, hide-ifdef-mode, and FoldDwim.

0
0

emacs has something called bookmarks, maybe it can be useful, take a look here (or here: http://www.cs.cmu.edu/cgi-bin/info2www?(emacs)Bookmarks).

You can also type inside emacs:

Ctrl + h a bookmark Enter

to see a list of functions about that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .