Skip to main content

Questions tagged [hideshow]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

How to use hideshow to fold the `#ifdef`

I use the package hideshow to fold/unfold codes. Recently I write some code to enable folding the #ifdef, #endif in c-mode like that (add-to-list 'hs-special-modes-alist '(c-mode &...
Thysrael's user avatar
0 votes
1 answer
22 views

Copy-visible for hideshow mode?

Is there an analog of org-copy-visible for hideshow minor mode? An example use case is: enter Python file -> hide all top-level -> copy visible and now I have a list of top-level defs in the ...
Eric Auld's user avatar
0 votes
1 answer
86 views

Use hs-minor-mode where it's not supported

I'd like to use hs-minor-mode is some buffers that are not related code editing, but still includes some structured data which I'd like to fold. For instance, in eshell I run a program with some debug ...
fevgenym's user avatar
  • 101
0 votes
1 answer
77 views

How to disable hideshow minor mode when editing?

I am trying to implement the following behavior: when hideshow minor mode is enabled and user start editing file (or alternatively pressed spacebar or enter key): automatically execute hs-show-all or ...
WorkPerNap's user avatar
0 votes
1 answer
99 views

Hideshow minor mode in LaTeX

It seems that HideShow mode is not compatible with LaTeX. Is there any way to achieve a similar effect: hide some blocks that I highlight?
Atbey's user avatar
  • 101
1 vote
2 answers
137 views

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 ...
ceving's user avatar
  • 1,378
1 vote
1 answer
95 views

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 ...
C-Entropy's user avatar
  • 143
0 votes
1 answer
44 views

How to make hideshow (hs-toggle-hiding) delimit blank lines for comments?

When using hideshow (specifically hs-hide-initial-comment-block), I often run into the problem where the very first comment is a license block, followed by a more detailed comment on the purpose of ...
ideasman42's user avatar
  • 8,856
3 votes
1 answer
33 views

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's user avatar
  • 8,856
2 votes
1 answer
799 views

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 ...
user32038's user avatar
2 votes
1 answer
98 views

hide-show display multiple lines while collapsed

Is it possible to have hide-show folding display multiple lines (probably 3) in the folded version? This would get us practically to having a codox-like view right inside a buffer. What I'm trying to ...
Micah Elliott's user avatar
1 vote
0 answers
159 views

Is it possible to create a way to toggle showing/hiding/changing text following a pattern? (org-mode or generally)

I'd like to create a way to toggle showing/hiding/changing text following a pattern in org-mode, but if it works generally, that's fine also. A few examples of where this might be useful. Hiding #+...
avv's user avatar
  • 1,573
1 vote
1 answer
265 views

Unable to fold code in Elpy

I am trying to get code folding to work in Elpy. I have turned the folding module on already. However, I still seem to be unable to fold code. When I click on the first line of a while loop, I get the ...
bluefyre91's user avatar
0 votes
1 answer
214 views

How to hide/fold parts of messages in notmuch

I've been trying various combinations of folding modes for Emacs, trying to get them to work with notmuch-show-mode, but to no avail: Given two messages like this: Summary: Some Guy <someguy@...
Rune Kaagaard's user avatar
2 votes
1 answer
299 views

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. ...
Martin Rubey's user avatar
10 votes
4 answers
2k views

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 ...
gavenkoa's user avatar
  • 3,462
1 vote
1 answer
96 views

hideshowvis text shown in Org mode source code

I am using in Org-mode to document inherited Java code. Here is shown an enum: However, when I export to HTML, the document is rendered like this: Which incorrectly shows a *hideshowvis* text. I ...
nephewtom's user avatar
  • 2,271
0 votes
2 answers
305 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 [...
Per Knytt's user avatar
  • 103
1 vote
1 answer
94 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 ...
ideasman42's user avatar
  • 8,856
4 votes
1 answer
417 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-...
z-nut's user avatar
  • 43
2 votes
2 answers
818 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)
serv-inc's user avatar
  • 838
1 vote
0 answers
128 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. ...
purple_arrows's user avatar
0 votes
1 answer
340 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-...
Calaf's user avatar
  • 483
4 votes
1 answer
216 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: ############## ##...
quazgar's user avatar
  • 341
2 votes
0 answers
151 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 ...
Tohiko's user avatar
  • 1,649
2 votes
0 answers
52 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,...
DiamondGeezer's user avatar
12 votes
1 answer
203 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 ...
ebpa's user avatar
  • 7,519
1 vote
1 answer
299 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 ...
The Unfun Cat's user avatar
3 votes
1 answer
393 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 ...
bertfred's user avatar
  • 1,729
2 votes
0 answers
96 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 ...
stacko's user avatar
  • 1,597
7 votes
1 answer
67 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 ...
castle-bravo's user avatar