There is this well-known package hide-region Link to the package (hide-region.el) I want to apply hide-region-hide from a certain "point a" to "point b" [a region] in my file. How can I do this? What I need to define? It works when I highlight manually some text, but I need to do it in my code and give it the beg. of a region and end of region and apply it to the resulted region.
相关问题
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
- Emacs CEDET Semantic tag folding
- how to return function in elisp
- How to make Emacs lock-buffer fail when it cannot
相关文章
- Does learning one Lisp help in learning the other?
- How to permanently enable the hs-minor-mode in ema
- How do I control emacs from a terminal?
- Advice for “kill-ring-save”
- Custom shells started automatically from .emacs
- Swap parentheses and square brackets in Emacs Pare
- Run commands in Emacs asynchronously, but display
- Emacs: Stop popup window for gpg passphrase [close
The package is somewhat poorly written, and does not allow you to pass it a region as arguments to the function. You can probably work around this by something like
It would be better if
hide-region-hide
took the region as arguments when called noninteractively, though. Perhaps the maintainer would be happy to accept a patch for this. See also the documentation forset-mark
which specifically advises against using it like I have done above. Furthermore, perhaps you also want to look at the documentation forsave-excursion
.