unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Words with spaces highlighted in elisp-mode comments
Date: Mon, 24 Jul 2023 14:13:07 +0200	[thread overview]
Message-ID: <87mszlfqy4.fsf@dataswamp.org> (raw)
In-Reply-To: 4DhjKANIbFgZWMXo6XhGnchGcbS3MrmPJZZKIJpQm1xbsUDq7jYnCIl7fNBXTQMpB8nN36XJPIdGhNLO9DvjvUC3a4UQEFZNiQsLdLRtnCU=@proton.me

uzibalqa wrote:

> Besides using comment for descriptive purposes, I use it for
> FIX-THIS, IMPROVE-THIS, DEVELOP-THIS, PENDING.
>
> ;; PENDING
> ;;   'OMS GMBL'
> ;;      1st Fail Y Down
> ;;      2nd Fail P Down if P not -2.5 to +2.5 
> ;;   'FF MDM I/O Error'
> ;;      I/O Reset

I think 'this' is an ugly syntax for that purpose, it looks
like the intention is ironic. Fix this as 'soon' as
possible ...

But moreover, I don't think we want to encourage people to
insert those as they make the code ugly - especially if given
a certain face, what would happen is people would develop
"code blindness", instead of seeing the source they would see
a bunch of "programming programmers" directives.

In Elisp, one could denote, say, three initiators to denote
a heading or label

;;; Brilliant Code Below

because that convention already exists in Emacs packages, see

  https://dataswamp.org/~incal/emacs-init/wrap-search.el

only the trailing colon would be optional. (I'm not sure what
they are called as it is, what did you say - overlay? - anyway
if three initiators must be reserved for that and only that
one could say that _four_ initiators denote a heading or label.)

Then a single one would be a comment relating to that
particular line

(cl-incf x) ; I think it can take one more

and two initiators for an arbitrary number of lines below;
also, for general comment use.

It would look like this

;;;; Duncan's code

;; now we are entering murky water
(setq x 1)
(cl-incf x) ; I think it can take one more

You can see how that works with `message-mode' (the angle
brackets) in this screenshot:

  https://dataswamp.org/~incal/figures/emacs/emacsuxusubmarinespetsnaz.png

Those are the `gnus-cite-1' all the way up to `gnus-cite-11'.

We could have that in Elisp as well, either by a similar
enumeration, or by calling the faces something to denote what
their intended usage are.

But then we would hurry to make sure that all the specific
comment faces would initially be unset, and inherit from
a base comment face. That way all comments would still get the
same color, because it is the way I like it anyway, and in the
example above, because of the blank lines not the least, I can
see quite clearly what is intended as a heading and what
isn't. Distinct face would make it even more clear in that
specific sense yes, but in general it would make the code
dizzy and unrestful and too much attention would land on the
comments, that we want to be low-key, instead of the code.

-- 
underground experts united
https://dataswamp.org/~incal




      reply	other threads:[~2023-07-24 12:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 22:49 Words with spaces highlighted in elisp-mode comments uzibalqa
2023-07-16 23:08 ` Emanuel Berg
2023-07-17 12:56   ` uzibalqa
2023-07-17 15:13     ` [External] : " Drew Adams
2023-07-19  1:02     ` Emanuel Berg
2023-07-20 11:47       ` uzibalqa
2023-07-22  6:00         ` Emanuel Berg
2023-07-22 12:02           ` Eli Zaretskii
2023-07-22 13:49             ` Christopher Dimech
2023-07-22 14:16               ` Eli Zaretskii
2023-07-22 14:22                 ` Heime
2023-07-22 14:33                   ` Eli Zaretskii
2023-07-24 12:18               ` Emanuel Berg
2023-07-22 13:21           ` uzibalqa
2023-07-24 12:13             ` Emanuel Berg [this message]

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=87mszlfqy4.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --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).