unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: tolugboji <tolugboji@protonmail.com>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Code folding in Emacs.
Date: Sun, 10 Oct 2021 11:37:56 +0000	[thread overview]
Message-ID: <S-D01c2_clBeeyprf5xJoScI3tMdHK1p_mr1DzUrxHNJ_BnuT3EQV3KSe4fx-WrDxZoh3tTjDv9bVZjj2gcvYvFiwV-wsSCQ97X9jv7Aw14=@protonmail.com> (raw)
In-Reply-To: <CAGP6POLzBYq8XSYG=VUf0TqdGBRkgpPuxK24BwDQ+WXOMbejqQ@mail.gmail.com>

Emacs should develop code folding (opening and closing) to also work with the mouse.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Sunday, October 10th, 2021 at 8:16 AM, Hongyi Zhao <hongyi.zhao@gmail.com> wrote:

> I just found the following code snippet from here [1] for code folding in Emacs:
>
> (global-set-key (kbd "<C-f5>") 'set-selective-display-dlw)
>
> (defun set-selective-display-dlw (&optional level)
>
> "Fold text indented same of more than the cursor.
>
> If level is set, set the indent level to LEVEL.
>
> If 'selective-display' is already set to LEVEL, clicking
>
> F5 again will unset 'selective-display' by setting it to 0."
>
> (interactive "P")
>
> (if (eq selective-display (1+ (current-column)))
>
> (set-selective-display 0)
>
> (set-selective-display (or level (1+ (current-column))))))
>
> The above code trick seems very simple, but it works for many
>
> languages. So I recommend it here.
>
> [1] https://discourse.julialang.org/t/code-folding-for-emacs/41421/3
>
> Regards
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Assoc. Prof. Hongyi Zhao hongyi.zhao@gmail.com
>
> Theory and Simulation of Materials
>
> Hebei Vocational University of Technology and Engineering
>
> No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



  reply	other threads:[~2021-10-10 11:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10  8:16 Code folding in Emacs Hongyi Zhao
2021-10-10 11:37 ` tolugboji [this message]
2021-10-10 11:54   ` Hongyi Zhao
2021-10-10 12:42     ` tolugboji
2021-10-10 13:16       ` Hongyi Zhao
2021-10-10 13:49         ` tolugboji
2021-10-10 16:35     ` Daniel Fleischer
2021-10-11  0:39       ` Hongyi Zhao
2021-10-11 12:09       ` Hongyi Zhao
2021-10-11 12:56         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-10 14:29 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-10 20:11 ` Eric S Fraga
2021-10-14  5:47 ` David Masterson
2021-10-14  8:21   ` Thibaut Verron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='S-D01c2_clBeeyprf5xJoScI3tMdHK1p_mr1DzUrxHNJ_BnuT3EQV3KSe4fx-WrDxZoh3tTjDv9bVZjj2gcvYvFiwV-wsSCQ97X9jv7Aw14=@protonmail.com' \
    --to=tolugboji@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).