Questions tagged [hideshow]
hs-minor-mode is a builtin minor mode to selectively hide or show (fold/unfold) parts of code.
29
questions
0
votes
1
answer
54
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 ...
0
votes
1
answer
58
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 ...
0
votes
1
answer
75
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?
1
vote
2
answers
98
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 ...
1
vote
1
answer
87
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 ...
0
votes
1
answer
36
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 ...
3
votes
1
answer
32
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?
2
votes
1
answer
687
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 ...
1
vote
1
answer
87
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 ...
1
vote
0
answers
135
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 #+...
1
vote
1
answer
240
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 ...
0
votes
1
answer
188
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@...
2
votes
1
answer
285
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.
...
9
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 ...
1
vote
1
answer
95
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 ...
0
votes
2
answers
277
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
1
answer
93
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
1
answer
395
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-...
2
votes
2
answers
739
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
0
answers
126
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
1
answer
299
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
1
answer
197
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
0
answers
149
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
0
answers
50
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,...
12
votes
1
answer
201
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
1
answer
290
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
1
answer
380
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
0
answers
95
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 ...
7
votes
1
answer
63
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 ...