5
votes
Hide lines by regex
I agree with comments that suggest using flush-lines. I would likely use that in this case, especially since your use case is line-oriented.
But if you want to make text that matches a regexp ...
5
votes
Hide lines by regex
You want to use occur. This feature is built-in and it does exactly what you want.
There is also a package called loccur, which does the same, but does not create a new window (it just hides all non ...
4
votes
How to fold nested list items in markdown-mode
markdown-mode uses parts of outline-mode for folding. So, IMHO it is most natural to implement the folding of items also with the help of outline-mode.
The most obvious way would be:
to include ...
3
votes
Is it possible for hideshow to display both the start and trailing comment characters?
This can be done using advice on hs-make-overlay:
(defun my-c-comment-end-skip-backward (pos)
(cond
((and (eq (char-before pos) ?/) (eq (char-before (- pos 1)) ?*))
(- pos 2))
(t
...
2
votes
Number of lines the cursor is from the top of the screen when using hideshow.el
M-x what-line gives both the relative line number and the narrow buffer number in the mini buffer echo area, for example:
M-x what-line
line 189 (narrowed line 1)
2
votes
Accepted
Folding code between a literal "begin"/"end" block using Hideshow
You did not implement alamo-forward-sexp correctly. If point is at begin_data almo-forward-sexp does not go to the block end, i.e., to the end of end_data but to the end of alamo-forward-sexp.
A ...
2
votes
Accepted
Copy-visible for hideshow mode?
Try running org-copy-visible itself. AFAICT, it does not place any requirements on the buffer (e.g. it does not require that it should be an Org mode buffer). In light testing, it seems to work: I ...
1
vote
Use hs-minor-mode where it's not supported
There are two variables that could help you, which you can set when starting an eshell buffer:
(add-hook 'eshell-mode-hook #'outline-minor-mode)
(add-hook 'eshell-mode-hook
(lambda () (...
1
vote
Accepted
How to disable hideshow minor mode when editing?
You could define the following function
(defun hs-show-all-on-editing ()
(unless (member last-command-event '(up down left right))
(hs-show-all)
(remove-hook 'pre-command-hook #'hs-show-all-...
1
vote
Hideshow minor mode in LaTeX
HideShow has a non-interactive function that hides a region (hs-hide-comment-region). I've written a wrapper function to call this function on the current region, if it is active. You can have the ...
1
vote
Accepted
How to customize the delimiter in the minor mode Hideshow for use with JSON data?
M-x finder-commentary RET hideshow RET says:
Normally, hideshow tries to determine appropriate values for block
and comment definitions by examining the buffer's major mode. If
there are problems, ...
1
vote
Accepted
How to prevent the moving of line numbers in display-line-numbers-mode
It turns out to be an emacs bug, see here
should be fixed in 28-branch
1
vote
Accepted
hs-minor-mode and sage-shell-mode (derived from python-mode)
I already filled a feature request for recognizing derived modes through hideshow.
Until this feature request is handled you can use the following workaround in your init file:
(defun my-sage-...
1
vote
Hide lines by regex
I found this most easy solution. https://github.com/vapniks/hide-lines
Some functions are here which can be useful for your scenario
hide-lines : Hide lines matching the specified regexp.
Keybinding: ...
1
vote
Hide lines by regex
Try this:
M-x query-replace-regexp RET .*FOO.* C-qC-jRET \,(propertize \& 'invisible t) RET
See also C-hig (elisp)Invisible Text
1
vote
hideshowvis text shown in Org mode source code
Just stumbled upon this. It depends where/how you enable the hideshowvis-minor-mode. In my case I had something like
(use-package hideshowvis
;; https://www.emacswiki.org/emacs/hideshowvis.el
:...
1
vote
Accepted
Hide/fold matching braces in text mode
In the text-mode buffer where your log is, set comment-start.
hideshow checks this and comment-end at the beginning of hs-grok-mode-type(). hs-grok-mode-type() says:
Set up hideshow variables for ...
1
vote
Hide only comments
This does not directly answer your question, but it might be an alternative to consider.
Library hide-comnt.el is designed to let you hide or ignore comments.
There are commands to hide, show, and ...
1
vote
Accepted
Hide only comments
You can just set hs-hide-all-non-comment-function to #'ignore.
If you want to do that globally put the following in your init file:
(setq hs-hide-all-non-comment-function #'ignore)
If you want to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hideshow × 31code-folding × 9
org-mode × 2
comment × 2
line-numbers × 2
latex × 1
python × 1
fonts × 1
major-mode × 1
eshell × 1
html × 1
highlighting × 1
c × 1
performance × 1
kill-ring × 1
markdown-mode × 1
linum-mode × 1
clojure × 1
json × 1
outline × 1
perl × 1
sexp × 1
notmuch × 1
delimiters × 1
interactive-development × 1