Questions tagged [hideshow]

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

hs-minor-mode is just one code folding mode, other notable modes with folding capacity are:

  • outline
  • folding
  • evil-mode
  • yafolding
  • origami
  • fold-this
29 questions
12
votes
1 answer

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 printed representation of an object or iteratively…
ebpa
  • 7,319
  • 26
  • 53
8
votes
4 answers

Hide lines by regex

I am reading detailed line oriented log file (100MB). I want to skip some parts by using regex. Usually I M-x flush-lines but this is destructive operation. I want to hide many lines by regex and expect it would be efficient when I navigate across…
gavenkoa
  • 3,352
  • 19
  • 36
7
votes
1 answer

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 hideshow folds up blocks of code. For…
castle-bravo
  • 283
  • 1
  • 3
4
votes
1 answer

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-special-modes-alist '((alamo-mode "begin_data"…
z-nut
  • 43
  • 5
4
votes
1 answer

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: ############## ## Section foo ############## #' This does…
quazgar
  • 341
  • 1
  • 11
3
votes
1 answer

Is it possible for hideshow to display both the start and trailing comment characters?

Running hs-toggle-hiding converts a C-style multi-line comment from. /* * This is a comment. */ To: /* ... Is there a way to collepse the comment to: /* ... */ Instead?
ideasman42
  • 8,375
  • 1
  • 28
  • 105
3
votes
1 answer

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 should hide them, thus all blocks are hidden. Applying…
bertfred
  • 1,699
  • 1
  • 11
  • 23
2
votes
1 answer

How to fold nested list items in markdown-mode

I would like to be able to fold nested list items in markdown-mode in the same way that it is possible to do in org-mode, so that, for example, the first sub-item in the following list can be easily hidden. List item 1 List item 1.1 List item…
user32038
  • 31
  • 2
2
votes
1 answer

hs-minor-mode and sage-shell-mode (derived from python-mode)

I would like to use emacs' hide-show mode (to collapse class and function definitions) with Sho Takemori's sage-shell-mode (for the SageMath computer algebra system) which derives from python-mode. Although emacs does not complain when I do M-x…
2
votes
2 answers

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)
serv-inc
  • 816
  • 6
  • 26
2
votes
0 answers

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 there a way to fix linum? To reproduce: Create a…
Tohiko
  • 1,589
  • 1
  • 10
  • 22
2
votes
0 answers

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, how, please)? (Note: when asked about this on…
2
votes
0 answers

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 set the regexp to ":.*$" and fold the matches, it…
stacko
  • 1,577
  • 1
  • 11
  • 18
1
vote
2 answers

How to customize the delimiter in the minor mode Hideshow for use with JSON data?

The documentation of hs-minor-mode explains: In C mode and related modes, blocks are delimited by braces, while in Lisp mode they are delimited by parentheses. I use the mode to collapse objects while reading JSON files. This works fine, because…
ceving
  • 1,308
  • 1
  • 14
  • 28
1
vote
1 answer

How to prevent the moving of line numbers in display-line-numbers-mode

Sorry about the title, I don't know how to describe it better. Using display-line-numbers-mode with hs-hide-all to edit a Common Lisp file, I see the line number moving to the right, which is quite distracting and annoying. How could I prevent that…
C-Entropy
  • 143
  • 5
1
2