unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Christopher Dimech <dimech@gmx.com>
To: Jean Louis <bugs@gnu.support>
Cc: help-gnu-emacs@gnu.org
Subject: Re: outline-minor-mode and org-mode capabilities for programming languages
Date: Mon, 10 May 2021 03:49:20 +0200	[thread overview]
Message-ID: <trinity-3bba264f-2c93-43de-ba29-29a942d3f7ea-1620611360594@3c-app-mailcom-bs04> (raw)
In-Reply-To: <YJgg97Zy4CjZSXzC@protected.localdomain>

> Sent: Monday, May 10, 2021 at 5:50 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: help-gnu-emacs@gnu.org
> Subject: Re: outline-minor-mode and org-mode capabilities for programming languages
>
> * Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-09 20:36]> > I can think that you barely use TAB in Emacs Lisp, but I use
> > > it very frequently to indent the lines, including to indent
> > > lines when region is active, and often I may use it on the
> > > whole marked buffer.
> >
> > You barely use it, but you use it all the time ... and so do
> > I :)
>
> Correction tip: when outline-minor-mode-cycle is TRUE, as functions
> are usually anyway on the beginning of the line, the TAB works just
> well to open and close the function.

Here you mention a different capability, that of function hide/show.
But then there is a different capability most prominent in org-mode,
where you hide/show by heading.  In programming languages which do not
allow multi-line comments, one can use a function so that when
you call it you put the asterisk on the first column of the next line,
so it can be treated as a heading.

Referring back to <tab>, I come from fortran where we used to hit <tab>
just as we do with elisp.  Fortran managed te get out of using the tab
during its development of free-format.

Indentation  is handled by using the <return> key, it gets you to the correct
indent column. you can also use enter at the beginning of the line.

fortran-mode also allows you to set different indentations according to any
fortran structure you use.

For instance:

(defcustom f90-do-indent 2
  "Extra indentation applied to `do' region."
  :type 'integer
  :group 'f90-indent)

(defcustom f90-if-indent 2
  "Indentation for `if', `select', `where' and `forall' region."
  :type 'integer
  :group 'f90-indent)

(defcustom f90-type-indent 2
  "Indentation for `type', `interface' and `block' region."
  :type 'integer
  :group 'f90-indent)

I will tell you what I have been doing regarding <tab>.  As yourself, I would use <tab>
when in emacs-lisp-mode, where I also introduce org type headings.  I would then switch
to org-mode when I need to.  And use <tab> in the context of org-mode, not emacs-lisp-mode.

But this switching over has downsides because 1) there is no code highlighting; and
2) there is no function folding.

Whilst I agree that programming language modes do their thing well, and org-mode
does its things well, the idea of headings and folding could be made to work much
better for programming languages.  Additionally, there could be org-minor-mode
that is specific for programming languages.  The people at org-mode would know
best about the capabilities and functionalities that would entail.  We could also
take some information out on their implementation.

We can ask what capabilities would be valuable to add, and do some more word on
outline-minor-mode and possibly emacs-lisp mode.  outline-minor-mode can be made
much much better.  And we can learn from other languages such as fortran for things
like indentation.

Regards
Christopher

> Try it.
>
> It is addictive. It gives clarity when working.
>
> Interesting is "Hide others" it hides everything else but the function
> you are editing, not bad and similar to narrowing.
>
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>
>



  parent reply	other threads:[~2021-05-10  1:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09  8:53 outline-minor-mode and org-mode capabilities for programming languages Christopher Dimech
2021-05-09  9:11 ` Jean Louis
2021-05-09 12:35   ` Christopher Dimech
2021-05-09 12:45     ` Jean Louis
2021-05-09 13:00       ` Christopher Dimech
2021-05-09 16:27         ` Jean Louis
2021-05-09 17:35           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-09 17:50             ` Jean Louis
2021-05-09 18:02               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-09 19:09                 ` Jean Louis
2021-05-10  1:49               ` Christopher Dimech [this message]
2021-05-10  6:22                 ` Jean Louis
2021-05-10  6:53                   ` Christopher Dimech
2021-05-10  7:32                     ` Jean Louis
2021-05-10  8:32                       ` Christopher Dimech
2021-05-10  9:29                         ` Christopher Dimech
2021-05-10  9:31                         ` Jean Louis
2021-05-10 10:01                           ` Christopher Dimech
2021-05-10 11:43                             ` Jean Louis
2021-05-10 12:52                               ` Christopher Dimech
2021-05-10 17:05                                 ` Jean Louis
2021-05-11  2:00                                   ` Christopher Dimech
2021-05-10 10:27                           ` Christopher Dimech
2021-05-10 11:53                             ` Jean Louis
2021-05-10 12:32                               ` Christopher Dimech
2021-05-10 16:07                                 ` Jean Louis
2021-05-11  2:26                                   ` Christopher Dimech
2021-05-10  8:46                       ` Christopher Dimech
2021-05-10  9:15                       ` Christopher Dimech
2021-05-10  9:33                         ` Jean Louis
2021-05-10  6:08             ` Christopher Dimech
2021-05-10  1:25         ` Christopher Dimech
2021-05-09 13:02       ` Christopher Dimech
2021-05-09 16:34         ` Jean Louis
2021-05-09 14:02 ` Stefan Monnier via Users list for the GNU Emacs text editor

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=trinity-3bba264f-2c93-43de-ba29-29a942d3f7ea-1620611360594@3c-app-mailcom-bs04 \
    --to=dimech@gmx.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /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).