Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

hs-minor-mode is a builtin minor mode to selectively hide or show (fold/unfold) parts of code.

0
votes
2answers
43 views

Hide/fold matching braces in text mode

I have free-form text logs with JSON-ish objects that I would like to selectively hide when analyzing the logs. They look something like this 2018-10-09 09:47:34.269 [T] T { 2018-10-09 09:47:34.269 [...
1
vote
1answer
41 views

Number of lines the cursor is from the top of the screen when using hideshow.el

It's simple to find the number of lines from the cursor to top of the screen, eg: (- (line-number-at-pos (point)) (line-number-at-pos (window-start)))) However when the hideshow library is used to ...
4
votes
1answer
120 views

Folding code between a literal “begin”/“end” block using Hideshow

A formatted input file (*.alm) often contains a large section of columned data. To fold this and improve navigation, I've tried to implement a hs-special-mode-alist entry from hideshow.el. (setq hs-...
0
votes
0answers
35 views

Make highlight-symbol-jump work with invisible overlay

I'm trying to make highlight-symbol-jump from highlight-symbol.el work with hide-ifdef-mode. hide-ifdef-mode creates an invisible overlay when it hides lines. This make thing-at-point, which is used ...
1
vote
2answers
55 views

Hide only comments

In hs-mode, is there a way to only hide the comments (C-style, delimited by /* ...*/), and no other blocks of code? (there was nothing obvious in M-x customize-group hideshow)
1
vote
0answers
33 views

How do I add a new hideshow block to Python mode?

I'm using a Python decorator that takes so many arguments it happens to frequently span multiple lines, and so I'd like to configure hs-minor-mode to recognize the decorator lines as a hideable block. ...
0
votes
1answer
50 views

How can I configure hideshow to hide comments in longer programs only?

If I start Emacs 25 with an init file (.emacs) containing (package-initialize) (load-library "hideshow") (add-hook 'python-mode-hook (lambda () (hs-minor-mode 1)) ) (setq hs-minor-mode-hook 'hs-hide-...
4
votes
0answers
77 views

hs-minor-mode: hide only some comment

In ESS mode with hs-minor-mode on, I want to collapse only those comments which directly belong to a function, not other comments which are separated by newlines. Take this example: ############## ##...
2
votes
0answers
80 views

hide-show with linum

When working on huge files, it seems that when hide-show collapses a large multi-line block, linum still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is ...
2
votes
0answers
35 views

Using hideshow with Perl code / POD

I've got emacs' HideShow mode working well with Perl code (let's face it, it's a doddle), but I don't know if it's even possible to get it to fold POD comments as well. Has anyone done this (and if so,...
13
votes
1answer
143 views

Methods for examining large/complicated lisp objects

I've been working with some org export engine code which passes around some rather large and complex list objects. It's rather tedious to explore an object by reading through a long word-wrapped ...
1
vote
1answer
114 views

How does this forward-sexp-function in hs-special-mode-alist work?

I wanted to look up the different hs-special-mode-alist forward-sexp functions for inspiration to create my own and this is what the python forward-sexp looks like on my setup: ;; (MODE START END ...
3
votes
1answer
153 views

hiding and showing all blocks with one binding

I want to combine the commands hs-hide-all and hs-show-all. It would be great if I'd have a function that detects the "status" of all blocks. If there are blocks that aren't hidden, the function ...
2
votes
0answers
56 views

Collapse regexp matches within a line

Is there a way I can collapse/expand regexp matches within a line? e.g. let's say I have this list and want to hide some parts of it temporarily: * apple: fruit; red * butter: dairy; yellow when I ...
8
votes
1answer
45 views

Folding up URLs

I am editing a document with lots of URLs in it, and I would like to automatically fold them down to just the last part of the URL so that they take up less room on the line, similar to the way ...