Skip to main content
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 ...
Drew's user avatar
  • 79.1k
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 ...
jue's user avatar
  • 4,686
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 ...
Tobias's user avatar
  • 33.7k
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 ...
ideasman42's user avatar
  • 9,157
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)
manandearth's user avatar
  • 2,138
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 ...
Tobias's user avatar
  • 33.7k
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 ...
NickD's user avatar
  • 33.6k
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 () (...
Bram Schoenmakers's user avatar
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-...
dalanicolai's user avatar
  • 7,985
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 ...
D. Gillis's user avatar
  • 496
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, ...
phils's user avatar
  • 53k
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
C-Entropy's user avatar
  • 143
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-...
Tobias's user avatar
  • 33.7k
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: ...
itirazimvar's user avatar
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
phils's user avatar
  • 53k
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 :...
actondev's user avatar
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 ...
nega's user avatar
  • 3,411
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 ...
Drew's user avatar
  • 79.1k
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 ...
Tobias's user avatar
  • 33.7k

Only top scored, non community-wiki answers of a minimum length are eligible